mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
SCI: got rid of EngineState::savegame_version; some cleanup
svn-id: r40713
This commit is contained in:
parent
091b347a7e
commit
4755fcb130
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user