aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-15 09:11:26 +0000
committerFilippos Karapetis2010-06-15 09:11:26 +0000
commite64eb71ce86663c479bbbb94072fee94a015eecb (patch)
tree27c06cb158d8ebced0d8cd39d15b46d3a06dd8a6
parentba3c43498b12b4c5855030bea7ab9e613c55d4ac (diff)
downloadscummvm-rg350-e64eb71ce86663c479bbbb94072fee94a015eecb.tar.gz
scummvm-rg350-e64eb71ce86663c479bbbb94072fee94a015eecb.tar.bz2
scummvm-rg350-e64eb71ce86663c479bbbb94072fee94a015eecb.zip
Properly reconstruct the running stack when restoring (a regression from commits #49376 and #49525), some formatting
svn-id: r49689
-rw-r--r--engines/sci/engine/savegame.cpp1
-rw-r--r--engines/sci/engine/segment.h2
-rw-r--r--engines/sci/engine/state.cpp4
3 files changed, 4 insertions, 3 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index d2bd955793..02fdde5622 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -994,6 +994,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
#endif
s->abortScriptProcessing = kAbortLoadGame;
+ s->shrinkStackToBase();
}
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 61f1c7b3c9..253d94cc53 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -802,7 +802,7 @@ public:
byte getType() const { return _type; }
uint32 getSize() const { return _size; }
T *getRawData() { return _data; }
- const T *getRawData()const { return _data; }
+ const T *getRawData() const { return _data; }
protected:
int8 _type;
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 41f263bb62..1c8113e5e4 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -90,13 +90,13 @@ void EngineState::reset(bool isRestoring) {
_fileHandles.resize(5);
- stack_base = 0;
- stack_top = 0;
abortScriptProcessing = kAbortNone;
}
executionStackBase = 0;
_executionStackPosChanged = false;
+ stack_base = 0;
+ stack_top = 0;
restAdjust = 0;