diff options
Diffstat (limited to 'engines/parallaction/parallaction.cpp')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index bb306c3299..6a61087804 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -118,12 +118,15 @@ int Parallaction::init() { _location._hasSound = false; _baseTime = 0; _numLocations = 0; + _gameToLoad = -1; _location._startPosition.x = -1000; _location._startPosition.y = -1000; _location._startFrame = 0; _location._comment = NULL; _location._endComment = NULL; + _quit = false; + _pathBuffer = 0; _screenSize = _screenWidth * _screenHeight; @@ -143,6 +146,7 @@ int Parallaction::init() { _menuHelper = 0; setupBalloonManager(); + syncSoundSettings(); return 0; } @@ -309,6 +313,7 @@ void Parallaction::processInput(InputData *data) { } switch (data->_event) { + case kEvSaveGame: _input->stopHovering(); saveGame(); @@ -329,18 +334,21 @@ void Parallaction::processInput(InputData *data) { void Parallaction::runGame() { InputData *data = _input->updateInput(); - if (_engineFlags & kEngineQuit) + if (_vm->quit()) return; runGuiFrame(); runDialogueFrame(); runCommentFrame(); + if (_vm->quit()) + return; + if (_input->_inputMode == Input::kInputModeGame) { processInput(data); runPendingZones(); - if (_engineFlags & kEngineQuit) + if (_vm->quit()) return; if (_engineFlags & kEngineChangeLocation) { @@ -443,7 +451,7 @@ ZonePtr Parallaction::findZone(const char *name) { void Parallaction::freeZones() { - debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit); + debugC(2, kDebugExec, "freeZones: _vm->_quit = %i", _vm->_quit); ZoneList::iterator it = _location._zones.begin(); @@ -452,7 +460,7 @@ void Parallaction::freeZones() { // NOTE : this condition has been relaxed compared to the original, to allow the engine // to retain special - needed - zones that were lost across location switches. ZonePtr z = *it; - if (((z->_top == -1) || (z->_left == -2)) && ((_engineFlags & kEngineQuit) == 0)) { + if (((z->_top == -1) || (z->_left == -2)) && ((_vm->_quit) == 0)) { debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name); it++; } else { @@ -466,6 +474,11 @@ void Parallaction::freeZones() { return; } +void Parallaction::syncSoundSettings() { + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume") / 6); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); +} enum { WALK_LEFT = 0, |