diff options
author | Max Horn | 2003-04-30 13:23:31 +0000 |
---|---|---|
committer | Max Horn | 2003-04-30 13:23:31 +0000 |
commit | 2b74abd2c900d1a8bfd6c15829397503d9439849 (patch) | |
tree | be0e1c3845c90a7e66fffc6b763b964066621ebb /scumm/saveload.cpp | |
parent | 30e3a8161857260e75c84e4a54cf0849afa10dfd (diff) | |
download | scummvm-rg350-2b74abd2c900d1a8bfd6c15829397503d9439849.tar.gz scummvm-rg350-2b74abd2c900d1a8bfd6c15829397503d9439849.tar.bz2 scummvm-rg350-2b74abd2c900d1a8bfd6c15829397503d9439849.zip |
PalmOS changes
svn-id: r7224
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r-- | scumm/saveload.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 2e964e888b..3454e02e85 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -73,6 +73,13 @@ bool Scumm::saveState(int slot, bool compat, SaveFileManager *mgr) { Serializer ser(out, true, CURRENT_VER); saveOrLoad(&ser, CURRENT_VER); +#ifdef __PALM_OS__ + if (_imuse) { // moved here to prevent stack overflow on palmos + _imuse->save_or_load(&ser, this); + _imuse->set_master_volume (_sound->_sound_volume_master); + _imuse->set_music_volume (_sound->_sound_volume_music); + } +#endif delete out; debug(1, "State saved as '%s'", filename); @@ -142,6 +149,13 @@ bool Scumm::loadState(int slot, bool compat, SaveFileManager *mgr) { Serializer ser(out, false, hdr.ver); saveOrLoad(&ser, hdr.ver); +#ifdef __PALM_OS__ + if (_imuse) { // moved here to prevent stack overflow on palmos + _imuse->save_or_load(&ser, this); + _imuse->set_master_volume (_sound->_sound_volume_master); + _imuse->set_music_volume (_sound->_sound_volume_music); + } +#endif delete out; sb = _screenB; @@ -179,7 +193,6 @@ bool Scumm::loadState(int slot, bool compat, SaveFileManager *mgr) { CHECK_HEAP debug(1, "State loaded from '%s'", filename); - _sound->pauseSounds(false); return true; @@ -188,7 +201,11 @@ bool Scumm::loadState(int slot, bool compat, SaveFileManager *mgr) { void Scumm::makeSavegameName(char *out, int slot, bool compatible) { const char *dir = getSavePath(); +#ifndef __PALM_OS__ sprintf(out, "%s%s.%c%.2d", dir, _game_name, compatible ? 'c' : 's', slot); +#else + sprintf(out, "%s%s.%s%.2d", dir, _game_name, compatible ? "c" : "s", slot); +#endif } void Scumm::listSavegames(bool *marks, int num, SaveFileManager *mgr) { @@ -667,12 +684,14 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { res.flags[r][s->loadWord()] |= RF_LOCK; } } - + +#ifndef __PALM_OS__// moved to ::loadState/saveState to prevent stack overflow on palmos if (_imuse) { _imuse->save_or_load(s, this); _imuse->set_master_volume (_sound->_sound_volume_master); _imuse->set_music_volume (_sound->_sound_volume_music); } +#endif } void Scumm::saveLoadResource(Serializer *ser, int type, int idx) { @@ -730,7 +749,14 @@ bool Serializer::checkEOFLoadStream() { _saveLoadStream->fseek(-1, SEEK_CUR); return false; } +#elif defined(__PALM_OS__) +bool Serializer::checkEOFLoadStream() { + if (_saveLoadStream->feof()) + return true; + + return false; +} #endif |