summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-22 00:38:17 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-22 00:38:17 +0200
commit0ff419560d5a567afaa0294968cc1f5b5e6b597b (patch)
tree03edeac0b7850348b9b910e0d39dd88a477afd75 /src/object
parent15ff1d512b9e103396144bec1cd8004ecf4f7f9c (diff)
downloadcolobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.gz
colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.tar.bz2
colobot-0ff419560d5a567afaa0294968cc1f5b5e6b597b.zip
Event fixes & refactoring
- added new state tracking to Event - removed old fields from Event - fixed some issues with Events and fps counter
Diffstat (limited to 'src/object')
-rw-r--r--src/object/brain.cpp2
-rw-r--r--src/object/robotmain.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/object/brain.cpp b/src/object/brain.cpp
index 953f878..7b580d7 100644
--- a/src/object/brain.cpp
+++ b/src/object/brain.cpp
@@ -578,7 +578,7 @@ bool CBrain::EventProcess(const Event &event)
}
if ( action == EVENT_OBJECT_TARGET && !m_object->GetTrainer() )
{
- err = StartTaskGunGoal((event.pos.y-0.50f)*1.3f, (event.pos.x-0.50f)*2.0f);
+ err = StartTaskGunGoal((event.mousePos.y-0.50f)*1.3f, (event.mousePos.x-0.50f)*2.0f);
}
if ( action == EVENT_OBJECT_FIREANT )
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 508e692..93e1fda 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -1333,8 +1333,8 @@ bool CRobotMain::EventProcess(Event &event)
{
if (event.type == EVENT_MOUSE_MOVE)
{
- m_lastMousePos = event.pos;
- HiliteObject(event.pos);
+ m_lastMousePos = event.mousePos;
+ HiliteObject(event.mousePos);
}
return false;
}
@@ -1344,8 +1344,8 @@ bool CRobotMain::EventProcess(Event &event)
if (event.type == EVENT_MOUSE_MOVE)
{
- m_lastMousePos = event.pos;
- HiliteObject(event.pos);
+ m_lastMousePos = event.mousePos;
+ HiliteObject(event.mousePos);
}
if (m_displayInfo != nullptr) // current info?
@@ -1514,7 +1514,7 @@ bool CRobotMain::EventProcess(Event &event)
if (event.mouseButton.button != 1) // only left mouse button
break;
- obj = DetectObject(event.pos);
+ obj = DetectObject(event.mousePos);
if (!m_shortCut) obj = nullptr;
if (obj != nullptr && obj->GetType() == OBJECT_TOTO)
{