diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/made/made.cpp | 10 | ||||
-rw-r--r-- | engines/made/made.h | 5 | ||||
-rw-r--r-- | engines/made/scriptfuncs_rtz.cpp | 20 |
3 files changed, 21 insertions, 14 deletions
diff --git a/engines/made/made.cpp b/engines/made/made.cpp index 932f5ddcc4..0cf73d5dd0 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -107,6 +107,8 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng debug(1, "Music disabled."); } + _quit = false; + _soundRate = 8000; } @@ -157,6 +159,12 @@ void MadeEngine::freeTimer(int16 timerNum) { _timers[timerNum] = -1; } +Common::String MadeEngine::getSavegameFilename(int16 saveNum) { + char filename[256]; + snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); + return filename; +} + int MadeEngine::go() { for (int i = 0; i < ARRAYSIZE(_timers); i++) @@ -191,7 +199,7 @@ int MadeEngine::go() { error ("Unknown MADE game"); } - _eventMouseX = _eventMouseY = 0; + _eventKey = _eventMouseX = _eventMouseY = 0; _script->runScript(_dat->getMainCodeObjectIndex()); return 0; diff --git a/engines/made/made.h b/engines/made/made.h index b3a25b4e02..f6f7fefd83 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -102,6 +102,8 @@ public: ScriptInterpreter *_script; MusicPlayer *_music; + bool _quit; + int _eventMouseX, _eventMouseY; uint16 _eventKey; int _soundRate; @@ -118,6 +120,9 @@ public: int16 allocTimer(); void freeTimer(int16 timerNum); + const Common::String getTargetName() { return _targetName; } + Common::String getSavegameFilename(int16 saveNum); + }; } // End of namespace Made diff --git a/engines/made/scriptfuncs_rtz.cpp b/engines/made/scriptfuncs_rtz.cpp index 20f6df8918..8f173dfa57 100644 --- a/engines/made/scriptfuncs_rtz.cpp +++ b/engines/made/scriptfuncs_rtz.cpp @@ -778,11 +778,9 @@ int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) { Object *obj = _vm->_dat->getObject(descObjectIndex); const char *description = obj->getString(); - // TODO: Use better filename - char filename[256]; - snprintf(filename, 256, "rtz.%03d", saveNum); - - return _vm->_dat->savegame(filename, description, version); + Common::String filename = _vm->getSavegameFilename(saveNum); + + return _vm->_dat->savegame(filename.c_str(), description, version); } @@ -794,11 +792,9 @@ int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) { if (saveNum > 999) return 1; - // TODO: Use better filename - char filename[256]; - snprintf(filename, 256, "rtz.%03d", saveNum); + Common::String filename = _vm->getSavegameFilename(saveNum); - return _vm->_dat->loadgame(filename, version); + return _vm->_dat->loadgame(filename.c_str(), version); } @@ -812,13 +808,11 @@ int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) { if (saveNum > 999) return 1; - // TODO: Use better filename - char filename[256]; - snprintf(filename, 256, "rtz.%03d", saveNum); + Common::String filename = _vm->getSavegameFilename(saveNum); Object *obj = _vm->_dat->getObject(descObjectIndex); - if (_vm->_dat->getSavegameDescription(filename, description)) { + if (_vm->_dat->getSavegameDescription(filename.c_str(), description)) { obj->setString(description.c_str()); return 0; } else { |