diff options
author | Arisotura <thetotalworm@gmail.com> | 2021-10-28 18:47:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 18:47:13 +0200 |
commit | ff3f661bb54dcb31e2533967aa231d827d2be4b7 (patch) | |
tree | f6b9d4ea0fc42f234bb1dd4f1dc6b0db9069333e /src/frontend/qt_sdl/Platform.cpp | |
parent | a8613af2bd3ba0cc9d52b6a5d63899cda7ca2864 (diff) |
DLDI/SD folder-sync apparatus (#1251)
guess we can finally have DLDI that isn't obtuse
Diffstat (limited to 'src/frontend/qt_sdl/Platform.cpp')
-rw-r--r-- | src/frontend/qt_sdl/Platform.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index 81d86d3..08190d6 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -127,6 +127,51 @@ void StopEmu() } +int GetConfigInt(ConfigEntry entry) +{ + const int imgsizes[] = {0, 256, 512, 1024, 2048, 4096}; + + switch (entry) + { + case DLDI_ImageSize: return imgsizes[Config::DLDISize]; + + case DSiSD_ImageSize: return imgsizes[Config::DSiSDSize]; + } + + return 0; +} + +bool GetConfigBool(ConfigEntry entry) +{ + switch (entry) + { + case DLDI_Enable: return Config::DLDIEnable != 0; + case DLDI_ReadOnly: return Config::DLDIReadOnly != 0; + case DLDI_FolderSync: return Config::DLDIFolderSync != 0; + + case DSiSD_Enable: return Config::DSiSDEnable != 0; + case DSiSD_ReadOnly: return Config::DSiSDReadOnly != 0; + case DSiSD_FolderSync: return Config::DSiSDFolderSync != 0; + } + + return false; +} + +std::string GetConfigString(ConfigEntry entry) +{ + switch (entry) + { + case DLDI_ImagePath: return Config::DLDISDPath; + case DLDI_FolderPath: return Config::DLDIFolderPath; + + case DSiSD_ImagePath: return Config::DSiSDPath; + case DSiSD_FolderPath: return Config::DSiSDFolderPath; + } + + return ""; +} + + FILE* OpenFile(const char* path, const char* mode, bool mustexist) { QFile f(path); |