macOS/iOS: Add resources to the bundle

This commit is contained in:
Gleb Mazovetskiy 2021-12-05 12:07:20 +00:00 committed by Anders Jenbo
commit 0f924528ba
3 changed files with 64 additions and 37 deletions

View file

@ -63,8 +63,8 @@ SDL_RWops *OpenAsset(const char *filename, bool threadsafe)
if ((rwops = SDL_RWFromFile(path.c_str(), "rb")) != nullptr)
return rwops;
#ifdef __ANDROID__
// On Android, fall back to the APK's assets.
#if defined(__ANDROID__) || defined(__APPLE__)
// Fall back to the bundled assets on supported systems.
// This is handled by SDL when we pass a relative path.
if (!paths::AssetsPath().empty() && (rwops = SDL_RWFromFile(relativePath.c_str(), "rb")))
return rwops;