Files
critterfolio/src/asset_io.hpp
chris bell a3c7d9cf75 Can now build to android apk
Need to fix:
- Remove default android header bar
- Fix rcss styling to work on small screens
2026-08-09 00:16:23 -05:00

16 lines
433 B
C++

#pragma once
#include <SDL3/SDL.h>
#include <string>
inline SDL_IOStream *OpenAssetFile(const std::string &virtual_path) {
std::string resolved = virtual_path;
#if defined(__ANDROID__)
if (resolved.rfind("./assets/", 0) == 0) {
resolved = resolved.substr(9);
} else if (resolved.rfind("assets/", 0) == 0) {
resolved = resolved.substr(7);
}
#endif
return SDL_IOFromFile(resolved.c_str(), "rb");
}