~ubuntu-branches/ubuntu/raring/scummvm/raring

« back to all changes in this revision

Viewing changes to backends/platform/sdl/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-05-25 19:02:23 UTC
  • mto: (21.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20110525190223-fiqm0oaec714xk31
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
20
20
 *
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 $
 
21
 * $URL$
 
22
 * $Id$
23
23
 *
24
24
 */
25
25
 
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
32
 
#include <windows.h>
33
 
// winnt.h defines ARRAYSIZE, but we want our own one...
34
 
#undef ARRAYSIZE
35
 
#endif
36
 
 
37
26
#include "common/scummsys.h"
38
27
 
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)
42
 
 
 
30
#if !defined(UNIX) && \
 
31
    !defined(WIN32) && \
 
32
    !defined(__MAEMO__) && \
 
33
    !defined(__SYMBIAN32__) && \
 
34
    !defined(_WIN32_WCE) && \
 
35
    !defined(__amigaos4__) && \
 
36
    !defined(DINGUX) && \
 
37
    !defined(CAANOO) && \
 
38
    !defined(LINUXMOTO) && \
 
39
    !defined(SAMSUNGTV) && \
 
40
    !defined(OPENPANDORA)
43
41
 
44
42
#include "backends/platform/sdl/sdl.h"
45
43
#include "backends/plugins/sdl/sdl-provider.h"
46
44
#include "base/main.h"
47
45
 
48
 
#ifdef WIN32
49
 
int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/,  LPSTR /*lpCmdLine*/, int /*iShowCmd*/) {
50
 
        SDL_SetModuleHandle(GetModuleHandle(NULL));
51
 
        return main(__argc, __argv);
52
 
}
53
 
#endif
54
 
 
55
46
int main(int argc, char *argv[]) {
56
47
 
57
48
        // Create our OSystem instance
58
49
        g_system = new OSystem_SDL();
59
50
        assert(g_system);
60
51
 
 
52
        // Pre initialize the backend
 
53
        ((OSystem_SDL *)g_system)->init();
 
54
 
61
55
#ifdef DYNAMIC_MODULES
62
56
        PluginManager::instance().addPluginProvider(new SDLPluginProvider());
63
57
#endif
64
58
 
65
59
        // Invoke the actual ScummVM main entry point:
66
60
        int res = scummvm_main(argc, argv);
67
 
        ((OSystem_SDL *)g_system)->deinit();
 
61
 
 
62
        // Free OSystem
 
63
        delete (OSystem_SDL *)g_system;
 
64
 
68
65
        return res;
69
66
}
70
67