From 7e89f42c388b92f264f58c4750e8529745a1f9f4 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 14 Mar 2022 16:24:01 -0400 Subject: a lot faster now thanks to only ticking on-screen every loop flickering while moving now though --- src/game.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 62e755b..af57b56 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -807,9 +807,14 @@ void Game::update(size_t frameTime) { } } - tick(true); - tick(true); - tick(true); + int x1 = player_x - curZoom * ZOOM_X_FACTOR / 2 - 1; + int y1 = player_y - curZoom * ZOOM_Y_FACTOR / 2 - 1; + int x2 = player_x + curZoom * ZOOM_X_FACTOR / 2 + 2; + int y2 = player_y + curZoom * ZOOM_Y_FACTOR / 2 + 2; + + tick(x1, y1, x2, y2, false, true); + tick(x1, y1, x2, y2, false, true); + tick(x1, y1, x2, y2, false, true); // TODO: better zoom algorithm setZoom(litSpots / 1500 + INIT_ZOOM); -- cgit 1.4.1