aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/saga/saveload.cpp6
-rw-r--r--engines/saga/scene.cpp5
-rw-r--r--engines/saga/scene.h7
-rw-r--r--engines/saga/sfuncs.cpp11
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);
}
}
}