Commit 51befd6e authored by mercury233's avatar mercury233 Committed by GitHub

fix chdir on macos (#12)

parent b00b64f1
...@@ -482,7 +482,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -482,7 +482,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
IsActive(true), IsFullscreen(false), IsShiftDown(false), IsControlDown(false), IsResizable(false) IsActive(true), IsFullscreen(false), IsShiftDown(false), IsControlDown(false), IsResizable(false)
{ {
struct utsname name; struct utsname name;
NSString *path;
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CIrrDeviceMacOSX"); setDebugName("CIrrDeviceMacOSX");
...@@ -501,11 +500,13 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -501,11 +500,13 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
[NSApp finishLaunching]; [NSApp finishLaunching];
} }
path = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
chdir([path fileSystemRepresentation]); if ([[bundlePath lowercaseString] hasSuffix:@".app"]) {
[path release]; NSString* path = [bundlePath stringByDeletingLastPathComponent];
chdir([path fileSystemRepresentation]);
}
} }
NSWindow* a;
uname(&name); uname(&name);
Operator = new COSOperator(name.version); Operator = new COSOperator(name.version);
os::Printer::log(name.version,ELL_INFORMATION); os::Printer::log(name.version,ELL_INFORMATION);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment