Can now build to android apk
Need to fix: - Remove default android header bar - Fix rcss styling to work on small screens
This commit is contained in:
16
src/asset_io.hpp
Normal file
16
src/asset_io.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#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");
|
||||
}
|
||||
Reference in New Issue
Block a user