Notify user on use of procedural textures

This commit is contained in:
bunnei 2015-05-10 17:57:15 -04:00
parent ba0bfe7d82
commit 537eb99372
6 changed files with 28 additions and 2 deletions

View File

@ -44,7 +44,11 @@ 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)

View File

@ -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

View File

@ -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

View File

@ -70,6 +70,7 @@ private slots:
void OnConfigure();
void OnDisplayTitleBars(bool);
void ToggleWindowMode();
void OnUserError(const char* str);
private:
Ui::MainWindow ui;

View File

@ -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;

View File

@ -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");
}