diff options
Diffstat (limited to 'src/citra_qt/bootmanager.cpp')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index cf9e1bffc..f85116419 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -50,7 +50,7 @@ void EmuThread::run() | |||
| 50 | 50 | ||
| 51 | void EmuThread::Stop() | 51 | void EmuThread::Stop() |
| 52 | { | 52 | { |
| 53 | if (!isRunning()) | 53 | if (!isRunning()) |
| 54 | { | 54 | { |
| 55 | INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); | 55 | INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); |
| 56 | return; | 56 | return; |
| @@ -65,7 +65,7 @@ void EmuThread::Stop() | |||
| 65 | terminate(); | 65 | terminate(); |
| 66 | wait(1000); | 66 | wait(1000); |
| 67 | if (isRunning()) | 67 | if (isRunning()) |
| 68 | WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); | 68 | WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); |
| 69 | } | 69 | } |
| 70 | INFO_LOG(MASTER_LOG, "EmuThread stopped"); | 70 | INFO_LOG(MASTER_LOG, "EmuThread stopped"); |
| 71 | } | 71 | } |
| @@ -76,9 +76,8 @@ void EmuThread::Stop() | |||
| 76 | class GGLWidgetInternal : public QGLWidget | 76 | class GGLWidgetInternal : public QGLWidget |
| 77 | { | 77 | { |
| 78 | public: | 78 | public: |
| 79 | GGLWidgetInternal(GRenderWindow* parent) : QGLWidget(parent) | 79 | GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent) |
| 80 | { | 80 | { |
| 81 | setAutoBufferSwap(false); | ||
| 82 | doneCurrent(); | 81 | doneCurrent(); |
| 83 | parent_ = parent; | 82 | parent_ = parent; |
| 84 | } | 83 | } |
| @@ -106,8 +105,13 @@ EmuThread& GRenderWindow::GetEmuThread() | |||
| 106 | GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this) | 105 | GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this) |
| 107 | { | 106 | { |
| 108 | // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose | 107 | // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose |
| 109 | 108 | QGLFormat fmt; | |
| 110 | child = new GGLWidgetInternal(this); | 109 | fmt.setProfile(QGLFormat::CoreProfile); |
| 110 | fmt.setVersion(3,2); | ||
| 111 | fmt.setSampleBuffers(true); | ||
| 112 | fmt.setSamples(4); | ||
| 113 | |||
| 114 | child = new GGLWidgetInternal(fmt, this); | ||
| 111 | QBoxLayout* layout = new QHBoxLayout(this); | 115 | QBoxLayout* layout = new QHBoxLayout(this); |
| 112 | resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight); | 116 | resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight); |
| 113 | layout->addWidget(child); | 117 | layout->addWidget(child); |
| @@ -147,12 +151,12 @@ void GRenderWindow::DoneCurrent() | |||
| 147 | void GRenderWindow::PollEvents() { | 151 | void GRenderWindow::PollEvents() { |
| 148 | // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title | 152 | // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title |
| 149 | // from the main thread, but this should probably be in an event handler... | 153 | // from the main thread, but this should probably be in an event handler... |
| 150 | /* | 154 | /* |
| 151 | static char title[128]; | 155 | static char title[128]; |
| 152 | sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), | 156 | sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), |
| 153 | video_core::g_renderer->current_fps()); | 157 | video_core::g_renderer->current_fps()); |
| 154 | setWindowTitle(title); | 158 | setWindowTitle(title); |
| 155 | */ | 159 | */ |
| 156 | } | 160 | } |
| 157 | 161 | ||
| 158 | void GRenderWindow::BackupGeometry() | 162 | void GRenderWindow::BackupGeometry() |
| @@ -185,26 +189,26 @@ QByteArray GRenderWindow::saveGeometry() | |||
| 185 | 189 | ||
| 186 | void GRenderWindow::keyPressEvent(QKeyEvent* event) | 190 | void GRenderWindow::keyPressEvent(QKeyEvent* event) |
| 187 | { | 191 | { |
| 188 | /* | 192 | /* |
| 189 | bool key_processed = false; | 193 | bool key_processed = false; |
| 190 | for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) | 194 | for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) |
| 191 | if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED)) | 195 | if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED)) |
| 192 | key_processed = true; | 196 | key_processed = true; |
| 193 | 197 | ||
| 194 | if (!key_processed) | 198 | if (!key_processed) |
| 195 | QWidget::keyPressEvent(event); | 199 | QWidget::keyPressEvent(event); |
| 196 | */ | 200 | */ |
| 197 | } | 201 | } |
| 198 | 202 | ||
| 199 | void GRenderWindow::keyReleaseEvent(QKeyEvent* event) | 203 | void GRenderWindow::keyReleaseEvent(QKeyEvent* event) |
| 200 | { | 204 | { |
| 201 | /* | 205 | /* |
| 202 | bool key_processed = false; | 206 | bool key_processed = false; |
| 203 | for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) | 207 | for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) |
| 204 | if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED)) | 208 | if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED)) |
| 205 | key_processed = true; | 209 | key_processed = true; |
| 206 | 210 | ||
| 207 | if (!key_processed) | 211 | if (!key_processed) |
| 208 | QWidget::keyPressEvent(event); | 212 | QWidget::keyPressEvent(event); |
| 209 | */ | 213 | */ |
| 210 | } \ No newline at end of file | 214 | } \ No newline at end of file |