From 87319250b4c30770903c2fb7054ef33134a72a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Mon, 10 May 2021 18:02:23 +0200 Subject: [PATCH] improve camera zoom --- code/game/source/platform_raylib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/source/platform_raylib.c b/code/game/source/platform_raylib.c index 767e1c3..579b5a8 100644 --- a/code/game/source/platform_raylib.c +++ b/code/game/source/platform_raylib.c @@ -92,7 +92,7 @@ void platform_input() { float mouse_z = (GetMouseWheelMove()*0.5f); if (mouse_z != 0.0f) { - target_zoom = zpl_clamp(render_camera.zoom+mouse_z, 0.3f, 10.0f); + target_zoom = zpl_clamp(target_zoom+mouse_z, 0.3f, 10.0f); } // NOTE(zaklaus): keystate handling @@ -174,6 +174,7 @@ void display_conn_status() { } DrawFPS(0, 20); + DrawText(TextFormat("Zoom: %.02f", target_zoom), 0, 45, 20, WHITE); } void DEBUG_draw_ground(uint64_t key, entity_view * data) {