Qt: Configurable display driver (requires restart)
Jeffrey Pfau jeffrey@endrift.com
Fri, 03 Jul 2015 00:05:55 -0700
4 files changed,
71 insertions(+),
31 deletions(-)
M
CHANGES
→
CHANGES
@@ -23,6 +23,7 @@ - Holdable shortcut for rewinding one frame at a time
- Ability to boot directly into the BIOS - Preliminary support for yanking out the game pak while a game is running - Thumb-drive mode by putting a file called portable.ini in the same folder + - Configurable display driver, between software and OpenGL Bugfixes: - ARM7: Fix SWI and IRQ timings - GBA Audio: Force audio FIFOs to 32-bit
M
src/platform/qt/SettingsView.cpp
→
src/platform/qt/SettingsView.cpp
@@ -7,6 +7,7 @@ #include "SettingsView.h"
#include "AudioProcessor.h" #include "ConfigController.h" +#include "Display.h" #include "GBAApp.h" using namespace QGBA;@@ -59,6 +60,19 @@ m_ui.audioDriver->setCurrentIndex(m_ui.audioDriver->count() - 1);
} #endif + QVariant displayDriver = m_controller->getQtOption("displayDriver"); + m_ui.displayDriver->addItem(tr("Software (Qt)"), static_cast<int>(Display::Driver::QT)); + if (!displayDriver.isNull() && displayDriver.toInt() == static_cast<int>(Display::Driver::QT)) { + m_ui.displayDriver->setCurrentIndex(m_ui.displayDriver->count() - 1); + } + +#ifdef BUILD_GL + m_ui.displayDriver->addItem(tr("OpenGL"), static_cast<int>(Display::Driver::OPENGL)); + if (displayDriver.isNull() || displayDriver.toInt() == static_cast<int>(Display::Driver::OPENGL)) { + m_ui.displayDriver->setCurrentIndex(m_ui.displayDriver->count() - 1); + } +#endif + connect(m_ui.biosBrowse, SIGNAL(clicked()), this, SLOT(selectBios())); connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(updateConfig())); }@@ -106,6 +120,13 @@ if (audioDriver != m_controller->getQtOption("audioDriver")) {
m_controller->setQtOption("audioDriver", audioDriver); AudioProcessor::setDriver(static_cast<AudioProcessor::Driver>(audioDriver.toInt())); emit audioDriverChanged(); + } + + QVariant displayDriver = m_ui.displayDriver->itemData(m_ui.displayDriver->currentIndex()); + if (displayDriver != m_controller->getQtOption("displayDriver")) { + m_controller->setQtOption("displayDriver", displayDriver); + Display::setDriver(static_cast<Display::Driver>(displayDriver.toInt())); + emit displayDriverChanged(); } m_controller->write();
M
src/platform/qt/SettingsView.h
→
src/platform/qt/SettingsView.h
@@ -23,6 +23,7 @@
signals: void biosLoaded(const QString&); void audioDriverChanged(); + void displayDriverChanged(); private slots: void selectBios();
M
src/platform/qt/SettingsView.ui
→
src/platform/qt/SettingsView.ui
@@ -6,7 +6,7 @@ <property name="geometry">
<rect> <x>0</x> <y>0</y> - <width>673</width> + <width>698</width> <height>366</height> </rect> </property>@@ -140,29 +140,11 @@ </property>
</widget> </item> <item row="4" column="0"> - <widget class="QLabel" name="label_2"> + <widget class="QLabel" name="label_10"> <property name="text"> - <string>Sync:</string> + <string>Display driver:</string> </property> </widget> - </item> - <item row="4" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QCheckBox" name="videoSync"> - <property name="text"> - <string>Video</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="audioSync"> - <property name="text"> - <string>Audio</string> - </property> - </widget> - </item> - </layout> </item> <item row="5" column="0"> <widget class="QLabel" name="label_9">@@ -230,27 +212,52 @@ <enum>Qt::Horizontal</enum>
</property> </widget> </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Sync:</string> + </property> + </widget> + </item> <item row="8" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="QCheckBox" name="videoSync"> + <property name="text"> + <string>Video</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="audioSync"> + <property name="text"> + <string>Audio</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="9" column="1"> <widget class="QCheckBox" name="lockAspectRatio"> <property name="text"> <string>Lock aspect ratio</string> </property> </widget> </item> - <item row="9" column="1"> + <item row="10" column="1"> <widget class="QCheckBox" name="resampleVideo"> <property name="text"> <string>Resample video</string> </property> </widget> </item> - <item row="10" column="1"> - <widget class="QCheckBox" name="suspendScreensaver"> - <property name="text"> - <string>Suspend screensaver</string> - </property> - <property name="checked"> - <bool>true</bool> + <item row="4" column="1"> + <widget class="QComboBox" name="displayDriver"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item>@@ -387,14 +394,24 @@ <string>Allow opposing input directions</string>
</property> </widget> </item> - <item row="9" column="0"> + <item row="9" column="1"> + <widget class="QCheckBox" name="suspendScreensaver"> + <property name="text"> + <string>Suspend screensaver</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="10" column="0"> <widget class="QLabel" name="label_15"> <property name="text"> <string>Idle loops</string> </property> </widget> </item> - <item row="9" column="1"> + <item row="10" column="1"> <widget class="QComboBox" name="idleOptimization"> <item> <property name="text">