]> git.jsancho.org Git - lugaru.git/blobdiff - Source/MacCompatibility.cpp
Fixed resolution selection and added 1920x1200 mode for my monitor. :)
[lugaru.git] / Source / MacCompatibility.cpp
index dfedc9a4b6490a084a0cd9904e2318549d0cecbe..e1226b608dc32edd854176e8d7b2bd56888b3257 100644 (file)
@@ -242,7 +242,7 @@ static int locateCorrectFile(char *buf, const char *mode)
     snprintf(prefpathfile, len, "%s/%s", prefpath, buf);
 
     int rc = locateCorrectCase(prefpathfile, iswriting);  /* favor prefpath. */
-    if (rc == 0)  // found?
+    if ( (rc == 0) || ((rc == -1) && (iswriting)) ) // found or create?
         strcpy(buf, prefpathfile);
     else if ((rc < 0) && (!iswriting))  /* not writing? Try game dir... */
         rc = locateCorrectCase(buf, iswriting);
@@ -255,6 +255,9 @@ static int locateCorrectFile(char *buf, const char *mode)
 static char g_filename[4096];
 char* ConvertFileName( const char* orgfilename, const char *mode)
 {
+    if (orgfilename == g_filename) // recursion?
+        return g_filename;
+
        // translate filename into proper path name
        if (orgfilename[ 0] == ':')
                orgfilename++;