[Scummvm-cvs-logs] SF.net SVN: scummvm: [21559] scummvm/trunk/base

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 2 07:32:01 CEST 2006


Revision: 21559
Author:   fingolfin
Date:     2006-04-02 07:31:23 -0700 (Sun, 02 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21559&view=rev

Log Message:
-----------
Backends now are also responsile for deiniting properly. In particular, moved the call to quit() from scummvm_main to the various backend main routines (porters may want to replace it by something different)

Modified Paths:
--------------
    scummvm/trunk/backends/dc/dcmain.cpp
    scummvm/trunk/backends/gp32/gp32_main.cpp
    scummvm/trunk/backends/maemo/main.cpp
    scummvm/trunk/backends/morphos/morphos_start.cpp
    scummvm/trunk/backends/null/null.cpp
    scummvm/trunk/backends/ps2/systemps2.cpp
    scummvm/trunk/backends/psp/psp_main.cpp
    scummvm/trunk/backends/sdl/sdl.cpp
    scummvm/trunk/backends/wince/wince-sdl.cpp
    scummvm/trunk/backends/x11/x11.cpp
    scummvm/trunk/base/main.cpp
Modified: scummvm/trunk/backends/dc/dcmain.cpp
===================================================================
--- scummvm/trunk/backends/dc/dcmain.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/dc/dcmain.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -206,7 +206,7 @@
   g_system = new OSystem_Dreamcast();
   assert(g_system);
 
-  scummvm_main(argc, argv);
+  int res = scummvm_main(argc, argv);
 
   exit(0);
 }

Modified: scummvm/trunk/backends/gp32/gp32_main.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32_main.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/gp32/gp32_main.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -74,5 +74,8 @@
 	g_system = new OSystem_GP32_create();
 	assert(g_system);
 
-	scummvm_main(1, NULL);
+	// Invoke the actual ScummVM main entry point:
+	int res = scummvm_main(1, NULL);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }

Modified: scummvm/trunk/backends/maemo/main.cpp
===================================================================
--- scummvm/trunk/backends/maemo/main.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/maemo/main.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -68,12 +68,14 @@
 	g_system = new OSystem_SDL();
 	assert(g_system);
 
-	scummvm_main(argc, argv);
+	// Invoke the actual ScummVM main entry point:
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
 
     /* Deinitialize OSSO */
     //osso_deinitialize(osso_context);
 
 	set_doubling(0);
 	
-	return 0;
+	return res;
 }

Modified: scummvm/trunk/backends/morphos/morphos_start.cpp
===================================================================
--- scummvm/trunk/backends/morphos/morphos_start.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/morphos/morphos_start.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -437,6 +437,9 @@
 	g_system = OSystem_MorphOS_create();
 	assert(g_system);
 
-	return scummvm_main(argc, argv);
+	// Invoke the actual ScummVM main entry point:
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
 

Modified: scummvm/trunk/backends/null/null.cpp
===================================================================
--- scummvm/trunk/backends/null/null.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/null/null.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -107,10 +107,13 @@
 };
 
 int main(int argc, char *argv[]) {
-	// Invoke the actual ScummVM main entry point:
 	g_system = OSystem_NULL_create();
 	assert(g_system);
-	return scummvm_main(argc, argv);
+
+	// Invoke the actual ScummVM main entry point:
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
 
 OSystem_NULL::OSystem_NULL()

Modified: scummvm/trunk/backends/ps2/systemps2.cpp
===================================================================
--- scummvm/trunk/backends/ps2/systemps2.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/ps2/systemps2.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -133,7 +133,9 @@
 	assert(g_system);
 
 	sioprintf("init done. starting ScummVM.");
-	return scummvm_main(argc, argv);
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
 
 s32 timerInterruptHandler(s32 cause) {

Modified: scummvm/trunk/backends/psp/psp_main.cpp
===================================================================
--- scummvm/trunk/backends/psp/psp_main.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/psp/psp_main.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -147,10 +147,12 @@
 	g_system = OSystem_PSP_create();
 	assert(g_system);
 
-	scummvm_main(argc, argv);
+	int res = scummvm_main(argc, argv);
+
+	g_system->quit();	// TODO: Consider removing / replacing this!
 	
 	sceKernelSleepThread();
 
-	return 0;
+	return res;
 }
 

Modified: scummvm/trunk/backends/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/sdl/sdl.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/sdl/sdl.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -91,12 +91,14 @@
 
 #endif // defined(__SYMBIAN32__)
 
-
+	// Create our OSystem instance
 	g_system = new OSystem_SDL();
 	assert(g_system);
 
 	// Invoke the actual ScummVM main entry point:
-	return scummvm_main(argc, argv);
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
 #endif
 

Modified: scummvm/trunk/backends/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/wince/wince-sdl.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/wince/wince-sdl.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -146,15 +146,20 @@
 	stderr_file = fopen("\\scummvm_stderr.txt", "w");
 	GUI::Actions::init(_gameDetector);
 
+	int rest = 0;
+
 	__try {
 		g_system = OSystem_WINCE3_create();
 		assert(g_system);
-		return scummvm_main(_gameDetector, argc, argv);
+
+		// Invoke the actual ScummVM main entry point:
+		res = scummvm_main(argc, argv);
+		g_system->quit();	// TODO: Consider removing / replacing this!
 	}
 	__except (handleException(GetExceptionInformation())) {
 	}
 
-	return 0;
+	return res;
 }
 
 // ********************************************************************************************

Modified: scummvm/trunk/backends/x11/x11.cpp
===================================================================
--- scummvm/trunk/backends/x11/x11.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/backends/x11/x11.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -63,7 +63,9 @@
 	assert(g_system);
 
 	// Invoke the actual ScummVM main entry point:
-	return scummvm_main(argc, argv);
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
 
 OSystem *OSystem_X11::create(int gfx_mode, bool full_screen) {

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2006-04-02 14:20:45 UTC (rev 21558)
+++ scummvm/trunk/base/main.cpp	2006-04-02 14:31:23 UTC (rev 21559)
@@ -398,11 +398,8 @@
 		running = launcherDialog(detector, system);
 	}
 
-	// ...and quit (the return 0 should never be reached)
+	// Deinit the timer
 	delete Common::g_timer;
-	system.quit();
 
-	error("If you are seeing this, your OSystem backend is not working properly");
-
 	return 0;
 }


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