From 4b52f51404aca45a7d5d8e5998649ff67df97bbd Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 15 Mar 2022 12:58:42 -0400 Subject: instead of ticking the entire screen every lighting update we only tick a chunk size around the player is this helping? --- src/game.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 7c67daa..170f584 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -806,10 +806,14 @@ void Game::update(size_t frameTime) { } } - int x1 = player_x - curZoom * ZOOM_X_FACTOR / 2 - 1; + /*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; + int y2 = player_y + curZoom * ZOOM_Y_FACTOR / 2 + 2;*/ + int x1 = player_x - CHUNK_WIDTH / 2 - 1; + int y1 = player_y - CHUNK_HEIGHT / 2 - 1; + int x2 = player_x + CHUNK_WIDTH / 2 + 2; + int y2 = player_y + CHUNK_HEIGHT / 2 + 2; tick(x1, y1, x2, y2, false, true); tick(x1, y1, x2, y2, false, true); -- cgit 1.4.1