X-Git-Url: http://git.localhorst.tv/?p=space.git;a=blobdiff_plain;f=src%2Fgraphics%2FCamera.h;h=ad1a997ef6383cad9283ff884321b46133822e33;hp=e40b051bc64d78c18479fdbcac6f276049a0e830;hb=a1fd5c4181db1da990b6280892eb1b9f31b73871;hpb=2d0a41dc0a53915153ceccda914d59affd388864 diff --git a/src/graphics/Camera.h b/src/graphics/Camera.h index e40b051..ad1a997 100644 --- a/src/graphics/Camera.h +++ b/src/graphics/Camera.h @@ -18,8 +18,10 @@ public: void Resize(int w, int h); void Update(float deltaT); - void DoubleZoom(); - void HalfZoom(); + void StartZoom(); + void StopZoom(); + void StartShrink(); + void StopShrink(); Vector ToScreen(Vector v) const { return Vector(OffsetOf(v)); @@ -28,20 +30,15 @@ public: return ToScale(v - *target) + offset; } Vector ToScale(Vector v) const { - if (zoom == 0) { - return v; - } else if (zoom > 0) { - return v * float(1 << zoom); - } else { - return v / float(1 << -zoom); - } + return v * zoom; } private: const Vector *target; Vector offset; - int zoom; + float zoom; + int zoomAcc; };