diff options
author | Nipun Garg | 2019-07-06 19:34:15 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:13 +0200 |
commit | 06c87e518c44ad64ee433689408013a7dbc0efc1 (patch) | |
tree | 288290557b31d1a6f00ccf1543150f18c696337e /engines | |
parent | 3fc69963f400b556fe7f1ddcea751ea83b3a1d7a (diff) | |
download | scummvm-rg350-06c87e518c44ad64ee433689408013a7dbc0efc1.tar.gz scummvm-rg350-06c87e518c44ad64ee433689408013a7dbc0efc1.tar.bz2 scummvm-rg350-06c87e518c44ad64ee433689408013a7dbc0efc1.zip |
HDB: Add HDBGame save() and load()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/hdb.cpp | 20 | ||||
-rw-r--r-- | engines/hdb/hdb.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 11b3bc2634..649c4a9d3a 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -127,6 +127,26 @@ bool HDBGame::init() { return true; } +void HDBGame::save(Common::OutSaveFile *out) { + out->write(_currentMapname, 64); + out->write(_lastMapname, 64); + out->write(_currentLuaName, 64); + out->writeSint32LE(_actionMode); + out->writeByte(_changeLevel); + out->write(_changeMapname, 64); + out->write(_inMapName, 32); +} + +void HDBGame::load(Common::InSaveFile *in) { + in->read(_currentMapname, 64); + in->read(_lastMapname, 64); + in->read(_currentLuaName, 64); + _actionMode = in->readSint32LE(); + _changeLevel = in->readByte(); + in->read(_changeMapname, 64); + in->read(_inMapName, 32); +} + /* Changes the current GameState to the next one. Game State Transitions are deterministic: each state can diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h index e16ee5aca1..01ed0b96da 100644 --- a/engines/hdb/hdb.h +++ b/engines/hdb/hdb.h @@ -30,6 +30,7 @@ #include "common/events.h" #include "common/str.h" #include "common/random.h" +#include "common/savefile.h" #include "graphics/surface.h" #include "gui/debugger.h" @@ -144,6 +145,8 @@ public: // Game related members; bool init(); + void save(Common::OutSaveFile *out); + void load(Common::InSaveFile *in); bool restartMap(); bool startMap(const char *name); |