From f87e058818fd54193423ca291326f9d806a9f008 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Sun, 28 Apr 2002 09:45:12 +0000 Subject: [PATCH] Project Builder files added. --- PB/.DS_Store | Bin 0 -> 6148 bytes PB/English.lproj/InfoPlist.strings | Bin 0 -> 480 bytes PB/JumpNBump.pbproj/.DS_Store | Bin 0 -> 6148 bytes PB/JumpNBump.pbproj/ben.pbxuser | 1146 +++++++++++++++++++++++++++ PB/JumpNBump.pbproj/project.pbxproj | 671 ++++++++++++++++ PB/SDLMain.h | 41 + PB/SDLMain.m | 227 ++++++ 7 files changed, 2085 insertions(+) create mode 100644 PB/.DS_Store create mode 100644 PB/English.lproj/InfoPlist.strings create mode 100644 PB/JumpNBump.pbproj/.DS_Store create mode 100644 PB/JumpNBump.pbproj/ben.pbxuser create mode 100644 PB/JumpNBump.pbproj/project.pbxproj create mode 100644 PB/SDLMain.h create mode 100644 PB/SDLMain.m diff --git a/PB/.DS_Store b/PB/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a9c40925c6dbf6a5fe5892f77d7a0658cd460628 GIT binary patch literal 6148 zcmeHK&ubGw6#gcrHPu!cLC}M+Coh6O&KB8*^dP7dE8FmtQV3$pJb3%fzWv_J?wdFJW&o(%M(H9j4Io1m zOil38L*%(=m!zC!oTyA6r7Pu1u~4oQXvsW}fY;FRM@Q=e>0GGe9dbYSA-P9~-)`G} zKMcV=Yq>fa%pIE{X%kv+4d!O1BB*(CH;3SEg;05Z+s(n;^duvBo7^GZVK3awyKNh@ zuJ@I>8$$sbSVkGi`ID5Gr=HM8*aD_7hgB?+xr~Qc!a268SVIN(6EiQKHEPmx94oj- zuT}aK|KM^Ibt*B+F)SdDs|Ya5-mCPe@(p{BBX4*s;XC1cuXRRS+C3T*6?oLwV`aC8 ziNdplhxFiOq!D;>CY8N&NxDpBAB3E{b>>Qi*)oIk%(QjpnB>kPF5`%?m3UvI{r7#< z<)pP-$Lx!juikt0G4MIiI|sPb%&(Az`shfPvhU1Cz(?R9L_q!z0aY+`7+EyG4qnU= zfS9J)2-~v#6Q96g=rFR#ClqB}iPlxQBZji>v5@yW-hflqHz*{4w|d*edq(SB>R+ig8+jpJC09z?0t zYI;;!uh(^>(a_CiQ@2_zGY|i9+_)?b*`+Zp^?&Z~=YO|=JopIs2pq%+sC0fIpW~Og z+S>JvQfmY1U8;!iB8wdtHcTldS4#0osu9`)X%It)kwsc4|9m6h>;K;N2)_Ogw@27# G_5T;3iN!Vm literal 0 HcmV?d00001 diff --git a/PB/English.lproj/InfoPlist.strings b/PB/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..ae9592ab25a50fde39ff53698903f5b7788d7967 GIT binary patch literal 480 zcmbu5NejX-6olvOuLwPgxb!MsEVv;(SnwXVDq1ad0sZmn*AxV$dXdn)w2Ud!H$@Sh40U_OKR7>q7`0IDf0@;1!s+Gk xzX>%|1t?F+CD$3_BTvd#ljWnL@Ea=9z-3|aGC_eQF{_zNt&E|_uk7W6`w0{lQAz*+ literal 0 HcmV?d00001 diff --git a/PB/JumpNBump.pbproj/.DS_Store b/PB/JumpNBump.pbproj/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..12e20a1fde4bf62c34b3212882b1755b0402f303 GIT binary patch literal 6148 zcmeHKzi-n(6n=JGpnxD)fDmG^U_lJD3`h)7F-b`XqN&@2iKQVm5D1Nxwkj0@d50kb z148^LJ3|+CCKi_d30)CO1_lPC@V)z$kanUCLdX|=e&_q{-goca#b*xcdFjkAXR(*EP@>G&>ay*Fv2w>7?<>*ow2l^~dMzlAfM_-RQNA-VoyJc3()vNb9{Pqo?C@o}kYz$G2kiBBM8i_;fnysnOds zdK{ng6({vstg$%%aAtGacREpBR=Lj&@J=^OcRImBYyr%J8F<^~Z}P)Y0yV?qvDW5}h4= zNwoL56V+==G`6_ZsxRD~*guMrp*@(5;!_c5O{iX&o8g^GF`uW5VuD;HGqyK;p#*#pIu&{gMEAfJj)svS&qV=8Y!PUZm1LVZ;sp~<3*t76aZMCYa6Xf=I zrtXZPqWix2A8T2Me1Ug=;C9&HOadcR_DW(S8gu1 zYN3a0_SU;xDAIr*{AYUnY#~e7O}+K{eLs&>uFMv$s12o7RqSV?l+;i2`F|CEnQcGv z%^Z_Tl7S=x|6>L$XR + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + JumpNBump + CFBundleGetInfoString + JumpNBump 1.2 + CFBundleIconFile + + CFBundleIdentifier + net.sf.jumpnbump + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + JumpNBump + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.2 + CFBundleSignature + jpnb + CFBundleVersion + 1.2 + NSMainNibFile + SDLMain.nib + NSPrincipalClass + NSApplication + + +"; + shouldUseHeadermap = 1; + }; + 29B97327FDCFA39411CA2CEA = { + buildActionMask = 2147483647; + files = ( + F5C435B3026C8997012A168D, + F5C435B4026C8997012A168D, + F5C435B5026C8997012A168D, + ); + isa = PBXHeadersBuildPhase; + }; + 29B97328FDCFA39411CA2CEA = { + buildActionMask = 2147483647; + files = ( + 089C165EFE840E0CC02AAC07, + F57C7C610279FFCF012A168D, + ); + isa = PBXResourcesBuildPhase; + }; + 29B9732BFDCFA39411CA2CEA = { + buildActionMask = 2147483647; + files = ( + F5A47AA301A0483001D3D55B, + F5C435B6026C8997012A168D, + F5C435B7026C8997012A168D, + F59A9B8B026DCE30012A168D, + F556CBA40271DD9A012A168D, + F556CBA50271DD9A012A168D, + F556CBA60271DD9A012A168D, + F556CBA70271DD9A012A168D, + ); + isa = PBXSourcesBuildPhase; + }; + 29B9732DFDCFA39411CA2CEA = { + buildActionMask = 2147483647; + files = ( + 1058C7A3FEA54F0111CA2CBB, + F5CA6B0F026B50C2012A168D, + ); + isa = PBXFrameworksBuildPhase; + }; +//290 +//291 +//292 +//293 +//294 +//4A0 +//4A1 +//4A2 +//4A3 +//4A4 + 4A9504CCFFE6A4B311CA0CBA = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = NO; + OPTIMIZATION_CFLAGS = "-O0"; + }; + isa = PBXBuildStyle; + name = Development; + }; + 4A9504CDFFE6A4B311CA0CBA = { + buildRules = ( + ); + buildSettings = { + COPY_PHASE_STRIP = YES; + }; + isa = PBXBuildStyle; + name = Deployment; + }; +//4A0 +//4A1 +//4A2 +//4A3 +//4A4 +//F50 +//F51 +//F52 +//F53 +//F54 + F556CBA00271DD9A012A168D = { + isa = PBXFileReference; + name = gfx.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/sdl/gfx.c; + refType = 0; + }; + F556CBA10271DD9A012A168D = { + isa = PBXFileReference; + name = input.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/sdl/input.c; + refType = 0; + }; + F556CBA20271DD9A012A168D = { + isa = PBXFileReference; + name = interrpt.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/sdl/interrpt.c; + refType = 0; + }; + F556CBA30271DD9A012A168D = { + isa = PBXFileReference; + name = sound.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/sdl/sound.c; + refType = 0; + }; + F556CBA40271DD9A012A168D = { + fileRef = F556CBA00271DD9A012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F556CBA50271DD9A012A168D = { + fileRef = F556CBA10271DD9A012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F556CBA60271DD9A012A168D = { + fileRef = F556CBA20271DD9A012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F556CBA70271DD9A012A168D = { + fileRef = F556CBA30271DD9A012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F57C7C3F0279FEDD012A168D = { + buildActionMask = 2147483647; + files = ( + ); + generatedFileNames = ( + ); + isa = PBXShellScriptBuildPhase; + neededFileNames = ( + ); + shellPath = /bin/sh; + shellScript = "chdir ../data\n${SYMROOT}/pack -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp\nmkdir ${SYMROOT}/JumpNBump.app/Contents/Resources/data/\ncp jumpbump.dat ${SYMROOT}/JumpNBump.app/Contents/Resources/data/jumpbump.dat"; + }; + F57C7C600279FFCF012A168D = { + isa = PBXFileReference; + name = SDLMain.nib; + path = /Users/ben/Library/Frameworks/SDL.framework/Versions/A/Resources/SDLMain.nib; + refType = 0; + }; + F57C7C610279FFCF012A168D = { + fileRef = F57C7C600279FFCF012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F59A9B8B026DCE30012A168D = { + fileRef = F5C435B2026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5A47A9E01A0483001D3D55B = { + isa = PBXFileReference; + path = SDLMain.m; + refType = 2; + }; + F5A47AA301A0483001D3D55B = { + fileRef = F5A47A9E01A0483001D3D55B; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435A6026C8394012A168D = { + children = ( + F5CA6B0A026B5089012A168D, + F5C435B9026C89A2012A168D, + ); + isa = PBXGroup; + name = modify; + refType = 4; + }; + F5C435A7026C8394012A168D = { + isa = PBXTargetDependency; + target = F5CA6B1B026B5376012A168D; + }; + F5C435A8026C8394012A168D = { + isa = PBXTargetDependency; + target = F5CA6B13026B535C012A168D; + }; + F5C435AD026C8997012A168D = { + isa = PBXFileReference; + name = menu.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/menu.c; + refType = 0; + }; + F5C435AE026C8997012A168D = { + isa = PBXFileReference; + name = config.h; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/config.h; + refType = 0; + }; + F5C435AF026C8997012A168D = { + isa = PBXFileReference; + name = dj.h; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/dj.h; + refType = 0; + }; + F5C435B0026C8997012A168D = { + isa = PBXFileReference; + name = fireworks.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/fireworks.c; + refType = 0; + }; + F5C435B1026C8997012A168D = { + isa = PBXFileReference; + name = globals.h; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/globals.h; + refType = 0; + }; + F5C435B2026C8997012A168D = { + isa = PBXFileReference; + name = main.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/main.c; + refType = 0; + }; + F5C435B3026C8997012A168D = { + fileRef = F5C435AE026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435B4026C8997012A168D = { + fileRef = F5C435AF026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435B5026C8997012A168D = { + fileRef = F5C435B1026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435B6026C8997012A168D = { + fileRef = F5C435AD026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435B7026C8997012A168D = { + fileRef = F5C435B0026C8997012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5C435B9026C89A2012A168D = { + isa = PBXFileReference; + name = unpack.c; + path = /Users/ben/Desktop/jumpnbumpc/jumpnbump/modify/unpack.c; + refType = 0; + }; + F5C435BA026C89A2012A168D = { + fileRef = F5C435B9026C89A2012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5CA6AF5026B505E012A168D = { + children = ( + F556CBA00271DD9A012A168D, + F556CBA10271DD9A012A168D, + F556CBA20271DD9A012A168D, + F556CBA30271DD9A012A168D, + ); + isa = PBXGroup; + name = sdl; + refType = 4; + }; + F5CA6B0A026B5089012A168D = { + isa = PBXFileReference; + name = pack.c; + path = ../modify/pack.c; + refType = 2; + }; + F5CA6B0E026B50C2012A168D = { + isa = PBXFrameworkReference; + name = SDL_mixer.framework; + path = /Users/ben/Library/Frameworks/SDL_mixer.framework; + refType = 0; + }; + F5CA6B0F026B50C2012A168D = { + fileRef = F5CA6B0E026B50C2012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5CA6B12026B535C012A168D = { + isa = PBXExecutableFileReference; + path = unpack; + refType = 3; + }; + F5CA6B13026B535C012A168D = { + buildPhases = ( + F5CA6B14026B535C012A168D, + F5CA6B15026B535C012A168D, + F5CA6B17026B535C012A168D, + F5CA6B18026B535C012A168D, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = unpack; + REZ_EXECUTABLE = YES; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + }; + dependencies = ( + ); + isa = PBXToolTarget; + name = unpack; + productInstallPath = /usr/local/bin; + productName = unpack; + productReference = F5CA6B12026B535C012A168D; + shouldUseHeadermap = 0; + }; + F5CA6B14026B535C012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXHeadersBuildPhase; + }; + F5CA6B15026B535C012A168D = { + buildActionMask = 2147483647; + files = ( + F5C435BA026C89A2012A168D, + ); + isa = PBXSourcesBuildPhase; + }; + F5CA6B17026B535C012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXFrameworksBuildPhase; + }; + F5CA6B18026B535C012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXRezBuildPhase; + }; + F5CA6B1A026B5376012A168D = { + isa = PBXExecutableFileReference; + path = pack; + refType = 3; + }; + F5CA6B1B026B5376012A168D = { + buildPhases = ( + F5CA6B1C026B5376012A168D, + F5CA6B1D026B5376012A168D, + F5CA6B1F026B5376012A168D, + F5CA6B20026B5376012A168D, + ); + buildSettings = { + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = pack; + REZ_EXECUTABLE = YES; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + }; + dependencies = ( + ); + isa = PBXToolTarget; + name = pack; + productInstallPath = /usr/local/bin; + productName = pack; + productReference = F5CA6B1A026B5376012A168D; + shouldUseHeadermap = 0; + }; + F5CA6B1C026B5376012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXHeadersBuildPhase; + }; + F5CA6B1D026B5376012A168D = { + buildActionMask = 2147483647; + files = ( + F5CA6B1E026B5376012A168D, + ); + isa = PBXSourcesBuildPhase; + }; + F5CA6B1E026B5376012A168D = { + fileRef = F5CA6B0A026B5089012A168D; + isa = PBXBuildFile; + settings = { + }; + }; + F5CA6B1F026B5376012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXFrameworksBuildPhase; + }; + F5CA6B20026B5376012A168D = { + buildActionMask = 2147483647; + files = ( + ); + isa = PBXRezBuildPhase; + }; + }; + rootObject = 29B97313FDCFA39411CA2CEA; +} diff --git a/PB/SDLMain.h b/PB/SDLMain.h new file mode 100644 index 0000000..9f36dea --- /dev/null +++ b/PB/SDLMain.h @@ -0,0 +1,41 @@ +/* + * SDLMain.m + * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ + * + * Copyright (C) 2001 Chuck Mason + * + * Copyright (C) 2002 Florian Schulze + * + * Portions of this code are from the MPEG software simulation group + * idct implementation. This code will be replaced with a new + * implementation soon. + * + * This file is part of Jump'n'Bump. + * + * Jump'n'Bump is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Jump'n'Bump is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import + +@interface SDLMain : NSObject +@end diff --git a/PB/SDLMain.m b/PB/SDLMain.m new file mode 100644 index 0000000..c4592d7 --- /dev/null +++ b/PB/SDLMain.m @@ -0,0 +1,227 @@ +/* + * SDLMain.m + * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ + * + * Copyright (C) 2001 Chuck Mason + * + * Copyright (C) 2002 Florian Schulze + * + * Portions of this code are from the MPEG software simulation group + * idct implementation. This code will be replaced with a new + * implementation soon. + * + * This file is part of Jump'n'Bump. + * + * Jump'n'Bump is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Jump'n'Bump is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + + These files turn an SDL app into a double-clickable Cocoa app on mac os X. + + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import "SDL.h" + +/* SDLMain.h */ +#import + +@interface SDLMain : NSObject +@end +/* SDLMain.h */ + +#import /* for MAXPATHLEN */ +#import + + +static int gArgc; +static char **gArgv; +static BOOL gFinderLaunch; + +/* A helper category for NSString */ +@interface NSString (ReplaceSubString) +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; +@end + +@interface SDLApplication : NSApplication +@end + +@implementation SDLApplication +/* Invoked from the Quit menu item */ +- (void)terminate:(id)sender +{ + /* Post a SDL_QUIT event */ + SDL_Event event; + event.type = SDL_QUIT; + SDL_PushEvent(&event); +} +@end + + +/* The main class of the application, the application's delegate */ +@implementation SDLMain +- (void)quit:(id)sender +{ + /* Post a SDL_QUIT event */ + SDL_Event event; + event.type = SDL_QUIT; + SDL_PushEvent(&event); + + // uMenu::quickexit=true; +} +//this changes the current working directory to the resource folder of +//the .app bundle in Mac OS X +void MacOSX_SetCWD(char **argv) { + char buffer[300]; + int count = 2, i; + strcpy(buffer, argv[0]); + + if ( !strstr( buffer, ".app") ) { + //it's not a .app bundle + return; + } + + for (i = strlen(buffer); i > 0 && count > 0; i--) { + if (buffer[i] == '/') + count--; + } + if (i == 0) + return; + i+=2; + buffer[i] = 0; + strcat( buffer, "Resources"); + printf(buffer); + chdir( buffer ); +} + + +/* Fix menu to contain the real app name instead of "SDL App" */ +- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName +{ + NSRange aRange; + NSEnumerator *enumerator; + NSMenuItem *menuItem; + + aRange = [[aMenu title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; + + enumerator = [[aMenu itemArray] objectEnumerator]; + while ((menuItem = [enumerator nextObject])) + { + aRange = [[menuItem title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; + if ([menuItem hasSubmenu]) + [self fixMenu:[menuItem submenu] withAppName:appName]; + } + [ aMenu sizeToFit ]; +} + +/* Called when the internal event loop has just started running */ +- (void) applicationDidFinishLaunching: (NSNotification *) note +{ + int status; + + /* Set the main menu to contain the real app name instead of "SDL App" */ + [self fixMenu:[NSApp mainMenu] withAppName:[[NSProcessInfo processInfo] processName]]; + + /* Hand off to main application code */ + status = SDL_main (gArgc, gArgv); + + /* We're done, thank you for playing */ + exit(status); +} +@end + + +@implementation NSString (ReplaceSubString) + +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString +{ + unsigned int bufferSize; + unsigned int selfLen = [self length]; + unsigned int aStringLen = [aString length]; + unichar *buffer; + NSRange localRange; + NSString *result; + + bufferSize = selfLen + aStringLen - aRange.length; + buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); + + /* Get first part into buffer */ + localRange.location = 0; + localRange.length = aRange.location; + [self getCharacters:buffer range:localRange]; + + /* Get middle part into buffer */ + localRange.location = 0; + localRange.length = aStringLen; + [aString getCharacters:(buffer+aRange.location) range:localRange]; + + /* Get last part into buffer */ + localRange.location = aRange.location + aRange.length; + localRange.length = selfLen - localRange.location; + [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; + + /* Build output string */ + result = [NSString stringWithCharacters:buffer length:bufferSize]; + + NSDeallocateMemoryPages(buffer, bufferSize); + + return result; +} + +@end + + + +#ifdef main +# undef main +#endif + + +/* 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 ) { + gArgc = 1; + gFinderLaunch = YES; + } else { + gArgc = argc; + 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; + + MacOSX_SetCWD(gArgv); + + [SDLApplication poseAsClass:[NSApplication class]]; + NSApplicationMain (argc, argv); + + return 0; +} -- 2.39.2