summaryrefslogtreecommitdiff
path: root/src/display.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-09-03 14:39:50 +0200
committerRaindropsSys <contact@minteck.org>2023-09-03 14:39:50 +0200
commit153d21ace9801ac665e2d7f99c967147d1214f29 (patch)
treef363dccf520fbc2c1670d2308b73294fa9ab5676 /src/display.py
parent6a20ab31ef4d9f6bb0e008b9f1b8d3fbeb6bd956 (diff)
downloadblocks-153d21ace9801ac665e2d7f99c967147d1214f29.tar.gz
blocks-153d21ace9801ac665e2d7f99c967147d1214f29.tar.bz2
blocks-153d21ace9801ac665e2d7f99c967147d1214f29.zip
Updated 16 files and added 5 files (automated)
Diffstat (limited to 'src/display.py')
-rw-r--r--src/display.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/display.py b/src/display.py
index 536b2f3..ad4c48b 100644
--- a/src/display.py
+++ b/src/display.py
@@ -5,16 +5,12 @@ import pause
import picker as picker_ui
import time
import save
+import debug
opacity = 0
-def draw(canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, offset, block_coordinates, paused, screen_blocks, selected_block, picker, save_data):
- global v1
- global v2
- global last_v1
- global last_v2
-
- blocks = [] # TODO: Figure out what chunks to get and how to get them
+def draw(canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, offset, block_coordinates, paused, screen_blocks, selected_block, picker, save_data, focused, clock):
+ blocks = []
start = time.time()
timings = {}
@@ -204,7 +200,9 @@ def draw(canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, o
timings['screen_display_final'] = (time.time() - tstart) * 1000
tstart = time.time()
- pygame.display.flip()
+ if focused:
+ debug.show_debug(clock)
+ pygame.display.flip()
timings['screen_display_flip'] = (time.time() - tstart) * 1000
if opacity < 1:
@@ -218,4 +216,4 @@ def draw(canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, o
print(timings)
print("-----------------------")
- return canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, offset, block_coordinates, paused, screen_blocks, selected_block, picker, blocks, save_data
+ return canvas, screen, need_update_world, world, mouse, loaded_chunks, zoom, offset, block_coordinates, paused, screen_blocks, selected_block, picker, blocks, save_data, focused, clock