aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-05-19 00:33:48 +0000
committerMax Horn2009-05-19 00:33:48 +0000
commit4755fcb130036f34ec5a3191138b2a3de2140896 (patch)
tree387f06c10166c9558f7f63c5f573e2a5c5045b6a
parent091b347a7e8bfa2162cdade24a9386a92c2e475c (diff)
downloadscummvm-rg350-4755fcb130036f34ec5a3191138b2a3de2140896.tar.gz
scummvm-rg350-4755fcb130036f34ec5a3191138b2a3de2140896.tar.bz2
scummvm-rg350-4755fcb130036f34ec5a3191138b2a3de2140896.zip
SCI: got rid of EngineState::savegame_version; some cleanup
svn-id: r40713
-rw-r--r--engines/sci/engine/savegame.cpp25
-rw-r--r--engines/sci/engine/state.cpp4
-rw-r--r--engines/sci/engine/state.h2
3 files changed, 8 insertions, 23 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index e099cb894a..0dbea5229d 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -248,7 +248,7 @@ static void sync_SavegameMetadata(Common::Serializer &s, SavegameMetadata &obj)
}
void EngineState::saveLoadWithSerializer(Common::Serializer &s) {
- s.syncAsSint32LE(savegame_version);
+ s.skip(4); // Obsolete: Used to be savegame_version
syncCStr(s, &game_version);
s.skip(4); // Obsolete: Used to be version
@@ -476,8 +476,6 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename
meta.savegame_date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
meta.savegame_time = ((curTime.tm_hour & 0xFF) << 16) | (((curTime.tm_min) & 0xFF) << 8) | ((curTime.tm_sec) & 0xFF);
- s->savegame_version = CURRENT_SAVEGAME_VERSION;
-
if (s->execution_stack_base) {
sciprintf("Cannot save from below kernel function\n");
return 1;
@@ -755,15 +753,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
}
*/
- // FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch.
- retval = new EngineState();
-
- retval->version = s->version;
- retval->flags = s->flags;
-
- retval->savegame_version = -1;
- retval->gfx_state = s->gfx_state;
-
SavegameMetadata meta;
Common::Serializer ser(fh, 0);
@@ -782,12 +771,13 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
return NULL;
}
- // Backwards compatibility settings
- retval->dyn_views = NULL;
- retval->drop_views = NULL;
- retval->port = NULL;
- retval->save_dir_copy_buf = NULL;
+ // FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch.
+ retval = new EngineState();
+ // Copy some old data
+ retval->version = s->version;
+ retval->flags = s->flags;
+ retval->gfx_state = s->gfx_state;
retval->sound_mute = s->sound_mute;
retval->sound_volume = s->sound_volume;
@@ -797,7 +787,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
// Set exec stack base to zero
retval->execution_stack_base = 0;
- retval->_executionStack.clear();
// Now copy all current state information
// Graphics and input state:
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 1ff371cbd7..03cd1dbbdf 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -28,8 +28,6 @@
namespace Sci {
EngineState::EngineState() : _dirseeker(this) {
- savegame_version = 0;
-
widget_serial_counter = 0;
resmgr = 0;
@@ -81,7 +79,7 @@ EngineState::EngineState() : _dirseeker(this) {
picture_port = 0;
iconbar_port = 0;
- memset(&pic_visible_map, 0, sizeof(pic_visible_map)); // FIXME: Remove this once/if we C++ify gfx_map_mask_t
+ pic_visible_map = GFX_MASK_NONE;
pic_animate = 0;
dyn_views = 0;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index f451ab96b0..476b2f9f00 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -116,8 +116,6 @@ public:
virtual void saveLoadWithSerializer(Common::Serializer &ser);
public:
- int savegame_version;
-
int widget_serial_counter; /**< Used for savegames */
ResourceManager *resmgr; /**< The resource manager */