From bad4994921353ab87201eeea11184674817cbf14 Mon Sep 17 00:00:00 2001 From: Sacha Date: Mon, 1 Apr 2013 22:45:27 +1000 Subject: [PATCH] Buildfix for Qt. Gets Qt compiling again but not working yet. Hasn't compiled in a days now so I thought this was worthwhile. --- Qt/EmuThread.cpp | 13 ++++--------- Qt/QtHost.cpp | 14 ++++++++------ Qt/mainwindow.cpp | 18 +++++++----------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Qt/EmuThread.cpp b/Qt/EmuThread.cpp index 5291bde76a..155ee683ea 100644 --- a/Qt/EmuThread.cpp +++ b/Qt/EmuThread.cpp @@ -178,8 +178,6 @@ void EmuThread::run() EmuThread_LockDraw(true); if(needInitGame) { - g_State.bEmuThreadStarted = true; - CoreParameter coreParameter; coreParameter.fileToStart = fileToStart.toStdString(); coreParameter.enableSound = true; @@ -211,7 +209,6 @@ void EmuThread::run() host->UpdateDisassembly(); Core_EnableStepping(coreParameter.startPaused ? TRUE : FALSE); - g_State.bBooted = true; #ifdef _DEBUG host->UpdateMemView(); #endif @@ -255,14 +252,14 @@ void EmuThread::run() glViewport(0, 0, pixel_xres, pixel_yres); - ui_draw2d.Begin(DBMODE_NORMAL); + ui_draw2d.Begin(UIShader_Get(), DBMODE_NORMAL); //if (g_Config.bShowTouchControls) // DrawGamepad(ui_draw2d); glsl_bind(UIShader_Get()); ui_draw2d.End(); - ui_draw2d.Flush(UIShader_Get()); + ui_draw2d.Flush(); // Tiled renderers like PowerVR should benefit greatly from this. However - seems I can't call it? @@ -302,7 +299,7 @@ void EmuThread::run() UIShader_Prepare(); glViewport(0, 0, pixel_xres, pixel_yres); - UIBegin(); + UIBegin(UIShader_Get()); DrawBackground(alpha); ui_draw2d.SetFontScale(1.5f, 1.5f); @@ -315,7 +312,7 @@ void EmuThread::run() UIEnd(); glsl_bind(UIShader_Get()); - ui_draw2d.Flush(UIShader_Get()); + ui_draw2d.Flush(); glWindow->swapBuffers(); EmuThread_LockDraw(false); @@ -339,7 +336,6 @@ void EmuThread::run() void EmuThread::Shutdown() { - host->PrepareShutdown(); FinalShutdown(); } void EmuThread::FinalShutdown() @@ -384,7 +380,6 @@ void EmuThread::stopGame() // TODO //The CPU should return when a game is stopped and cleanup should be done here, //so we can restart the plugins (or load new ones) for the next game - g_State.bEmuThreadStarted = false; frames_ = 0; gameMutex->unlock(); diff --git a/Qt/QtHost.cpp b/Qt/QtHost.cpp index ffd4b30f86..88b6c95ae3 100644 --- a/Qt/QtHost.cpp +++ b/Qt/QtHost.cpp @@ -8,10 +8,10 @@ #include "Core/Debugger/SymbolMap.h" #include "Core/Config.h" #include "base/NativeApp.h" -#include "android/jni/MenuScreens.h" -#include "android/jni/EmuScreen.h" -#include "android/jni/UIShader.h" -#include "android/jni/ui_atlas.h" +#include "UI/MenuScreens.h" +#include "UI/EmuScreen.h" +#include "UI/UIShader.h" +#include "UI/ui_atlas.h" #include "GPU/ge_constants.h" #include "EmuThread.h" @@ -211,10 +211,12 @@ void QtHost::NextGPUStep() m_hGPUStepEvent.notify_one(); } -void NativeMix(short *audio, int num_samples) +int NativeMix(short *audio, int num_samples) { if (g_mixer) - g_mixer->Mix(audio, num_samples); + return g_mixer->Mix(audio, num_samples); + else + return 0; } void NativeInitGraphics() diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index f4a2bfa713..b394b1b39d 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -194,8 +194,7 @@ void MainWindow::Update() void MainWindow::UpdateMenus() { - // enabling - bool enable = g_State.bEmuThreadStarted ? false : true; + bool enable = false; ui->action_FileLoad->setEnabled(enable); ui->action_FileClose->setEnabled(!enable); ui->action_FileSaveStateFile->setEnabled(!enable); @@ -212,9 +211,9 @@ void MainWindow::UpdateMenus() ui->action_DebugDisplayList->setEnabled(!enable); enable = !Core_IsStepping() ? false : true; - ui->action_EmulationRun->setEnabled(g_State.bEmuThreadStarted ? enable : false); - ui->action_EmulationPause->setEnabled(g_State.bEmuThreadStarted ? !enable : false); - ui->action_EmulationReset->setEnabled(g_State.bEmuThreadStarted ? true : false); + ui->action_EmulationRun->setEnabled(false); + ui->action_EmulationPause->setEnabled(true); + ui->action_EmulationReset->setEnabled(true); // checking ui->action_EmulationRunLoad->setChecked(g_Config.bAutoRun); @@ -419,13 +418,10 @@ void MainWindow::on_action_FileExit_triggered() void MainWindow::on_action_EmulationRun_triggered() { - if (g_State.bEmuThreadStarted) + if(dialogDisasm) { - if(dialogDisasm) - { - dialogDisasm->Stop(); - dialogDisasm->Go(); - } + dialogDisasm->Stop(); + dialogDisasm->Go(); } }