aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-06-19 11:23:20 +0000
committerFilippos Karapetis2007-06-19 11:23:20 +0000
commit4ffd38a19999053dcd6796df4e0bda9d25001032 (patch)
tree437c94ec48c94320e6b0df3094d02d73f1e271df
parentfc19079902896d03a557a98501bcae9677f97382 (diff)
downloadscummvm-rg350-4ffd38a19999053dcd6796df4e0bda9d25001032.tar.gz
scummvm-rg350-4ffd38a19999053dcd6796df4e0bda9d25001032.tar.bz2
scummvm-rg350-4ffd38a19999053dcd6796df4e0bda9d25001032.zip
When saving the game in IHNM after a chapter point change, the chapter point change music will no longer be incorrectly saved, and the normal chapter music will be saved instead
svn-id: r27545
-rw-r--r--engines/saga/scene.cpp2
-rw-r--r--engines/saga/scene.h3
-rw-r--r--engines/saga/sfuncs.cpp10
3 files changed, 13 insertions, 2 deletions
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 7131bf0308..84d1b45114 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -568,6 +568,8 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
event.time = 0;
_vm->_events->queue(&event);
+ _chapterPointsChanged = false;
+
if ((_vm->getGameType() == GType_IHNM) && (loadSceneParams->chapter != NO_CHAPTER_CHANGE)) {
if (loadSceneParams->loadFlag != kLoadBySceneNumber) {
error("loadScene wrong usage");
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 05bf3abe5d..5fa4569949 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -321,6 +321,8 @@ class Scene {
void setCurrentMusicTrack(int tr) { _currentMusicTrack = tr; }
int getCurrentMusicRepeat() const { return _currentMusicRepeat; }
void setCurrentMusicRepeat(int rp) { _currentMusicRepeat = rp; }
+ bool haveChapterPointsChanged() const { return _chapterPointsChanged; }
+ void setChapterPointsChanged(bool cp) { _chapterPointsChanged = cp; }
void cutawaySkip() {
if (_vm->_scene->isInIntro())
@@ -361,6 +363,7 @@ class Scene {
int _sceneResourceId;
int _currentMusicTrack;
int _currentMusicRepeat;
+ bool _chapterPointsChanged;
bool _inGame;
bool _loadDescription;
SceneDescription _sceneDescription;
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index fdb589971c..f061769643 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1683,8 +1683,13 @@ 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);
+ if (!_vm->_scene->haveChapterPointsChanged()) {
+ _vm->_scene->setCurrentMusicTrack(param1);
+ _vm->_scene->setCurrentMusicRepeat(param2);
+ } else {
+ // Don't save this music track when saving in IHNM
+ _vm->_scene->setChapterPointsChanged(false);
+ }
}
}
}
@@ -1885,6 +1890,7 @@ void Script::sfSetChapterPoints(SCRIPTFUNC_PARAMS) {
_vm->_ethicsPoints[chapter] = ethics;
_vm->_spiritualBarometer = ethics * 256 / barometer;
+ _vm->_scene->setChapterPointsChanged(true); // don't save this music when saving in IHNM
}
void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) {