aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-01 06:41:52 +0000
committerFilippos Karapetis2010-01-01 06:41:52 +0000
commitafc4bc12959ffa9ac5a611f2f7de4da598b80857 (patch)
treed4aa1b2063a939f0c366937d15251adff9f32c10 /engines/sci/engine
parentac7c92c67f3916ef0e5ad09835f161f65a7c3b8b (diff)
downloadscummvm-rg350-afc4bc12959ffa9ac5a611f2f7de4da598b80857.tar.gz
scummvm-rg350-afc4bc12959ffa9ac5a611f2f7de4da598b80857.tar.bz2
scummvm-rg350-afc4bc12959ffa9ac5a611f2f7de4da598b80857.zip
SCI/new music code:
- Resolved a deadlock with the mixer, and added appropriate mutexes (a result of the fact that SCI mixes MIDI and digital audio in the same list) - Fixed sound playing when loading games, by properly resetting the MIDI driver - Reverted savegame version to 14 - the changes in versions 15 and 16 don't have any effect on the currently enabled old music code, and the new music code is disabled by default, and is still prone to changes - Now saving/loading signal, loop and hold for each sound, as well as reverb - Added stub code for setting reverb and channel hold - The signal, loop and hold values of each song are cached, like in SSCI and like what happens in Greg's SCI implementation. This allows a clear separation of the engine code from the rest of the engine. Reverted commits 46792 and 46797 - Removed duplicate song list accessing code - Song cues are now updated in kAnimate for SCI0, like the old music code does, to compensate for the fact that SCI0 didn't poll for music changes via cmdUpdateCues, like what SCI01 and newer do - Cleanup svn-id: r46812
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp3
-rw-r--r--engines/sci/engine/savegame.cpp13
-rw-r--r--engines/sci/engine/savegame.h2
3 files changed, 13 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 51ad54d2c1..83b9eb0f75 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -962,6 +962,9 @@ reg_t kAnimate(EngineState *s, int argc, reg_t *argv) {
// Take care of incoming events (kAnimate is called semi-regularly)
#ifdef USE_OLD_MUSIC_FUNCTIONS
process_sound_events(s);
+#else
+ if (s->detectDoSoundType() <= SCI_VERSION_0_LATE)
+ s->_soundCmd->updateSci0Cues();
#endif
s->_gui->animate(castListReference, cycle, argc, argv);
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 1c3ae06cec..75f191256f 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -116,8 +116,8 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) {
uint32 restoreTime = 0;
s.syncAsSint32LE(restoreTime);
ticker = restoreTime * 60 / 1000;
- s.skip(4); // loop
- s.skip(4); // hold
+ s.syncAsSint32LE(loop);
+ s.syncAsSint32LE(hold);
// volume and dataInc will be synced from the sound objects
// when the sound list is reconstructed in gamestate_restore()
volume = 100;
@@ -133,9 +133,11 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint16LE(resnum);
s.syncAsSint16LE(dataInc);
s.syncAsSint16LE(ticker);
+ s.syncAsSint16LE(signal);
s.syncAsByte(prio);
- s.skip(1, VER(15), VER(15));
+ s.syncAsSint16LE(loop);
s.syncAsByte(volume);
+ s.syncAsByte(hold);
s.syncAsByte(fadeTo);
s.syncAsSint16LE(fadeStep);
s.syncAsSint32LE(fadeTicker);
@@ -628,16 +630,19 @@ void SciMusic::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsByte(_soundOn);
s.syncAsByte(masterVolume);
} else if (s.isLoading()) {
- if (s.getVersion() >= 15) {
+ if (s.getVersion() >= 14) {
s.syncAsByte(_soundOn);
s.syncAsByte(masterVolume);
+ s.syncAsByte(_reverb);
} else {
_soundOn = true;
masterVolume = 15;
+ _reverb = 0;
}
soundSetSoundOn(_soundOn);
soundSetMasterVolume(masterVolume);
+ setReverb(_reverb);
}
if (s.isSaving())
diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h
index ae3badc6da..8a4d8e7d3b 100644
--- a/engines/sci/engine/savegame.h
+++ b/engines/sci/engine/savegame.h
@@ -36,7 +36,7 @@ namespace Sci {
struct EngineState;
enum {
- CURRENT_SAVEGAME_VERSION = 16,
+ CURRENT_SAVEGAME_VERSION = 14,
MINIMUM_SAVEGAME_VERSION = 9
};