Merge pull request #202 from MattTuttle/next
Set working directory for OS X
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#include "SDLApplication.h"
|
||||
|
||||
#ifdef HX_MACOS
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
@@ -18,6 +22,18 @@ namespace lime {
|
||||
|
||||
SDL_Init (SDL_INIT_VIDEO | SDL_INIT_TIMER);
|
||||
|
||||
#ifdef HX_MACOS
|
||||
// set working directory for OS X
|
||||
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL (CFBundleGetMainBundle ());
|
||||
char path[PATH_MAX];
|
||||
if (CFURLGetFileSystemRepresentation (resourcesURL, TRUE, (UInt8 *)path, PATH_MAX)) {
|
||||
|
||||
chdir(path);
|
||||
|
||||
}
|
||||
CFRelease(resourcesURL);
|
||||
#endif
|
||||
|
||||
currentUpdate = 0;
|
||||
lastUpdate = 0;
|
||||
nextUpdate = 0;
|
||||
@@ -314,4 +330,4 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,11 +71,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
|
||||
if (Sys.args ().indexOf ("-livereload") > -1) {
|
||||
|
||||
#if mac
|
||||
var path = FileSystem.fullPath ("../Resources/manifest");
|
||||
#else
|
||||
var path = FileSystem.fullPath ("manifest");
|
||||
#end
|
||||
lastModified = FileSystem.stat (path).mtime.getTime ();
|
||||
|
||||
timer = new Timer (2000);
|
||||
|
||||
Reference in New Issue
Block a user