X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;h=ad44c0494faf3333ee74b6131277c79b66b21f3d;hb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;hp=ee87e3f6f107e6cc4f314cbf47acf69d74c15280;hpb=06db9f596cd1c5aa4c0832b387882f7c74c1b4c0;p=l2e.git diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index ee87e3f..ad44c04 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -2,17 +2,18 @@ #include +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(); }