MacBoot was missing a call in sdl 2 stage, which causes asset problems on 10.7.x

This commit is contained in:
underscorediscovery
2013-12-06 23:36:34 -03:30
parent b07b770db5
commit 6a4efcf9cf
2 changed files with 13 additions and 1 deletions

View File

@@ -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) 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 fullscreen = (inFlags & wfFullScreen) != 0;
bool opengl = (inFlags & wfHardware) != 0; bool opengl = (inFlags & wfHardware) != 0;
bool resizable = (inFlags & wfResizable) != 0; bool resizable = (inFlags & wfResizable) != 0;

View File

@@ -161,9 +161,10 @@ FILE *OpenOverwrite(const char *inName)
/* The main class of the application, the application's delegate */ /* The main class of the application, the application's delegate */
@implementation SDLMain @implementation SDLMain
/* Set the working directory to the .app's parent directory */ /* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir - (void) setupWorkingDirectory:(BOOL)shouldChdir
{ {
if (shouldChdir) if (shouldChdir)
{ {
//char parentdir[MAXPATHLEN]; //char parentdir[MAXPATHLEN];
@@ -177,11 +178,16 @@ FILE *OpenOverwrite(const char *inName)
CFBundleRef mainBundle = CFBundleGetMainBundle(); CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
// NSLog( @"%s\n", CFStringGetCStringPtr(CFURLGetString(resourcesURL), kCFStringEncodingASCII) );
char path[PATH_MAX]; char path[PATH_MAX];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX)) if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
{ {
// error! // error!
printf("error %s\n", path);
} }
CFRelease(resourcesURL); CFRelease(resourcesURL);
chdir(path); chdir(path);
@@ -462,6 +468,7 @@ static void CustomApplicationMain (int argc, char **argv)
void MacBoot() void MacBoot()
{ {
//continueBoot = inFunc; //continueBoot = inFunc;
/* Copy the arguments into a global variable */ /* Copy the arguments into a global variable */