From: Daniel Karbach Date: Sun, 30 Sep 2012 14:24:14 +0000 (+0200) Subject: changed camera target to float X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=b8790ff84da07774a2eb986ca6b9379a16a8ea7b;p=l2e.git changed camera target to float --- diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index d43864a..a0773db 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -13,13 +13,13 @@ using geometry::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) { assert(target && "construct camera without target"); } -void Camera::SetTarget(const Vector *t) { +void Camera::SetTarget(const Vector *t) { assert(t && "cannot change camera target to 0"); target = t; } diff --git a/src/graphics/Camera.h b/src/graphics/Camera.h index 16c0caf..b35acf9 100644 --- a/src/graphics/Camera.h +++ b/src/graphics/Camera.h @@ -15,17 +15,17 @@ namespace graphics { class Camera { public: - Camera(int width, int height, const geometry::Vector *target); + Camera(int width, int height, const geometry::Vector *target); ~Camera() { } public: void Resize(int w, int h) { halfWidth = w / 2; halfHeight = h / 2; } - void SetTarget(const geometry::Vector *t); + void SetTarget(const geometry::Vector *t); geometry::Vector CalculateOffset() const; private: - const geometry::Vector *target; + const geometry::Vector *target; int halfWidth; int halfHeight;