From 766e87a5f17b00077ce358d6a1a657f0e702d7a7 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Mon, 25 Dec 2017 01:40:58 -0600 Subject: [PATCH] wait rather than check for CPU goodness --- engine.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engine.py b/engine.py index e43caf4..b5f17d9 100644 --- a/engine.py +++ b/engine.py @@ -26,8 +26,6 @@ def play_game(player, entities, game_map, message_log, game_state, con, panel, c targeting_item = None while not libtcod.console_is_window_closed(): - libtcod.sys_check_for_event(libtcod.EVENT_KEY_PRESS | libtcod.EVENT_MOUSE, key, mouse) - if fov_recompute: recompute_fov(fov_map, player.x, player.y, constants['fov_radius'], constants['fov_light_walls'], constants['fov_algorithm']) @@ -38,10 +36,10 @@ def play_game(player, entities, game_map, message_log, game_state, con, panel, c fov_recompute = False - libtcod.console_flush() - clear_all(con, entities) + libtcod.console_flush() + libtcod.sys_wait_for_event(libtcod.EVENT_KEY_PRESS | libtcod.EVENT_MOUSE, key, mouse, True) action = handle_keys(key, game_state) mouse_action = handle_mouse(mouse)