[Scummvm-cvs-logs] SF.net SVN: scummvm:[45802] scummvm/trunk/backends/platform

anotherguest at users.sourceforge.net anotherguest at users.sourceforge.net
Tue Nov 10 09:01:49 CET 2009


Revision: 45802
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45802&view=rev
Author:   anotherguest
Date:     2009-11-10 08:01:48 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
Move Symbian main implementation from main.cpp to SymbianOS.cpp

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/main.cpp
    scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp

Modified: scummvm/trunk/backends/platform/sdl/main.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/main.cpp	2009-11-10 07:29:29 UTC (rev 45801)
+++ scummvm/trunk/backends/platform/sdl/main.cpp	2009-11-10 08:01:48 UTC (rev 45802)
@@ -27,18 +27,15 @@
 
 // Several SDL based ports use a custom main, and hence do not want to compile
 // of this file. The following "#if" ensures that.
-#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO)
+#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO) && !defined(__SYMBIAN32__)
 
 
 #include "backends/platform/sdl/sdl.h"
 #include "backends/plugins/sdl/sdl-provider.h"
 #include "base/main.h"
 
-#if defined(__SYMBIAN32__)
-#include "SymbianOs.h"
+#if defined(WIN32)
 
-#elif defined(WIN32)
-
 #include <windows.h>
 // winnt.h defines ARRAYSIZE, but we want our own one...
 #undef ARRAYSIZE
@@ -49,73 +46,9 @@
 }
 #endif
 
-
-#if defined(__SYMBIAN32__)
-
-// TODO: Move this symbian specific code to a separate source file in the "symbian" directory tree.
-
 int main(int argc, char *argv[]) {
-	//
-	// Set up redirects for stdout/stderr under Windows and Symbian.
-	// Code copied from SDL_main.
-	//
 
-	// Symbian does not like any output to the console through any *print* function
-	char STDOUT_FILE[256], STDERR_FILE[256]; // shhh, don't tell anybody :)
-	strcpy(STDOUT_FILE, Symbian::GetExecutablePath());
-	strcpy(STDERR_FILE, Symbian::GetExecutablePath());
-	strcat(STDOUT_FILE, "scummvm.stdout.txt");
-	strcat(STDERR_FILE, "scummvm.stderr.txt");
-
-	/* Flush the output in case anything is queued */
-	fclose(stdout);
-	fclose(stderr);
-
-	/* Redirect standard input and standard output */
-	FILE *newfp = freopen(STDOUT_FILE, "w", stdout);
-	if (newfp == NULL) {	/* This happens on NT */
-#if !defined(stdout)
-		stdout = fopen(STDOUT_FILE, "w");
-#else
-		newfp = fopen(STDOUT_FILE, "w");
-		if (newfp) {
-			*stdout = *newfp;
-		}
-#endif
-	}
-	newfp = freopen(STDERR_FILE, "w", stderr);
-	if (newfp == NULL) {	/* This happens on NT */
-#if !defined(stderr)
-		stderr = fopen(STDERR_FILE, "w");
-#else
-		newfp = fopen(STDERR_FILE, "w");
-		if (newfp) {
-			*stderr = *newfp;
-		}
-#endif
-	}
-	setbuf(stderr, NULL);			/* No buffering */
-
-
 	// Create our OSystem instance
-	g_system = new OSystem_SDL_Symbian();
-	assert(g_system);
-
-#ifdef DYNAMIC_MODULES
-	PluginManager::instance().addPluginProvider(new SDLPluginProvider());
-#endif
-
-	// Invoke the actual ScummVM main entry point:
-	int res = scummvm_main(argc, argv);
-	g_system->quit();	// TODO: Consider removing / replacing this!
-	return res;
-}
-
-#else // defined(__SYMBIAN32__)
-
-int main(int argc, char *argv[]) {
-
-	// Create our OSystem instance
 	g_system = new OSystem_SDL();
 	assert(g_system);
 
@@ -129,7 +62,4 @@
 	return res;
 }
 
-
-#endif // defined(__SYMBIAN32__)
-
 #endif

Modified: scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp
===================================================================
--- scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp	2009-11-10 07:29:29 UTC (rev 45801)
+++ scummvm/trunk/backends/platform/symbian/src/SymbianOS.cpp	2009-11-10 08:01:48 UTC (rev 45802)
@@ -30,14 +30,15 @@
 #include "backends/platform/symbian/src/SymbianOS.h"
 #include "backends/platform/symbian/src/SymbianActions.h"
 #include "backends/saves/default/default-saves.h"
