fix mac resources

This commit is contained in:
2025-12-10 19:38:06 +01:00
parent d2fa5b2782
commit 3c6466e2a0

View File

@ -70,6 +70,22 @@ inline std::string resolveWithBase(const std::string& path) {
if (tryOpenFile(combinedStr)) {
return combinedStr;
}
#if defined(__APPLE__)
// When running from a macOS bundle, SDL_GetBasePath may point at
// Contents/Resources while assets are in Contents/MacOS. Search that
// sibling too so Finder launches find the packaged assets.
std::filesystem::path basePath(base);
auto contentsDir = basePath.parent_path();
if (contentsDir.filename() == "Resources") {
auto macosDir = contentsDir.parent_path() / "MacOS";
std::filesystem::path alt = macosDir / p;
std::string altStr = alt.string();
if (tryOpenFile(altStr)) {
return altStr;
}
}
#endif
}
}
return path;