18
18
* along with this program; if not, write to the Free Software
19
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/tags/release-1-2-1/backends/platform/sdl/main.cpp $
22
* $Id: main.cpp 52599 2010-09-06 17:28:17Z djwillis $
26
// Fix for bug #2895217 "MSVC compilation broken with r47595":
27
// We need to keep this on top of the "common/scummsys.h" include,
28
// otherwise we will get errors about the windows headers redefining
29
// "ARRAYSIZE" for example.
30
#if defined(WIN32) && !defined(__SYMBIAN32__)
31
#define WIN32_LEAN_AND_MEAN
33
// winnt.h defines ARRAYSIZE, but we want our own one...
37
26
#include "common/scummsys.h"
39
28
// Several SDL based ports use a custom main, and hence do not want to compile
40
29
// of this file. The following "#if" ensures that.
41
#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(CAANOO) && !defined(GP2XWIZ) && !defined(LINUXMOTO) && !defined(OPENPANDORA) && !defined(__SYMBIAN32__) && !defined(DINGUX)
30
#if !defined(UNIX) && \
32
!defined(__MAEMO__) && \
33
!defined(__SYMBIAN32__) && \
34
!defined(_WIN32_WCE) && \
35
!defined(__amigaos4__) && \
38
!defined(LINUXMOTO) && \
39
!defined(SAMSUNGTV) && \
44
42
#include "backends/platform/sdl/sdl.h"
45
43
#include "backends/plugins/sdl/sdl-provider.h"
46
44
#include "base/main.h"
49
int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) {
50
SDL_SetModuleHandle(GetModuleHandle(NULL));
51
return main(__argc, __argv);
55
46
int main(int argc, char *argv[]) {
57
48
// Create our OSystem instance
58
49
g_system = new OSystem_SDL();
52
// Pre initialize the backend
53
((OSystem_SDL *)g_system)->init();
61
55
#ifdef DYNAMIC_MODULES
62
56
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
65
59
// Invoke the actual ScummVM main entry point:
66
60
int res = scummvm_main(argc, argv);
67
((OSystem_SDL *)g_system)->deinit();
63
delete (OSystem_SDL *)g_system;