#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");
}