Qt: Fix GL-less build (fixes #788)
Vicki Pfau vi@endrift.com
Tue, 11 Jul 2017 09:59:01 -0700
5 files changed,
19 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -179,6 +179,7 @@ - GB Audio: Fix incorrect channel 4 iteration
- GB Audio: Fix zombie mode bit masking - GBA Timer: Fix count-up timing overflowing timer 3 - Core: Fix rewinding getting out of sync (fixes mgba.io/i/791) + - Qt: Fix GL-less build Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers
M
src/platform/qt/SettingsView.cpp
→
src/platform/qt/SettingsView.cpp
@@ -187,17 +187,21 @@ m_ui.tabs->addItem(tr("Shortcuts"));
} SettingsView::~SettingsView() { +#if defined(BUILD_GL) || defined(BUILD_GLES) if (m_shader) { m_ui.stackedWidget->removeWidget(m_shader); m_shader->setParent(nullptr); } +#endif } void SettingsView::setShaderSelector(ShaderSelector* shaderSelector) { +#if defined(BUILD_GL) || defined(BUILD_GLES) m_shader = shaderSelector; m_ui.stackedWidget->addWidget(m_shader); m_ui.tabs->addItem(tr("Shaders")); connect(m_ui.buttonBox, &QDialogButtonBox::accepted, m_shader, &ShaderSelector::saved); +#endif } void SettingsView::selectBios(QLineEdit* bios) {
M
src/platform/qt/ShaderSelector.cpp
→
src/platform/qt/ShaderSelector.cpp
@@ -21,6 +21,8 @@ #include <mgba/core/version.h>
#include <mgba-util/vfs.h> #include "platform/video-backend.h" +#if defined(BUILD_GL) || defined(BUILD_GLES) + #if !defined(_WIN32) || defined(USE_EPOXY) #include "platform/opengl/gles2.h" #endif@@ -280,3 +282,5 @@ default:
break; } } + +#endif
M
src/platform/qt/ShaderSelector.h
→
src/platform/qt/ShaderSelector.h
@@ -6,6 +6,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_SHADER_SELECTOR_H #define QGBA_SHADER_SELECTOR_H +#if defined(BUILD_GL) || defined(BUILD_GLES) + #include <QDialog> #include "ui_ShaderSelector.h"@@ -56,3 +58,5 @@
} #endif + +#endif
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -78,7 +78,9 @@ m_controller->setInputController(&m_inputController);
updateTitle(); m_display = Display::create(this); +#if defined(BUILD_GL) || defined(BUILD_GLES) m_shaderView = new ShaderSelector(m_display, m_config); +#endif m_logo.setDevicePixelRatio(m_screenWidget->devicePixelRatio()); m_logo = m_logo; // Free memory left over in old pixmap@@ -274,6 +276,7 @@ if (opts->fullscreen) {
enterFullScreen(); } +#if defined(BUILD_GL) || defined(BUILD_GLES) if (opts->shader) { struct VDir* shader = VDirOpen(opts->shader); if (shader) {@@ -282,6 +285,7 @@ m_shaderView->refreshShaders();
shader->close(shader); } } +#endif m_mruFiles = m_config->getMRU(); updateMRU();@@ -459,9 +463,11 @@ }
void Window::openSettingsWindow() { SettingsView* settingsWindow = new SettingsView(m_config, &m_inputController, m_shortcutController); +#if defined(BUILD_GL) || defined(BUILD_GLES) if (m_display->supportsShaders()) { settingsWindow->setShaderSelector(m_shaderView); } +#endif connect(settingsWindow, &SettingsView::biosLoaded, m_controller, &GameController::loadBIOS); connect(settingsWindow, &SettingsView::audioDriverChanged, m_controller, &GameController::reloadAudioDriver); connect(settingsWindow, &SettingsView::displayDriverChanged, this, &Window::mustRestart);