From: Christian Heller Date: Sat, 7 Nov 2015 19:39:12 +0000 (+0100) Subject: New client: Only redraw screen when content change can be assumed. X-Git-Tag: tce~261 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%22https:/validator.w3.org/ledger?a=commitdiff_plain;h=e64fbb87ec0b4d36f2d47d0b0bcbcd3f5f7d2918;p=plomrogue New client: Only redraw screen when content change can be assumed. --- diff --git a/client_prototype.py b/client_prototype.py index b5c7f59..9a67b98 100644 --- a/client_prototype.py +++ b/client_prototype.py @@ -79,6 +79,7 @@ def set_window_geometries(): for win in windows: set_window_size() place_window() + cursed_main.redraw = True def draw_screen(): @@ -195,11 +196,14 @@ def cursed_main(stdscr): while True: stdscr.timeout(delay) delay = delay * 2 if delay < 1000 else delay - draw_screen() + if cursed_main.redraw: + draw_screen() + cursed_main.redraw = False char = stdscr.getch() if (char >= 0): if chr(char) in commands: commands[chr(char)]() + cursed_main.redraw = True test_and_poll_server()