aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/players/player_ad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/players/player_ad.cpp')
-rw-r--r--engines/scumm/players/player_ad.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index 55bbeeef98..2de8ac96e4 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -191,27 +191,27 @@ int Player_AD::getSoundStatus(int sound) const {
return false;
}
-void Player_AD::saveLoadWithSerializer(Serializer *ser) {
+void Player_AD::saveLoadWithSerializer(Common::Serializer &s) {
Common::StackLock lock(_mutex);
- if (ser->getVersion() < VER(95)) {
+ if (s.getVersion() < VER(95)) {
IMuse *dummyImuse = IMuse::create(_vm->_system, NULL, NULL);
- dummyImuse->save_or_load(ser, _vm, false);
+ dummyImuse->saveLoadWithSerializer(s, _vm, false);
delete dummyImuse;
return;
}
- if (ser->getVersion() >= VER(96)) {
+ if (s.getVersion() >= VER(96)) {
int32 res[4] = {
_musicResource, _sfx[0].resource, _sfx[1].resource, _sfx[2].resource
};
// The first thing we save is a list of sound resources being played
// at the moment.
- ser->saveLoadArrayOf(res, 4, sizeof(res[0]), sleInt32);
+ s.syncArray(res, 4, Common::Serializer::Sint32LE);
// If we are loading start the music again at this point.
- if (ser->isLoading()) {
+ if (s.isLoading()) {
if (res[0] != -1) {
startSound(res[0]);
}
@@ -219,26 +219,21 @@ void Player_AD::saveLoadWithSerializer(Serializer *ser) {
uint32 musicOffset = _curOffset;
- static const SaveLoadEntry musicData[] = {
- MKLINE(Player_AD, _engineMusicTimer, sleInt32, VER(96)),
- MKLINE(Player_AD, _musicTimer, sleUint32, VER(96)),
- MKLINE(Player_AD, _internalMusicTimer, sleUint32, VER(96)),
- MKLINE(Player_AD, _curOffset, sleUint32, VER(96)),
- MKLINE(Player_AD, _nextEventTimer, sleUint32, VER(96)),
- MKEND()
- };
-
- ser->saveLoadEntries(this, musicData);
+ s.syncAsSint32LE(_engineMusicTimer, VER(96));
+ s.syncAsUint32LE(_musicTimer, VER(96));
+ s.syncAsUint32LE(_internalMusicTimer, VER(96));
+ s.syncAsUint32LE(_curOffset, VER(96));
+ s.syncAsUint32LE(_nextEventTimer, VER(96));
// We seek back to the old music position.
- if (ser->isLoading()) {
+ if (s.isLoading()) {
SWAP(musicOffset, _curOffset);
musicSeekTo(musicOffset);
}
// Finally start up the SFX. This makes sure that they are not
// accidently stopped while seeking to the old music position.
- if (ser->isLoading()) {
+ if (s.isLoading()) {
for (int i = 1; i < ARRAYSIZE(res); ++i) {
if (res[i] != -1) {
startSound(res[i]);