| 1 |
/* GemRB - Infinity Engine Emulator |
| 2 |
* Copyright (C) 2011 The GemRB Project |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 |
* |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#include <Python.h> |
| 22 |
|
| 23 |
#import "GEM_AppDelegate.h" |
| 24 |
|
| 25 |
extern int SDL_main(int argc, char *argv[]); |
| 26 |
|
| 27 |
// use the SDL 1.3 build in wrapper for iOS |
| 28 |
int SDL_main (int __unused argc, char __unused **argv) |
| 29 |
{ |
| 30 |
/* |
| 31 |
Consideration: we are currently getting argv and argc from cocoa process info and not using the ones passed here (they of course ought to be the same) |
| 32 |
*/ |
| 33 |
|
| 34 |
|
| 35 |
/* |
| 36 |
Beware!: This relies on haveing a certain revision of SDL 1.3 or later. |
| 37 |
Early revisions of 1.3 would call exit() when this method returns instad of leaving the runloop running for us. |
| 38 |
GemRB used to hack its own runloop to workaround the issue, but that caused problems with the config editor |
| 39 |
Now that SDL no longer exits and we are creating our own app delegate we can safely use this wrapper without hacks. |
| 40 |
|
| 41 |
Also note this function never returns. exit is called after GemRB_main returns in the app delegate. |
| 42 |
*/ |
| 43 |
|
| 44 |
//do all the special plugin initializations here |
| 45 |
Py_NoSiteFlag = 1; |
| 46 |
|
| 47 |
return 0; //never actually returns. |
| 48 |
} |