diff options
-rw-r--r-- | crawl-ref/source/delay.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/libgui.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.h | 2 |
4 files changed, 22 insertions, 1 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index bc9c19376b..b12f293868 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1517,6 +1517,11 @@ static command_type _get_running_command() if (is_resting()) { you.running.rest(); + +#ifdef USE_TILE + tiles.redraw(); +#endif + if (!is_resting() && you.running.hp == you.hp && you.running.mp == you.magic_points) { diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc index 87839a9c78..e934d5ee64 100644 --- a/crawl-ref/source/libgui.cc +++ b/crawl-ref/source/libgui.cc @@ -343,7 +343,7 @@ void delay(int ms) void update_screen() { - tiles.redraw(); + tiles.set_need_redraw(); } int kbhit() diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index ccc34e7813..1cc27c12a2 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -79,6 +79,7 @@ TilesFramework::TilesFramework() : m_viewsc(0, 0), m_context(NULL), m_fullscreen(false), + m_need_redraw(false), m_active_layer(LAYER_CRT), m_buttons_held(0), m_key_mod(0), @@ -591,6 +592,12 @@ int TilesFramework::getch_ck() unsigned int res = std::max(30, Options.tile_tooltip_ms); SDL_SetTimer(res, &_timer_callback); + if (m_need_redraw) + { + redraw(); + last_redraw_tick = SDL_GetTicks(); + } + while (!key) { unsigned int ticks = 0; @@ -944,6 +951,8 @@ void TilesFramework::cgotoxy(int x, int y, int region) void TilesFramework::redraw() { + m_need_redraw = false; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); @@ -1274,3 +1283,8 @@ void TilesFramework::clear_overlays() { m_region_tile->clear_overlays(); } + +void TilesFramework::set_need_redraw() +{ + m_need_redraw = true; +} diff --git a/crawl-ref/source/tilesdl.h b/crawl-ref/source/tilesdl.h index 735189c95b..258ea5b3a3 100644 --- a/crawl-ref/source/tilesdl.h +++ b/crawl-ref/source/tilesdl.h @@ -106,6 +106,7 @@ public: void clear_minimap(); void update_inventory(); + void set_need_redraw(); void redraw(); void place_cursor(cursor_type type, const coord_def &gc); @@ -134,6 +135,7 @@ protected: SDL_Surface* m_context; bool m_fullscreen; + bool m_need_redraw; enum LayerID { |