summaryrefslogtreecommitdiff
path: root/src/display.py
diff options
context:
space:
mode:
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