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:
Diffstat (limited to 'source/gameengine/GameLogic/SCA_MouseManager.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_MouseManager.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/gameengine/GameLogic/SCA_MouseManager.cpp b/source/gameengine/GameLogic/SCA_MouseManager.cpp
index 4f5d199e163..f7f9a566c8d 100644
--- a/source/gameengine/GameLogic/SCA_MouseManager.cpp
+++ b/source/gameengine/GameLogic/SCA_MouseManager.cpp
@@ -30,10 +30,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
// This warning tells us about truncation of __long__ stl-generated names.
// It can occasionally cause DevStudio to have internal compiler warnings.
@@ -44,12 +40,15 @@
#include "SCA_MouseManager.h"
#include "SCA_MouseSensor.h"
#include "IntValue.h"
+#include "RAS_ICanvas.h"
SCA_MouseManager::SCA_MouseManager(SCA_LogicManager* logicmgr,
- SCA_IInputDevice* mousedev)
+ SCA_IInputDevice* mousedev,
+ RAS_ICanvas* canvas)
: SCA_EventManager(logicmgr, MOUSE_EVENTMGR),
- m_mousedevice (mousedev)
+ m_mousedevice (mousedev),
+ m_canvas(canvas)
{
m_xpos = 0;
m_ypos = 0;
@@ -82,12 +81,13 @@ void SCA_MouseManager::NextFrame()
// coordinates
if (!mousesensor->IsSuspended())
{
- const SCA_InputEvent& event =
+ const SCA_InputEvent& event1 =
m_mousedevice->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
- int mx = event.m_eventval;
const SCA_InputEvent& event2 =
m_mousedevice->GetEventValue(SCA_IInputDevice::KX_MOUSEY);
- int my = event2.m_eventval;
+
+ int mx = this->m_canvas->GetMouseX(event1.m_eventval);
+ int my = this->m_canvas->GetMouseY(event2.m_eventval);
mousesensor->setX(mx);
mousesensor->setY(my);