diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-11 11:32:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-11 11:32:29 +0300 |
commit | b2bb9ca39a687efc5dd1014e78650e39452d7cbf (patch) | |
tree | ff81299979056c20a9099a68f3b0254eb513cb29 /source/blender | |
parent | 1dfc7942d3f35cbb8bb0e94fec57828da0eb756c (diff) |
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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 14 |
3 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index a4e093644c3..fe79e9b4285 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1563,7 +1563,7 @@ void BIF_draw_manipulator(const bContext *C) break; } - mul_mat3_m4_fl((float *)rv3d->twmat, get_manipulator_drawsize(ar)); + mul_mat3_m4_fl(rv3d->twmat, get_manipulator_drawsize(ar)); } if(v3d->twflag & V3D_DRAW_MANIPULATOR) { diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index a784a1d560a..554418e6483 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -86,6 +86,8 @@ void WM_timecursor (struct wmWindow *win, int nr); void *WM_paint_cursor_activate(struct wmWindowManager *wm, int (*poll)(struct bContext *C), void (*draw)(struct bContext *C, int, int, void *customdata), void *customdata); void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle); +void WM_cursor_warp (struct wmWindow *win, int x, int y); + /* keyconfig and keymap */ wmKeyConfig *WM_keyconfig_add (struct wmWindowManager *wm, char *idname); void WM_keyconfig_free (struct wmKeyConfig *keyconf); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index ae6d9ddb425..a4a22f347b7 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -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; + } +}
\ No newline at end of file |