X-Git-Url: http://git.localhorst.tv/?p=space.git;a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;fp=src%2Fgraphics%2FCamera.cpp;h=ea2f97de328f5270a0edeab91c998d9444b9aefa;hp=ad2587f3e755e5a06b5fc47300da564ee4a426fe;hb=08d0e47634e1632c96ebe3308535a86f5e625b40;hpb=11306935dbf7213d583222ce239985e1b3f180bf diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index ad2587f..ea2f97d 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -5,7 +5,8 @@ namespace space { Camera::Camera(int w, int h, const Vector &t) : target(&t) -, offset(w/2, h/2) +, size(w, h) +, offset(size / 2) , zoom(1) , zoomAcc(0) { @@ -13,7 +14,8 @@ Camera::Camera(int w, int h, const Vector &t) void Camera::Resize(int w, int h) { - offset = Vector(w/2, h/2); + size = Vector(w, h); + offset = size / 2; } void Camera::Update(float delta) {