summaryrefslogtreecommitdiff
path: root/src/being/actor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-05 02:38:49 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-05 03:16:32 +0300
commit31782ba3cdeced9baa91739c55e9ae819d70d616 (patch)
tree8de190fa01b37a960dd392fb6d3d159249bb1603 /src/being/actor.cpp
parent097ef639a433f5d87d675ee7551a1640788031bd (diff)
downloadmv-31782ba3cdeced9baa91739c55e9ae819d70d616.tar.gz
mv-31782ba3cdeced9baa91739c55e9ae819d70d616.tar.bz2
mv-31782ba3cdeced9baa91739c55e9ae819d70d616.tar.xz
mv-31782ba3cdeced9baa91739c55e9ae819d70d616.zip
Add pixel position into actor.
Diffstat (limited to 'src/being/actor.cpp')
-rw-r--r--src/being/actor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/being/actor.cpp b/src/being/actor.cpp
index b66435739..aebf00adb 100644
--- a/src/being/actor.cpp
+++ b/src/being/actor.cpp
@@ -26,6 +26,8 @@
#include "debug.h"
Actor::Actor() :
+ mPixelX(0),
+ mPixelY(0),
mMap(nullptr),
mPos(),
mYDiff(0),
@@ -70,3 +72,10 @@ int Actor::getTileY() const
return getPixelY() / mMap->getTileHeight();
}
+
+void Actor::setPixelPositionF(const Vector &restrict pos) restrict2
+{
+ mPos = pos;
+ mPixelX = CAST_S32(mPos.x);
+ mPixelY = CAST_S32(mPos.y);
+}