Mitchell Stokes BGE MouseWarp patch + warning fix

[#19854] [bugfix] Fix for broken Rasterizer mouse functions
---
This patch fixes the embedded player's ability to control the mouse. For example, hiding and unhiding the mouse cursor
did not work in 2.5, nor could the mouse's position be controlled. This was because these parts still needed to be ported
to 2.5 window manager code.
This commit is contained in:
2009-11-11 08:32:29 +00:00
parent 1dfc7942d3
commit b2bb9ca39a
7 changed files with 39 additions and 25 deletions

View File

@@ -972,3 +972,17 @@ void WM_setprefsize(int stax, int stay, int sizx, int sizy)
prefsizy= sizy;
}
/* This function requires access to the GHOST_SystemHandle (g_system) */
void WM_cursor_warp(wmWindow *win, int x, int y)
{
if (win && win->ghostwin) {
int oldx=x, oldy=y;
y= win->sizey -y - 1;
GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y);
GHOST_SetCursorPosition(g_system, x, y);
win->eventstate->prevx= oldx;
win->eventstate->prevy= oldy;
}
}