2005-05-20 12:29:03 +00:00
|
|
|
#import <AppKit/NSApplication.h>
|
2005-04-19 19:53:18 +00:00
|
|
|
|
|
|
|
#ifdef GNUSTEP
|
2005-05-31 12:10:03 +00:00
|
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
#import <Foundation/NSString.h>
|
|
|
|
|
2005-04-19 19:53:18 +00:00
|
|
|
#import "GameController.h"
|
|
|
|
|
|
|
|
GameController* controller;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int debug = NO;
|
|
|
|
|
|
|
|
int main(int argc, const char *argv[])
|
|
|
|
{
|
|
|
|
#ifdef GNUSTEP
|
2005-05-23 11:57:23 +00:00
|
|
|
// This is still necessary for NSFont calls.
|
2005-04-19 19:53:18 +00:00
|
|
|
[NSApplication sharedApplication];
|
|
|
|
|
2005-05-23 11:57:23 +00:00
|
|
|
// Need this because we're not using the default run loop's autorelease
|
|
|
|
// pool.
|
|
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
2005-05-20 12:29:03 +00:00
|
|
|
|
2005-05-23 11:57:23 +00:00
|
|
|
// dajt: allocate and set the NSApplication delegate manually because not
|
|
|
|
// using NIB to do this
|
2005-04-19 19:53:18 +00:00
|
|
|
controller = [[GameController alloc] init];
|
2005-05-23 11:57:23 +00:00
|
|
|
|
|
|
|
// Release anything allocated during the controller initialisation that
|
|
|
|
// is no longer required.
|
|
|
|
[pool release];
|
2005-04-19 19:53:18 +00:00
|
|
|
|
2005-05-31 12:10:03 +00:00
|
|
|
if (argc > 1)
|
|
|
|
[controller setPlayerFileToLoad: [NSString stringWithCString: argv[argc - 1]]];
|
|
|
|
|
2005-05-23 11:57:23 +00:00
|
|
|
// Call applicationDidFinishLaunching because NSApp is not running in
|
|
|
|
// GNUstep port.
|
2005-05-20 12:29:03 +00:00
|
|
|
[controller applicationDidFinishLaunching: nil];
|
|
|
|
#else
|
2005-04-19 19:53:18 +00:00
|
|
|
return NSApplicationMain(argc, argv);
|
2005-05-20 12:29:03 +00:00
|
|
|
#endif
|
2005-04-19 19:53:18 +00:00
|
|
|
|
2005-05-20 12:29:03 +00:00
|
|
|
// never reached
|
|
|
|
return 0;
|
|
|
|
}
|
2005-04-19 19:53:18 +00:00
|
|
|
|
2005-05-20 12:29:03 +00:00
|
|
|
/*
|
2005-05-23 11:57:23 +00:00
|
|
|
* This is called from a couple of places, and having it here saves one more
|
|
|
|
* AppKit dependency.
|
2005-05-20 12:29:03 +00:00
|
|
|
*/
|
|
|
|
void NSBeep()
|
|
|
|
{
|
|
|
|
}
|