From b8790ff84da07774a2eb986ca6b9379a16a8ea7b Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 30 Sep 2012 16:24:14 +0200 Subject: [PATCH] changed camera target to float --- src/graphics/Camera.cpp | 4 ++-- src/graphics/Camera.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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; -- 2.39.2