Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-11-11 11:32:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-11 11:32:29 +0300
commitb2bb9ca39a687efc5dd1014e78650e39452d7cbf (patch)
treeff81299979056c20a9099a68f3b0254eb513cb29 /source/gameengine
parent1dfc7942d3f35cbb8bb0e94fec57828da0eb756c (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/gameengine')
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp8
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.h2
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.cpp28
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.h8
4 files changed, 22 insertions, 24 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 73803846d70..e53a96ad9f6 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -138,17 +138,17 @@ void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate)
{
case MOUSE_INVISIBLE:
{
- BL_HideMouse();
+ BL_HideMouse(m_win);
break;
}
case MOUSE_WAIT:
{
- BL_WaitMouse();
+ BL_WaitMouse(m_win);
break;
}
case MOUSE_NORMAL:
{
- BL_NormalMouse();
+ BL_NormalMouse(m_win);
break;
}
default:
@@ -166,7 +166,7 @@ void KX_BlenderCanvas::SetMousePosition(int x,int y)
int winY = m_frame_rect.GetBottom();
int winH = m_frame_rect.GetHeight();
- BL_warp_pointer(winX + x, winY + (winH-y-1));
+ BL_warp_pointer(m_win, winX + x, winY + (winH-y-1));
}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
index 5967ce78b46..2c6962b5863 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
@@ -64,7 +64,7 @@ public:
*
* @param area The Blender ARegion to run the game within.
*/
- KX_BlenderCanvas(struct wmWindow* win, struct RAS_Rect &rect);
+ KX_BlenderCanvas(struct wmWindow* win, class RAS_Rect &rect);
~KX_BlenderCanvas();
void
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index bb02f3b372e..b718dfc1acd 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -73,11 +73,11 @@ extern "C" {
#include "BKE_image.h"
extern "C" {
-//XXX #include "BDR_drawmesh.h"
-//XXX #include "BIF_mywindow.h"
-//XXX #include "BIF_toolbox.h"
-//XXX #include "BIF_graphics.h" /* For CURSOR_NONE CURSOR_WAIT CURSOR_STD */
-void wm_window_swap_buffers(wmWindow *win); // wm_window.h
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_event_system.h"
+#include "wm_cursors.h"
+#include "wm_window.h"
}
/* end of blender block */
@@ -90,16 +90,14 @@ void spack(unsigned int ucol)
glColor3ub(cp[3], cp[2], cp[1]);
}
-void BL_warp_pointer(int x,int y)
+void BL_warp_pointer(wmWindow *win, int x,int y)
{
- //XXX warp_pointer(x,y);
+ WM_cursor_warp(win, x, y);
}
void BL_SwapBuffers(wmWindow *win)
{
- //wmWindow *window= CTX_wm_window(C);
wm_window_swap_buffers(win);
- //XXX myswapbuffers();
}
void DisableForText()
@@ -194,21 +192,21 @@ void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int widt
glEnable(GL_DEPTH_TEST);
}
-void BL_HideMouse()
+void BL_HideMouse(wmWindow *win)
{
- //XXX set_cursor(CURSOR_NONE);
+ WM_cursor_set(win, CURSOR_NONE);
}
-void BL_WaitMouse()
+void BL_WaitMouse(wmWindow *win)
{
- //XXX set_cursor(CURSOR_WAIT);
+ WM_cursor_set(win, CURSOR_WAIT);
}
-void BL_NormalMouse()
+void BL_NormalMouse(wmWindow *win)
{
- //XXX set_cursor(CURSOR_STD);
+ WM_cursor_set(win, CURSOR_STD);
}
#define MAX_FILE_LENGTH 512
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
index 5c947ff630e..d93b5eeabc5 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h
@@ -39,13 +39,13 @@ struct ARegion;
// special swapbuffers, that takes care of which area (viewport) needs to be swapped
void BL_SwapBuffers(struct wmWindow *win);
-void BL_warp_pointer(int x,int y);
+void BL_warp_pointer(struct wmWindow *win,int x,int y);
void BL_MakeScreenShot(struct ARegion *ar, const char* filename);
-void BL_HideMouse();
-void BL_NormalMouse();
-void BL_WaitMouse();
+void BL_HideMouse(struct wmWindow *win);
+void BL_NormalMouse(struct wmWindow *win);
+void BL_WaitMouse(struct wmWindow *win);
void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height);
void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height);