]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
switched geometric scalars from floating to fixed
[l2e.git] / src / main.cpp
index a890871fb4c162dd12399ff1baa0190f5a6d7dc8..05f3d8ad231057619d140110c6f6b42b0cc95abc 100644 (file)
@@ -17,6 +17,7 @@
 #include "common/Script.h"
 #include "common/Spell.h"
 #include "common/Stats.h"
+#include "math/Fixed.h"
 #include "math/Vector.h"
 #include "graphics/CharSelect.h"
 #include "graphics/ComplexAnimation.h"
@@ -63,6 +64,7 @@ using common::GameConfig;
 using common::GameState;
 using common::Hero;
 using common::Spell;
+using math::Fixed;
 using math::Vector;
 using graphics::Texture;
 using loader::Caster;
@@ -87,7 +89,7 @@ int main(int argc, char **argv) {
        const int width = 512;
        const int height = 448;
 
-       const float walkSpeed = 128.0f;
+       const Fixed<8> walkSpeed = Fixed<8>(1, 8);
 
        bool battle(false);
 
@@ -278,17 +280,17 @@ int main(int argc, char **argv) {
                gameState.heroes[3].SetEquipment(Hero::EQUIP_RING, caster.GetItem("rocketRingItem"));
                gameState.heroes[3].SetEquipment(Hero::EQUIP_JEWEL, caster.GetItem("krakenRockItem"));
 
-               gameState.heroes[0].MapEntity().Position() = Vector<float>(64, 128);
+               gameState.heroes[0].MapEntity().Position() = Vector<Fixed<8> >(64, 128);
 
-               gameState.heroes[1].MapEntity().Position() = Vector<float>(64, 128);
+               gameState.heroes[1].MapEntity().Position() = Vector<Fixed<8> >(64, 128);
                gameState.heroes[1].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING);
                gameState.heroes[0].MapEntity().AddFollower(&gameState.heroes[1].MapEntity());
 
-               gameState.heroes[2].MapEntity().Position() = Vector<float>(64, 128);
+               gameState.heroes[2].MapEntity().Position() = Vector<Fixed<8> >(64, 128);
                gameState.heroes[2].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING);
                gameState.heroes[1].MapEntity().AddFollower(&gameState.heroes[2].MapEntity());
 
-               gameState.heroes[3].MapEntity().Position() = Vector<float>(64, 128);
+               gameState.heroes[3].MapEntity().Position() = Vector<Fixed<8> >(64, 128);
                gameState.heroes[3].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING);
                gameState.heroes[2].MapEntity().AddFollower(&gameState.heroes[3].MapEntity());