diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse.cpp | 11 | ||||
-rw-r--r-- | scumm/scumm.h | 1 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 28 |
3 files changed, 28 insertions, 12 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 0085e4ce61..15934101d1 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -3110,7 +3110,7 @@ void Part::set_detune(int8 detune) void Part::set_pitchbend(int value) { - _pitchbend = value * _pitchbend_factor >> 6; + _pitchbend = value; changed(IMuseDriver::pcMod); } @@ -3993,7 +3993,7 @@ void IMuseAdlib::part_changed(Part *part, byte what) if (what & pcMod) { for (mc = part->_mc->adl(); mc; mc = mc->_next) { adlib_note_on(mc->_channel, mc->_note + part->_transpose_eff, - part->_pitchbend + part->_detune_eff); + (part->_pitchbend * part->_pitchbend_factor >> 6) + part->_detune_eff); } } @@ -4278,7 +4278,7 @@ void IMuseGM::midiPitchBend(byte chan, int16 pitchbend) if (_midi_pitchbend_last[chan] != pitchbend) { _midi_pitchbend_last[chan] = pitchbend; - tmp = (pitchbend << 2) + 0x2000; + tmp = pitchbend + 0x2000; _md->send(((tmp >> 7) & 0x7F) << 16 | (tmp & 0x7F) << 8 | 0xE0 | chan); } } @@ -4570,8 +4570,9 @@ void IMuseGM::part_changed(Part *part, byte what) if (what & pcMod) midiPitchBend(mc->_chan, - clamp(part->_pitchbend + part->_detune_eff + - (part->_transpose_eff << 7), -2048, 2047)); + clamp(part->_pitchbend + + (part->_detune_eff * 64 / 12) + + (part->_transpose_eff * 8192 / 12), -8192, 8191)); if (what & pcVolume) midiVolume(mc->_chan, part->_vol_eff); diff --git a/scumm/scumm.h b/scumm/scumm.h index d14d822453..fee7eb45b3 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -401,6 +401,7 @@ public: Dialog *_optionsDialog; Dialog *_saveLoadDialog; + void runDialog(Dialog *dialog); void pauseDialog(); void saveloadDialog(); void optionsDialog(); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 2d0bdfdb23..7a6d3e9c10 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -103,7 +103,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) _gui = new Gui(); _gui->init(this); - _newgui = new NewGui(this); + _newgui = new NewGui(_system); _bundle = new Bundle(); _sound = new Sound(this); _timer = Engine::_timer; @@ -917,28 +917,42 @@ void Scumm::setOptions() //_newgui->optionsDialog(); } +void Scumm::runDialog(Dialog *dialog) +{ + // Pause sound put + bool old_soundsPaused = _sound->_soundsPaused; + _sound->pauseSounds(true); + + // Open & run the dialog + dialog->open(); + _newgui->runLoop(); + + // Restore old cursor + updateCursor(); + + // Resume sound output + _sound->pauseSounds(old_soundsPaused); +} + void Scumm::pauseDialog() { if (!_pauseDialog) _pauseDialog = new PauseDialog(_newgui, this); - _pauseDialog->open(); - _newgui->runLoop(); + runDialog(_pauseDialog); } void Scumm::saveloadDialog() { if (!_saveLoadDialog) _saveLoadDialog = new SaveLoadDialog(_newgui, this); - _saveLoadDialog->open(); - _newgui->runLoop(); + runDialog(_saveLoadDialog); } void Scumm::optionsDialog() { if (!_optionsDialog) _optionsDialog = new OptionsDialog(_newgui, this); - _optionsDialog->open(); - _newgui->runLoop(); + runDialog(_optionsDialog); } void Scumm::shutDown(int i) |