mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 20:54:28 +00: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:
parent
f727139ebf
commit
73caf37bca
@ -40,7 +40,7 @@ void ControllerInterface::Init()
|
||||
ciface::DirectInput::Init( m_devices/*, (HWND)m_hwnd*/ );
|
||||
#endif
|
||||
#ifdef CIFACE_USE_XLIB
|
||||
ciface::XLIB::Init( m_devices, m_hwnd );
|
||||
ciface::Xlib::Init( m_devices, m_hwnd );
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
ciface::OSX::Init( m_devices, m_hwnd );
|
||||
|
@ -14,7 +14,7 @@ void Init( std::vector<ControllerInterface::Device*>& devices, void* const hwnd
|
||||
{
|
||||
// mouse will be added to this, Keyboard class will be turned into KeyboardMouse
|
||||
// single device for combined keyboard/mouse, this will allow combinations like shift+click more easily
|
||||
devices.push_back( new Keyboard( (Display*)display ) );
|
||||
devices.push_back( new Keyboard( (Display*)hwnd ) );
|
||||
}
|
||||
|
||||
Keyboard::Keyboard( Display* const display ) : m_display(display)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -9,28 +9,30 @@ padenv = env.Clone()
|
||||
files = [
|
||||
'Config.cpp',
|
||||
'ControllerEmu.cpp',
|
||||
'ControllerEmu/GCPad/GCPad.cpp',
|
||||
'ControllerEmu/GCPad/GCPad.cpp',
|
||||
'GCPadNew.cpp',
|
||||
'ControllerInterface/ControllerInterface.cpp',
|
||||
'IniFile.cpp',
|
||||
]
|
||||
'IniFile.cpp'
|
||||
]
|
||||
|
||||
if padenv['HAVE_SDL']:
|
||||
files += [ 'ControllerInterface/SDL/SDL.cpp' ]
|
||||
files += [ 'ControllerInterface/SDL/SDL.cpp' ]
|
||||
if sys.platform == 'darwin':
|
||||
files += [ 'ControllerInterface/OSX/OSX.cpp', 'ControllerInterface/OSX/OSXPrivate.mm' ]
|
||||
files += [ 'ControllerInterface/OSX/OSX.cpp', 'ControllerInterface/OSX/OSXPrivate.mm' ]
|
||||
if sys.platform == 'linux2':
|
||||
files += [ 'ControllerInterface/Xlib/Xlib.cpp' ]
|
||||
|
||||
if padenv['HAVE_WX']:
|
||||
files += [
|
||||
'ConfigDiag.cpp',
|
||||
'ConfigDiagBitmaps.cpp',
|
||||
]
|
||||
files += [
|
||||
'ConfigDiag.cpp',
|
||||
'ConfigDiagBitmaps.cpp',
|
||||
]
|
||||
|
||||
padenv.Append(
|
||||
LIBS = [ 'inputcommon', 'common', ],
|
||||
LIBS = [ 'inputcommon', 'common' ],
|
||||
)
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
padenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'Cocoa', ]
|
||||
padenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'Cocoa' ]
|
||||
|
||||
padenv.SharedLibrary(env['plugin_dir']+name, files)
|
||||
|
Loading…
x
Reference in New Issue
Block a user