mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Fix an issue introduced in revision 5290 that caused a segmenation fault when GCPadNew was used in linux. The same issue made the IsFocus function useless in windows. The g_PADInitialize was never initialized.
Also added Xlib.cpp to the linux build. It is completely non-functional but it builds. Finally, did some clean up of GCPadNew.cpp. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5298 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -12,7 +12,6 @@
|
||||
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include <X11/Xlib.h>
|
||||
Display* GCdisplay;
|
||||
#endif
|
||||
|
||||
#define PLUGIN_VERSION 0x0100
|
||||
@ -55,10 +54,11 @@ bool IsFocus()
|
||||
else
|
||||
return false;
|
||||
#elif defined HAVE_X11 && HAVE_X11
|
||||
Display* GCdisplay = (Display*)g_PADInitialize->hWnd;
|
||||
Window GLWin = *(Window *)g_PADInitialize->pXWindow;
|
||||
Window FocusWin;
|
||||
int Revert;
|
||||
XGetInputFocus((Display*)g_PADInitialize->hWnd, &FocusWin, &Revert);
|
||||
XGetInputFocus(GCdisplay, &FocusWin, &Revert);
|
||||
XWindowAttributes WinAttribs;
|
||||
XGetWindowAttributes (GCdisplay, GLWin, &WinAttribs);
|
||||
return (GLWin != 0 && (GLWin == FocusWin || WinAttribs.override_redirect));
|
||||
@ -111,10 +111,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
|
||||
#endif
|
||||
|
||||
|
||||
// wut ??
|
||||
#define EXPORT
|
||||
#define CALL
|
||||
|
||||
int _last_numPAD = 4;
|
||||
|
||||
|
||||
@ -153,7 +149,7 @@ void InitPlugin( void* const hwnd )
|
||||
// input:
|
||||
// output:
|
||||
//
|
||||
EXPORT void CALL PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
{
|
||||
// why not, i guess
|
||||
if ( NULL == _pPADStatus )
|
||||
@ -206,7 +202,7 @@ EXPORT void CALL PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
// input: The key and if it's pressed or released
|
||||
// output: None
|
||||
//
|
||||
EXPORT void CALL PAD_Input(u16 _Key, u8 _UpDown)
|
||||
void PAD_Input(u16 _Key, u8 _UpDown)
|
||||
{
|
||||
// nofin
|
||||
}
|
||||
@ -217,7 +213,7 @@ EXPORT void CALL PAD_Input(u16 _Key, u8 _UpDown)
|
||||
// input: PAD number, Command type (Stop=0, Rumble=1, Stop Hard=2) and strength of Rumble
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
{
|
||||
// enter
|
||||
if ( g_plugin.controls_crit.TryEnter() )
|
||||
@ -240,7 +236,7 @@ EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStre
|
||||
// filled by the function. (see def above)
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo)
|
||||
void GetDllInfo(PLUGIN_INFO* _pPluginInfo)
|
||||
{
|
||||
// don't feel like messing around with all those strcpy functions and warnings
|
||||
//char *s1 = CIFACE_PLUGIN_FULL_NAME, *s2 = _pPluginInfo->Name;
|
||||
@ -257,7 +253,7 @@ EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo)
|
||||
// input: A handle to the window that calls this function
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL DllConfig(HWND _hParent)
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
bool was_init = false;
|
||||
if ( g_plugin.controller_interface.IsInit() ) // hack for showing dialog when game isnt running
|
||||
@ -300,7 +296,7 @@ EXPORT void CALL DllConfig(HWND _hParent)
|
||||
// input: a handle to the window that calls this function
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
{
|
||||
// wut?
|
||||
}
|
||||
@ -311,7 +307,7 @@ EXPORT void CALL DllDebugger(HWND _hParent, bool Show)
|
||||
// input: a pointer to the global struct
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
{
|
||||
// wut?
|
||||
}
|
||||
@ -322,8 +318,9 @@ EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
// input: Init
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL Initialize(void *init)
|
||||
void Initialize(void *init)
|
||||
{
|
||||
g_PADInitialize = (SPADInitialize*)init;
|
||||
if ( false == g_plugin.controller_interface.IsInit() )
|
||||
InitPlugin( ((SPADInitialize*)init)->hWnd );
|
||||
}
|
||||
@ -335,7 +332,7 @@ EXPORT void CALL Initialize(void *init)
|
||||
// input: none
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL Shutdown(void)
|
||||
void Shutdown(void)
|
||||
{
|
||||
//plugin.controls_crit.Enter(); // enter
|
||||
if ( g_plugin.controller_interface.IsInit() )
|
||||
@ -349,7 +346,7 @@ EXPORT void CALL Shutdown(void)
|
||||
// input/output: ptr
|
||||
// input: mode
|
||||
//
|
||||
EXPORT void CALL DoState(unsigned char **ptr, int mode)
|
||||
void DoState(unsigned char **ptr, int mode)
|
||||
{
|
||||
// prolly won't need this
|
||||
}
|
||||
@ -360,7 +357,7 @@ EXPORT void CALL DoState(unsigned char **ptr, int mode)
|
||||
// input: newState
|
||||
// output: none
|
||||
//
|
||||
EXPORT void CALL EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
// maybe use this later
|
||||
}
|
||||
|
Reference in New Issue
Block a user