diff options
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.cpp | 4 | ||||
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.h | 2 | ||||
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 33 |
3 files changed, 34 insertions, 5 deletions
diff --git a/src/frontend/qt_sdl/PlatformConfig.cpp b/src/frontend/qt_sdl/PlatformConfig.cpp index 3b4b4aa..28c224d 100644 --- a/src/frontend/qt_sdl/PlatformConfig.cpp +++ b/src/frontend/qt_sdl/PlatformConfig.cpp @@ -40,11 +40,11 @@ int ScreenRotation; int ScreenGap; int ScreenLayout; int ScreenSizing; +int IntegerScaling; int ScreenFilter; int ScreenUseGL; int ScreenVSync; -int ScreenRatio; int LimitFPS; int AudioSync; @@ -121,11 +121,11 @@ ConfigEntry PlatformConfigFile[] = {"ScreenGap", 0, &ScreenGap, 0, NULL, 0}, {"ScreenLayout", 0, &ScreenLayout, 0, NULL, 0}, {"ScreenSizing", 0, &ScreenSizing, 0, NULL, 0}, + {"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0}, {"ScreenFilter", 0, &ScreenFilter, 1, NULL, 0}, {"ScreenUseGL", 0, &ScreenUseGL, 1, NULL, 0}, {"ScreenVSync", 0, &ScreenVSync, 0, NULL, 0}, - {"ScreenRatio", 0, &ScreenRatio, 0, NULL, 0}, {"LimitFPS", 0, &LimitFPS, 0, NULL, 0}, {"AudioSync", 0, &AudioSync, 1, NULL, 0}, diff --git a/src/frontend/qt_sdl/PlatformConfig.h b/src/frontend/qt_sdl/PlatformConfig.h index 3704d14..539f9a4 100644 --- a/src/frontend/qt_sdl/PlatformConfig.h +++ b/src/frontend/qt_sdl/PlatformConfig.h @@ -53,11 +53,11 @@ extern int ScreenRotation; extern int ScreenGap; extern int ScreenLayout; extern int ScreenSizing; +extern int IntegerScaling; extern int ScreenFilter; extern int ScreenUseGL; extern int ScreenVSync; -extern int ScreenRatio; extern int LimitFPS; extern int AudioSync; diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 7ab7f0e..af95c49 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -707,6 +707,30 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) panel = new MainWindowPanel(this); setCentralWidget(panel); panel->setMinimumSize(256, 384); + + + actSavestateSRAMReloc->setChecked(Config::SavestateRelocSRAM != 0); + + actScreenRotation[Config::ScreenRotation]->setChecked(true); + + for (int i = 0; i < 6; i++) + { + if (actScreenGap[i]->data().toInt() == Config::ScreenGap) + { + actScreenGap[i]->setChecked(true); + break; + } + } + + actScreenLayout[Config::ScreenLayout]->setChecked(true); + actScreenSizing[Config::ScreenSizing]->setChecked(true); + actIntegerScaling->setChecked(Config::IntegerScaling != 0); + + actScreenFiltering->setChecked(Config::ScreenFilter != 0); + actShowOSD->setChecked(Config::ShowOSD != 0); + + actLimitFramerate->setChecked(Config::LimitFPS != 0); + actAudioSync->setChecked(Config::AudioSync != 0); } MainWindow::~MainWindow() @@ -1183,8 +1207,13 @@ int main(int argc, char** argv) Config::Load(); - if (Config::AudioVolume < 0) Config::AudioVolume = 0; - else if (Config::AudioVolume > 256) Config::AudioVolume = 256; +#define SANITIZE(var, min, max) { if (var < min) var = min; else if (var > max) var = max; } + SANITIZE(Config::AudioVolume, 0, 256); + SANITIZE(Config::ScreenRotation, 0, 3); + SANITIZE(Config::ScreenGap, 0, 500); + SANITIZE(Config::ScreenLayout, 0, 2); + SANITIZE(Config::ScreenSizing, 0, 3); +#undef SANITIZE // TODO: this should be checked before running anything #if 0 |