Test having SM not run in the main thread. This is most noticeable during the loading window since events are still processed.

It's possible that this causes problems if something in SDL or SM absolutely must be run in the main thread. One thing to consider is lowering the main thread's precedence.
This commit is contained in:
Steve Checkoway
2005-10-24 11:29:34 +00:00
parent 10688caf8e
commit ff9f7d25c5
2 changed files with 13 additions and 8 deletions
+2 -1
View File
@@ -7,5 +7,6 @@
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@interface SDLMain : NSObject {}
- (void) startGame:(id)obj;
@end
+11 -7
View File
@@ -63,6 +63,12 @@ static BOOL gFinderLaunch;
/* The main class of the application, the application's delegate */
@implementation SDLMain
- (void) startGame:(id)obj
{
/* Hand off to main application code */
exit(SDL_main (gArgc, gArgv));
}
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
@@ -209,8 +215,6 @@ void CustomApplicationMain (int argc, char **argv)
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
@@ -219,11 +223,11 @@ void CustomApplicationMain (int argc, char **argv)
[self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]];
#endif
/* Hand off to main application code */
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
#if 1
[NSThread detachNewThreadSelector:@selector(startGame:) toTarget:self withObject:nil];
#else
[self startGame:nil];
#endif
}
@end