aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-10-10 13:12:15 -0400
committerMatthew Hoops2011-10-10 13:12:15 -0400
commite998fb6c0e87bcdeb6240d3bf2c8b7e97b8a372f (patch)
tree309e386af9ff3c625754955def0e834b5fa3bdd5
parent820e424e980107568142caf29862c2b4bf004706 (diff)
downloadscummvm-rg350-e998fb6c0e87bcdeb6240d3bf2c8b7e97b8a372f.tar.gz
scummvm-rg350-e998fb6c0e87bcdeb6240d3bf2c8b7e97b8a372f.tar.bz2
scummvm-rg350-e998fb6c0e87bcdeb6240d3bf2c8b7e97b8a372f.zip
PEGASUS: Allow for loading games from the launcher/cli
-rw-r--r--engines/pegasus/detection.cpp1
-rw-r--r--engines/pegasus/pegasus.cpp17
2 files changed, 14 insertions, 4 deletions
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index fe797b4eee..76455e976f 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -111,6 +111,7 @@ public:
bool PegasusMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves)
+ || (f == kSupportsLoadingDuringStartup)
|| (f == kSupportsDeleteSave);
}
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 3d1c4d539c..a696edaedc 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -143,10 +143,6 @@ Common::Error PegasusEngine::run() {
_biochips.setWeightLimit(8);
_biochips.setOwnerID(kPlayerID);
- // Start up the first notification
- _shellNotification.notifyMe(this, kJMPShellNotificationFlags, kJMPShellNotificationFlags);
- _shellNotification.setNotificationFlags(kGameStartingFlag, kGameStartingFlag);
-
_returnHotspot.setArea(Common::Rect(kNavAreaLeft, kNavAreaTop, 512 + kNavAreaLeft, 256 + kNavAreaTop));
_returnHotspot.setHotspotFlags(kInfoReturnSpotFlag);
g_allHotspots.push_back(&_returnHotspot);
@@ -154,6 +150,19 @@ Common::Error PegasusEngine::run() {
_screenDimmer.setBounds(Common::Rect(0, 0, 640, 480));
_screenDimmer.setDisplayOrder(kScreenDimmerOrder);
+ // Load from the launcher/cli if requested (and don't show the intro in those cases)
+ bool doIntro = true;
+ if (ConfMan.hasKey("save_slot")) {
+ uint32 gameToLoad = ConfMan.getInt("save_slot");
+ doIntro = (loadGameState(gameToLoad).getCode() != Common::kNoError);
+ }
+
+ if (doIntro) {
+ // Start up the first notification
+ _shellNotification.notifyMe(this, kJMPShellNotificationFlags, kJMPShellNotificationFlags);
+ _shellNotification.setNotificationFlags(kGameStartingFlag, kGameStartingFlag);
+ }
+
while (!shouldQuit()) {
processShell();
_system->delayMillis(10); // Ease off the CPU