diff --git a/project/src/backend/sdl2/SDL2Stage.cpp b/project/src/backend/sdl2/SDL2Stage.cpp index 9c3066e1b..68a61e7d4 100644 --- a/project/src/backend/sdl2/SDL2Stage.cpp +++ b/project/src/backend/sdl2/SDL2Stage.cpp @@ -1074,6 +1074,11 @@ void ProcessEvent(SDL_Event &inEvent) void CreateMainFrame(FrameCreationCallback inOnFrame, int inWidth, int inHeight, unsigned int inFlags, const char *inTitle, Surface *inIcon) { + +#ifdef HX_MACOS + MacBoot(); +#endif + bool fullscreen = (inFlags & wfFullScreen) != 0; bool opengl = (inFlags & wfHardware) != 0; bool resizable = (inFlags & wfResizable) != 0; diff --git a/project/src/platform/mac/MacBoot.m b/project/src/platform/mac/MacBoot.m index 59a87a5ec..e294ee786 100644 --- a/project/src/platform/mac/MacBoot.m +++ b/project/src/platform/mac/MacBoot.m @@ -161,9 +161,10 @@ FILE *OpenOverwrite(const char *inName) /* The main class of the application, the application's delegate */ @implementation SDLMain + /* Set the working directory to the .app's parent directory */ - (void) setupWorkingDirectory:(BOOL)shouldChdir -{ +{ if (shouldChdir) { //char parentdir[MAXPATHLEN]; @@ -177,11 +178,16 @@ FILE *OpenOverwrite(const char *inName) CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); + + // NSLog( @"%s\n", CFStringGetCStringPtr(CFURLGetString(resourcesURL), kCFStringEncodingASCII) ); + char path[PATH_MAX]; if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX)) { // error! + printf("error %s\n", path); } + CFRelease(resourcesURL); chdir(path); @@ -462,6 +468,7 @@ static void CustomApplicationMain (int argc, char **argv) void MacBoot() { + //continueBoot = inFunc; /* Copy the arguments into a global variable */