From 537eb99372c9528d5db7d90ed521c26fb98b1709 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 10 May 2015 17:57:15 -0400 Subject: [PATCH] Notify user on use of procedural textures --- src/citra_qt/bootmanager.cpp | 8 ++++++-- src/citra_qt/bootmanager.h | 2 ++ src/citra_qt/main.cpp | 6 ++++++ src/citra_qt/main.h | 1 + src/video_core/rasterizer.cpp | 9 +++++++++ src/video_core/video_core.cpp | 4 ++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index d3df289f8..5cb4e8481 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -44,8 +44,12 @@ void EmuThread::run() { if (!was_active) emit DebugModeLeft(); - Core::RunLoop(); - + try { + Core::RunLoop(); + } catch (const char* str) { + emit UserError(str); + } + was_active = running || exec_step; if (!was_active && !stop_run) emit DebugModeEntered(); diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index d5d74c949..8b0a00a61 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -78,6 +78,8 @@ signals: * @warning When connecting to this signal from other threads, make sure to specify either Qt::QueuedConnection (invoke slot within the destination object's message thread) or even Qt::BlockingQueuedConnection (additionally block source thread until slot returns) */ void DebugModeLeft(); + + void UserError(const char* str); }; class GRenderWindow : public QWidget, public EmuWindow diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index f115c5b6a..2746a7646 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -219,6 +219,7 @@ void GMainWindow::BootGame(std::string filename) { connect(emu_thread.get(), SIGNAL(DebugModeLeft()), disasmWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection); connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection); connect(emu_thread.get(), SIGNAL(DebugModeLeft()), callstackWidget, SLOT(OnDebugModeLeft()), Qt::BlockingQueuedConnection); + connect(emu_thread.get(), SIGNAL(UserError(const char*)), this, SLOT(OnUserError(const char*))); // Update the GUI registersWidget->OnDebugModeEntered(); @@ -325,6 +326,11 @@ void GMainWindow::OnConfigure() //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this); } +void GMainWindow::OnUserError(const char* str) +{ + QMessageBox::information(this, "Error", str); +} + void GMainWindow::closeEvent(QCloseEvent* event) { // Save window layout diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 3e29534fb..de9810dea 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -70,6 +70,7 @@ private slots: void OnConfigure(); void OnDisplayTitleBars(bool); void ToggleWindowMode(); + void OnUserError(const char* str); private: Ui::MainWindow ui; diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 46a326bb4..5b8eb09c9 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -16,6 +16,8 @@ #include "vertex_shader.h" #include "video_core/utils.h" +extern bool thrown; + namespace Pica { namespace Rasterizer { @@ -404,6 +406,13 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, case Source::Texture2: return texture_color[2]; + case Source::Texture3: + if (!thrown) { + thrown = true; + throw "Uses procedural textures, tell bunnei!"; + } + return{ 255, 0, 255, 255 }; + case Source::PreviousBuffer: return combiner_buffer; diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 42e3bdd5b..e02bf89cd 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -14,6 +14,8 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // Video Core namespace +bool thrown = false; + namespace VideoCore { EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window @@ -26,6 +28,8 @@ void Init(EmuWindow* emu_window) { g_renderer->SetWindow(g_emu_window); g_renderer->Init(); + thrown = false; + LOG_DEBUG(Render, "initialized OK"); }