We detect if we might be in an .app bundle and try to use the exe path instead
@@ -33,6 +33,12 @@ char* getBasePath(void) {
}
}
basePath = ptr;
+
+ if (strstr(basePath, ".app/") != NULL) {
+ // If this is a MAC bundle, we need to use the exe location
+ free(basePath);
+ basePath = SDL_GetBasePath();
+ } else {
size_t len = strlen(basePath);
*(basePath + len) = '/';
*(basePath + len + 1) = '\0';
@@ -42,6 +48,7 @@ char* getBasePath(void) {
}
}
}
+ }
return basePath;
}
