[Scummvm-cvs-logs] SF.net SVN: scummvm:[54813] scummvm/trunk/engines/mohawk
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Tue Dec 7 19:21:06 CET 2010
Revision: 54813
http://scummvm.svn.sourceforge.net/scummvm/?rev=54813&view=rev
Author: mthreepwood
Date: 2010-12-07 18:21:05 +0000 (Tue, 07 Dec 2010)
Log Message:
-----------
MOHAWK: Fix loading from the launcher in Myst
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/myst.cpp
scummvm/trunk/engines/mohawk/myst_saveload.cpp
Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp 2010-12-07 18:15:07 UTC (rev 54812)
+++ scummvm/trunk/engines/mohawk/myst.cpp 2010-12-07 18:21:05 UTC (rev 54813)
@@ -261,36 +261,36 @@
_rnd = new Common::RandomSource();
_mouseClicked = false;
- // Start us on the first stack.
- if (getGameType() == GType_MAKINGOF)
- changeToStack(kMakingOfStack);
- else if (getFeatures() & GF_DEMO)
- changeToStack(kDemoStack);
- else
- changeToStack(kIntroStack);
+ // Load Help System (Masterpiece Edition Only)
+ if (getFeatures() & GF_ME) {
+ MohawkArchive *mhk = new MohawkArchive();
+ if (!mhk->open("help.dat"))
+ error("Could not load help.dat");
+ _mhk.push_back(mhk);
+ }
- if (getFeatures() & GF_DEMO)
- changeToCard(2000, true);
- else
- changeToCard(1, true);
-
// Load game from launcher/command line if requested
- if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
+ if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) {
uint32 gameToLoad = ConfMan.getInt("save_slot");
Common::StringArray savedGamesList = _saveLoad->generateSaveGameList();
if (gameToLoad > savedGamesList.size())
error ("Could not find saved game");
_saveLoad->loadGame(savedGamesList[gameToLoad]);
+ } else {
+ // Start us on the first stack.
+ if (getGameType() == GType_MAKINGOF)
+ changeToStack(kMakingOfStack);
+ else if (getFeatures() & GF_DEMO)
+ changeToStack(kDemoStack);
+ else
+ changeToStack(kIntroStack);
+
+ if (getFeatures() & GF_DEMO)
+ changeToCard(2000, true);
+ else
+ changeToCard(1, true);
}
- // Load Help System (Masterpiece Edition Only)
- if (getFeatures() & GF_ME) {
- MohawkArchive *mhk = new MohawkArchive();
- if (!mhk->open("help.dat"))
- error("Could not load help.dat");
- _mhk.push_back(mhk);
- }
-
// Test Load Function...
loadHelp(10000);
@@ -1062,12 +1062,10 @@
}
Common::Error MohawkEngine_Myst::loadGameState(int slot) {
- if (_saveLoad->loadGame(_saveLoad->generateSaveGameList()[slot])) {
- changeToStack(kIntroStack);
- changeToCard(5, true);
+ if (_saveLoad->loadGame(_saveLoad->generateSaveGameList()[slot]))
return Common::kNoError;
- } else
- return Common::kUnknownError;
+
+ return Common::kUnknownError;
}
Common::Error MohawkEngine_Myst::saveGameState(int slot, const char *desc) {
Modified: scummvm/trunk/engines/mohawk/myst_saveload.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_saveload.cpp 2010-12-07 18:15:07 UTC (rev 54812)
+++ scummvm/trunk/engines/mohawk/myst_saveload.cpp 2010-12-07 18:21:05 UTC (rev 54813)
@@ -65,9 +65,6 @@
}
bool MystSaveLoad::loadGame(const Common::String &filename) {
- if (_vm->getFeatures() & GF_DEMO) // Don't load games in the demo
- return false;
-
Common::InSaveFile *loadFile = _saveFileMan->openForLoading(filename);
if (!loadFile)
return false;
@@ -90,6 +87,9 @@
syncGameState(s);
delete loadFile;
+ // Switch us back to the intro stack
+ _vm->changeToStack(kIntroStack);
+
// Set our default cursor
switch (_v->globals.heldPage) {
case 2:
@@ -105,6 +105,9 @@
_vm->setMainCursor(kDefaultMystCursor);
}
+ // Set us to the linking book
+ _vm->changeToCard(5, true);
+
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list