/* Begin PBXBuildFile section */
002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
- 8E0441C614FE8379000B923E /* SDL_gfx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E0441C514FE8379000B923E /* SDL_gfx.framework */; };
- 8E0441C814FE83A8000B923E /* Lua.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E0441C714FE83A8000B923E /* Lua.framework */; };
8E15FEF41071DB470046A4C4 /* dejavubold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8E15FEF31071DB470046A4C4 /* dejavubold.ttf */; };
8E15FEF61071DB5B0046A4C4 /* mappink.bin in Resources */ = {isa = PBXBuildFile; fileRef = 8E15FEF51071DB5B0046A4C4 /* mappink.bin */; };
8E2005E912FA4E3B00BA92CE /* audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E2005E812FA4E3B00BA92CE /* audio.cpp */; };
8E4BCB2C105F641B0051A838 /* mapweird.bin in Resources */ = {isa = PBXBuildFile; fileRef = 8E4BCB24105F641B0051A838 /* mapweird.bin */; };
8E5C11CD12E796DA002FED0B /* npc_jumper.lua in Copy Scripts to Folder */ = {isa = PBXBuildFile; fileRef = 8E5C11CC12E796DA002FED0B /* npc_jumper.lua */; };
8E5D1EAD12E8FF8200AFF51E /* npc_walker.lua in Copy Scripts to Folder */ = {isa = PBXBuildFile; fileRef = 8E5D1EAA12E8FF4100AFF51E /* npc_walker.lua */; };
- 8E5DE9A2140413F900CCD79E /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E5DE99D140413F900CCD79E /* SDL_image.framework */; };
- 8E5DE9A3140413F900CCD79E /* SDL_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E5DE99E140413F900CCD79E /* SDL_mixer.framework */; };
- 8E5DE9A4140413F900CCD79E /* SDL_ttf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E5DE99F140413F900CCD79E /* SDL_ttf.framework */; };
- 8E5DE9A5140413F900CCD79E /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E5DE9A0140413F900CCD79E /* SDL.framework */; };
8E660B8B109CDE9500DC2D83 /* walkersprite.png in Copy Sprites to Folder */ = {isa = PBXBuildFile; fileRef = 8E660B8A109CDE9500DC2D83 /* walkersprite.png */; };
8E662C1F14E8E09800E9CD0E /* tilesheet.png in Copy Sprites to Folder */ = {isa = PBXBuildFile; fileRef = 8E662C1D14E8DBE600E9CD0E /* tilesheet.png */; };
8E6682E6118E22A200E1FC0A /* map2.bin in Resources */ = {isa = PBXBuildFile; fileRef = 8E6682E5118E22A200E1FC0A /* map2.bin */; };
8EBF903212E8C8BC00A5D281 /* LuaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBF902C12E8C8BC00A5D281 /* LuaScript.cpp */; };
8EBF903312E8C8BC00A5D281 /* LuaVirtualMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBF902F12E8C8BC00A5D281 /* LuaVirtualMachine.cpp */; };
8EC2FAFC13061BFF00085F6D /* shot.wav in Copy SFX to Folder */ = {isa = PBXBuildFile; fileRef = 8EBF5BF6122DD6D600B7AF64 /* shot.wav */; };
+ 8ED18CC7158939D7007091AE /* tilesheet.gif in Resources */ = {isa = PBXBuildFile; fileRef = 8ED18CC6158939D7007091AE /* tilesheet.gif */; };
+ 8ED18CC815893A06007091AE /* tilesheet.gif in Copy Sprites to Folder */ = {isa = PBXBuildFile; fileRef = 8ED18CC6158939D7007091AE /* tilesheet.gif */; };
8EE7BFA912F3A51A00D5C66A /* shot.lua in Copy Scripts to Folder */ = {isa = PBXBuildFile; fileRef = 8EB151C812E964B300122F7F /* shot.lua */; };
8EEC047412CE07500043F29D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
8EEC047512CE07500043F29D /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; };
+ B556B5B520E42C12007CD29E /* libSDL_image-1.2.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5B420E42C12007CD29E /* libSDL_image-1.2.0.dylib */; };
+ B556B5B720E42C28007CD29E /* libSDL_mixer-1.2.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5B620E42C28007CD29E /* libSDL_mixer-1.2.0.dylib */; };
+ B556B5B920E42C39007CD29E /* libSDL_ttf-2.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5B820E42C39007CD29E /* libSDL_ttf-2.0.0.dylib */; };
+ B556B5BB20E42C52007CD29E /* liblua.5.3.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5BA20E42C52007CD29E /* liblua.5.3.4.dylib */; };
+ B556B5BD20E42C64007CD29E /* libSDL_gfx.15.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5BC20E42C64007CD29E /* libSDL_gfx.15.dylib */; };
+ B556B5BF20E42CAF007CD29E /* libSDL-1.2.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B556B5BE20E42CAF007CD29E /* libSDL-1.2.0.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
files = (
8E660B8B109CDE9500DC2D83 /* walkersprite.png in Copy Sprites to Folder */,
8EA9F18A122F15B000759947 /* picosprite.png in Copy Sprites to Folder */,
+ 8ED18CC815893A06007091AE /* tilesheet.gif in Copy Sprites to Folder */,
8E662C1F14E8E09800E9CD0E /* tilesheet.png in Copy Sprites to Folder */,
8EA9F1F5122F2AEB00759947 /* shotsprite.png in Copy Sprites to Folder */,
);
32CA4F630368D1EE00C91783 /* Pico_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pico_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Pico Engine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Pico Engine.app"; sourceTree = BUILT_PRODUCTS_DIR; };
- 8E0441C514FE8379000B923E /* SDL_gfx.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_gfx.framework; path = ../../../../../../Library/Frameworks/SDL_gfx.framework; sourceTree = "<group>"; };
- 8E0441C714FE83A8000B923E /* Lua.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lua.framework; path = ../../../../../../Library/Frameworks/Lua.framework; sourceTree = "<group>"; };
8E15FEF31071DB470046A4C4 /* dejavubold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = dejavubold.ttf; sourceTree = "<group>"; };
8E15FEF51071DB5B0046A4C4 /* mappink.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = mappink.bin; sourceTree = "<group>"; };
8E2005D112FA4E0000BA92CE /* newpicoambient.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; path = newpicoambient.ogg; sourceTree = "<group>"; };
8E4BCB24105F641B0051A838 /* mapweird.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = mapweird.bin; sourceTree = "<group>"; };
8E5C11CC12E796DA002FED0B /* npc_jumper.lua */ = {isa = PBXFileReference; explicitFileType = sourcecode.lua; fileEncoding = 4; lastKnownFileType = text; path = npc_jumper.lua; sourceTree = "<group>"; };
8E5D1EAA12E8FF4100AFF51E /* npc_walker.lua */ = {isa = PBXFileReference; explicitFileType = sourcecode.lua; fileEncoding = 4; lastKnownFileType = text; path = npc_walker.lua; sourceTree = "<group>"; };
- 8E5DE99D140413F900CCD79E /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = ../../../../../../Library/Frameworks/SDL_image.framework; sourceTree = "<group>"; };
- 8E5DE99E140413F900CCD79E /* SDL_mixer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_mixer.framework; path = ../../../../../../Library/Frameworks/SDL_mixer.framework; sourceTree = "<group>"; };
- 8E5DE99F140413F900CCD79E /* SDL_ttf.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_ttf.framework; path = ../../../../../../Library/Frameworks/SDL_ttf.framework; sourceTree = "<group>"; };
- 8E5DE9A0140413F900CCD79E /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = ../../../../../../Library/Frameworks/SDL.framework; sourceTree = "<group>"; };
8E660B8A109CDE9500DC2D83 /* walkersprite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = walkersprite.png; sourceTree = "<group>"; };
8E662C1D14E8DBE600E9CD0E /* tilesheet.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tilesheet.png; sourceTree = "<group>"; };
8E6682E5118E22A200E1FC0A /* map2.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = map2.bin; sourceTree = "<group>"; };
8EBF902F12E8C8BC00A5D281 /* LuaVirtualMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaVirtualMachine.cpp; sourceTree = "<group>"; };
8EBF903012E8C8BC00A5D281 /* LuaVirtualMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaVirtualMachine.h; sourceTree = "<group>"; };
8EBF906912E8C98E00A5D281 /* luainc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = luainc.h; sourceTree = "<group>"; };
+ 8ED18CC6158939D7007091AE /* tilesheet.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = tilesheet.gif; sourceTree = "<group>"; };
+ B556B5B420E42C12007CD29E /* libSDL_image-1.2.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL_image-1.2.0.dylib"; path = "../../../../../usr/local/Cellar/sdl_image/1.2.12_7/lib/libSDL_image-1.2.0.dylib"; sourceTree = "<group>"; };
+ B556B5B620E42C28007CD29E /* libSDL_mixer-1.2.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL_mixer-1.2.0.dylib"; path = "../../../../../usr/local/Cellar/sdl_mixer/1.2.12_3/lib/libSDL_mixer-1.2.0.dylib"; sourceTree = "<group>"; };
+ B556B5B820E42C39007CD29E /* libSDL_ttf-2.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL_ttf-2.0.0.dylib"; path = "../../../../../usr/local/Cellar/sdl_ttf/2.0.11_1/lib/libSDL_ttf-2.0.0.dylib"; sourceTree = "<group>"; };
+ B556B5BA20E42C52007CD29E /* liblua.5.3.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblua.5.3.4.dylib; path = ../../../../../usr/local/Cellar/lua/5.3.4_4/lib/liblua.5.3.4.dylib; sourceTree = "<group>"; };
+ B556B5BC20E42C64007CD29E /* libSDL_gfx.15.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libSDL_gfx.15.dylib; path = ../../../../../usr/local/Cellar/sdl_gfx/2.0.26/lib/libSDL_gfx.15.dylib; sourceTree = "<group>"; };
+ B556B5BE20E42CAF007CD29E /* libSDL-1.2.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libSDL-1.2.0.dylib"; path = "../../../../../usr/local/Cellar/sdl/1.2.15/lib/libSDL-1.2.0.dylib"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ B556B5BF20E42CAF007CD29E /* libSDL-1.2.0.dylib in Frameworks */,
+ B556B5BD20E42C64007CD29E /* libSDL_gfx.15.dylib in Frameworks */,
+ B556B5BB20E42C52007CD29E /* liblua.5.3.4.dylib in Frameworks */,
+ B556B5B920E42C39007CD29E /* libSDL_ttf-2.0.0.dylib in Frameworks */,
+ B556B5B720E42C28007CD29E /* libSDL_mixer-1.2.0.dylib in Frameworks */,
+ B556B5B520E42C12007CD29E /* libSDL_image-1.2.0.dylib in Frameworks */,
8EEC047412CE07500043F29D /* Cocoa.framework in Frameworks */,
8EEC047512CE07500043F29D /* OpenGL.framework in Frameworks */,
- 8E5DE9A2140413F900CCD79E /* SDL_image.framework in Frameworks */,
- 8E5DE9A3140413F900CCD79E /* SDL_mixer.framework in Frameworks */,
- 8E5DE9A4140413F900CCD79E /* SDL_ttf.framework in Frameworks */,
- 8E5DE9A5140413F900CCD79E /* SDL.framework in Frameworks */,
- 8E0441C614FE8379000B923E /* SDL_gfx.framework in Frameworks */,
- 8E0441C814FE83A8000B923E /* Lua.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
- 8E0441C714FE83A8000B923E /* Lua.framework */,
- 8E0441C514FE8379000B923E /* SDL_gfx.framework */,
- 8E5DE99D140413F900CCD79E /* SDL_image.framework */,
- 8E5DE99E140413F900CCD79E /* SDL_mixer.framework */,
- 8E5DE99F140413F900CCD79E /* SDL_ttf.framework */,
- 8E5DE9A0140413F900CCD79E /* SDL.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
002F3C0009D093BD00EBEB88 /* OpenGL.framework */,
);
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ B556B5BE20E42CAF007CD29E /* libSDL-1.2.0.dylib */,
+ B556B5BC20E42C64007CD29E /* libSDL_gfx.15.dylib */,
+ B556B5BA20E42C52007CD29E /* liblua.5.3.4.dylib */,
+ B556B5B820E42C39007CD29E /* libSDL_ttf-2.0.0.dylib */,
+ B556B5B620E42C28007CD29E /* libSDL_mixer-1.2.0.dylib */,
+ B556B5B420E42C12007CD29E /* libSDL_image-1.2.0.dylib */,
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
isa = PBXGroup;
children = (
8E662C1D14E8DBE600E9CD0E /* tilesheet.png */,
+ 8ED18CC6158939D7007091AE /* tilesheet.gif */,
8EA9F189122F15B000759947 /* picosprite.png */,
8EA9F1F4122F2AEB00759947 /* shotsprite.png */,
8E660B8A109CDE9500DC2D83 /* walkersprite.png */,
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Koala Workshop";
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Pico Engine" */;
8E965FE1123048510056F76F /* map0.bin in Resources */,
8E8C972112C095550010C970 /* picolevel1.mp3 in Resources */,
8E8C984F12C0A3C20010C970 /* picobg1.png in Resources */,
+ 8ED18CC7158939D7007091AE /* tilesheet.gif in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
HEADER_SEARCH_PATHS = (
"$(HOME)/Library/Frameworks/SDL.framework/Headers",
"$(HEADER_SEARCH_PATHS)",
+ /usr/local/include/SDL,
+ /usr/local/include/lua,
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ /usr/local/Cellar/sdl_image/1.2.12_7/lib,
+ /usr/local/Cellar/sdl_mixer/1.2.12_3/lib,
+ /usr/local/Cellar/sdl_ttf/2.0.11_1/lib,
+ /usr/local/Cellar/lua/5.3.4_4/lib,
+ /usr/local/Cellar/sdl_gfx/2.0.26/lib,
+ /usr/local/Cellar/sdl/1.2.15/lib,
+ );
PRODUCT_NAME = "Pico Engine";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ /usr/local/Cellar/sdl_image/1.2.12_7/lib,
+ /usr/local/Cellar/sdl_mixer/1.2.12_3/lib,
+ /usr/local/Cellar/sdl_ttf/2.0.11_1/lib,
+ /usr/local/Cellar/lua/5.3.4_4/lib,
+ /usr/local/Cellar/sdl_gfx/2.0.26/lib,
+ /usr/local/Cellar/sdl/1.2.15/lib,
+ );
PRODUCT_NAME = "Pico Engine";
WRAPPER_EXTENSION = app;
};
Feel free to customize this file to suit your needs
*/
-#include "SDL/SDL.h"
+#include "SDL.h"
#include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h>
{
const NSDictionary *dict;
NSString *appName = 0;
-
+
/* Determine the application name */
dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
-
+
return 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]))
{
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
-
+
[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];
[menuItem release];
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
-
+
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
-
+
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
-
+
/* Ensure the application object is initialised */
[NSApplication sharedApplication];
[NSApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
-
+
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
-
+
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
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)
{
return FALSE;
}
gArgv = newargv;
-
+
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
-
+
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
-
+
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[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 */
exit(status);
}
unichar *buffer;
NSRange localRange;
NSString *result;
-
+
bufferSize = selfLen + aStringLen - aRange.length;
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
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;
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
-
+
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else