| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -47,7 +47,7 @@ void EmuThread::run()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void EmuThread::Stop()
 | 
					 | 
					 | 
					 | 
					void EmuThread::Stop()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (!isRunning())
 | 
					 | 
					 | 
					 | 
					    if (!isRunning())
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    {
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning...");
 | 
					 | 
					 | 
					 | 
					        INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning...");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return;
 | 
					 | 
					 | 
					 | 
					        return;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -62,7 +62,7 @@ void EmuThread::Stop()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        terminate();
 | 
					 | 
					 | 
					 | 
					        terminate();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        wait(1000);
 | 
					 | 
					 | 
					 | 
					        wait(1000);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (isRunning())
 | 
					 | 
					 | 
					 | 
					        if (isRunning())
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here...");
 | 
					 | 
					 | 
					 | 
					            WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here...");
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    INFO_LOG(MASTER_LOG, "EmuThread stopped");
 | 
					 | 
					 | 
					 | 
					    INFO_LOG(MASTER_LOG, "EmuThread stopped");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -75,8 +75,8 @@ class GGLWidgetInternal : public QGLWidget
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					public:
 | 
					 | 
					 | 
					 | 
					public:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent)
 | 
					 | 
					 | 
					 | 
					    GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    {
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							doneCurrent();
 | 
					 | 
					 | 
					 | 
					        doneCurrent();
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							parent_ = parent;
 | 
					 | 
					 | 
					 | 
					        parent_ = parent;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    void paintEvent(QPaintEvent* ev)
 | 
					 | 
					 | 
					 | 
					    void paintEvent(QPaintEvent* ev)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -102,11 +102,11 @@ EmuThread& GRenderWindow::GetEmuThread()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this)
 | 
					 | 
					 | 
					 | 
					GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
 | 
					 | 
					 | 
					 | 
					    // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						QGLFormat fmt;
 | 
					 | 
					 | 
					 | 
					    QGLFormat fmt;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						fmt.setProfile(QGLFormat::CoreProfile);
 | 
					 | 
					 | 
					 | 
					    fmt.setProfile(QGLFormat::CoreProfile);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						fmt.setVersion(4,1);
 | 
					 | 
					 | 
					 | 
					    fmt.setVersion(4,1);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						fmt.setSampleBuffers(true);
 | 
					 | 
					 | 
					 | 
					    fmt.setSampleBuffers(true);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						fmt.setSamples(4);
 | 
					 | 
					 | 
					 | 
					    fmt.setSamples(4);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    
 | 
					 | 
					 | 
					 | 
					    
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    child = new GGLWidgetInternal(fmt, this);
 | 
					 | 
					 | 
					 | 
					    child = new GGLWidgetInternal(fmt, this);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QBoxLayout* layout = new QHBoxLayout(this);
 | 
					 | 
					 | 
					 | 
					    QBoxLayout* layout = new QHBoxLayout(this);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -148,12 +148,12 @@ void GRenderWindow::DoneCurrent()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void GRenderWindow::PollEvents() {
 | 
					 | 
					 | 
					 | 
					void GRenderWindow::PollEvents() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title
 | 
					 | 
					 | 
					 | 
					    // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    //  from the main thread, but this should probably be in an event handler...
 | 
					 | 
					 | 
					 | 
					    //  from the main thread, but this should probably be in an event handler...
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/*
 | 
					 | 
					 | 
					 | 
					    /*
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						static char title[128];
 | 
					 | 
					 | 
					 | 
					    static char title[128];
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), 
 | 
					 | 
					 | 
					 | 
					    sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), 
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        video_core::g_renderer->current_fps());
 | 
					 | 
					 | 
					 | 
					        video_core::g_renderer->current_fps());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    setWindowTitle(title);
 | 
					 | 
					 | 
					 | 
					    setWindowTitle(title);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						*/
 | 
					 | 
					 | 
					 | 
					    */
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void GRenderWindow::BackupGeometry()
 | 
					 | 
					 | 
					 | 
					void GRenderWindow::BackupGeometry()
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -186,26 +186,26 @@ QByteArray GRenderWindow::saveGeometry()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void GRenderWindow::keyPressEvent(QKeyEvent* event)
 | 
					 | 
					 | 
					 | 
					void GRenderWindow::keyPressEvent(QKeyEvent* event)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/*
 | 
					 | 
					 | 
					 | 
					    /*
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						bool key_processed = false;
 | 
					 | 
					 | 
					 | 
					    bool key_processed = false;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
 | 
					 | 
					 | 
					 | 
					    for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED))
 | 
					 | 
					 | 
					 | 
					        if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED))
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            key_processed = true;
 | 
					 | 
					 | 
					 | 
					            key_processed = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!key_processed)
 | 
					 | 
					 | 
					 | 
					    if (!key_processed)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        QWidget::keyPressEvent(event);
 | 
					 | 
					 | 
					 | 
					        QWidget::keyPressEvent(event);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						*/
 | 
					 | 
					 | 
					 | 
					    */
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void GRenderWindow::keyReleaseEvent(QKeyEvent* event)
 | 
					 | 
					 | 
					 | 
					void GRenderWindow::keyReleaseEvent(QKeyEvent* event)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/*
 | 
					 | 
					 | 
					 | 
					    /*
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						bool key_processed = false;
 | 
					 | 
					 | 
					 | 
					    bool key_processed = false;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
 | 
					 | 
					 | 
					 | 
					    for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED))
 | 
					 | 
					 | 
					 | 
					        if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED))
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            key_processed = true;
 | 
					 | 
					 | 
					 | 
					            key_processed = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!key_processed)
 | 
					 | 
					 | 
					 | 
					    if (!key_processed)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        QWidget::keyPressEvent(event);
 | 
					 | 
					 | 
					 | 
					        QWidget::keyPressEvent(event);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						*/
 | 
					 | 
					 | 
					 | 
					    */
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 |