summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-03-15 12:58:42 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2022-03-15 12:58:42 -0400
commit4b52f51404aca45a7d5d8e5998649ff67df97bbd (patch)
tree877d9feeaf3e11e19417b9381499585145d3d673 /src
parentfbee8b6c35e3bf55ad02c30f354bd42b2c245a1b (diff)
downloadether-4b52f51404aca45a7d5d8e5998649ff67df97bbd.tar.gz
ether-4b52f51404aca45a7d5d8e5998649ff67df97bbd.tar.bz2
ether-4b52f51404aca45a7d5d8e5998649ff67df97bbd.zip
instead of ticking the entire screen every lighting update we only tick a chunk size around the player
is this helping?
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp8
1 files changed, 6 insertions, 2 deletions
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) {
806 } 806 }
807 } 807 }
808 808
809 int x1 = player_x - curZoom * ZOOM_X_FACTOR / 2 - 1; 809 /*int x1 = player_x - curZoom * ZOOM_X_FACTOR / 2 - 1;
810 int y1 = player_y - curZoom * ZOOM_Y_FACTOR / 2 - 1; 810 int y1 = player_y - curZoom * ZOOM_Y_FACTOR / 2 - 1;
811 int x2 = player_x + curZoom * ZOOM_X_FACTOR / 2 + 2; 811 int x2 = player_x + curZoom * ZOOM_X_FACTOR / 2 + 2;
812 int y2 = player_y + curZoom * ZOOM_Y_FACTOR / 2 + 2; 812 int y2 = player_y + curZoom * ZOOM_Y_FACTOR / 2 + 2;*/
813 int x1 = player_x - CHUNK_WIDTH / 2 - 1;
814 int y1 = player_y - CHUNK_HEIGHT / 2 - 1;
815 int x2 = player_x + CHUNK_WIDTH / 2 + 2;
816 int y2 = player_y + CHUNK_HEIGHT / 2 + 2;
813 817
814 tick(x1, y1, x2, y2, false, true); 818 tick(x1, y1, x2, y2, false, true);
815 tick(x1, y1, x2, y2, false, true); 819 tick(x1, y1, x2, y2, false, true);