start teewars by default on osx, no launcher yet

This commit is contained in:
Joel de Vahl 2007-12-19 21:32:58 +00:00
parent 72ffd0ae8a
commit 5669c11a0b
3 changed files with 12 additions and 15 deletions

View file

@ -99,7 +99,7 @@ if use_bundle:
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>TeeLaunch</string>
<string>teewars</string>
<key>CFBundleIconFile</key>
<string>Teewars</string>
<key>CFBundleInfoDictionaryVersion</key>

View file

@ -707,7 +707,7 @@ int _glfwPlatformOpenWindow( int width,
return GL_FALSE;
}
if (_glfwLibrary.Unbundled)
//if (_glfwLibrary.Unbundled)
{
if( GetCurrentProcess( &psn ) != noErr )
{

View file

@ -3,15 +3,20 @@
@interface ServerView : NSTextView
{
NSTask *task;
NSFileHandle *file;
}
- (void)listenTo: (NSFileHandle*)f;
- (void)listenTo: (NSTask*)t;
@end
@implementation ServerView
- (void)listenTo: (NSFileHandle*)f;
- (void)listenTo: (NSTask*)t;
{
file = f;
NSPipe *pipe;
task = t;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
file = [pipe fileHandleForReading];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(outputNotification:) name: NSFileHandleReadCompletionNotification object: file];
@ -35,6 +40,7 @@
-(void)windowWillClose:(NSNotification *)notification
{
[task terminate]
[NSApp terminate:self];
}
@end
@ -49,12 +55,6 @@ int main(int argc, char **argv)
NSTask *task;
task = [[NSTask alloc] init];
[task setCurrentDirectoryPath: [mainBundle resourcePath]];
NSPipe *pipe;
NSFileHandle *file;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
file = [pipe fileHandleForReading];
if(mod & optionKey)
{
@ -82,7 +82,7 @@ int main(int argc, char **argv)
[window setDelegate: view];
[window makeKeyAndOrderFront: nil];
[view listenTo: file];
[view listenTo: task];
[task setLaunchPath: [mainBundle pathForAuxiliaryExecutable: @"teewars_srv"]];
[task launch];
[NSApp run];
@ -93,11 +93,8 @@ int main(int argc, char **argv)
// run client
[task setLaunchPath: [mainBundle pathForAuxiliaryExecutable: @"teewars"]];
[task launch];
[task waitUntilExit];
}
[NSApp release];
[pool release];
return(EXIT_SUCCESS);