mac updates
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1126 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
/*
|
||||
* A basic console view
|
||||
*/
|
||||
|
||||
@interface ConsoleView : NSView {
|
||||
@private
|
||||
NSMutableArray *array;
|
||||
NSDictionary *attr;
|
||||
BOOL endScroll;
|
||||
}
|
||||
- (void)scrollToEnd:(BOOL)enable;
|
||||
|
||||
/*
|
||||
* Append the given line
|
||||
*/
|
||||
- (void)appendLine:(NSString*)line;
|
||||
|
||||
/*
|
||||
* Append multiple lines, skip blank ones
|
||||
*/
|
||||
- (void)appendText:(NSString*)text;
|
||||
|
||||
@end
|
||||
Executable
+120
@@ -0,0 +1,120 @@
|
||||
#import "ConsoleView.h"
|
||||
|
||||
#define MAX_LINES 200
|
||||
#define LINE_WIDTH 500
|
||||
#define LINE_HEIGHT 12
|
||||
|
||||
/*
|
||||
* This VScroller sends a scrollToEnd message to the console based on whether you hit page/line down or not
|
||||
*/
|
||||
@interface VScroller : NSScroller {
|
||||
}
|
||||
@end
|
||||
@implementation VScroller
|
||||
- (NSScrollerPart)hitPart {
|
||||
ConsoleView *view = (ConsoleView *)[(NSScrollView*)[self superview] documentView];
|
||||
NSScrollerPart part = [super hitPart];
|
||||
[view scrollToEnd:((part == NSScrollerIncrementPage) || (part == NSScrollerIncrementLine))];
|
||||
return part;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation ConsoleView
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
array = [[[NSMutableArray alloc] init] retain];
|
||||
|
||||
attr = [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSFont userFontOfSize:(LINE_HEIGHT-2)], NSFontAttributeName,
|
||||
[NSColor colorWithCalibratedRed:0.2 green:0.8 blue:0.2 alpha:1.0], NSForegroundColorAttributeName,
|
||||
nil] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[self scrollToEnd:YES];
|
||||
|
||||
NSScroller *vscroll = [[VScroller alloc] init];
|
||||
[vscroll setControlSize:[[[self enclosingScrollView] verticalScroller] controlSize]];
|
||||
[[self enclosingScrollView] setVerticalScroller:vscroll];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[attr release];
|
||||
[array release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)isFlipped {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
//draw the visible lines only
|
||||
int startLine = rect.origin.y/LINE_HEIGHT;
|
||||
int endLine = 1 + (rect.origin.y+rect.size.height)/LINE_HEIGHT;
|
||||
if(startLine < 0) startLine = 0;
|
||||
if(endLine > [array count]) endLine = [array count];
|
||||
int i;
|
||||
for(i = startLine; i < endLine; i++) {
|
||||
NSString *str = [array objectAtIndex:i];
|
||||
[str drawAtPoint:NSMakePoint(2, i * LINE_HEIGHT) withAttributes:attr];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scrollToEnd:(BOOL)enable {
|
||||
endScroll = enable;
|
||||
}
|
||||
|
||||
- (void)appendLine:(NSString*)line {
|
||||
BOOL chop = [array count] > MAX_LINES;
|
||||
if(chop) {
|
||||
[array removeObjectAtIndex:0]; // limit the number of lines
|
||||
}
|
||||
[array addObject:line];
|
||||
int i = [array count];
|
||||
[self setFrame:NSMakeRect(0, 0, LINE_WIDTH, i*LINE_HEIGHT)]; // increase the frame size
|
||||
|
||||
NSRect rect = NSMakeRect(0, (i-1)*LINE_HEIGHT, LINE_WIDTH, LINE_HEIGHT);
|
||||
if(endScroll) {
|
||||
// Scroll to the line just added
|
||||
if([self scrollRectToVisible:rect]) return;
|
||||
} else {
|
||||
// Lock the scrolling on the first visible line
|
||||
i = [self visibleRect].origin.y/LINE_HEIGHT;
|
||||
if(!chop) i++;
|
||||
if(i < 0) i = 0;
|
||||
if(i > [array count]) i = [array count];
|
||||
NSRect vrect = NSMakeRect(0, (i-1)*LINE_HEIGHT, LINE_WIDTH, LINE_HEIGHT);
|
||||
if([self scrollRectToVisible:vrect]) return;
|
||||
}
|
||||
if(chop)
|
||||
[self setNeedsDisplay:YES];
|
||||
else
|
||||
[self setNeedsDisplayInRect:rect];
|
||||
}
|
||||
|
||||
- (void)appendText:(NSString*)text {
|
||||
NSArray *lines = [text componentsSeparatedByString:@"\n"]; //@TODO assumes we get given lines rather than fragments...
|
||||
int i;
|
||||
for(i = 0; i < [lines count]; i++) {
|
||||
NSString *line = [lines objectAtIndex:i];
|
||||
if([line length] == 0) continue; //skip empty
|
||||
[self appendLine:line];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstResponder {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (IBAction)delete:(id)sender {
|
||||
[array removeAllObjects];
|
||||
[self setFrame:NSMakeRect(0,0,0,0)];
|
||||
}
|
||||
|
||||
@end
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
+20
-4
@@ -1,10 +1,26 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface MyObject : NSObject
|
||||
{
|
||||
IBOutlet NSPopUpButton *resolutions;
|
||||
IBOutlet NSButtonCell *fullscreen;
|
||||
@class ConsoleView;
|
||||
|
||||
@interface Launcher : NSObject {
|
||||
IBOutlet NSWindow *window;
|
||||
IBOutlet NSView *view1;
|
||||
IBOutlet NSView *view2;
|
||||
IBOutlet NSView *view3;
|
||||
|
||||
IBOutlet NSArrayController *maps;
|
||||
IBOutlet NSArrayController *keys;
|
||||
IBOutlet NSPopUpButton *resolutions;
|
||||
IBOutlet NSButton *multiplayer;
|
||||
IBOutlet ConsoleView *console;
|
||||
@private
|
||||
NSMutableDictionary *toolBarItems;
|
||||
pid_t server;
|
||||
}
|
||||
|
||||
- (IBAction)playAction:(id)sender;
|
||||
|
||||
- (IBAction)multiplayerAction:(id)sender;
|
||||
|
||||
- (IBAction)helpAction:(id)sender;
|
||||
@end
|
||||
+504
-80
@@ -1,109 +1,533 @@
|
||||
#import "Launcher.h"
|
||||
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#import "ConsoleView.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> /* unlink */
|
||||
#include <util.h> /* forkpty */
|
||||
|
||||
#define kMaxDisplays 16
|
||||
|
||||
NSMutableArray *array;
|
||||
|
||||
static int numberForKey( CFDictionaryRef desc, CFStringRef key )
|
||||
// unless you want strings with "(null)" in them :-/
|
||||
@interface NSUserDefaults(Extras)
|
||||
- (NSString*)nonNullStringForKey:(NSString*)key;
|
||||
@end
|
||||
|
||||
@implementation NSUserDefaults(Extras)
|
||||
- (NSString*)nonNullStringForKey:(NSString*)key {
|
||||
NSString *result = [self stringForKey:key];
|
||||
return (result?result:@"");
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface Map : NSObject {
|
||||
NSString *path;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation Map
|
||||
- (id)initWithPath:(NSString*)aPath
|
||||
{
|
||||
if((self = [super init]))
|
||||
path = [[aPath stringByDeletingPathExtension] retain];
|
||||
return self;
|
||||
}
|
||||
- (void)dealloc
|
||||
{
|
||||
[path release];
|
||||
[super dealloc];
|
||||
}
|
||||
- (NSString*)path { return path; }
|
||||
- (NSString*)name { return [path lastPathComponent]; }
|
||||
- (NSImage*)image { return [[NSImage alloc] initWithContentsOfFile:[path stringByAppendingString:@".jpg"]]; }
|
||||
- (NSString*)text
|
||||
{
|
||||
NSString *text = [NSString alloc];
|
||||
if(![text respondsToSelector:@selector(initWithContentsOfFile:encoding:error:)])
|
||||
return [text initWithContentsOfFile:[path stringByAppendingString:@".txt"]]; //deprecated in 10.4
|
||||
NSError *error;
|
||||
return [text initWithContentsOfFile:[path stringByAppendingString:@".txt"] encoding:NSASCIIStringEncoding error:&error];
|
||||
}
|
||||
- (NSString*)tickIfExists:(NSString*)ext
|
||||
{
|
||||
unichar tickCh = 0x2713;
|
||||
return [[NSFileManager defaultManager] fileExistsAtPath:[path stringByAppendingString:ext]] ? [NSString stringWithCharacters:&tickCh length:1] : @"";
|
||||
}
|
||||
- (NSString*)hasImage { return [self tickIfExists:@".jpg"]; }
|
||||
- (NSString*)hasText { return [self tickIfExists:@".txt"]; }
|
||||
- (NSString*)hasCfg { return [self tickIfExists:@".cfg"]; }
|
||||
@end
|
||||
|
||||
|
||||
|
||||
static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
{
|
||||
CFNumberRef value;
|
||||
int num = 0;
|
||||
|
||||
if ( (value = CFDictionaryGetValue(desc, key)) == NULL )
|
||||
if ((value = CFDictionaryGetValue(desc, key)) == NULL)
|
||||
return 0;
|
||||
CFNumberGetValue(value, kCFNumberIntType, &num);
|
||||
return num;
|
||||
}
|
||||
|
||||
@implementation Launcher
|
||||
|
||||
static void listModes(CGDirectDisplayID dspy)
|
||||
- (void)switchViews:(NSToolbarItem *)item
|
||||
{
|
||||
NSView *prefsView;
|
||||
switch([item tag])
|
||||
{
|
||||
case 1: prefsView = view1; break;
|
||||
case 2: prefsView = view2; break;
|
||||
case 3: prefsView = view3; break;
|
||||
//extend as see fit...
|
||||
default: return;
|
||||
}
|
||||
|
||||
//to stop flicker, we make a temp blank view.
|
||||
NSView *tempView = [[NSView alloc] initWithFrame:[[window contentView] frame]];
|
||||
[window setContentView:tempView];
|
||||
[tempView release];
|
||||
|
||||
//mojo to get the right frame for the new window.
|
||||
NSRect newFrame = [window frame];
|
||||
newFrame.size.height = [prefsView frame].size.height + ([window frame].size.height - [[window contentView] frame].size.height);
|
||||
newFrame.size.width = [prefsView frame].size.width;
|
||||
newFrame.origin.y += ([[window contentView] frame].size.height - [prefsView frame].size.height);
|
||||
|
||||
//set the frame to newFrame and animate it.
|
||||
[window setFrame:newFrame display:YES animate:YES];
|
||||
//set the main content view to the new view we have picked through the if structure above.
|
||||
[window setContentView:prefsView];
|
||||
[window setContentMinSize:[prefsView bounds].size];
|
||||
}
|
||||
|
||||
- (NSToolbarItem*)addToolBarItem:(NSString*)name
|
||||
{
|
||||
int n = [toolBarItems count] + 1;
|
||||
NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:[NSString stringWithFormat:@"%0d", n]];
|
||||
[item setTag:n];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(switchViews:)];
|
||||
[toolBarItems setObject:item forKey:[item itemIdentifier]];
|
||||
[item setLabel:NSLocalizedString(name, @"")];
|
||||
[item setImage:[NSImage imageNamed:name]];
|
||||
[item release];
|
||||
return item;
|
||||
}
|
||||
|
||||
- (void)initViews
|
||||
{
|
||||
toolBarItems = [[NSMutableDictionary alloc] init];
|
||||
NSToolbarItem *first = [self addToolBarItem:@"Main"];
|
||||
[self addToolBarItem:@"Keys"];
|
||||
[self addToolBarItem:@"Server"];
|
||||
|
||||
NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:NSToolbarFlexibleSpaceItemIdentifier];
|
||||
[toolBarItems setObject:item forKey:[item itemIdentifier]];
|
||||
[item release];
|
||||
|
||||
[[self addToolBarItem:@"Help"] setAction:@selector(helpAction:)];
|
||||
|
||||
NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"PreferencePanes"];
|
||||
[toolbar setDelegate:self];
|
||||
[toolbar setAllowsUserCustomization:NO];
|
||||
[toolbar setAutosavesConfiguration:NO];
|
||||
[window setToolbar:toolbar];
|
||||
[toolbar release];
|
||||
if([window respondsToSelector:@selector(setShowsToolbarButton:)]) [window setShowsToolbarButton:NO]; //10.4+
|
||||
|
||||
//Make it select the first by default
|
||||
[toolbar setSelectedItemIdentifier:[first itemIdentifier]];
|
||||
[self switchViews:first];
|
||||
}
|
||||
|
||||
/*
|
||||
* toolbar delegate methods
|
||||
*/
|
||||
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
|
||||
{
|
||||
return [toolBarItems objectForKey:itemIdentifier];
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)theToolbar
|
||||
{
|
||||
return [self toolbarDefaultItemIdentifiers:theToolbar];
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)theToolbar
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"1", @"2", @"3", NSToolbarFlexibleSpaceItemIdentifier, @"5", nil];
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar {
|
||||
return [NSArray arrayWithObjects:@"1", @"2", @"3", nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)addResolutionsForDisplay:(CGDirectDisplayID)dspy
|
||||
{
|
||||
CFArrayRef modeList;
|
||||
CFDictionaryRef mode;
|
||||
CFIndex i, cnt;
|
||||
|
||||
modeList = CGDisplayAvailableModes(dspy);
|
||||
if ( modeList == NULL )
|
||||
{
|
||||
printf( "Display is invalid\n" );
|
||||
return;
|
||||
}
|
||||
CFArrayRef modeList = CGDisplayAvailableModes(dspy);
|
||||
if(modeList == NULL) return;
|
||||
cnt = CFArrayGetCount(modeList);
|
||||
//printf( "Display 0x%x: %d modes:\n", (unsigned int)dspy, (int)cnt );
|
||||
for ( i = 0; i < cnt; ++i )
|
||||
{
|
||||
mode = CFArrayGetValueAtIndex(modeList, i);
|
||||
[array addObject:[NSString stringWithFormat:@"%i x %i", numberForKey(mode, kCGDisplayWidth), numberForKey(mode, kCGDisplayHeight)]];
|
||||
|
||||
}
|
||||
for(i = 0; i < cnt; i++) {
|
||||
CFDictionaryRef mode = CFArrayGetValueAtIndex(modeList, i);
|
||||
NSString *title = [NSString stringWithFormat:@"%i x %i", numberForKey(mode, kCGDisplayWidth), numberForKey(mode, kCGDisplayHeight)];
|
||||
if(![resolutions itemWithTitle:title]) [resolutions addItemWithTitle:title];
|
||||
}
|
||||
}
|
||||
|
||||
@implementation MyObject
|
||||
|
||||
- (IBAction)playAction:(id)sender
|
||||
{
|
||||
NSArray *res = [[resolutions titleOfSelectedItem] componentsSeparatedByString:@" x "];
|
||||
NSMutableArray *args = [[NSMutableArray alloc] init];
|
||||
NSString *cwd = [[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"actioncube"];
|
||||
|
||||
[args addObject:[NSString stringWithFormat:@"-w%@", [res objectAtIndex:0]]];
|
||||
[args addObject:[NSString stringWithFormat:@"-h%@", [res objectAtIndex:1]]];
|
||||
|
||||
if([fullscreen state] == NSOffState) [args addObject:@"-t"];
|
||||
|
||||
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath:cwd];
|
||||
[task setLaunchPath:[cwd stringByAppendingPathComponent:@"actioncube.app/Contents/MacOS/actioncube"]];
|
||||
[task setArguments:args];
|
||||
[args release];
|
||||
|
||||
BOOL okay = YES;
|
||||
|
||||
NS_DURING
|
||||
[task launch];
|
||||
[NSApp terminate:self];
|
||||
NS_HANDLER
|
||||
NSRunAlertPanel(@"Error", @"Can't start Sauerbraten! Please move the directory containing Sauerbraten to a path that doesn't contain weird characters or start Sauerbraten manually.", @"OK", NULL, NULL);
|
||||
okay = NO;
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
- (void)initResolutions
|
||||
{
|
||||
CGDirectDisplayID display[kMaxDisplays];
|
||||
CGDisplayCount numDisplays;
|
||||
CGDisplayCount i;
|
||||
CGDisplayErr err;
|
||||
|
||||
array = [[NSMutableArray alloc] init];
|
||||
|
||||
err = CGGetActiveDisplayList(kMaxDisplays,
|
||||
display,
|
||||
&numDisplays);
|
||||
if ( err != CGDisplayNoErr )
|
||||
[resolutions removeAllItems];
|
||||
if(CGGetActiveDisplayList(kMaxDisplays, display, &numDisplays) == CGDisplayNoErr)
|
||||
{
|
||||
printf("Cannot get displays (%d)\n", err);
|
||||
exit( 1 );
|
||||
CGDisplayCount i;
|
||||
for (i = 0; i < numDisplays; i++)
|
||||
[self addResolutionsForDisplay:display[i]];
|
||||
}
|
||||
[resolutions selectItemAtIndex: [[NSUserDefaults standardUserDefaults] integerForKey:@"resolution"]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* directory where the executable lives */
|
||||
-(NSString *)cwd
|
||||
{
|
||||
return [[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"assaultcube"];
|
||||
}
|
||||
|
||||
/* build key array from config data */
|
||||
-(NSArray *)getKeys:(NSDictionary *)dict
|
||||
{
|
||||
NSMutableArray *arr = [[NSMutableArray alloc] init];
|
||||
NSEnumerator *e = [dict keyEnumerator];
|
||||
NSString *key;
|
||||
while ((key = [e nextObject]))
|
||||
{
|
||||
NSString *trig;
|
||||
if([key hasPrefix:@"editbind"])
|
||||
trig = [key substringFromIndex:9];
|
||||
else if([key hasPrefix:@"bind"])
|
||||
trig = [key substringFromIndex:5];
|
||||
else
|
||||
continue;
|
||||
[arr addObject:[NSDictionary dictionaryWithObjectsAndKeys: //keys used in nib
|
||||
trig, @"key",
|
||||
[key hasPrefix:@"editbind"]?@"edit":@"", @"mode",
|
||||
[dict objectForKey:key], @"action",
|
||||
nil]];
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* extract a dictionary from the config files containing:
|
||||
* - name, team, gamma strings
|
||||
* - bind/editbind '.' key strings
|
||||
*/
|
||||
-(NSDictionary *)readConfigFiles
|
||||
{
|
||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
||||
[dict setObject:@"" forKey:@"name"]; //ensure these entries are never nil
|
||||
[dict setObject:@"" forKey:@"team"];
|
||||
|
||||
//printf( "%d displays found\n", (int)numDisplays );
|
||||
for ( i = 0; i < numDisplays; ++i )
|
||||
listModes(display[i]);
|
||||
NSString *files[] = {@"config.cfg", @"autoexec.cfg"};
|
||||
int i;
|
||||
for(i = 0; i < sizeof(files)/sizeof(NSString*); i++)
|
||||
{
|
||||
NSString *file = [[self cwd] stringByAppendingPathComponent:files[i]];
|
||||
NSArray *lines = [[NSString stringWithContentsOfFile:file] componentsSeparatedByString:@"\n"];
|
||||
|
||||
if(i==0 && !lines) // ugh - special case when first run...
|
||||
{
|
||||
file = [[self cwd] stringByAppendingPathComponent:@"config/defaults.cfg"];
|
||||
lines = [[NSString stringWithContentsOfFile:file] componentsSeparatedByString:@"\n"];
|
||||
}
|
||||
|
||||
NSString *line;
|
||||
NSEnumerator *e = [lines objectEnumerator];
|
||||
while(line = [e nextObject])
|
||||
{
|
||||
NSRange r; // more flexible to do this manually rather than via NSScanner...
|
||||
int j = 0;
|
||||
while(j < [line length] && [line characterAtIndex:j] <= ' ') j++; //skip white
|
||||
r.location = j;
|
||||
while(j < [line length] && [line characterAtIndex:j] > ' ') j++; //until white
|
||||
r.length = j - r.location;
|
||||
NSString *type = [line substringWithRange:r];
|
||||
|
||||
while(j < [line length] && [line characterAtIndex:j] <= ' ') j++; //skip white
|
||||
if(j < [line length] && [line characterAtIndex:j] == '"')
|
||||
{
|
||||
r.location = ++j;
|
||||
while(j < [line length] && [line characterAtIndex:j] != '"') j++; //until close quote
|
||||
r.length = (j++) - r.location;
|
||||
} else {
|
||||
r.location = j;
|
||||
while(j < [line length] && [line characterAtIndex:j] > ' ') j++; //until white
|
||||
r.length = j - r.location;
|
||||
}
|
||||
NSString *value = [line substringWithRange:r];
|
||||
|
||||
while(j < [line length] && [line characterAtIndex:j] <= ' ') j++; //skip white
|
||||
NSString *remainder = [line substringFromIndex:j];
|
||||
|
||||
if([type isEqual:@"name"] || [type isEqual:@"team"] || [type isEqual:@"gamma"])
|
||||
[dict setObject:value forKey:type];
|
||||
else if([type isEqual:@"bind"] || [type isEqual:@"editbind"])
|
||||
[dict setObject:remainder forKey:[NSString stringWithFormat:@"%@.%@", type,value]];
|
||||
}
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
-(void)updateAutoexecFile:(NSDictionary *)updates
|
||||
{
|
||||
NSString *file = [[self cwd] stringByAppendingPathComponent:@"config/autoexec.cfg"];
|
||||
//build the data
|
||||
NSString *result = nil;
|
||||
NSArray *lines = [[NSString stringWithContentsOfFile:file] componentsSeparatedByString:@"\n"];
|
||||
if(lines)
|
||||
{
|
||||
NSString *line;
|
||||
NSEnumerator *e = [lines objectEnumerator];
|
||||
while(line = [e nextObject])
|
||||
{
|
||||
NSScanner *scanner = [NSScanner scannerWithString:line];
|
||||
NSString *type;
|
||||
if([scanner scanCharactersFromSet:[NSCharacterSet letterCharacterSet] intoString:&type])
|
||||
if([updates objectForKey:type]) continue; //skip things declared in updates
|
||||
result = (result) ? [NSString stringWithFormat:@"%@\n%@", result, line] : line;
|
||||
}
|
||||
}
|
||||
NSEnumerator *e = [updates keyEnumerator];
|
||||
NSString *type;
|
||||
while(type = [e nextObject])
|
||||
{
|
||||
id value = [updates objectForKey:type];
|
||||
if([type isEqual:@"name"] || [type isEqual:@"team"]) value = [NSString stringWithFormat:@"\"%@\"", value];
|
||||
NSString *line = [NSString stringWithFormat:@"%@ %@", type, value];
|
||||
result = (result) ? [NSString stringWithFormat:@"%@\n%@", result, line] : line;
|
||||
}
|
||||
//backup
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSString *backupfile = nil;
|
||||
if([fm fileExistsAtPath:file])
|
||||
{
|
||||
backupfile = [file stringByAppendingString:@".bak"];
|
||||
if(![fm movePath:file toPath:backupfile handler:nil]) return; //can't create backup
|
||||
}
|
||||
//write the new file
|
||||
if(![fm createFileAtPath:file contents:[result dataUsingEncoding:NSASCIIStringEncoding] attributes:nil]) return; //can't create new file
|
||||
//remove the backup
|
||||
if(backupfile) [fm removeFileAtPath:backupfile handler:nil];
|
||||
}
|
||||
|
||||
- (void)serverTerminated
|
||||
{
|
||||
if(server==-1) return;
|
||||
server = -1;
|
||||
[multiplayer setTitle:@"Start"];
|
||||
[console appendText:@"\n \n"];
|
||||
}
|
||||
|
||||
- (void)setServerActive:(BOOL)start
|
||||
{
|
||||
if((server==-1) != start) return;
|
||||
|
||||
[resolutions removeAllItems];
|
||||
if(!start)
|
||||
{ //STOP
|
||||
|
||||
//damn server, terminate isn't good enough for you - die, die, die...
|
||||
if((server!=-1) && (server!=0)) kill(server, SIGKILL); //@WARNING - you do not want a 0 or -1 to be accidentally sent a kill!
|
||||
[self serverTerminated];
|
||||
}
|
||||
else
|
||||
{ //START
|
||||
NSString *cwd = [self cwd];
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSArray *opts = [[defs nonNullStringForKey:@"server_options"] componentsSeparatedByString:@" "];
|
||||
|
||||
const char *childCwd = [cwd fileSystemRepresentation];
|
||||
const char *childPath = [[cwd stringByAppendingPathComponent:@"actioncube.app/Contents/MacOS/actioncube"] fileSystemRepresentation];
|
||||
const char **args = (const char**)malloc(sizeof(char*)*([opts count] + 3 + 3)); //3 = {path, -d, NULL}, and +3 again for optional settings...
|
||||
int i, fdm, argc = 0;
|
||||
|
||||
args[argc++] = childPath;
|
||||
args[argc++] = "-d";
|
||||
|
||||
for(i = 0; i < [opts count]; i++)
|
||||
{
|
||||
NSString *opt = [opts objectAtIndex:i];
|
||||
if([opt length] == 0) continue; //skip empty
|
||||
args[argc++] = [opt UTF8String];
|
||||
}
|
||||
|
||||
NSString *desc = [[NSUserDefaults standardUserDefaults] nonNullStringForKey:@"server_description"];
|
||||
if (![desc isEqualToString:@""]) args[argc++] = [[NSString stringWithFormat:@"-n%@", desc] UTF8String];
|
||||
|
||||
NSString *pass = [[NSUserDefaults standardUserDefaults] nonNullStringForKey:@"server_password"];
|
||||
if (![pass isEqualToString:@""]) args[argc++] = [[NSString stringWithFormat:@"-p%@", pass] UTF8String];
|
||||
|
||||
int clients = [[NSUserDefaults standardUserDefaults] integerForKey:@"server_maxclients"];
|
||||
if (clients > 0) args[argc++] = [[NSString stringWithFormat:@"-c%d", clients] UTF8String];
|
||||
|
||||
args[argc++] = NULL;
|
||||
|
||||
switch ( (server = forkpty(&fdm, NULL, NULL, NULL)) ) // forkpty so we can reliably grab SDL console
|
||||
{
|
||||
case -1:
|
||||
[console appendLine:@"Error - can't launch server"];
|
||||
[self serverTerminated];
|
||||
break;
|
||||
case 0: // child
|
||||
chdir(childCwd);
|
||||
execv(childPath, (char*const*)args);
|
||||
fprintf(stderr, "Error - can't launch server\n");
|
||||
_exit(0);
|
||||
default: // parent
|
||||
free(args);
|
||||
//fprintf(stderr, "fdm=%d\n", slave_name, fdm);
|
||||
[multiplayer setTitle:@"Stop"];
|
||||
|
||||
NSFileHandle *taskOutput = [[NSFileHandle alloc] initWithFileDescriptor:fdm];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self selector:@selector(serverDataAvailable:) name:NSFileHandleReadCompletionNotification object:taskOutput];
|
||||
[taskOutput readInBackgroundAndNotify];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)serverDataAvailable:(NSNotification *)note
|
||||
{
|
||||
NSFileHandle *taskOutput = [note object];
|
||||
NSData *data = [[note userInfo] objectForKey:NSFileHandleNotificationDataItem];
|
||||
|
||||
int h;
|
||||
for (h = 0; h < [array count]; h++)
|
||||
{
|
||||
id haha = [resolutions itemWithTitle:[array objectAtIndex:h]];
|
||||
if (haha == nil)
|
||||
[resolutions addItemWithTitle:[array objectAtIndex:h]];
|
||||
}
|
||||
if (data && [data length])
|
||||
{
|
||||
NSString *text = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||
[console appendText:text];
|
||||
[text release];
|
||||
[taskOutput readInBackgroundAndNotify]; //wait for more data
|
||||
}
|
||||
else
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc removeObserver:self name:NSFileHandleReadCompletionNotification object:taskOutput];
|
||||
close([taskOutput fileDescriptor]);
|
||||
[self setServerActive:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)playFile
|
||||
{
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSArray *res = [[resolutions titleOfSelectedItem] componentsSeparatedByString:@" x "];
|
||||
NSMutableArray *args = [[NSMutableArray alloc] init];
|
||||
NSString *cwd = [self cwd];
|
||||
|
||||
[resolutions selectItemAtIndex: [[NSUserDefaults standardUserDefaults] integerForKey:@"resolution"]];
|
||||
//suppose could use this to update gamma and keys too, but can't be bothered...
|
||||
[self updateAutoexecFile:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[defs nonNullStringForKey:@"name"], @"name",
|
||||
[defs nonNullStringForKey:@"team"], @"team",
|
||||
nil]];
|
||||
|
||||
[args addObject:[NSString stringWithFormat:@"-w%@", [res objectAtIndex:0]]];
|
||||
[args addObject:[NSString stringWithFormat:@"-h%@", [res objectAtIndex:1]]];
|
||||
[args addObject:@"-z32"];
|
||||
|
||||
if([defs integerForKey:@"fullscreen"] == 0) [args addObject:@"-t"];
|
||||
[args addObject:[NSString stringWithFormat:@"-a%d", [defs integerForKey:@"fsaa"]]];
|
||||
[args addObject:[NSString stringWithFormat:@"-f%d", [defs integerForKey:@"shader"]]];
|
||||
|
||||
NSString *adv = [defs nonNullStringForKey:@"advancedOptions"];
|
||||
if(![adv isEqual:@""]) [args addObjectsFromArray:[adv componentsSeparatedByString:@" "]];
|
||||
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath:cwd];
|
||||
[task setLaunchPath:[cwd stringByAppendingPathComponent:@"actioncube.app/Contents/MacOS/actioncube"]];
|
||||
[task setArguments:args];
|
||||
[task setEnvironment:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"1", @"SDL_SINGLEDISPLAY",
|
||||
@"1", @"SDL_ENABLEAPPEVENTS", nil
|
||||
]]; // makes Command-H, Command-M and Command-Q work at least when not in fullscreen
|
||||
[args release];
|
||||
|
||||
BOOL okay = YES;
|
||||
|
||||
NS_DURING
|
||||
[task launch];
|
||||
if(server==-1) [NSApp terminate:self]; //if there is a server then don't exit!
|
||||
NS_HANDLER
|
||||
//NSLog(@"%@", localException);
|
||||
NSBeginCriticalAlertSheet(
|
||||
@"Can't start AssaultCube", nil, nil, nil,
|
||||
window, nil, nil, nil, nil,
|
||||
@"Please move the directory containing AssaultCube to a path that doesn't contain weird characters or start AssaultCube manually.");
|
||||
okay = NO;
|
||||
NS_ENDHANDLER
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[self initViews];
|
||||
|
||||
NSDictionary *dict = [self readConfigFiles];
|
||||
[keys addObjects:[self getKeys:dict]];
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
if([[defs nonNullStringForKey:@"name"] isEqual:@""])
|
||||
{
|
||||
NSString *name = [dict objectForKey:@"name"];
|
||||
if([name isEqual:@""] || [name isEqual:@"unnamed"]) name = NSUserName();
|
||||
[defs setValue:name forKey:@"name"];
|
||||
}
|
||||
if([[defs nonNullStringForKey:@"team"] isEqual:@""]) [defs setValue:[dict objectForKey:@"team"] forKey:@"team"];
|
||||
|
||||
[self initResolutions];
|
||||
server = -1;
|
||||
[window setDelegate:self]; // so can catch the window close
|
||||
[NSApp setDelegate:self]; //so can catch the double-click & dropped files
|
||||
}
|
||||
|
||||
-(void)windowWillClose:(NSNotification *)notification
|
||||
{
|
||||
[self setServerActive:NO];
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
/*
|
||||
* Interface actions
|
||||
*/
|
||||
- (IBAction)multiplayerAction:(id)sender
|
||||
{
|
||||
[window makeFirstResponder:window]; //ensure fields are exited and committed
|
||||
[self setServerActive:(server==-1)];
|
||||
}
|
||||
|
||||
- (IBAction)playAction:(id)sender
|
||||
{
|
||||
[window makeFirstResponder:window]; //ensure fields are exited and committed
|
||||
[self playFile];
|
||||
}
|
||||
|
||||
- (IBAction)helpAction:(id)sender
|
||||
{
|
||||
NSString *file = [[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"ReadMe.html"];
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:file]];
|
||||
}
|
||||
@end
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>AssaultCube Documentation</TITLE>
|
||||
<META
|
||||
HTTP-EQUIV="Refresh"
|
||||
CONTENT="1; URL=docs/README.xml">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1>AssaultCube Documentation</H1>
|
||||
Click <A HREF="docs/README.xml">here</A>.
|
||||
</BODY></HTML>
|
||||
+174
-59
@@ -10,24 +10,58 @@
|
||||
#import <sys/param.h> /* for MAXPATHLEN */
|
||||
#import <unistd.h>
|
||||
|
||||
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
|
||||
but the method still is there and works. To avoid warnings, we declare
|
||||
it ourselves here. */
|
||||
@interface NSApplication(SDL_Missing_Methods)
|
||||
- (void)setAppleMenu:(NSMenu *)menu;
|
||||
@end
|
||||
|
||||
/* Use this flag to determine whether we use SDLMain.nib or not */
|
||||
#define SDL_USE_NIB_FILE 0
|
||||
|
||||
/* Use this flag to determine whether we use CPS (docking) or not */
|
||||
#define SDL_USE_CPS 1
|
||||
#ifdef SDL_USE_CPS
|
||||
/* Portions of CPS.h */
|
||||
typedef struct CPSProcessSerNum
|
||||
{
|
||||
UInt32 lo;
|
||||
UInt32 hi;
|
||||
} CPSProcessSerNum;
|
||||
|
||||
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
|
||||
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
|
||||
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
|
||||
|
||||
#endif /* SDL_USE_CPS */
|
||||
|
||||
static int gArgc;
|
||||
static char **gArgv;
|
||||
static BOOL gFinderLaunch;
|
||||
static BOOL gCalledAppMainline = FALSE;
|
||||
|
||||
static NSString *getApplicationName(void)
|
||||
{
|
||||
NSDictionary *dict;
|
||||
NSString *appName = 0;
|
||||
|
||||
/* Determine the application name */
|
||||
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
|
||||
if (dict)
|
||||
appName = [dict objectForKey: @"CFBundleName"];
|
||||
|
||||
if (![appName length])
|
||||
appName = [[NSProcessInfo processInfo] processName];
|
||||
|
||||
return appName;
|
||||
}
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
/* A helper category for NSString */
|
||||
@interface NSString (ReplaceSubString)
|
||||
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
|
||||
@end
|
||||
#else
|
||||
/* An internal Apple class used to setup Apple menus */
|
||||
@interface NSAppleMenuController:NSObject {}
|
||||
- (void)controlMenu:(NSMenu *)aMenu;
|
||||
@end
|
||||
#endif
|
||||
|
||||
@interface SDLApplication : NSApplication
|
||||
@@ -42,8 +76,17 @@ static BOOL gFinderLaunch;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
@end
|
||||
|
||||
// ADDED SO IT DOESN'T BEEP BECAUSE WE ENABLE SDL_ENABLEAPPEVENTS
|
||||
- (void)sendEvent:(NSEvent *)anEvent
|
||||
{
|
||||
if( NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type] ) {
|
||||
if( [anEvent modifierFlags] & NSCommandKeyMask )
|
||||
[super sendEvent: anEvent];
|
||||
} else
|
||||
[super sendEvent: anEvent];
|
||||
}
|
||||
@end
|
||||
|
||||
/* The main class of the application, the application's delegate */
|
||||
@implementation SDLMain
|
||||
@@ -51,25 +94,18 @@ static BOOL gFinderLaunch;
|
||||
/* Set the working directory to the .app's parent directory */
|
||||
- (void) setupWorkingDirectory:(BOOL)shouldChdir
|
||||
{
|
||||
char parentdir[MAXPATHLEN];
|
||||
char *c;
|
||||
|
||||
strncpy ( parentdir, gArgv[0], sizeof(parentdir) );
|
||||
c = (char*) parentdir;
|
||||
|
||||
while (*c != '\0') /* go to end */
|
||||
c++;
|
||||
|
||||
while (*c != '/') /* back up to parent */
|
||||
c--;
|
||||
|
||||
*c++ = '\0'; /* cut off last part (binary name) */
|
||||
|
||||
if (shouldChdir)
|
||||
{
|
||||
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
|
||||
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */
|
||||
}
|
||||
char parentdir[MAXPATHLEN];
|
||||
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
|
||||
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
|
||||
if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
|
||||
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
|
||||
}
|
||||
CFRelease(url);
|
||||
CFRelease(url2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
@@ -99,38 +135,56 @@ static BOOL gFinderLaunch;
|
||||
|
||||
#else
|
||||
|
||||
void setupAppleMenu(void)
|
||||
static void setApplicationMenu(void)
|
||||
{
|
||||
/* warning: this code is very odd */
|
||||
NSAppleMenuController *appleMenuController;
|
||||
NSMenu *appleMenu;
|
||||
NSMenuItem *appleMenuItem;
|
||||
|
||||
appleMenuController = [[NSAppleMenuController alloc] init];
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
appleMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||
NSMenuItem *menuItem;
|
||||
NSString *title;
|
||||
NSString *appName;
|
||||
|
||||
[appleMenuItem setSubmenu:appleMenu];
|
||||
appName = getApplicationName();
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
|
||||
/* Add menu items */
|
||||
title = [@"About " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||
|
||||
/* yes, we do need to add it and then remove it --
|
||||
if you don't add it, it doesn't get displayed
|
||||
if you don't remove it, you have an extra, titleless item in the menubar
|
||||
when you remove it, it appears to stick around
|
||||
very, very odd */
|
||||
[[NSApp mainMenu] addItem:appleMenuItem];
|
||||
[appleMenuController controlMenu:appleMenu];
|
||||
[[NSApp mainMenu] removeItem:appleMenuItem];
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
title = [@"Hide " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
|
||||
|
||||
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
|
||||
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
|
||||
|
||||
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
|
||||
|
||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
title = [@"Quit " stringByAppendingString:appName];
|
||||
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
|
||||
|
||||
|
||||
/* Put menu into the menubar */
|
||||
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
|
||||
[menuItem setSubmenu:appleMenu];
|
||||
[[NSApp mainMenu] addItem:menuItem];
|
||||
|
||||
/* Tell the application object that this is now the application menu */
|
||||
[NSApp setAppleMenu:appleMenu];
|
||||
|
||||
/* Finally give up our references to the objects */
|
||||
[appleMenu release];
|
||||
[appleMenuItem release];
|
||||
[menuItem release];
|
||||
}
|
||||
|
||||
/* Create a window menu */
|
||||
void setupWindowMenu(void)
|
||||
static void setupWindowMenu(void)
|
||||
{
|
||||
NSMenu *windowMenu;
|
||||
NSMenuItem *windowMenuItem;
|
||||
NSMenuItem *menuItem;
|
||||
|
||||
NSMenu *windowMenu;
|
||||
NSMenuItem *windowMenuItem;
|
||||
NSMenuItem *menuItem;
|
||||
|
||||
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||
|
||||
@@ -153,7 +207,7 @@ void setupWindowMenu(void)
|
||||
}
|
||||
|
||||
/* Replacement for NSApplicationMain */
|
||||
void CustomApplicationMain (argc, argv)
|
||||
static void CustomApplicationMain (int argc, char **argv)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
SDLMain *sdlMain;
|
||||
@@ -161,11 +215,22 @@ void CustomApplicationMain (argc, argv)
|
||||
/* Ensure the application object is initialised */
|
||||
[SDLApplication sharedApplication];
|
||||
|
||||
#ifdef SDL_USE_CPS
|
||||
{
|
||||
CPSProcessSerNum PSN;
|
||||
/* Tell the dock about us */
|
||||
if (!CPSGetCurrentProcess(&PSN))
|
||||
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
|
||||
if (!CPSSetFrontProcess(&PSN))
|
||||
[SDLApplication sharedApplication];
|
||||
}
|
||||
#endif /* SDL_USE_CPS */
|
||||
|
||||
/* Set up the menubar */
|
||||
[NSApp setMainMenu:[[NSMenu alloc] init]];
|
||||
setupAppleMenu();
|
||||
setApplicationMenu();
|
||||
setupWindowMenu();
|
||||
|
||||
|
||||
/* Create SDLMain and make it the app delegate */
|
||||
sdlMain = [[SDLMain alloc] init];
|
||||
[NSApp setDelegate:sdlMain];
|
||||
@@ -179,6 +244,56 @@ void CustomApplicationMain (argc, argv)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Catch document open requests...this lets us notice files when the app
|
||||
* was launched by double-clicking a document, or when a document was
|
||||
* dragged/dropped on the app's icon. You need to have a
|
||||
* CFBundleDocumentsType section in your Info.plist to get this message,
|
||||
* apparently.
|
||||
*
|
||||
* Files are added to gArgv, so to the app, they'll look like command line
|
||||
* arguments. Previously, apps launched from the finder had nothing but
|
||||
* an argv[0].
|
||||
*
|
||||
* This message may be received multiple times to open several docs on launch.
|
||||
*
|
||||
* This message is ignored once the app's mainline has been called.
|
||||
*/
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
{
|
||||
const char *temparg;
|
||||
size_t arglen;
|
||||
char *arg;
|
||||
char **newargv;
|
||||
|
||||
if (!gFinderLaunch) /* MacOS is passing command line args. */
|
||||
return FALSE;
|
||||
|
||||
if (gCalledAppMainline) /* app has started, ignore this document. */
|
||||
return FALSE;
|
||||
|
||||
temparg = [filename UTF8String];
|
||||
arglen = SDL_strlen(temparg) + 1;
|
||||
arg = (char *) SDL_malloc(arglen);
|
||||
if (arg == NULL)
|
||||
return FALSE;
|
||||
|
||||
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
|
||||
if (newargv == NULL)
|
||||
{
|
||||
SDL_free(arg);
|
||||
return FALSE;
|
||||
}
|
||||
gArgv = newargv;
|
||||
|
||||
SDL_strlcpy(arg, temparg, arglen);
|
||||
gArgv[gArgc++] = arg;
|
||||
gArgv[gArgc] = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Called when the internal event loop has just started running */
|
||||
- (void) applicationDidFinishLaunching: (NSNotification *) note
|
||||
{
|
||||
@@ -189,10 +304,11 @@ void CustomApplicationMain (argc, argv)
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
/* Set the main menu to contain the real app name instead of "SDL App" */
|
||||
[self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]];
|
||||
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
|
||||
#endif
|
||||
|
||||
/* Hand off to main application code */
|
||||
gCalledAppMainline = TRUE;
|
||||
status = SDL_main (gArgc, gArgv);
|
||||
|
||||
/* We're done, thank you for playing */
|
||||
@@ -250,23 +366,22 @@ void CustomApplicationMain (argc, argv)
|
||||
/* Main entry point to executable - should *not* be SDL_main! */
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
|
||||
/* Copy the arguments into a global variable */
|
||||
int i;
|
||||
|
||||
/* This is passed if we are launched by double-clicking */
|
||||
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
|
||||
gArgv[0] = argv[0];
|
||||
gArgv[1] = NULL;
|
||||
gArgc = 1;
|
||||
gFinderLaunch = YES;
|
||||
gFinderLaunch = YES;
|
||||
} else {
|
||||
int i;
|
||||
gArgc = argc;
|
||||
gFinderLaunch = NO;
|
||||
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
|
||||
for (i = 0; i <= argc; i++)
|
||||
gArgv[i] = argv[i];
|
||||
gFinderLaunch = NO;
|
||||
}
|
||||
gArgv = (char**) malloc (sizeof(*gArgv) * (gArgc+1));
|
||||
assert (gArgv != NULL);
|
||||
for (i = 0; i < gArgc; i++)
|
||||
gArgv[i] = argv[i];
|
||||
gArgv[i] = NULL;
|
||||
|
||||
#if SDL_USE_NIB_FILE
|
||||
[SDLApplication poseAsClass:[NSApplication class]];
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,6 @@
|
||||
665CDD170AFE7ED80030D605 /* bot_waypoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 665CDCE50AFE7ED80030D605 /* bot_waypoint.h */; };
|
||||
665CDD180AFE7ED80030D605 /* botmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCE60AFE7ED80030D605 /* botmanager.cpp */; };
|
||||
665CDD190AFE7ED80030D605 /* client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCE70AFE7ED80030D605 /* client.cpp */; };
|
||||
665CDD1A0AFE7ED80030D605 /* clientextras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCE80AFE7ED80030D605 /* clientextras.cpp */; };
|
||||
665CDD1B0AFE7ED80030D605 /* clientgame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCE90AFE7ED80030D605 /* clientgame.cpp */; };
|
||||
665CDD1C0AFE7ED80030D605 /* clients2c.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCEA0AFE7ED80030D605 /* clients2c.cpp */; };
|
||||
665CDD1D0AFE7ED80030D605 /* command.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCEB0AFE7ED80030D605 /* command.cpp */; };
|
||||
@@ -47,7 +46,6 @@
|
||||
665CDD270AFE7ED80030D605 /* physics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCF50AFE7ED80030D605 /* physics.cpp */; };
|
||||
665CDD280AFE7ED80030D605 /* protos.h in Headers */ = {isa = PBXBuildFile; fileRef = 665CDCF60AFE7ED80030D605 /* protos.h */; };
|
||||
665CDD290AFE7ED80030D605 /* rendercubes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCF70AFE7ED80030D605 /* rendercubes.cpp */; };
|
||||
665CDD2A0AFE7ED80030D605 /* renderextras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCF80AFE7ED80030D605 /* renderextras.cpp */; };
|
||||
665CDD2B0AFE7ED80030D605 /* rendergl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCF90AFE7ED80030D605 /* rendergl.cpp */; };
|
||||
665CDD2E0AFE7ED80030D605 /* renderparticles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCFC0AFE7ED80030D605 /* renderparticles.cpp */; };
|
||||
665CDD2F0AFE7ED80030D605 /* rendertext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDCFD0AFE7ED80030D605 /* rendertext.cpp */; };
|
||||
@@ -56,7 +54,6 @@
|
||||
665CDD320AFE7ED80030D605 /* server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD000AFE7ED80030D605 /* server.cpp */; };
|
||||
665CDD330AFE7ED80030D605 /* serverbrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD010AFE7ED80030D605 /* serverbrowser.cpp */; };
|
||||
665CDD340AFE7ED80030D605 /* serverms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD020AFE7ED80030D605 /* serverms.cpp */; };
|
||||
665CDD350AFE7ED80030D605 /* serverutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD030AFE7ED80030D605 /* serverutil.cpp */; };
|
||||
665CDD360AFE7ED80030D605 /* sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD040AFE7ED80030D605 /* sound.cpp */; };
|
||||
665CDD370AFE7ED80030D605 /* tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 665CDD050AFE7ED80030D605 /* tools.cpp */; };
|
||||
665CDD380AFE7ED80030D605 /* tools.h in Headers */ = {isa = PBXBuildFile; fileRef = 665CDD060AFE7ED80030D605 /* tools.h */; };
|
||||
@@ -69,6 +66,23 @@
|
||||
665CDD490AFE7FB70030D605 /* actioncube-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 665CDD480AFE7FB70030D605 /* actioncube-Info.plist */; };
|
||||
665CDD4B0AFE7FBD0030D605 /* actioncube.icns in Resources */ = {isa = PBXBuildFile; fileRef = 665CDD4A0AFE7FBD0030D605 /* actioncube.icns */; };
|
||||
665CDFD20AFE90F30030D605 /* actioncube.icns in Resources */ = {isa = PBXBuildFile; fileRef = 665CDD4A0AFE7FBD0030D605 /* actioncube.icns */; };
|
||||
66899C970C14739400927C34 /* command.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899C960C14739400927C34 /* command.h */; };
|
||||
66899C990C14739F00927C34 /* docs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66899C980C14739F00927C34 /* docs.cpp */; };
|
||||
66899C9B0C1473AC00927C34 /* entity.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899C9A0C1473AC00927C34 /* entity.h */; };
|
||||
66899C9D0C1473B500927C34 /* geom.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899C9C0C1473B500927C34 /* geom.h */; };
|
||||
66899C9F0C1473BE00927C34 /* model.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899C9E0C1473BE00927C34 /* model.h */; };
|
||||
66899CA10C1473CA00927C34 /* protocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66899CA00C1473CA00927C34 /* protocol.cpp */; };
|
||||
66899CA30C1473CF00927C34 /* protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899CA20C1473CF00927C34 /* protocol.h */; };
|
||||
66899CA50C1473EA00927C34 /* sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 66899CA40C1473EA00927C34 /* sound.h */; };
|
||||
66899CA70C1473F300927C34 /* texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66899CA60C1473F300927C34 /* texture.cpp */; };
|
||||
66899DC60C14813F00927C34 /* scoreboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66899DC50C14813F00927C34 /* scoreboard.cpp */; };
|
||||
66899DCD0C14815500927C34 /* renderhud.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 66899DCC0C14815500927C34 /* renderhud.cpp */; };
|
||||
66899E700C1485E200927C34 /* ConsoleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 66899E6E0C1485E200927C34 /* ConsoleView.m */; };
|
||||
66899E770C14862300927C34 /* macutils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 66899E760C14862300927C34 /* macutils.mm */; };
|
||||
66899EB60C14898500927C34 /* Help.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 66899EA80C14887F00927C34 /* Help.tiff */; };
|
||||
66899EB70C14898500927C34 /* Keys.gif in Resources */ = {isa = PBXBuildFile; fileRef = 66899EA90C14887F00927C34 /* Keys.gif */; };
|
||||
66899EB80C14898500927C34 /* Main.gif in Resources */ = {isa = PBXBuildFile; fileRef = 66899EAA0C14887F00927C34 /* Main.gif */; };
|
||||
66899EB90C14898500927C34 /* Server.gif in Resources */ = {isa = PBXBuildFile; fileRef = 66899EAB0C14887F00927C34 /* Server.gif */; };
|
||||
B90357B509D09B9D002C9DC7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
B92DC0FC09D08CF9008219BD /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B92DC0F909D08CF9008219BD /* SDL_image.framework */; };
|
||||
B92DC0FD09D08CF9008219BD /* SDL_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B92DC0FA09D08CF9008219BD /* SDL_mixer.framework */; };
|
||||
@@ -125,7 +139,6 @@
|
||||
665CDCE50AFE7ED80030D605 /* bot_waypoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = bot_waypoint.h; sourceTree = "<group>"; };
|
||||
665CDCE60AFE7ED80030D605 /* botmanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = botmanager.cpp; sourceTree = "<group>"; };
|
||||
665CDCE70AFE7ED80030D605 /* client.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = client.cpp; sourceTree = "<group>"; };
|
||||
665CDCE80AFE7ED80030D605 /* clientextras.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = clientextras.cpp; sourceTree = "<group>"; };
|
||||
665CDCE90AFE7ED80030D605 /* clientgame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = clientgame.cpp; sourceTree = "<group>"; };
|
||||
665CDCEA0AFE7ED80030D605 /* clients2c.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = clients2c.cpp; sourceTree = "<group>"; };
|
||||
665CDCEB0AFE7ED80030D605 /* command.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = command.cpp; sourceTree = "<group>"; };
|
||||
@@ -139,7 +152,6 @@
|
||||
665CDCF50AFE7ED80030D605 /* physics.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = physics.cpp; sourceTree = "<group>"; };
|
||||
665CDCF60AFE7ED80030D605 /* protos.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protos.h; sourceTree = "<group>"; };
|
||||
665CDCF70AFE7ED80030D605 /* rendercubes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = rendercubes.cpp; sourceTree = "<group>"; };
|
||||
665CDCF80AFE7ED80030D605 /* renderextras.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = renderextras.cpp; sourceTree = "<group>"; };
|
||||
665CDCF90AFE7ED80030D605 /* rendergl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = rendergl.cpp; sourceTree = "<group>"; };
|
||||
665CDCFC0AFE7ED80030D605 /* renderparticles.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = renderparticles.cpp; sourceTree = "<group>"; };
|
||||
665CDCFD0AFE7ED80030D605 /* rendertext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = rendertext.cpp; sourceTree = "<group>"; };
|
||||
@@ -148,7 +160,6 @@
|
||||
665CDD000AFE7ED80030D605 /* server.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = server.cpp; sourceTree = "<group>"; };
|
||||
665CDD010AFE7ED80030D605 /* serverbrowser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = serverbrowser.cpp; sourceTree = "<group>"; };
|
||||
665CDD020AFE7ED80030D605 /* serverms.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = serverms.cpp; sourceTree = "<group>"; };
|
||||
665CDD030AFE7ED80030D605 /* serverutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = serverutil.cpp; sourceTree = "<group>"; };
|
||||
665CDD040AFE7ED80030D605 /* sound.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = sound.cpp; sourceTree = "<group>"; };
|
||||
665CDD050AFE7ED80030D605 /* tools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tools.cpp; sourceTree = "<group>"; };
|
||||
665CDD060AFE7ED80030D605 /* tools.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tools.h; sourceTree = "<group>"; };
|
||||
@@ -160,6 +171,24 @@
|
||||
665CDD0C0AFE7ED80030D605 /* worldrender.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = worldrender.cpp; sourceTree = "<group>"; };
|
||||
665CDD480AFE7FB70030D605 /* actioncube-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "actioncube-Info.plist"; sourceTree = "<group>"; };
|
||||
665CDD4A0AFE7FBD0030D605 /* actioncube.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = actioncube.icns; sourceTree = "<group>"; };
|
||||
66899C960C14739400927C34 /* command.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = command.h; sourceTree = "<group>"; };
|
||||
66899C980C14739F00927C34 /* docs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = docs.cpp; sourceTree = "<group>"; };
|
||||
66899C9A0C1473AC00927C34 /* entity.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = entity.h; sourceTree = "<group>"; };
|
||||
66899C9C0C1473B500927C34 /* geom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = geom.h; sourceTree = "<group>"; };
|
||||
66899C9E0C1473BE00927C34 /* model.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = model.h; sourceTree = "<group>"; };
|
||||
66899CA00C1473CA00927C34 /* protocol.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = protocol.cpp; sourceTree = "<group>"; };
|
||||
66899CA20C1473CF00927C34 /* protocol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protocol.h; sourceTree = "<group>"; };
|
||||
66899CA40C1473EA00927C34 /* sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = sound.h; sourceTree = "<group>"; };
|
||||
66899CA60C1473F300927C34 /* texture.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = texture.cpp; sourceTree = "<group>"; };
|
||||
66899DC50C14813F00927C34 /* scoreboard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = scoreboard.cpp; sourceTree = "<group>"; };
|
||||
66899DCC0C14815500927C34 /* renderhud.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = renderhud.cpp; sourceTree = "<group>"; };
|
||||
66899E6D0C1485E200927C34 /* ConsoleView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ConsoleView.h; sourceTree = "<group>"; };
|
||||
66899E6E0C1485E200927C34 /* ConsoleView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ConsoleView.m; sourceTree = "<group>"; };
|
||||
66899E760C14862300927C34 /* macutils.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = macutils.mm; sourceTree = "<group>"; };
|
||||
66899EA80C14887F00927C34 /* Help.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Help.tiff; sourceTree = "<group>"; };
|
||||
66899EA90C14887F00927C34 /* Keys.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Keys.gif; sourceTree = "<group>"; };
|
||||
66899EAA0C14887F00927C34 /* Main.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Main.gif; sourceTree = "<group>"; };
|
||||
66899EAB0C14887F00927C34 /* Server.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Server.gif; sourceTree = "<group>"; };
|
||||
B2F67ED704C74A3F00A80002 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
|
||||
B92DC0F909D08CF9008219BD /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = "<absolute>"; };
|
||||
B92DC0FA09D08CF9008219BD /* SDL_mixer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_mixer.framework; path = /Library/Frameworks/SDL_mixer.framework; sourceTree = "<absolute>"; };
|
||||
@@ -202,6 +231,9 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B96D0D6C0920976E00B6C936 /* main.m */,
|
||||
66899E760C14862300927C34 /* macutils.mm */,
|
||||
66899E6D0C1485E200927C34 /* ConsoleView.h */,
|
||||
66899E6E0C1485E200927C34 /* ConsoleView.m */,
|
||||
B96D0D570920970C00B6C936 /* Launcher.h */,
|
||||
B96D0D580920970C00B6C936 /* Launcher.m */,
|
||||
F5A47A9D01A0482F01D3D55B /* SDLMain.h */,
|
||||
@@ -269,6 +301,10 @@
|
||||
B96D0D5A0920971300B6C936 /* MainMenu.nib */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
665CDD4A0AFE7FBD0030D605 /* actioncube.icns */,
|
||||
66899EA80C14887F00927C34 /* Help.tiff */,
|
||||
66899EA90C14887F00927C34 /* Keys.gif */,
|
||||
66899EAA0C14887F00927C34 /* Main.gif */,
|
||||
66899EAB0C14887F00927C34 /* Server.gif */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
@@ -303,35 +339,43 @@
|
||||
children = (
|
||||
665CDCDB0AFE7ED80030D605 /* bot */,
|
||||
665CDCE70AFE7ED80030D605 /* client.cpp */,
|
||||
665CDCE80AFE7ED80030D605 /* clientextras.cpp */,
|
||||
665CDCE90AFE7ED80030D605 /* clientgame.cpp */,
|
||||
665CDCEA0AFE7ED80030D605 /* clients2c.cpp */,
|
||||
665CDCEB0AFE7ED80030D605 /* command.cpp */,
|
||||
66899C960C14739400927C34 /* command.h */,
|
||||
665CDCEC0AFE7ED80030D605 /* console.cpp */,
|
||||
665CDCED0AFE7ED80030D605 /* cube.h */,
|
||||
66899C980C14739F00927C34 /* docs.cpp */,
|
||||
665CDCEF0AFE7ED80030D605 /* editing.cpp */,
|
||||
665CDCF00AFE7ED80030D605 /* entities.cpp */,
|
||||
66899C9A0C1473AC00927C34 /* entity.h */,
|
||||
66899C9C0C1473B500927C34 /* geom.h */,
|
||||
6638511C0B092A3800C6A735 /* hudgun.cpp */,
|
||||
665CDCF10AFE7ED80030D605 /* main.cpp */,
|
||||
6638511E0B092A4800C6A735 /* md2.h */,
|
||||
6638511F0B092A4800C6A735 /* md3.h */,
|
||||
665CDCF30AFE7ED80030D605 /* menus.cpp */,
|
||||
66899C9E0C1473BE00927C34 /* model.h */,
|
||||
665CDCF40AFE7ED80030D605 /* pch.cpp */,
|
||||
665CDCF50AFE7ED80030D605 /* physics.cpp */,
|
||||
66899CA00C1473CA00927C34 /* protocol.cpp */,
|
||||
66899CA20C1473CF00927C34 /* protocol.h */,
|
||||
665CDCF60AFE7ED80030D605 /* protos.h */,
|
||||
665CDCF70AFE7ED80030D605 /* rendercubes.cpp */,
|
||||
665CDCF80AFE7ED80030D605 /* renderextras.cpp */,
|
||||
665CDCF90AFE7ED80030D605 /* rendergl.cpp */,
|
||||
66899DCC0C14815500927C34 /* renderhud.cpp */,
|
||||
663851220B092A5700C6A735 /* rendermodel.cpp */,
|
||||
665CDCFC0AFE7ED80030D605 /* renderparticles.cpp */,
|
||||
665CDCFD0AFE7ED80030D605 /* rendertext.cpp */,
|
||||
665CDCFE0AFE7ED80030D605 /* rndmap.cpp */,
|
||||
665CDCFF0AFE7ED80030D605 /* savegamedemo.cpp */,
|
||||
66899DC50C14813F00927C34 /* scoreboard.cpp */,
|
||||
665CDD000AFE7ED80030D605 /* server.cpp */,
|
||||
665CDD010AFE7ED80030D605 /* serverbrowser.cpp */,
|
||||
665CDD020AFE7ED80030D605 /* serverms.cpp */,
|
||||
665CDD030AFE7ED80030D605 /* serverutil.cpp */,
|
||||
665CDD040AFE7ED80030D605 /* sound.cpp */,
|
||||
66899CA40C1473EA00927C34 /* sound.h */,
|
||||
66899CA60C1473F300927C34 /* texture.cpp */,
|
||||
665CDD050AFE7ED80030D605 /* tools.cpp */,
|
||||
665CDD060AFE7ED80030D605 /* tools.h */,
|
||||
663851240B092A7500C6A735 /* tristrip.h */,
|
||||
@@ -350,16 +394,16 @@
|
||||
665CDCDB0AFE7ED80030D605 /* bot */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
665CDCDE0AFE7ED80030D605 /* ac_bot_ai.cpp */,
|
||||
665CDCDC0AFE7ED80030D605 /* ac_bot.cpp */,
|
||||
665CDCDD0AFE7ED80030D605 /* ac_bot.h */,
|
||||
665CDCDE0AFE7ED80030D605 /* ac_bot_ai.cpp */,
|
||||
665CDCDF0AFE7ED80030D605 /* bot.cpp */,
|
||||
665CDCE00AFE7ED80030D605 /* bot.h */,
|
||||
665CDCE10AFE7ED80030D605 /* bot_ai.cpp */,
|
||||
665CDCE20AFE7ED80030D605 /* bot_util.cpp */,
|
||||
665CDCE30AFE7ED80030D605 /* bot_util.h */,
|
||||
665CDCE40AFE7ED80030D605 /* bot_waypoint.cpp */,
|
||||
665CDCE50AFE7ED80030D605 /* bot_waypoint.h */,
|
||||
665CDCDF0AFE7ED80030D605 /* bot.cpp */,
|
||||
665CDCE00AFE7ED80030D605 /* bot.h */,
|
||||
665CDCE60AFE7ED80030D605 /* botmanager.cpp */,
|
||||
);
|
||||
path = bot;
|
||||
@@ -384,6 +428,12 @@
|
||||
663851210B092A4800C6A735 /* md3.h in Headers */,
|
||||
663851260B092A7500C6A735 /* tristrip.h in Headers */,
|
||||
663851270B092A7500C6A735 /* vertmodel.h in Headers */,
|
||||
66899C970C14739400927C34 /* command.h in Headers */,
|
||||
66899C9B0C1473AC00927C34 /* entity.h in Headers */,
|
||||
66899C9D0C1473B500927C34 /* geom.h in Headers */,
|
||||
66899C9F0C1473BE00927C34 /* model.h in Headers */,
|
||||
66899CA30C1473CF00927C34 /* protocol.h in Headers */,
|
||||
66899CA50C1473EA00927C34 /* sound.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -461,6 +511,10 @@
|
||||
files = (
|
||||
B96D0D630920971300B6C936 /* MainMenu.nib in Resources */,
|
||||
B9CACA13092099DF00A13F04 /* launcher-Info.plist in Resources */,
|
||||
66899EB60C14898500927C34 /* Help.tiff in Resources */,
|
||||
66899EB70C14898500927C34 /* Keys.gif in Resources */,
|
||||
66899EB80C14898500927C34 /* Main.gif in Resources */,
|
||||
66899EB90C14898500927C34 /* Server.gif in Resources */,
|
||||
B90357B509D09B9D002C9DC7 /* InfoPlist.strings in Resources */,
|
||||
665CDFD20AFE90F30030D605 /* actioncube.icns in Resources */,
|
||||
);
|
||||
@@ -480,7 +534,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "echo $TARGET_BUILD_DIR\ncd $TARGET_BUILD_DIR\n\n#make the directory which our disk image will be made of\nmkdir ActionCube\nmkdir ActionCube/actioncube\n\n#copy sauerbraten there\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/actioncube.app ActionCube/actioncube\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/launcher.app ActionCube/\nmv ActionCube/launcher.app ActionCube/ActionCube.app\n\n#install all frameworks into app bundle\nmkdir ActionCube/actioncube/actioncube.app/Contents/Frameworks\nfor framework in SDL.framework SDL_mixer.framework SDL_image.framework\ndo\n\tif [ -d $LOCAL_LIBRARY_DIR/Frameworks/$framework/ ] \n\tthen\t\n\t\t/Developer/Tools/CpMac -r $LOCAL_LIBRARY_DIR/Frameworks/$framework/ ActionCube/actioncube/actioncube.app/Contents/Frameworks\n\t\trm -rf ActionCube/actioncube/actioncube.app/Contents/Frameworks/$framework/Versions/A/Headers\n\telse\n\t\texit 1\n\tfi\ndone\n\n#copy readme and data and remove unneccesary stuff\n/Developer/Tools/CpMac -r $SRCROOT/../../docs ActionCube/\n/Developer/Tools/CpMac -r $SRCROOT/../../bot ActionCube/actioncube/\n/Developer/Tools/CpMac -r $SRCROOT/../../config ActionCube/actioncube/\n/Developer/Tools/CpMac -r $SRCROOT/../../packages ActionCube/actioncube/\n/Developer/Tools/CpMac -r $SRCROOT/../../README.html ActionCube/\n\n#finally make a disk image out of the stuff\nhdiutil create -srcfolder ActionCube ActionCube.dmg\nhdiutil internet-enable -yes ActionCube.dmg\n\n#cleanup\nrm -r ActionCube";
|
||||
shellScript = "echo $TARGET_BUILD_DIR\ncd $TARGET_BUILD_DIR\n\n#make the directory which our disk image will be made of\nmkdir AssaultCube\nmkdir AssaultCube/assaultcube\n\n#copy sauerbraten there\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/actioncube.app AssaultCube/assaultcube\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/launcher.app AssaultCube/\nmv AssaultCube/launcher.app AssaultCube/AssaultCube.app\nstrip -u -r $TARGET_BUILD_DIR/AssaultCube/assaultcube/actioncube.app/Contents/MacOS/actioncube -o $TARGET_BUILD_DIR/AssaultCube/assaultcube/actioncube.app/Contents/MacOS/actioncube_stripped\nmv $TARGET_BUILD_DIR/AssaultCube/assaultcube/actioncube.app/Contents/MacOS/actioncube $TARGET_BUILD_DIR/actioncube_nonstripped\nmv $TARGET_BUILD_DIR/AssaultCube/assaultcube/actioncube.app/Contents/MacOS/actioncube_stripped $TARGET_BUILD_DIR/AssaultCube/assaultcube/actioncube.app/Contents/MacOS/actioncube\ncp $SRCROOT/ReadMe.html $TARGET_BUILD_DIR/AssaultCube/\n\n#install all frameworks into app bundle\nmkdir AssaultCube/assaultcube/actioncube.app/Contents/Frameworks\nfor framework in SDL.framework SDL_mixer.framework SDL_image.framework\ndo\n\tif [ -d $LOCAL_LIBRARY_DIR/Frameworks/$framework/ ] \n\tthen\t\n\t\t/Developer/Tools/CpMac -r $LOCAL_LIBRARY_DIR/Frameworks/$framework/ AssaultCube/assaultcube/actioncube.app/Contents/Frameworks\n\t\trm -rf AssaultCube/assaultcube/actioncube.app/Contents/Frameworks/$framework/Versions/A/Headers\n\telse\n\t\texit 1\n\tfi\ndone\n\n#copy readme and data and remove unneccesary stuff\n/Developer/Tools/CpMac -r $SRCROOT/../../docs AssaultCube/\n/Developer/Tools/CpMac -r $SRCROOT/../../bot AssaultCube/assaultcube/\n/Developer/Tools/CpMac -r $SRCROOT/../../config AssaultCube/assaultcube/\n/Developer/Tools/CpMac -r $SRCROOT/../../packages AssaultCube/assaultcube/\nrm -rf AssaultCube/docs/CVS/\nrm -rf AssaultCube/docs/*/CVS/\nrm -rf AssaultCube/docs/*/*/CVS/\nrm -f AssaultCube/docs/.DS_Store\nrm -f AssaultCube/docs/*/.DS_Store\nrm -f AssaultCube/docs/*/*/.DS_Store\nrm -rf AssaultCube/assaultcube/packages/CVS/\nrm -rf AssaultCube/assaultcube/packages/*/CVS/\nrm -rf AssaultCube/assaultcube/packages/*/*/CVS/\nrm -f AssaultCube/assaultcube/packages/.DS_Store\nrm -f AssaultCube/assaultcube/packages/*/.DS_Store\nrm -f AssaultCube/assaultcube/packages/*/*/.DS_Store\nrm -rf AssaultCube/assaultcube/config/CVS/\nrm -f AssaultCube/assaultcube/config/.DS_Store\nrm -rf AssaultCube/assaultcube/bot/CVS/\nrm -rf AssaultCube/assaultcube/bot/*/CVS/\nrm -f AssaultCube/assaultcube/bot/.DS_Store\nrm -f AssaultCube/assaultcube/bot/*/.DS_Store\nrm -rf AssaultCube/assaultcube/data/CVS/\nrm -rf AssaultCube/assaultcube/data/*/CVS/\nrm -f AssaultCube/assaultcube/data/.DS_Store\nrm -f AssaultCube/assaultcube/data/*/.DS_Store\n\n#finally make a disk image out of the stuff\nhdiutil create -srcfolder AssaultCube AssaultCube.dmg\nhdiutil internet-enable -yes AssaultCube.dmg\n\n#cleanup\nrm -r AssaultCube";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -506,7 +560,6 @@
|
||||
665CDD160AFE7ED80030D605 /* bot_waypoint.cpp in Sources */,
|
||||
665CDD180AFE7ED80030D605 /* botmanager.cpp in Sources */,
|
||||
665CDD190AFE7ED80030D605 /* client.cpp in Sources */,
|
||||
665CDD1A0AFE7ED80030D605 /* clientextras.cpp in Sources */,
|
||||
665CDD1B0AFE7ED80030D605 /* clientgame.cpp in Sources */,
|
||||
665CDD1C0AFE7ED80030D605 /* clients2c.cpp in Sources */,
|
||||
665CDD1D0AFE7ED80030D605 /* command.cpp in Sources */,
|
||||
@@ -518,7 +571,6 @@
|
||||
665CDD260AFE7ED80030D605 /* pch.cpp in Sources */,
|
||||
665CDD270AFE7ED80030D605 /* physics.cpp in Sources */,
|
||||
665CDD290AFE7ED80030D605 /* rendercubes.cpp in Sources */,
|
||||
665CDD2A0AFE7ED80030D605 /* renderextras.cpp in Sources */,
|
||||
665CDD2B0AFE7ED80030D605 /* rendergl.cpp in Sources */,
|
||||
665CDD2E0AFE7ED80030D605 /* renderparticles.cpp in Sources */,
|
||||
665CDD2F0AFE7ED80030D605 /* rendertext.cpp in Sources */,
|
||||
@@ -527,7 +579,6 @@
|
||||
665CDD320AFE7ED80030D605 /* server.cpp in Sources */,
|
||||
665CDD330AFE7ED80030D605 /* serverbrowser.cpp in Sources */,
|
||||
665CDD340AFE7ED80030D605 /* serverms.cpp in Sources */,
|
||||
665CDD350AFE7ED80030D605 /* serverutil.cpp in Sources */,
|
||||
665CDD360AFE7ED80030D605 /* sound.cpp in Sources */,
|
||||
665CDD370AFE7ED80030D605 /* tools.cpp in Sources */,
|
||||
665CDD390AFE7ED80030D605 /* weapon.cpp in Sources */,
|
||||
@@ -538,6 +589,12 @@
|
||||
665CDD3E0AFE7ED80030D605 /* worldrender.cpp in Sources */,
|
||||
6638511D0B092A3800C6A735 /* hudgun.cpp in Sources */,
|
||||
663851230B092A5700C6A735 /* rendermodel.cpp in Sources */,
|
||||
66899C990C14739F00927C34 /* docs.cpp in Sources */,
|
||||
66899CA10C1473CA00927C34 /* protocol.cpp in Sources */,
|
||||
66899CA70C1473F300927C34 /* texture.cpp in Sources */,
|
||||
66899DC60C14813F00927C34 /* scoreboard.cpp in Sources */,
|
||||
66899DCD0C14815500927C34 /* renderhud.cpp in Sources */,
|
||||
66899E770C14862300927C34 /* macutils.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -547,6 +604,7 @@
|
||||
files = (
|
||||
B96D0D590920970C00B6C936 /* Launcher.m in Sources */,
|
||||
B96D0D6D0920976E00B6C936 /* main.m in Sources */,
|
||||
66899E700C1485E200927C34 /* ConsoleView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -580,149 +638,119 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
B94198C709207E810029DAD1 /* Development */ = {
|
||||
B94198C709207E810029DAD1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||
"$(LOCAL_LIBRARY_DIR)/Frameworks",
|
||||
);
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = HAS_SOCKLEN_T;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../enet/include,
|
||||
../include/,
|
||||
);
|
||||
INFOPLIST_FILE = "actioncube-Info.plist";
|
||||
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-fpermissive",
|
||||
);
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = actioncube;
|
||||
SECTORDER_FLAGS = "";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
WARNING_CFLAGS = "";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Development;
|
||||
name = Debug;
|
||||
};
|
||||
B94198C809207E810029DAD1 /* Deployment */ = {
|
||||
B94198C809207E810029DAD1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||
"$(LOCAL_LIBRARY_DIR)/Frameworks",
|
||||
);
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = HAS_SOCKLEN_T;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../enet/include,
|
||||
../include/,
|
||||
);
|
||||
INFOPLIST_FILE = "actioncube-Info.plist";
|
||||
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-fpermissive",
|
||||
);
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = actioncube;
|
||||
SECTORDER_FLAGS = "";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
WARNING_CFLAGS = "";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Deployment;
|
||||
name = Release;
|
||||
};
|
||||
B94198EB09207F510029DAD1 /* Deployment-Release */ = {
|
||||
B94198EB09207F510029DAD1 /* Release-Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = HAS_SOCKLEN_T;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../enet/include,
|
||||
../include/,
|
||||
);
|
||||
INFOPLIST_FILE = "actioncube-Info.plist";
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
PRODUCT_NAME = actioncube;
|
||||
};
|
||||
name = "Release-Deployment";
|
||||
};
|
||||
B94198EC09207F510029DAD1 /* Release-Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEPLOYMENT_LOCATION = YES;
|
||||
DEPLOYMENT_POSTPROCESSING = YES;
|
||||
DSTROOT = /;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||
"$(LOCAL_LIBRARY_DIR)/Frameworks",
|
||||
);
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = HAS_SOCKLEN_T;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../enet/include,
|
||||
../include/,
|
||||
);
|
||||
INFOPLIST_FILE = "actioncube-Info.plist";
|
||||
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-fpermissive",
|
||||
);
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = actioncube;
|
||||
SECTORDER_FLAGS = "";
|
||||
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
WARNING_CFLAGS = "";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = "Deployment-Release";
|
||||
name = "Release-Deployment";
|
||||
};
|
||||
B94198EC09207F510029DAD1 /* Deployment-Release */ = {
|
||||
B960CF36085F3CC7004FB142 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||
"$(LOCAL_LIBRARY_DIR)/Frameworks",
|
||||
);
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
|
||||
PREBINDING = NO;
|
||||
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
B960CF37085F3CC7004FB142 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.3;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = "Deployment-Release";
|
||||
};
|
||||
B960CF36085F3CC7004FB142 /* Development */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(USER_LIBRARY_DIR)/Frameworks",
|
||||
"$(LOCAL_LIBRARY_DIR)/Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.3;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
ZERO_LINK = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
|
||||
PREBINDING = NO;
|
||||
SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
};
|
||||
name = Development;
|
||||
name = Release;
|
||||
};
|
||||
B960CF37085F3CC7004FB142 /* Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.3;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Deployment;
|
||||
};
|
||||
B96D0D50092096F300B6C936 /* Development */ = {
|
||||
B96D0D50092096F300B6C936 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -751,9 +779,9 @@
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
};
|
||||
name = Development;
|
||||
name = Debug;
|
||||
};
|
||||
B96D0D51092096F300B6C936 /* Deployment */ = {
|
||||
B96D0D51092096F300B6C936 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -782,9 +810,9 @@
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
};
|
||||
name = Deployment;
|
||||
name = Release;
|
||||
};
|
||||
B96D0D52092096F300B6C936 /* Deployment-Release */ = {
|
||||
B96D0D52092096F300B6C936 /* Release-Deployment */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@@ -813,7 +841,7 @@
|
||||
"-Wno-unknown-pragmas",
|
||||
);
|
||||
};
|
||||
name = "Deployment-Release";
|
||||
name = "Release-Deployment";
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
@@ -821,32 +849,32 @@
|
||||
B94198C609207E810029DAD1 /* Build configuration list for PBXNativeTarget "actioncube" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B94198C709207E810029DAD1 /* Development */,
|
||||
B94198C809207E810029DAD1 /* Deployment */,
|
||||
B94198EB09207F510029DAD1 /* Deployment-Release */,
|
||||
B94198C709207E810029DAD1 /* Debug */,
|
||||
B94198C809207E810029DAD1 /* Release */,
|
||||
B94198EB09207F510029DAD1 /* Release-Deployment */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Development;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
B960CF35085F3CC7004FB142 /* Build configuration list for PBXProject "actioncube" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B960CF36085F3CC7004FB142 /* Development */,
|
||||
B960CF37085F3CC7004FB142 /* Deployment */,
|
||||
B94198EC09207F510029DAD1 /* Deployment-Release */,
|
||||
B960CF36085F3CC7004FB142 /* Debug */,
|
||||
B960CF37085F3CC7004FB142 /* Release */,
|
||||
B94198EC09207F510029DAD1 /* Release-Deployment */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Development;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
B96D0D4F092096F300B6C936 /* Build configuration list for PBXNativeTarget "launcher" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B96D0D50092096F300B6C936 /* Development */,
|
||||
B96D0D51092096F300B6C936 /* Deployment */,
|
||||
B96D0D52092096F300B6C936 /* Deployment-Release */,
|
||||
B96D0D50092096F300B6C936 /* Debug */,
|
||||
B96D0D51092096F300B6C936 /* Release */,
|
||||
B96D0D52092096F300B6C936 /* Release-Deployment */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Development;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string>launcher</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>actioncube</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>assaultcube</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#define _MAXDEFSTR 260
|
||||
inline char *s_strncpy(char *d, const char *s, size_t m) { strncpy(d,s,m); d[m-1] = 0; return d; };
|
||||
inline char *s_strcat(char *d, const char *s) { size_t n = strlen(d); return s_strncpy(d+n,s,_MAXDEFSTR-n); };
|
||||
|
||||
void mac_pasteconsole(char *commandbuf)
|
||||
{
|
||||
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||
NSString *type = [pasteboard availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]];
|
||||
if (type != nil) {
|
||||
NSString *contents = [pasteboard stringForType:type];
|
||||
if (contents != nil)
|
||||
s_strcat(commandbuf, [contents lossyCString]);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,3 @@
|
||||
//
|
||||
// main.m
|
||||
// Play Cube
|
||||
//
|
||||
// Created by Julian Mayer on 31.08.05.
|
||||
// Copyright __MyCompanyName__ 2005. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
Reference in New Issue
Block a user