X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;h=74ebd5f6fb3759f99870ec618af5ed20b5c707e6;hb=1129b8ac89f1e614f69793227ccec90157708aea;hp=553b74f77f0f9afbd36e1f6373d1b7b41bda50b5;hpb=a1fd5c4181db1da990b6280892eb1b9f31b73871;p=space.git diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index 553b74f..74ebd5f 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -3,16 +3,19 @@ namespace space { -Camera::Camera(int w, int h, const Vector &t) +Camera::Camera(Vector s, const Vector &t) : target(&t) -, offset(w/2, h/2) -, zoom(1) { +, size(s) +, offset(size / 2) +, zoom(1) +, zoomAcc(0) { } -void Camera::Resize(int w, int h) { - offset = Vector(w/2, h/2); +void Camera::Resize(Vector s) { + size = s; + offset = size / 2; } void Camera::Update(float delta) {