[Scummvm-cvs-logs] SF.net SVN: scummvm:[45795] scummvm/trunk/backends/platform/sdl/main.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Nov 10 00:52:50 CET 2009
Revision: 45795
http://scummvm.svn.sourceforge.net/scummvm/?rev=45795&view=rev
Author: fingolfin
Date: 2009-11-09 23:52:50 +0000 (Mon, 09 Nov 2009)
Log Message:
-----------
SDL: Separate Symbian specific main() from standard SDL main() -- to be moved into a separate file
Modified Paths:
--------------
scummvm/trunk/backends/platform/sdl/main.cpp
Modified: scummvm/trunk/backends/platform/sdl/main.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/main.cpp 2009-11-09 23:50:19 UTC (rev 45794)
+++ scummvm/trunk/backends/platform/sdl/main.cpp 2009-11-09 23:52:50 UTC (rev 45795)
@@ -23,32 +23,38 @@
*
*/
-#if defined(WIN32) && !defined(__SYMBIAN32__)
-#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one...
-#undef ARRAYSIZE
-#endif
+#include "common/scummsys.h"
+// 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)
+
+
#include "backends/platform/sdl/sdl.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
#if defined(__SYMBIAN32__)
#include "SymbianOs.h"
-#endif
-#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO)
+#elif defined(WIN32)
-#if defined (WIN32)
+#include <windows.h>
+// winnt.h defines ARRAYSIZE, but we want our own one...
+#undef ARRAYSIZE
+
int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) {
SDL_SetModuleHandle(GetModuleHandle(NULL));
return main(__argc, __argv);
}
#endif
-int main(int argc, char *argv[]) {
#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.
@@ -90,14 +96,27 @@
}
setbuf(stderr, NULL); /* No buffering */
-#endif // defined(__SYMBIAN32__)
// Create our OSystem instance
-#if defined(__SYMBIAN32__)
g_system = new OSystem_SDL_Symbian();
-#else
+ 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();
-#endif
assert(g_system);
#ifdef DYNAMIC_MODULES
@@ -110,4 +129,7 @@
return res;
}
+
+#endif // defined(__SYMBIAN32__)
+
#endif
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