[Scummvm-cvs-logs] scummvm master -> 4548cbddb5b0490effe402242e08001859c7266c

bluegr bluegr at gmail.com
Sun Dec 27 22:08:40 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4548cbddb5 LAB: Add support for loading games from the launcher


Commit: 4548cbddb5b0490effe402242e08001859c7266c
    https://github.com/scummvm/scummvm/commit/4548cbddb5b0490effe402242e08001859c7266c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-27T23:07:41+02:00

Commit Message:
LAB: Add support for loading games from the launcher

Changed paths:
    engines/lab/detection.cpp
    engines/lab/engine.cpp
    engines/lab/savegame.cpp



diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index 805594b..5850dc6 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -145,13 +145,13 @@ public:
 
 bool LabMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-	(f == kSupportsListSaves) ||
-	//(f == kSupportsLoadingDuringStartup) ||
-	(f == kSupportsDeleteSave) ||
-	(f == kSavesSupportMetaInfo) ||
-	(f == kSavesSupportThumbnail) ||
-	(f == kSavesSupportCreationDate) ||
-	(f == kSavesSupportPlayTime);
+		(f == kSupportsListSaves) ||
+		(f == kSupportsLoadingDuringStartup) ||
+		(f == kSupportsDeleteSave) ||
+		(f == kSavesSupportMetaInfo) ||
+		(f == kSavesSupportThumbnail) ||
+		(f == kSavesSupportCreationDate) ||
+		(f == kSavesSupportPlayTime);
 }
 
 bool Lab::LabEngine::hasFeature(EngineFeature f) const {
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 8f39ff5..20f38ef 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -28,8 +28,9 @@
  *
  */
 
-#include "lab/lab.h"
+#include "common/config-manager.h"
 
+#include "lab/lab.h"
 #include "lab/anim.h"
 #include "lab/dispman.h"
 #include "lab/eventman.h"
@@ -404,6 +405,18 @@ void LabEngine::mainGameLoop() {
 
 	perFlipButton(actionMode);
 
+	// Load saved slot from the launcher, if requested
+	if (ConfMan.hasKey("save_slot")) {
+		loadGame(ConfMan.getInt("save_slot"));
+
+		// Since the intro hasn't been shown, init the background music here
+		if (getPlatform() != Common::kPlatformAmiga)
+			_music->changeMusic("Music:BackGrou", false, false);
+		else
+			_music->changeMusic("Music:BackGround", false, false);
+		_music->checkRoomMusic();
+	}
+
 	// Set up initial picture.
 	while (1) {
 		_event->processInput();
@@ -1020,11 +1033,14 @@ void LabEngine::go() {
 	else
 		_msgFont = _resource->getFont("F:Map.fon");
 
-	_event->mouseHide();
-	Intro *intro = new Intro(this);
-	intro->play();
-	delete intro;
-	_event->mouseShow();
+	// If the user has requested to load a game from the launcher, skip the intro
+	if (!ConfMan.hasKey("save_slot")) {
+		_event->mouseHide();
+		Intro *intro = new Intro(this);
+		intro->play();
+		delete intro;
+		_event->mouseShow();
+	}
 
 	mainGameLoop();
 
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp
index 8d8b42f..d815929 100644
--- a/engines/lab/savegame.cpp
+++ b/engines/lab/savegame.cpp
@@ -114,7 +114,8 @@ bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) {
 	header._descr.setSaveTime(hour, minutes);
 
 	header._descr.setPlayTime(playTime * 1000);
-	g_engine->setTotalPlayTime(playTime * 1000);
+	if (g_engine)
+		g_engine->setTotalPlayTime(playTime * 1000);
 
 	return true;
 }






More information about the Scummvm-git-logs mailing list