diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 15 | ||||
-rw-r--r-- | engines/sci/engine/savegame.h | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui.cpp | 6 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 1 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.cpp | 8 | ||||
-rw-r--r-- | engines/sci/gui32/gui32.h | 1 |
6 files changed, 32 insertions, 1 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 90694cf84f..fb4e658b54 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -340,6 +340,21 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) { s.skip(4, VER(12), VER(12)); // obsolete: used to be status_bar_foreground s.skip(4, VER(12), VER(12)); // obsolete: used to be status_bar_background + if (s.getVersion() >= 13) { + // Save/Load picPort as well (cause sierra sci also does this) + int16 picPortTop, picPortLeft; + Common::Rect picPortRect; + if (s.isSaving()) + picPortRect = _gui->getPortPic(&picPortTop, &picPortLeft); + + s.syncBytes((byte *)&picPortRect, sizeof(picPortRect)); + s.syncAsSint16LE(picPortTop); + s.syncAsSint16LE(picPortLeft); + + if (s.isLoading()) + _gui->setPortPic(picPortRect, picPortTop, picPortLeft, true); + } + sync_SegManagerPtr(s, resMan, _segMan); syncArray<Class>(s, _segMan->_classtable); diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 95f3099f07..ade9715c48 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -36,7 +36,7 @@ namespace Sci { struct EngineState; enum { - CURRENT_SAVEGAME_VERSION = 12, + CURRENT_SAVEGAME_VERSION = 13, MINIMUM_SAVEGAME_VERSION = 9 }; diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index d649e5b478..ef6fc92bbc 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -126,6 +126,12 @@ void SciGui::setPort(uint16 portPtr) { }; } +Common::Rect SciGui::getPortPic(int16 *picTop, int16 *picLeft) { + *picTop = _windowMgr->_picWind->top; + *picLeft = _windowMgr->_picWind->left; + return _windowMgr->_picWind->rect; +} + void SciGui::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag) { _windowMgr->_picWind->rect = rect; _windowMgr->_picWind->top = picTop; diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index 150c84bed3..006fa1189d 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -63,6 +63,7 @@ public: virtual void wait(int16 ticks); virtual void setPort(uint16 portPtr); + virtual Common::Rect getPortPic(int16 *picTop, int16 *picLeft); virtual void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag); virtual reg_t getPort(); virtual void globalToLocal(int16 *x, int16 *y); diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp index f48437b291..acfcc65377 100644 --- a/engines/sci/gui32/gui32.cpp +++ b/engines/sci/gui32/gui32.cpp @@ -420,6 +420,14 @@ void SciGui32::setPort(uint16 portPtr) { _s->port = new_port; } +Common::Rect SciGui32::getPortPic(int16 *picTop, int16 *picLeft) { + // Don't want to fiddle around with oldgui, so we just return defaults when saving games + Common::Rect defaultRect(0, 0, 320, 200); + *picTop = 10; + *picLeft = 0; + return defaultRect; +} + void SciGui32::setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag) { if (activated_icon_bar) { port_origin_x = port_origin_y = 0; diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h index 51f57c0615..48d1b7fb5c 100644 --- a/engines/sci/gui32/gui32.h +++ b/engines/sci/gui32/gui32.h @@ -42,6 +42,7 @@ public: void wait(int16 ticks); void setPort(uint16 portPtr); + Common::Rect getPortPic(int16 *picTop, int16 *picLeft); void setPortPic(Common::Rect rect, int16 picTop, int16 picLeft, bool initPriorityBandsFlag); reg_t getPort(); void globalToLocal(int16 *x, int16 *y); |