Get the wiimote new plugin working in linux. Wiimote emulation works at least. Real wiimotes don't.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5399 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-04-23 04:46:42 +00:00
parent 219e8beb6d
commit 05e3808beb
4 changed files with 71 additions and 9 deletions

View File

@ -12,6 +12,10 @@
#if defined(HAVE_X11) && HAVE_X11
#include <X11/Xlib.h>
#if defined(HAVE_WX) && HAVE_WX
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#endif
#endif
#define PLUGIN_VERSION 0x0100
@ -232,14 +236,24 @@ void GetDllInfo(PLUGIN_INFO* _pPluginInfo)
//
void DllConfig(HWND _hParent)
{
#if defined(HAVE_WX) && HAVE_WX
bool was_init = false;
if ( g_plugin.controller_interface.IsInit() ) // hack for showing dialog when game isnt running
was_init = true;
else
InitPlugin( _hParent );
{
#if defined(HAVE_X11) && HAVE_X11
Window win = GDK_WINDOW_XID(GTK_WIDGET(_hParent)->window);
g_WiimoteInitialize.hWnd = GDK_WINDOW_XDISPLAY(GTK_WIDGET(_hParent)->window);
g_WiimoteInitialize.pXWindow = &win;
InitPlugin(g_WiimoteInitialize.hWnd);
#else
InitPlugin(_hParent);
#endif
}
// copied from GCPad
#if defined(HAVE_WX) && HAVE_WX
wxWindow *frame = GetParentedWxWindow(_hParent);
ConfigDialog* m_ConfigFrame = new ConfigDialog( frame, g_plugin, PLUGIN_FULL_NAME, was_init );
@ -260,11 +274,11 @@ void DllConfig(HWND _hParent)
m_ConfigFrame->Destroy();
m_ConfigFrame = NULL;
frame->Destroy();
#endif
// /
if ( false == was_init ) // hack for showing dialog when game isnt running
DeInitPlugin();
#endif
}
// ___________________________________________________________________________
@ -299,7 +313,7 @@ void Initialize(void *init)
{
g_WiimoteInitialize = *(SWiimoteInitialize*)init;
if ( false == g_plugin.controller_interface.IsInit() )
InitPlugin( ((SPADInitialize*)init)->hWnd );
InitPlugin( g_WiimoteInitialize.hWnd );
}
// ___________________________________________________________________________