X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;h=ad44c0494faf3333ee74b6131277c79b66b21f3d;hb=bace3ec042d1d7bdb2cea48f06d0af4dacbcc375;hp=6039586ffb7eca0caa7be2703753b977ea9f54a1;hpb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;p=l2e.git diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index 6039586..ad44c04 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -2,17 +2,18 @@ #include -using geometry::Vector; +using math::Fixed; +using math::Vector; namespace graphics { -Camera::Camera(int width, int height, const Vector *target) +Camera::Camera(int width, int height, const Vector > *target) : target(target), halfWidth(width / 2), halfHeight(height / 2) { } -void Camera::SetTarget(const Vector *t) { +void Camera::SetTarget(const Vector > *t) { target = t; } @@ -20,8 +21,8 @@ void Camera::SetTarget(const Vector *t) { Vector Camera::CalculateOffset() const { if (target) { return Vector( - (target->X() - halfWidth) * -1, - (target->Y() - halfHeight) * -1); + (target->X().Int() - halfWidth) * -1, + (target->Y().Int() - halfHeight) * -1); } else { return Vector(); }