Fix configuration file path on Android

This commit is contained in:
wheremyfoodat 2023-11-28 12:08:25 +02:00
parent 7a78b2cf20
commit 070d5b1c6d
5 changed files with 41 additions and 13 deletions

View file

@ -17,7 +17,9 @@ struct EmulatorConfig {
// Default to 3% battery to make users suffer
int batteryPercentage = 3;
std::filesystem::path filePath;
EmulatorConfig(const std::filesystem::path& path);
void load(const std::filesystem::path& path);
void save(const std::filesystem::path& path);
void load();
void save();
};

View file

@ -122,4 +122,7 @@ class Emulator {
RendererType getRendererType() const { return config.rendererType; }
Renderer* getRenderer() { return gpu.getRenderer(); }
u64 getTicks() { return cpu.getTicks(); }
std::filesystem::path getConfigPath();
std::filesystem::path getAndroidAppPath();
};

View file

@ -90,6 +90,13 @@ namespace Helpers {
return false;
}
static constexpr bool isAndroid() {
#ifdef __ANDROID__
return true;
#endif
return false;
}
static void debug_printf(const char* fmt, ...) {
if constexpr (buildingInDebugMode()) {
std::va_list args;