[Scummvm-git-logs] scummvm master -> 22fb7015ffde0eb850ee0182abe5e6e09671debc

aquadran aquadran at gmail.com
Sat Mar 13 06:48:39 UTC 2021


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:
22fb7015ff ICB: Added return to launcher functionality


Commit: 22fb7015ffde0eb850ee0182abe5e6e09671debc
    https://github.com/scummvm/scummvm/commit/22fb7015ffde0eb850ee0182abe5e6e09671debc
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-03-13T07:48:34+01:00

Commit Message:
ICB: Added return to launcher functionality

Changed paths:
    engines/icb/icb.cpp
    engines/icb/icb.h
    engines/icb/p4_pc.cpp


diff --git a/engines/icb/icb.cpp b/engines/icb/icb.cpp
index 4bffe6b6d5..8fd1d33410 100644
--- a/engines/icb/icb.cpp
+++ b/engines/icb/icb.cpp
@@ -135,9 +135,15 @@ Common::KeymapArray IcbEngine::initKeymapsIcb(const char *target) {
 	return Keymap::arrayOf(engineKeyMap);
 }
 
+bool IcbEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsReturnToLauncher);
+}
+
 // TODO: Refactor, this is currently implemented in p4_pc.cpp
 void InitEngine(const char *cmdLine);
 bool mainLoopIteration();
+void quitEngine();
 
 Common::Error IcbEngine::run() {
 	initGfx(false, false);
@@ -152,6 +158,10 @@ void IcbEngine::initGfx(bool hwAccel, bool fullscreen) {
 
 void IcbEngine::mainLoop() {
 	while (mainLoopIteration()) {
+		if (shouldQuit()) {
+			quitEngine();
+			break;
+		}
 	}
 }
 
diff --git a/engines/icb/icb.h b/engines/icb/icb.h
index 6b8bac0d97..45ab7e797b 100644
--- a/engines/icb/icb.h
+++ b/engines/icb/icb.h
@@ -42,10 +42,11 @@ public:
 
 	Common::RandomSource *getRandomSource() { return _randomSource; }
 	static Common::Array<Common::Keymap *> initKeymapsIcb(const char *target);
+	bool hasFeature(EngineFeature f) const override;
 
 protected:
 	// Engine APIs
-	virtual Common::Error run();
+	virtual Common::Error run() override;
 
 private:
 	void initGfx(bool hwAccel, bool fullscreen);
diff --git a/engines/icb/p4_pc.cpp b/engines/icb/p4_pc.cpp
index 0530a5cfc5..6ae2d85202 100644
--- a/engines/icb/p4_pc.cpp
+++ b/engines/icb/p4_pc.cpp
@@ -262,6 +262,27 @@ void InitEngine(const char *lpCmdLine) {
 	ReadConfigFromIniFile();
 }
 
+void quitEngine() {
+	Zdebug("\nap closed");
+	Zdebug("Be Vigilant!\n");
+
+	if (g_mission)
+		g_icb_mission->___delete_mission();
+
+	Close_Sound_Engine();
+
+	if (surface_manager)
+		delete surface_manager;
+
+	Save_config_file(); // write user options ini file
+	DestoryRevRenderDevice();
+
+	// Shutdown the runtime cluster manager
+	g_theClusterManager->Shutdown();
+
+	DestroyGlobalObjects();
+}
+
 bool mainLoopIteration() {
 	Common::Event event;
 
@@ -309,24 +330,7 @@ bool mainLoopIteration() {
 			break;
 
 		case Common::EVENT_QUIT:
-			Zdebug("\nap closed");
-			Zdebug("Be Vigilant!\n");
-
-			if (g_mission)
-				g_icb_mission->___delete_mission();
-
-			Close_Sound_Engine();
-
-			if (surface_manager)
-				delete surface_manager;
-
-			Save_config_file(); // write user options ini file
-			DestoryRevRenderDevice();
-
-			// Shutdown the runtime cluster manager
-			g_theClusterManager->Shutdown();
-
-			DestroyGlobalObjects();
+			quitEngine();
 			return false;
 		default:
 			break;




More information about the Scummvm-git-logs mailing list