Removed unused variable, fixed chdir regression.

master
Camilla Berglund ago%!(EXTRA string=14 years)
parent 4a9545317e
commit 84ea69358f
  1. 20
      src/cocoa_init.m
  2. 1
      src/cocoa_platform.h
  3. 1
      src/cocoa_window.m

@ -35,23 +35,28 @@
//======================================================================== //========================================================================
static void changeToResourcesDirectory(void) static void changeToResourcesDirectory(void)
{ {
char resourcesPath[MAXPATHLEN];
CFBundleRef bundle = CFBundleGetMainBundle(); CFBundleRef bundle = CFBundleGetMainBundle();
if (!bundle) if (!bundle)
return; return;
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(bundle); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(bundle);
char resourcesPath[MAXPATHLEN];
CFStringRef name = CFURLCopyLastPathComponent(resourcesURL); CFStringRef last = CFURLCopyLastPathComponent(resourcesURL);
if (CFStringCompare(CFSTR("Resources"), name, 0) != kCFCompareEqualTo) if (CFStringCompare(CFSTR("Resources"), last, 0) != kCFCompareEqualTo)
{
CFRelease(last);
CFRelease(resourcesURL);
return; return;
}
CFRelease(name); CFRelease(last);
if (!CFURLGetFileSystemRepresentation(resourcesURL, if (!CFURLGetFileSystemRepresentation(resourcesURL,
TRUE, true,
(UInt8*) resourcesPath, (UInt8*) resourcesPath,
MAXPATHLEN)); MAXPATHLEN))
{ {
CFRelease(resourcesURL); CFRelease(resourcesURL);
return; return;
@ -82,8 +87,7 @@ int _glfwPlatformInit(void)
return GL_FALSE; return GL_FALSE;
} }
if (_glfwLibrary.NS.bundled) changeToResourcesDirectory();
changeToResourcesDirectory();
_glfwLibrary.NS.desktopMode = _glfwLibrary.NS.desktopMode =
(NSDictionary*) CGDisplayCurrentMode(CGMainDisplayID()); (NSDictionary*) CGDisplayCurrentMode(CGMainDisplayID());

@ -91,7 +91,6 @@ typedef struct _GLFWlibraryNS
// dlopen handle for dynamically loading OpenGL extension entry points // dlopen handle for dynamically loading OpenGL extension entry points
void* OpenGLFramework; void* OpenGLFramework;
GLboolean bundled;
id desktopMode; id desktopMode;
id delegate; id delegate;
id autoreleasePool; id autoreleasePool;

@ -500,7 +500,6 @@ static NSString* findAppName(void)
[name isKindOfClass:[NSString class]] && [name isKindOfClass:[NSString class]] &&
![@"" isEqualToString:name]) ![@"" isEqualToString:name])
{ {
_glfwLibrary.NS.bundled = GL_TRUE;
return name; return name;
} }
} }

Loading…
Cancel
Save