diff options
author | Filippos Karapetis | 2007-06-19 02:42:59 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-06-19 02:42:59 +0000 |
commit | 8bc226b0e595ebb90e1fd237a44d040ba4678b21 (patch) | |
tree | 34b70709d6633ed814f418118809860e6a74d5d1 /engines | |
parent | 3c424d98cd23c139bf1863630711b94a3a826ecd (diff) | |
download | scummvm-rg350-8bc226b0e595ebb90e1fd237a44d040ba4678b21.tar.gz scummvm-rg350-8bc226b0e595ebb90e1fd237a44d040ba4678b21.tar.bz2 scummvm-rg350-8bc226b0e595ebb90e1fd237a44d040ba4678b21.zip |
The correct music track is now played when loading a game in IHNM. The save/load mechanism in IHNM seems to be working correctly now (although it needs testing), however there are still some graphical glitches with the save/load dialogs. Also, moved some unfinished code for returning to the chapter selection screen to a more appropriate place
svn-id: r27542
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/saveload.cpp | 6 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 5 | ||||
-rw-r--r-- | engines/saga/scene.h | 7 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 11 |
4 files changed, 23 insertions, 6 deletions
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 804cba9aa7..f5504ab59a 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -195,6 +195,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) { out->writeSint32LE(_scene->currentChapterNumber()); // Protagonist out->writeSint32LE(_scene->currentProtag()); + out->writeSint32LE(_scene->getCurrentMusicTrack()); + out->writeSint32LE(_scene->getCurrentMusicRepeat()); } // Inset scene @@ -270,6 +272,10 @@ void SagaEngine::load(const char *fileName) { _scene->setProtag(in->readSint32LE()); if (_scene->currentChapterNumber()) _scene->changeScene(-2, 0, kTransitionFade, _scene->currentChapterNumber()); + _scene->setCurrentMusicTrack(in->readSint32LE()); + _scene->setCurrentMusicRepeat(in->readSint32LE()); + _music->stop(); + _music->play(_music->_songTable[_scene->getCurrentMusicTrack()], _scene->getCurrentMusicRepeat() ? MUSIC_LOOP : MUSIC_NORMAL); } // Inset scene diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index b83e1e29f9..7131bf0308 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -478,11 +478,6 @@ void Scene::changeScene(int16 sceneNumber, int actorsEntrance, SceneTransitionTy endScene(); } - if (sceneParams.sceneDescriptor == -1 && _vm->getGameType() == GType_IHNM) { - sceneParams.chapter = 8; - sceneParams.sceneDescriptor = 152; - } - loadScene(&sceneParams); } diff --git a/engines/saga/scene.h b/engines/saga/scene.h index 5080406d94..05bf3abe5d 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -317,6 +317,11 @@ class Scene { void setChapterNumber(int ch) { _chapterNumber = ch; } int getOutsetSceneNumber() const { return _outsetSceneNumber; } int currentSceneResourceId() const { return _sceneResourceId; } + int getCurrentMusicTrack() const { return _currentMusicTrack; } + void setCurrentMusicTrack(int tr) { _currentMusicTrack = tr; } + int getCurrentMusicRepeat() const { return _currentMusicRepeat; } + void setCurrentMusicRepeat(int rp) { _currentMusicRepeat = rp; } + void cutawaySkip() { if (_vm->_scene->isInIntro()) _vm->_framesEsc = 2; @@ -354,6 +359,8 @@ class Scene { int _chapterNumber; int _outsetSceneNumber; int _sceneResourceId; + int _currentMusicTrack; + int _currentMusicRepeat; bool _inGame; bool _loadDescription; SceneDescription _sceneDescription; diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 4f31d292a1..fdb589971c 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -574,7 +574,14 @@ void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) { _vm->_interface->setMode(kPanelMain); } - _vm->_scene->changeScene(sceneNumber, entrance, (sceneNumber == ITE_SCENE_ENDCREDIT1) ? kTransitionFade : kTransitionNoFade); + if (sceneNumber == -1 && _vm->getGameType() == GType_IHNM) { + // TODO: This is used to return back to the character selection screen in IHNM. + // However, it seems more than this is needed, AM's speech is wrong and no actors + // are shown + _vm->_scene->changeScene(154, entrance, kTransitionFade, 8); + } else { + _vm->_scene->changeScene(sceneNumber, entrance, (sceneNumber == ITE_SCENE_ENDCREDIT1) ? kTransitionFade : kTransitionNoFade); + } //TODO: placard stuff _pendingVerb = _vm->_script->getVerbType(kVerbNone); @@ -1676,6 +1683,8 @@ void Script::sfPlayMusic(SCRIPTFUNC_PARAMS) { } else { _vm->_music->setVolume(-1, 1); _vm->_music->play(_vm->_music->_songTable[param1], param2 ? MUSIC_LOOP : MUSIC_NORMAL); + _vm->_scene->setCurrentMusicTrack(param1); + _vm->_scene->setCurrentMusicRepeat(param2); } } } |