aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-11-09 23:52:50 +0000
committerMax Horn2009-11-09 23:52:50 +0000
commitd6d2c5d7b83027c21f8e00d364c925ca5f45c392 (patch)
treed77ee6b0f8d993afb1decfd11d2f189c6051c076
parentb3a07754e23f026d842ccc5b414b535c51ff3d56 (diff)
downloadscummvm-rg350-d6d2c5d7b83027c21f8e00d364c925ca5f45c392.tar.gz
scummvm-rg350-d6d2c5d7b83027c21f8e00d364c925ca5f45c392.tar.bz2
scummvm-rg350-d6d2c5d7b83027c21f8e00d364c925ca5f45c392.zip
SDL: Separate Symbian specific main() from standard SDL main() -- to be moved into a separate file
svn-id: r45795
-rw-r--r--backends/platform/sdl/main.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp
index fa8f6ededb..939cfb4048 100644
--- a/backends/platform/sdl/main.cpp
+++ b/backends/platform/sdl/main.cpp
@@ -23,11 +23,12 @@
*
*/
-#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"
@@ -35,20 +36,25 @@
#if defined(__SYMBIAN32__)
#include "SymbianOs.h"
-#endif
-#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO)
+#elif defined(WIN32)
+
+#include <windows.h>
+// winnt.h defines ARRAYSIZE, but we want our own one...
+#undef ARRAYSIZE
-#if defined (WIN32)
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 @@ int main(int argc, char *argv[]) {
}
setbuf(stderr, NULL); /* No buffering */
-#endif // defined(__SYMBIAN32__)
// Create our OSystem instance
-#if defined(__SYMBIAN32__)
g_system = new OSystem_SDL_Symbian();
-#else
- g_system = new OSystem_SDL();
+ 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);
#ifdef DYNAMIC_MODULES
@@ -110,4 +129,7 @@ int main(int argc, char *argv[]) {
return res;
}
+
+#endif // defined(__SYMBIAN32__)
+
#endif