Qt: Configurable display driver (requires restart)

This commit is contained in:
Jeffrey Pfau 2015-07-03 00:05:55 -07:00
parent 41c19a8f09
commit e8b5127dac
4 changed files with 71 additions and 31 deletions

View File

@ -23,6 +23,7 @@ Features:
- 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

View File

@ -7,6 +7,7 @@
#include "AudioProcessor.h"
#include "ConfigController.h"
#include "Display.h"
#include "GBAApp.h"
using namespace QGBA;
@ -59,6 +60,19 @@ SettingsView::SettingsView(ConfigController* controller, QWidget* parent)
}
#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()));
}
@ -108,6 +122,13 @@ void SettingsView::updateConfig() {
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();
emit biosLoaded(m_ui.bios->text());

View File

@ -23,6 +23,7 @@ public:
signals:
void biosLoaded(const QString&);
void audioDriverChanged();
void displayDriverChanged();
private slots:
void selectBios();

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>673</width>
<width>698</width>
<height>366</height>
</rect>
</property>
@ -140,30 +140,12 @@
</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">
<property name="text">
@ -230,27 +212,52 @@
</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 @@
</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">