PEGASUS: Allow for loading games from the launcher/cli

This commit is contained in:
Matthew Hoops 2011-10-10 13:12:15 -04:00
parent 820e424e98
commit e998fb6c0e
2 changed files with 14 additions and 4 deletions

View File

@ -111,6 +111,7 @@ public:
bool PegasusMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves)
|| (f == kSupportsLoadingDuringStartup)
|| (f == kSupportsDeleteSave);
}

View File

@ -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