mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
New Wiimote Plugin: Moved Linux cursor position code into ControllerInterface/Xlib. (absolute cursor position can be mapped to something other than IR camera) (code fixed by Glennrics) Put the UDP Wiimote dialog's Update Buttons,Update IR,Update Nunchuk... checkboxes in an "Update" group box. Fixed some Linux config dialog problems. (thanks Glennrics again) Some other minor cleanup in ControllerInterface. (changed some std::string/stringstream to char[] where possible) Removed a warning in DX11 plugin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5880 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -319,36 +319,3 @@ void ControllerEmu::LoadDefaults(const ControllerInterface &ciface)
|
||||
UpdateDefaultDevice();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove this hackery
|
||||
void GetMousePos(float& x, float& y, const SWiimoteInitialize* const wiimote_initialize)
|
||||
{
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
|
||||
unsigned int win_width = 2, win_height = 2;
|
||||
int root_x, root_y;
|
||||
struct
|
||||
{
|
||||
int x, y;
|
||||
} point = { 1, 1 };
|
||||
|
||||
Display* const wm_display = (Display*)wiimote_initialize->hWnd;
|
||||
Window glwin = *(Window *)wiimote_initialize->pXWindow;
|
||||
|
||||
XWindowAttributes win_attribs;
|
||||
XGetWindowAttributes (wm_display, glwin, &win_attribs);
|
||||
win_width = win_attribs.width;
|
||||
win_height = win_attribs.height;
|
||||
Window root_dummy, child_win;
|
||||
unsigned int mask;
|
||||
XQueryPointer(wm_display, glwin, &root_dummy, &child_win, &root_x, &root_y, &point.x, &point.y, &mask);
|
||||
|
||||
// Return the mouse position as a range from -1 to 1
|
||||
x = (float)point.x / (float)win_width * 2 - 1;
|
||||
y = (float)point.y / (float)win_height * 2 - 1;
|
||||
#else
|
||||
|
||||
x = 0;
|
||||
y = 0;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user