aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/main.cpp
diff options
context:
space:
mode:
authorMax Horn2010-11-28 14:56:31 +0000
committerMax Horn2010-11-28 14:56:31 +0000
commit7760077cf530c35c969f9286145d9a36d0440d70 (patch)
tree34c67abbacefa26792ca77fc9f5360c77a34663d /backends/platform/sdl/main.cpp
parent284b49aabc54590e1444f06561a815c2a3c5de7e (diff)
parent74a53df11b51fa4956745c086b2e6351b8383568 (diff)
downloadscummvm-rg350-7760077cf530c35c969f9286145d9a36d0440d70.tar.gz
scummvm-rg350-7760077cf530c35c969f9286145d9a36d0440d70.tar.bz2
scummvm-rg350-7760077cf530c35c969f9286145d9a36d0440d70.zip
Merging the gsoc2010-opengl branch
svn-id: r54518
Diffstat (limited to 'backends/platform/sdl/main.cpp')
-rw-r--r--backends/platform/sdl/main.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp
index a9e1f5cf4b..14cfaaee57 100644
--- a/backends/platform/sdl/main.cpp
+++ b/backends/platform/sdl/main.cpp
@@ -23,50 +23,44 @@
*
*/
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-// Fix for bug #2895217 "MSVC compilation broken with r47595":
-// We need to keep this on top of the "common/scummsys.h" include,
-// otherwise we will get errors about the windows headers redefining
-// "ARRAYSIZE" for example.
-#if defined(WIN32) && !defined(__SYMBIAN32__)
-#define WIN32_LEAN_AND_MEAN
-#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(__SYMBIAN32__) && !defined(_WIN32_WCE) && !defined(DINGUX) && !defined(GPH_DEVICE) && !defined(LINUXMOTO) && !defined(OPENPANDORA)
-
+#if !defined(UNIX) && \
+ !defined(WIN32) && \
+ !defined(__MAEMO__) && \
+ !defined(__SYMBIAN32__) && \
+ !defined(_WIN32_WCE) && \
+ !defined(__amigaos4__) && \
+ !defined(DINGUX) && \
+ !defined(CAANOO) && \
+ !defined(LINUXMOTO) && \
+ !defined(OPENPANDORA)
#include "backends/platform/sdl/sdl.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
-#ifdef 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[]) {
// Create our OSystem instance
g_system = new OSystem_SDL();
assert(g_system);
+ // Pre initialize the backend
+ ((OSystem_SDL *)g_system)->init();
+
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
#endif
// Invoke the actual ScummVM main entry point:
int res = scummvm_main(argc, argv);
- ((OSystem_SDL *)g_system)->deinit();
+
+ // Free OSystem
+ delete (OSystem_SDL *)g_system;
+
return res;
}