]> git.localhorst.tv Git - l2e.git/commitdiff
minor performance improvements
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 21 Jan 2013 20:51:29 +0000 (21:51 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 21 Jan 2013 20:51:29 +0000 (21:51 +0100)
src/map/Entity.cpp
src/math/Fixed.h

index 93530f142735021f063f8dab333f66d694680f51..6b6adaca3561e2d2f8aeeaf15d1eb369ce7b542d 100644 (file)
@@ -123,7 +123,7 @@ void Entity::UpdateVelocity() {
 bool Entity::TileLock(const math::Vector<int> &tileSize) const {
        // TODO: change position to point to the top-left corner of a tile
        Vector<int> tilePosition(ToInt(position));
-       return (tilePosition.X() % tileSize.X() == 0) && (tilePosition.Y() % tileSize.Y() == 0);
+       return tilePosition % tileSize == Vector<int>();
 }
 
 
index 7fe099cee57ea789f0cc631f9397c89da6165e94..7a5e13d5fa9f2f1f6c891c0dfc2fb9467de50dff 100644 (file)
@@ -51,7 +51,7 @@ public:
 public:
        int Int() const { return IntPart() * Sigma(); }
        int Sigma() const {
-               if (IntPart() == 0 && FracPart() == 0) {
+               if (RawInt() == 0) {
                        return 0;
                } else if (SignPart() == 0) {
                        return 1;