diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index d57bba7063..d0a56195c9 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -23,6 +23,7 @@ #include "Gif_Unit.h" #include "MTVU.h" #include "Elfheader.h" +#include "PAD/Linux/PAD.h" // Uncomment this to enable profiling of the GS RingBufferCopy function. @@ -450,7 +451,7 @@ void SysMtgsThread::ExecuteTaskInThread() // if we're not using GSOpen2, then the GS window is on this thread (MTGS thread), // so we need to call PADupdate from here. - if ((GSopen2 == NULL) && (PADupdate != NULL)) + if (GSopen2 == NULL) PADupdate(0); m_QueuedFrameCount.fetch_sub(1); diff --git a/pcsx2/PAD/Linux/PAD.h b/pcsx2/PAD/Linux/PAD.h index 1a5d43634b..902c2be18a 100644 --- a/pcsx2/PAD/Linux/PAD.h +++ b/pcsx2/PAD/Linux/PAD.h @@ -46,7 +46,6 @@ #include #define PADdefs -#include "PS2Edefs.h" enum PadOptions { PADOPTION_FORCEFEEDBACK = 0x1, @@ -110,7 +109,7 @@ enum gamePadValues { extern FILE *padLog; extern void initLogging(); -#define PAD_LOG __Log +//#define PAD_LOG __Log //#define PAD_LOG __LogToConsole extern keyEvent event; diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index db6319dd2f..a7ea28f9a6 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -20,6 +20,7 @@ #include "ConsoleLogger.h" #include "Sio.h" #include "sio_internal.h" +#include "PAD/Linux/PAD.h" #ifndef DISABLE_RECORDING # include "Recording/InputRecording.h" diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 6a00b7a3ff..2c03921311 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -21,6 +21,7 @@ #include "AppSaveStates.h" #include "AppGameDatabase.h" #include "AppAccelerators.h" +#include "PAD/Linux/PAD.h" #include "Plugins.h" #include "ps2/BiosTools.h" @@ -567,7 +568,7 @@ void Pcsx2App::LogicalVsync() // Only call PADupdate here if we're using GSopen2. Legacy GSopen plugins have the // GS window belonging to the MTGS thread. - if( (PADupdate != NULL) && (GSopen2 != NULL) && (wxGetApp().GetGsFramePtr() != NULL) ) + if( (GSopen2 != NULL) && (wxGetApp().GetGsFramePtr() != NULL) ) PADupdate(0); while( const keyEvent* ev = PADkeyEvent() ) diff --git a/pcsx2/gui/FrameForGS.cpp b/pcsx2/gui/FrameForGS.cpp index 42c701903c..81d954cbf6 100644 --- a/pcsx2/gui/FrameForGS.cpp +++ b/pcsx2/gui/FrameForGS.cpp @@ -22,6 +22,7 @@ #include "GS.h" #include "MainFrame.h" #include "MSWstuff.h" +#include "PAD/Linux/PAD.h" #include "ConsoleLogger.h" @@ -314,7 +315,7 @@ void GSPanel::OnMouseEvent( wxMouseEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { + if( (GSopen2 != NULL) ) { keyEvent event; // FIXME how to handle double click ??? if (evt.ButtonDown()) { @@ -377,7 +378,7 @@ void GSPanel::OnKeyDownOrUp( wxKeyEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { + if( (GSopen2 != NULL) ) { keyEvent event; event.key = evt.GetRawKeyCode(); if (evt.GetEventType() == wxEVT_KEY_UP) @@ -410,7 +411,7 @@ void GSPanel::OnKeyDownOrUp( wxKeyEvent& evt ) evt.m_keyCode += (int)'a' - 'A'; #endif - if ((PADopen != NULL) && CoreThread.IsOpen()) + if (CoreThread.IsOpen()) { return; } @@ -442,8 +443,7 @@ void GSPanel::DirectKeyCommand( wxKeyEvent& evt ) void GSPanel::UpdateScreensaver() { - bool prevent = g_Conf->GSWindow.DisableScreenSaver - && m_HasFocus && m_coreRunning; + bool prevent = g_Conf->GSWindow.DisableScreenSaver && m_HasFocus && m_coreRunning; ScreensaverAllow(!prevent); } @@ -463,7 +463,7 @@ void GSPanel::OnFocus( wxFocusEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { + if((GSopen2 != NULL) ) { keyEvent event = {0, 9}; // X equivalent of FocusIn; PADWriteEvent(event); } @@ -481,7 +481,7 @@ void GSPanel::OnFocusLost( wxFocusEvent& evt ) #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. - if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { + if((GSopen2 != NULL) ) { keyEvent event = {0, 10}; // X equivalent of FocusOut PADWriteEvent(event); }