X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=d68861c7a60c5a7006aefe234abd39d26d3af294;hb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;hp=be3197d9da4010fa6e9fc2100171c3e3d44a2f62;hpb=06db9f596cd1c5aa4c0832b387882f7c74c1b4c0;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index be3197d..d68861c 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -3,6 +3,7 @@ #include "../battle/fwd.h" #include "../battle/Monster.h" +#include "../math/Fixed.h" #include "../math/Vector.h" #include "../graphics/fwd.h" #include "../graphics/Animation.h" @@ -38,12 +39,12 @@ public: public: /// Pixel resolved position of the entity's top left corner on the map. - math::Vector &Position() { return position; } - const math::Vector &Position() const { return position; } + math::Vector > &Position() { return position; } + const math::Vector > &Position() const { return position; } /// Velocity of the entity in pixels per second. - math::Vector &Velocity() { return velocity; } - const math::Vector &Velocity() const { return velocity; } + math::Vector > &Velocity() { return velocity; } + const math::Vector > &Velocity() const { return velocity; } /// Offset of the entity's sprite's to left corner relative to Position(). math::Vector &SpriteOffset() { return spriteOffset; } @@ -79,7 +80,7 @@ public: Orientation GetOrientation() const { return orientation; } /// Set the entity's speed in pixels per second. /// This speed is then combined with the orientation to form a velocity. - void SetSpeed(float); + void SetSpeed(math::Fixed<8>); /// Change to a natural, relaxed animation state (row offset 0). void SetHandsFree(); @@ -127,7 +128,7 @@ public: bool TileLock(const math::Vector &tileSize) const; /// Integrate this entity's physical properties over given time interval. - void Update(float deltaT); + void Update(Uint32 deltaT); void Render(SDL_Surface *, const math::Vector &offset) const; @@ -148,10 +149,10 @@ private: graphics::AnimationRunner runner; math::Vector spriteOffset; math::Vector tilePosition; - math::Vector position; - math::Vector velocity; + math::Vector > position; + math::Vector > velocity; Orientation orientation; - float speed; + math::Fixed<8> speed; int flags; };