X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;h=ad44c0494faf3333ee74b6131277c79b66b21f3d;hb=ce1e9a11c89c83356d797c8225369b711513a4da;hp=e882eb19a322f32231f501d286f24109edb397fd;hpb=978ccdf2644bc445c864dbe581ead365b238cff8;p=l2e.git diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index e882eb1..ad44c04 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -1,25 +1,19 @@ -/* - * Camera.cpp - * - * Created on: Sep 29, 2012 - * Author: holy - */ - #include "Camera.h" #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; } @@ -27,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(); }