X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.cpp;h=74ebd5f6fb3759f99870ec618af5ed20b5c707e6;hb=1129b8ac89f1e614f69793227ccec90157708aea;hp=ad2587f3e755e5a06b5fc47300da564ee4a426fe;hpb=11306935dbf7213d583222ce239985e1b3f180bf;p=space.git diff --git a/src/graphics/Camera.cpp b/src/graphics/Camera.cpp index ad2587f..74ebd5f 100644 --- a/src/graphics/Camera.cpp +++ b/src/graphics/Camera.cpp @@ -3,17 +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) +, 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) {