aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-05-20 21:19:04 +0200
committerArisotura <thetotalworm@gmail.com>2020-05-20 21:19:04 +0200
commitd761db005694899342beee101b12aaa6d6cbf711 (patch)
tree54154a64f9d1343257461592d00f6db3a2a3153c /src/frontend/qt_sdl/main.cpp
parent7be662b2dd1e7f99cf5a31c18c115c1106300964 (diff)
populate the menus with the config data
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r--src/frontend/qt_sdl/main.cpp33
1 files changed, 31 insertions, 2 deletions
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