diff --git a/polymer/eduke32/Apple/StartupWinController.game.m b/polymer/eduke32/Apple/StartupWinController.game.m index 01db59e53..8cce09a09 100644 --- a/polymer/eduke32/Apple/StartupWinController.game.m +++ b/polymer/eduke32/Apple/StartupWinController.game.m @@ -13,6 +13,8 @@ #import "GrpFile.game.h" #import "GameListSource.game.h" +static id nsapp; + static struct { int fullscreen; int xdim3d, ydim3d, bpp3d; @@ -186,7 +188,7 @@ static struct soundQuality_t { - (IBAction)cancel:(id)sender { - [NSApp abortModal]; + [nsapp abortModal]; } - (IBAction)start:(id)sender @@ -217,7 +219,7 @@ static struct soundQuality_t { settings.forcesetup = [alwaysShowButton state] == NSOnState; - [NSApp stopModal]; + [nsapp stopModal]; } - (void)setupRunMode @@ -305,6 +307,12 @@ static StartupWinController *startwin = nil; int startwin_open(void) { + // PK: is this the entry point? + + // fix for "ld: absolute address to symbol _NSApp in a different linkage unit not supported" + // (OS X 10.6) when building for PPC + nsapp = [NSApplication sharedApplication]; + if (startwin != nil) return 1; startwin = [[StartupWinController alloc] initWithWindowNibName:@"startwin.game"]; @@ -412,7 +420,7 @@ int startwin_run(void) [startwin setupRunMode]; - switch ([NSApp runModalForWindow:[startwin window]]) { + switch ([nsapp runModalForWindow:[startwin window]]) { case NSRunStoppedResponse: retval = 1; break; case NSRunAbortedResponse: retval = 0; break; default: retval = -1; diff --git a/polymer/eduke32/build/src/StartupWinController.editor.m b/polymer/eduke32/build/src/StartupWinController.editor.m index 9723b8cb2..796b516b1 100644 --- a/polymer/eduke32/build/src/StartupWinController.editor.m +++ b/polymer/eduke32/build/src/StartupWinController.editor.m @@ -2,6 +2,8 @@ #include "baselayer.h" +static id nsapp; + @interface StartupWinController : NSWindowController { IBOutlet NSButton *alwaysShowButton; @@ -39,13 +41,13 @@ - (IBAction)cancel:(id)sender { - [NSApp abortModal]; + [nsapp abortModal]; } - (IBAction)start:(id)sender { // XXX: write the states of the form controls to their respective homes - [NSApp stopModal]; + [nsapp stopModal]; } - (void)setupRunMode @@ -114,6 +116,8 @@ static StartupWinController *startwin = nil; int startwin_open(void) { + nsapp = [NSApplication sharedApplication]; + if (startwin != nil) return 1; startwin = [[StartupWinController alloc] initWithWindowNibName:@"startwin.editor"]; @@ -177,7 +181,7 @@ int startwin_run(void) [startwin setupRunMode]; - switch ([NSApp runModalForWindow:[startwin window]]) { + switch ([nsapp runModalForWindow:[startwin window]]) { case NSRunStoppedResponse: retval = 1; break; case NSRunAbortedResponse: retval = 0; break; default: retval = -1;