+
+#include "base/main.h"
+
 #include "common/config-manager.h"
-#include "common/events.h"
-#include "common/file.h"
-#include "gui/Actions.h"
-#include "gui/Key.h"
+#include "common/scummsys.h"
+
 #include "gui/message.h"
+
 #include "sound/mixer_intern.h"
-#include "..\..\sdl\main.cpp"
 
 #ifdef SAMPLES_PER_SEC_8000 // the GreanSymbianMMP format cannot handle values for defines :(
   #define SAMPLES_PER_SEC 8000
@@ -45,17 +46,12 @@
   #define SAMPLES_PER_SEC 16000
 #endif
 
-
 #define DEFAULT_CONFIG_FILE "scummvm.ini"
 #define DEFAULT_SAVE_PATH "Savegames"
 
-#define FILE void
-
 ////////// extern "C" ///////////////////////////////////////////////////
 namespace Symbian {
 
-
-
 // Show a simple Symbian Info win with Msg & exit
 void FatalError(const char *msg) {
 	TPtrC8 msgPtr((const TUint8 *)msg);
@@ -531,31 +527,60 @@
 #include "vsnprintf.h"
 }
 
-/** Vibration support */
-#ifdef  USE_VIBRA_SE_PXXX
-void OSystem_SDL_Symbian::initializeVibration() {
-#ifdef UIQ3
+// Symbian SDL_Main implementation
+// Redirects standard io, creates Symbian specific SDL backend (inherited from main SDL)
+int main(int argc, char *argv[]) {
+	//
+	// Set up redirects for stdout/stderr under Symbian.
+	// Code copied from SDL_main.
+	//
+
+	// Symbian does not like any output to the console through any *print* function
+	char STDOUT_FILE[256], STDERR_FILE[256]; // shhh, don't tell anybody :)
+	strcpy(STDOUT_FILE, Symbian::GetExecutablePath());
+	strcpy(STDERR_FILE, Symbian::GetExecutablePath());
+	strcat(STDOUT_FILE, "scummvm.stdout.txt");
+	strcat(STDERR_FILE, "scummvm.stderr.txt");
+
+	/* Flush the output in case anything is queued */
+	fclose(stdout);
+	fclose(stderr);
+
+	/* Redirect standard input and standard output */
+	FILE *newfp = freopen(STDOUT_FILE, "w", stdout);
+	if (newfp == NULL) {	/* This happens on NT */
+#if !defined(stdout)
+		stdout = fopen(STDOUT_FILE, "w");
 #else
+		newfp = fopen(STDOUT_FILE, "w");
+		if (newfp) {
+			*stdout = *newfp;
+		}
 #endif
-}
-
-void OSystem_SDL_Symbian::vibrationOn(int vibraLength) {
-#ifdef UIQ3
-		// initialize?
-	if (!_vibrationApi) _vibrationApi = SonyEricsson::CVibration::NewL();
-	// do it!
-	_vibrationApi->VibrationOn(1, 1, vibraLength);
+	}
+	newfp = freopen(STDERR_FILE, "w", stderr);
+	if (newfp == NULL) {	/* This happens on NT */
+#if !defined(stderr)
+		stderr = fopen(STDERR_FILE, "w");
 #else
+		newfp = fopen(STDERR_FILE, "w");
+		if (newfp) {
+			*stderr = *newfp;
+		}
+#endif
+	}
+	setbuf(stderr, NULL);			/* No buffering */
 
+	// Create our OSystem instance
+	g_system = new OSystem_SDL_Symbian();
+	assert(g_system);
+
+#ifdef DYNAMIC_MODULES
+	PluginManager::instance().addPluginProvider(new SDLPluginProvider());
 #endif
-}
 
-void OSystem_SDL_Symbian::vibrationOff() {
-#ifdef UIQ3
-#else
-	_vibrationApi->VibrationOff();
-#endif
+	// Invoke the actual ScummVM main entry point:
+	int res = scummvm_main(argc, argv);
+	g_system->quit();	// TODO: Consider removing / replacing this!
+	return res;
 }
-
-#endif //  USE_SE_PXX_VIBRA
-


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