From 61af435d8a870a0630b5dea2ecf69cd58fc95946 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 12 Aug 2012 15:00:58 +1000 Subject: AGOS: Improve the quick load/save code. --- engines/agos/saveload.cpp | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'engines/agos/saveload.cpp') diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index b3ec916b47..c6bca1a6e6 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -142,23 +142,41 @@ void AGOSEngine_Feeble::quickLoadOrSave() { } #endif +// The function uses segments of code from the original game scripts +// to allow quick loading and saving, but isn't perfect. +// +// Unfortuntely this allows loading and saving in locations, +// which aren't supported, and will not restore correctly: +// Various locations in Elvira 1/2 and Waxworks where saving +// was disabled void AGOSEngine::quickLoadOrSave() { - // The function uses segments of code from the original game scripts - // to allow quick loading and saving, but isn't perfect. - // - // Unfortuntely this allows loading and saving in locations, - // which aren't supported, and will not restore correctly: - // Any overhead maps in Simon the Sorcerer 2 - // Various locations in Elvira 1/2 and Waxworks where saving - // was disabled - - // The floppy disk demo of Simon the Sorcerer 1 doesn't work. - if (getFeatures() & GF_DEMO) - return; - bool success; Common::String buf; + // Disable loading and saving when it was not possible in the original: + // In overhead maps areas in Simon the Sorcerer 2 + // In the floppy disk demo of Simon the Sorcerer 1 + // In copy protection, conversations and cut scenes + if ((getGameType() == GType_SIMON2 && _boxStarHeight == 200) || + (getGameType() == GType_SIMON1 && (getFeatures() & GF_DEMO)) || + _mouseHideCount || _showPreposition) { + buf = Common::String::format("Quick load or save game isn't supported in this location"); + GUI::MessageDialog dialog(buf, "OK"); + dialog.runModal(); + return; + } + + // Check if Simon is walking, and stop when required + if (getGameType() == GType_SIMON1 && getBitFlag(11)) { + vcStopAnimation(11, 1122); + animate(4, 11, 1122, 0, 0, 2); + waitForSync(1122); + } else if (getGameType() == GType_SIMON2 && getBitFlag(11)) { + vcStopAnimation(11, 232); + animate(4, 11, 232, 0, 0, 2); + waitForSync(1122); + } + char *filename = genSaveName(_saveLoadSlot); if (_saveLoadType == 2) { Subroutine *sub; -- cgit v1.2.3 From 89abab97e3124fa25eb4c7d3e8b38501747a8d17 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Sep 2012 04:17:31 +0200 Subject: JANITORIAL: Remove trailing whitespaces. Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//' --- engines/agos/saveload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/agos/saveload.cpp') diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index c6bca1a6e6..e13fa214d1 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -142,7 +142,7 @@ void AGOSEngine_Feeble::quickLoadOrSave() { } #endif -// The function uses segments of code from the original game scripts +// The function uses segments of code from the original game scripts // to allow quick loading and saving, but isn't perfect. // // Unfortuntely this allows loading and saving in locations, @@ -1424,7 +1424,7 @@ bool AGOSEngine_Elvira2::loadGame(const char *filename, bool restartMode) { // The floppy disk versions of Simon the Sorcerer 2 block changing // to scrolling rooms, if the copy protection fails. But the copy // protection flags are never set in the CD version. - // Setting this copy protection flag, allows saved games to be shared + // Setting this copy protection flag, allows saved games to be shared // between all versions of Simon the Sorcerer 2. if (getGameType() == GType_SIMON2) { setBitFlag(135, 1); -- cgit v1.2.3