summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/view.cc21
-rw-r--r--crawl-ref/source/view.h3
2 files changed, 15 insertions, 9 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 2a858a06b0..9a9cb25c23 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -813,12 +813,13 @@ static void draw_los_backup(screen_buffer_t* buffy,
// Draws the main window using the character set returned
// by get_show_glyph().
//
-// This function should not interfere with the game condition,
-// unless do_updates is set (ie. stealth checks for visible
-// monsters).
+// If monster_updates is set, stealth and conversion checks
+// take place. Should be set once per turn.
//
+// If show_updates is set, env.show and dependent structures
+// are updated. Should be set if anything in view has changed.
//---------------------------------------------------------------
-void viewwindow(bool do_updates)
+void viewwindow(bool monster_updates, bool show_updates)
{
if (you.duration[DUR_TIME_STEP])
return;
@@ -826,7 +827,6 @@ void viewwindow(bool do_updates)
screen_buffer_t *buffy(crawl_view.vbuf);
- you.update_los();
#ifdef USE_TILE
tiles.clear_text_tags(TAG_NAMED_MONSTER);
@@ -834,12 +834,17 @@ void viewwindow(bool do_updates)
mcache.clear_nonref();
#endif
- env.show.init();
+ if (show_updates)
+ {
+ you.update_los();
+ env.show.init();
+ }
- if (do_updates && !crawl_state.arena)
+ if (monster_updates && !crawl_state.arena)
monster_grid_updates();
- player_view_update(); // XXX: also conditional on do_updates?
+ if (show_updates)
+ player_view_update();
#ifdef USE_TILE
tile_draw_rays(true);
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index 0e55871761..c02e269a58 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -40,7 +40,8 @@ void view_update_at(const coord_def &pos);
void flash_monster_colour(const monsters *mon, unsigned char fmc_colour,
int fmc_delay);
#endif
-void viewwindow(bool do_updates);
+
+void viewwindow(bool monster_updates, bool show_updates = true);
void update_monsters_in_view();
void handle_seen_interrupt(monsters* monster);
void flush_comes_into_view();