all repos — mgba @ bdc4e2837d7f82189e2342851ef3c67340df0741

mGBA Game Boy Advance Emulator

Qt: Add settings for enhancements
Vicki Pfau vi@endrift.com
Tue, 14 May 2019 13:56:01 -0700
commit

bdc4e2837d7f82189e2342851ef3c67340df0741

parent

8450417086c5b70904f93f2db720456d54c9cfeb

M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -401,6 +401,7 @@ saveSetting("logToFile", m_ui.logToFile);

saveSetting("logToStdout", m_ui.logToStdout); saveSetting("logFile", m_ui.logFile); saveSetting("useDiscordPresence", m_ui.useDiscordPresence); + saveSetting("audioHle", m_ui.audioHle); if (m_ui.fastForwardUnbounded->isChecked()) { saveSetting("fastForwardRatio", "-1");

@@ -464,6 +465,14 @@ if (language != m_controller->getQtOption("language").toLocale() && !(language.bcp47Name() == QLocale::system().bcp47Name() && m_controller->getQtOption("language").isNull())) {

m_controller->setQtOption("language", language.bcp47Name()); emit languageChanged(); } + + int videoScale = m_controller->getOption("videoScale").toInt(); + int hwaccelVideo = m_controller->getOption("hwaccelVideo").toInt(); + if (videoScale != m_ui.videoScale->value() || hwaccelVideo != m_ui.hwaccelVideo->currentIndex()) { + emit videoRendererChanged(); + } + saveSetting("videoScale", m_ui.videoScale); + saveSetting("hwaccelVideo", m_ui.hwaccelVideo->currentIndex()); m_logModel.save(m_controller); m_logModel.logger()->setLogFile(m_ui.logFile->text());

@@ -541,6 +550,8 @@ loadSetting("logToFile", m_ui.logToFile);

loadSetting("logToStdout", m_ui.logToStdout); loadSetting("logFile", m_ui.logFile); loadSetting("useDiscordPresence", m_ui.useDiscordPresence); + loadSetting("audioHle", m_ui.audioHle); + loadSetting("videoScale", m_ui.videoScale); m_ui.libraryStyle->setCurrentIndex(loadSetting("libraryStyle").toInt());

@@ -604,6 +615,12 @@ int index = s_gbModelList.indexOf(model);

m_ui.cgbModel->setCurrentIndex(index >= 0 ? index : 0); } #endif + + int hwaccelVideo = m_controller->getOption("hwaccelVideo", 1).toInt(); + if (hwaccelVideo < 1) { + hwaccelVideo = 1; + } + m_ui.hwaccelVideo->setCurrentIndex(hwaccelVideo); } void SettingsView::saveSetting(const char* key, const QAbstractButton* field) {
M src/platform/qt/SettingsView.hsrc/platform/qt/SettingsView.h

@@ -40,6 +40,7 @@ void audioDriverChanged();

void displayDriverChanged(); void cameraDriverChanged(); void cameraChanged(const QByteArray&); + void videoRendererChanged(); void pathsChanged(); void languageChanged(); void libraryCleared();
M src/platform/qt/SettingsView.uisrc/platform/qt/SettingsView.ui

@@ -6,8 +6,8 @@ <property name="geometry">

<rect> <x>0</x> <y>0</y> - <width>588</width> - <height>488</height> + <width>790</width> + <height>686</height> </rect> </property> <property name="sizePolicy">

@@ -33,14 +33,14 @@ </item>

<item row="1" column="0"> <widget class="QListWidget" name="tabs"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> + <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="maximumSize"> <size> - <width>140</width> + <width>200</width> <height>16777215</height> </size> </property>

@@ -60,6 +60,11 @@ </item>

<item> <property name="text"> <string>Emulation</string> + </property> + </item> + <item> + <property name="text"> + <string>Enhancements</string> </property> </item> <item>

@@ -844,6 +849,70 @@ </widget>

</item> </layout> </widget> + <widget class="QWidget" name="enhancements"> + <layout class="QFormLayout" name="formLayout_6"> + <item row="0" column="0"> + <widget class="QLabel" name="label_36"> + <property name="text"> + <string>Video renderer:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="hwaccelVideo"> + <item> + <property name="text"> + <string>Software</string> + </property> + </item> + <item> + <property name="text"> + <string>OpenGL</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <widget class="QGroupBox" name="oglEnahance"> + <property name="title"> + <string>OpenGL enhancements</string> + </property> + <layout class="QFormLayout" name="formLayout_7"> + <item row="0" column="0"> + <widget class="QLabel" name="label_37"> + <property name="text"> + <string>High-resolution scale:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="videoScale"> + <property name="suffix"> + <string>×</string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>13</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="audioHle"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>XQ GBA audio (experimental)</string> + </property> + </widget> + </item> + </layout> + </widget> <widget class="QWidget" name="bios"> <layout class="QFormLayout" name="formLayout_5"> <item row="0" column="0">

@@ -1221,11 +1290,11 @@ <widget class="QWidget" name="logging">

<layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTableView" name="loggingView"> - <attribute name="horizontalHeaderDefaultSectionSize"> - <number>77</number> - </attribute> <attribute name="horizontalHeaderMinimumSectionSize"> <number>0</number> + </attribute> + <attribute name="horizontalHeaderDefaultSectionSize"> + <number>77</number> </attribute> </widget> </item>
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -460,6 +460,7 @@ connect(settingsWindow, &SettingsView::displayDriverChanged, this, &Window::reloadDisplayDriver);

connect(settingsWindow, &SettingsView::audioDriverChanged, this, &Window::reloadAudioDriver); connect(settingsWindow, &SettingsView::cameraDriverChanged, this, &Window::mustRestart); connect(settingsWindow, &SettingsView::cameraChanged, &m_inputController, &InputController::setCamera); + connect(settingsWindow, &SettingsView::videoRendererChanged, this, &Window::mustRestart); connect(settingsWindow, &SettingsView::languageChanged, this, &Window::mustRestart); connect(settingsWindow, &SettingsView::pathsChanged, this, &Window::reloadConfig); #ifdef USE_SQLITE3