optionally use guarded alloc for tiles compositor, also replace allocation functions...
[blender.git] / source / gameengine / GameLogic / SCA_MouseManager.cpp
index 19d7422df1dd564c1f8aa81faaf01efa6f577f62..a067b9c4d5b500d0919f22bf6570b12f5d698973 100644 (file)
@@ -1,8 +1,7 @@
-/**
+/*
  * Manager for mouse events
  *
  *
- * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifdef WIN32
+/** \file gameengine/GameLogic/SCA_MouseManager.cpp
+ *  \ingroup gamelogic
+ */
+
+
+#if defined(WIN32) && !defined(FREE_WINDOWS)
 // This warning tells us about truncation of __long__ stl-generated names.
 // It can occasionally cause DevStudio to have internal compiler warnings.
 #pragma warning( disable : 4786 )     
 #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;
@@ -78,12 +85,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);