From f8d69cbe96b1bcb39b90554800a60d99c0a596f7 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Mon, 9 Nov 2009 22:44:43 +0100 Subject: Remove option draw_it from viewwindow. The only use was just removed. Also move the draw check closer to where it's used. --- crawl-ref/source/abyss.cc | 4 +- crawl-ref/source/acr.cc | 8 +- crawl-ref/source/arena.cc | 6 +- crawl-ref/source/command.cc | 6 +- crawl-ref/source/delay.cc | 6 +- crawl-ref/source/directn.cc | 8 +- crawl-ref/source/exclude.cc | 4 +- crawl-ref/source/files.cc | 2 +- crawl-ref/source/godabil.cc | 4 +- crawl-ref/source/it_use3.cc | 2 +- crawl-ref/source/item_use.cc | 2 +- crawl-ref/source/l_crawl.cc | 2 +- crawl-ref/source/l_dgn.cc | 4 +- crawl-ref/source/misc.cc | 10 +- crawl-ref/source/mon-abil.cc | 2 +- crawl-ref/source/mon-act.cc | 8 +- crawl-ref/source/mon-cast.cc | 2 +- crawl-ref/source/monplace.cc | 12 +- crawl-ref/source/monstuff.cc | 6 +- crawl-ref/source/ouch.cc | 2 +- crawl-ref/source/player.cc | 10 +- crawl-ref/source/religion.cc | 2 +- crawl-ref/source/spells1.cc | 2 +- crawl-ref/source/spells2.cc | 6 +- crawl-ref/source/spells3.cc | 4 +- crawl-ref/source/spells4.cc | 4 +- crawl-ref/source/spl-cast.cc | 4 +- crawl-ref/source/stuff.cc | 2 +- crawl-ref/source/terrain.cc | 4 +- crawl-ref/source/travel.cc | 4 +- crawl-ref/source/tutorial.cc | 48 ++--- crawl-ref/source/view.cc | 428 +++++++++++++++++++++---------------------- crawl-ref/source/view.h | 2 +- crawl-ref/source/wiz-dgn.cc | 4 +- crawl-ref/source/wiz-mon.cc | 2 +- crawl-ref/source/xom.cc | 2 +- 36 files changed, 310 insertions(+), 318 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc index 126ba384ab..cf3f74267d 100644 --- a/crawl-ref/source/abyss.cc +++ b/crawl-ref/source/abyss.cc @@ -373,7 +373,7 @@ static void _xom_check_nearness_setup() static void _xom_check_nearness() { // Update known terrain - viewwindow(true, false); + viewwindow(false); int exit_is_near = _abyss_exit_nearness(); int rune_is_near = _abyss_rune_nearness(); @@ -938,7 +938,7 @@ bool lugonu_corrupt_level(int power) mpr("Lugonu's Hand of Corruption reaches out!", MSGCH_GOD); you.flash_colour = MAGENTA; - viewwindow(true, false); + viewwindow(false); _initialise_level_corrupt_seeds(power); diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index c66132f260..12b4b348e3 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1124,7 +1124,7 @@ static void _input() world_reacts(); } else - viewwindow(true, false); + viewwindow(false); _update_replay_state(); @@ -2774,7 +2774,7 @@ void world_reacts() // If you're wielding a rod, it'll gradually recharge. _recharge_rods(); - viewwindow(true, true); + viewwindow(true); maybe_update_stashes(); handle_monsters(); @@ -2834,7 +2834,7 @@ void world_reacts() } } - viewwindow(true, false); + viewwindow(false); if (you.cannot_act() && any_messages() && crawl_state.repeat_cmd != CMD_WIZARD) @@ -3751,7 +3751,7 @@ static bool _initialise(void) maybe_update_stashes(); // This just puts the view up for the first turn. - viewwindow(true, false); + viewwindow(false); activate_notes(true); diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc index ac02f2e7fd..dcae744e65 100644 --- a/crawl-ref/source/arena.cc +++ b/crawl-ref/source/arena.cc @@ -840,7 +840,7 @@ namespace arena void do_fight() { - viewwindow(true, false); + viewwindow(false); mesclr(true); { cursor_control coff(false); @@ -863,7 +863,7 @@ namespace arena if ((turns++ % 100) == 0) count_foes(); - viewwindow(true, false); + viewwindow(false); unwind_var pos(you.position); // Move hero offscreen. you.position.y = -1; @@ -881,7 +881,7 @@ namespace arena dump_messages(); ASSERT(you.pet_target == MHITNOT); } - viewwindow(true, false); + viewwindow(false); } mesclr(); diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index b4e365a41a..3d0ef4a04f 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1421,7 +1421,7 @@ static bool _do_description(std::string key, std::string type, static bool _handle_FAQ() { clrscr(); - viewwindow(true, false); + viewwindow(false); std::vector question_keys = getAllFAQKeys(); if (question_keys.empty()) @@ -1496,7 +1496,7 @@ static bool _find_description(bool &again, std::string& error_inout) again = true; clrscr(); - viewwindow(true, false); + viewwindow(false); if (!error_inout.empty()) mpr(error_inout.c_str(), MSGCH_PROMPT); @@ -1796,7 +1796,7 @@ static int _keyhelp_keyfilter(int ch) } while (again); - viewwindow(true, false); + viewwindow(false); return -1; } diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 82776f0ac5..f4ffa5c2c8 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -583,7 +583,7 @@ void handle_interrupted_swap(bool swap_if_safe, bool force_unsafe, // If we're going to prompt then update the window so the player can // see what the monsters are. if (prompt) - viewwindow(true, false); + viewwindow(false); if (delay == DELAY_WEAPON_SWAP) { @@ -821,7 +821,7 @@ void handle_delay() _get_recite_speech("start", you.num_turns + delay.duration).c_str()); if (apply_area_visible(_recite_to_monsters, delay.parm1)) - viewwindow(true, false); + viewwindow(false); break; default: @@ -1031,7 +1031,7 @@ void handle_delay() mprf(MSGCH_MULTITURN_ACTION, "You continue %s.", _get_recite_speech("other", you.num_turns + delay.duration+1).c_str()); if (apply_area_visible(_recite_to_monsters, delay.parm1)) - viewwindow(true, false); + viewwindow(false); break; case DELAY_MULTIDROP: diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index b332862a97..7d8d3a8392 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -914,7 +914,7 @@ range_view_annotator::range_view_annotator(int range) range_view_annotator::~range_view_annotator() { restore_state(); - viewwindow(true, false); + viewwindow(false); } void range_view_annotator::restore_state() @@ -1543,7 +1543,7 @@ void direction(dist& moves, targetting_type restricts, // To update visual branding of friendlies. Only // seems capabable of adding bolding, not removing it, // though. - viewwindow(true, false); + viewwindow(false); } break; @@ -1695,7 +1695,7 @@ void direction(dist& moves, targetting_type restricts, if (need_beam_redraw) { #ifndef USE_TILE - viewwindow(true, false); + viewwindow(false); #endif if (show_beam && have_beam) { @@ -1731,7 +1731,7 @@ void direction(dist& moves, targetting_type restricts, #endif } #ifdef USE_TILE - viewwindow(true, false); + viewwindow(false); #endif } skip_iter = false; // Only skip one iteration at most. diff --git a/crawl-ref/source/exclude.cc b/crawl-ref/source/exclude.cc index 6fbd185e11..4b2aed3fa5 100644 --- a/crawl-ref/source/exclude.cc +++ b/crawl-ref/source/exclude.cc @@ -61,7 +61,7 @@ void set_auto_exclude(const monsters *mon) { set_exclude(mon->pos(), LOS_RADIUS, true); #ifdef USE_TILE - viewwindow(true, false); + viewwindow(false); #endif learned_something_new(TUT_AUTO_EXCLUSION, mon->pos()); } @@ -75,7 +75,7 @@ void remove_auto_exclude(const monsters *mon, bool sleepy) { del_exclude(mon->pos()); #ifdef USE_TILE - viewwindow(true, false); + viewwindow(false); #endif } } diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 4afaf1039f..3bb45a6c55 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1390,7 +1390,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, if (timeval > 0) { you.time_taken = timeval; - viewwindow(true, false); + viewwindow(false); handle_monsters(); } } diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index fa6c766e0e..56cc06c313 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -1331,7 +1331,7 @@ void cheibriados_time_step(int pow) // pow is the number of turns to skip mpr("You step out of the flow of time."); you.flash_colour = LIGHTBLUE; - viewwindow(true, true); + viewwindow(true); you.moveto(coord_def(0, 0)); you.duration[DUR_TIME_STEP] = pow; @@ -1353,6 +1353,6 @@ void cheibriados_time_step(int pow) // pow is the number of turns to skip you.flash_colour = 0; you.moveto(old_pos); you.duration[DUR_TIME_STEP] = 0; - viewwindow(true, false); + viewwindow(false); mpr("You return into the normal time flow."); } diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 7adf5c5e50..42379cccc6 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -539,7 +539,7 @@ void tome_of_power(int slot) } else { - viewwindow(true, false); + viewwindow(false); int temp_rand = random2(23) + random2(you.skills[SK_EVOCATIONS] / 3); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index bd431202fc..67fede953d 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3042,7 +3042,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, { // Fire beam in reverse. pbolt.setup_retrace(); - viewwindow(true, false); + viewwindow(false); pbolt.fire(); msg::stream << item.name(DESC_CAP_THE) << " returns to your pack!" diff --git a/crawl-ref/source/l_crawl.cc b/crawl-ref/source/l_crawl.cc index 7496a2f1c6..0918a9f099 100644 --- a/crawl-ref/source/l_crawl.cc +++ b/crawl-ref/source/l_crawl.cc @@ -618,7 +618,7 @@ LUAFN(_crawl_milestone) LUAFN(_crawl_redraw_view) { - viewwindow(true, false); + viewwindow(false); return (0); } diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index f91d4ef063..9a0318e1a9 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -781,7 +781,7 @@ static int dgn_change_floor_colour(lua_State *ls) env.floor_colour = (unsigned char) colour; if (crawl_state.need_save && update_now) - viewwindow(true, false); + viewwindow(false); return (0); } @@ -793,7 +793,7 @@ static int dgn_change_rock_colour(lua_State *ls) env.rock_colour = (unsigned char) colour; if (crawl_state.need_save && update_now) - viewwindow(true, false); + viewwindow(false); return (0); } diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 003be3ef61..505a4328b0 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1935,7 +1935,7 @@ void up_stairs(dungeon_feature_type force_stair, new_level(); - viewwindow(true, true); + viewwindow(true); // Left Zot without enough runes to get back in (because they were // destroyed), but need to get back in Zot to get the Orb? @@ -2247,7 +2247,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, update_screen(); #else you.flash_colour = LIGHTGREEN; - viewwindow(true, false); + viewwindow(false); #endif mpr("The lock glows an eerie green colour!"); more(); @@ -2255,7 +2255,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, mprf("You insert %s into the lock.", you.inv[runes[1]].name(DESC_NOCAP_THE).c_str()); big_cloud(CLOUD_BLUE_SMOKE, KC_YOU, you.pos(), 20, 7 + random2(7)); - viewwindow(true, false); + viewwindow(false); mpr("Heavy smoke blows from the lock!"); more(); @@ -2597,7 +2597,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, trackers_init_new_level(true); - viewwindow(true, true); + viewwindow(true); maybe_update_stashes(); if (collect_travel_data) @@ -3115,7 +3115,7 @@ void reveal_secret_door(const coord_def& p) // until opened. grd(p) = feat_is_opaque(door) ? DNGN_DETECTED_SECRET_DOOR : DNGN_OPEN_DOOR; - viewwindow(true, false); + viewwindow(false); learned_something_new(TUT_SEEN_SECRET_DOOR, p); } diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 11a32b6d45..aba43a7b22 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -296,7 +296,7 @@ static bool _do_merge(monsters *initial_slime, monsters *merge_to) } you.flash_colour = LIGHTGREEN; - viewwindow(true, false); + viewwindow(false); int flash_delay = 150; // Scale delay to match change in arena_delay. diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index d61a798eb8..73b25f3a7d 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -1408,7 +1408,7 @@ static bool _mons_throw(struct monsters *monster, struct bolt &pbolt, // Redraw the screen before firing, in case the monster just // came into view and the screen hasn't been updated yet. - viewwindow(true, false); + viewwindow(false); pbolt.fire(); // The item can be destroyed before returning. @@ -1421,7 +1421,7 @@ static bool _mons_throw(struct monsters *monster, struct bolt &pbolt, { // Fire beam in reverse. pbolt.setup_retrace(); - viewwindow(true, false); + viewwindow(false); pbolt.fire(); msg::stream << "The weapon returns " << (you.can_see(monster)? @@ -2665,7 +2665,7 @@ static void _mons_open_door(monsters* monster, const coord_def &pos) if (was_seen) { - viewwindow(true, false); + viewwindow(false); if (was_secret) { @@ -3293,7 +3293,7 @@ static bool _monster_move(monsters *monster) if (observe_cell(newpos)) { - viewwindow(true, false); + viewwindow(false); if (!you.can_see(monster)) { diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index c69a029b4a..23661a062d 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -2114,7 +2114,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, // If a monster just came into view and immediately cast a spell, // we need to refresh the screen before drawing the beam. - viewwindow(true, false); + viewwindow(false); if (spell_is_direct_explosion(spell_cast)) { const actor *foe = monster->get_foe(); diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 1bc990438a..37ec0ca297 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -239,7 +239,7 @@ static void _hell_spawn_random_monsters() mg.proximity = (one_chance_in(10) ? PROX_NEAR_STAIRS : PROX_AWAY_FROM_PLAYER); mons_place(mg); - viewwindow(true, false); + viewwindow(false); } } @@ -290,7 +290,7 @@ void spawn_random_monsters() mgen_data mg(WANDERING_MONSTER); mg.proximity = prox; mons_place(mg); - viewwindow(true, false); + viewwindow(false); return; } @@ -303,7 +303,7 @@ void spawn_random_monsters() && (you.religion != GOD_CHEIBRIADOS || coinflip())) { mons_place(mgen_data(WANDERING_MONSTER)); - viewwindow(true, false); + viewwindow(false); return; } @@ -311,7 +311,7 @@ void spawn_random_monsters() if (you.level_type == LEVEL_PANDEMONIUM && x_chance_in_y(5, rate)) { pandemonium_mons(); - viewwindow(true, false); + viewwindow(false); return; } @@ -320,7 +320,7 @@ void spawn_random_monsters() if (you.level_type == LEVEL_PORTAL_VAULT && x_chance_in_y(5, rate)) { mons_place(mgen_data(WANDERING_MONSTER)); - viewwindow(true, false); + viewwindow(false); } // No random monsters in the Labyrinth. @@ -955,7 +955,7 @@ int place_monster(mgen_data mg, bool force_pos) // Special case: must update the view for monsters created // in player LOS. - viewwindow(true, false); + viewwindow(false); } // Now, forget about banding if the first placement failed, or there are diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 5f82495a9d..ada3bff10b 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1126,7 +1126,7 @@ static bool _spore_goes_pop(monsters *monster, killer_type killer, if (you.can_see(monster)) { saw = true; - viewwindow(true, false); + viewwindow(false); if (is_sanctuary(monster->pos())) mpr(sanct_msg, MSGCH_GOD); else @@ -1149,7 +1149,7 @@ static bool _spore_goes_pop(monsters *monster, killer_type killer, // Exploding kills the monster a bit earlier than normal. monster->hit_points = -16; if (saw) - viewwindow(true, false); + viewwindow(false); // FIXME: show_more == mons_near(monster) beam.explode(); @@ -3891,7 +3891,7 @@ int clone_mons(const monsters* orig, bool quiet, bool* obvious, if (you.can_see(&mon)) { handle_seen_interrupt(&mon); - viewwindow(true, false); + viewwindow(false); } if (crawl_state.arena) diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 82fa411e66..3b81350a08 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1287,7 +1287,7 @@ void end_game( scorefile_entry &se ) mpr("You die..."); // insert player name here? {dlb} xom_death_message((kill_method_type) se.death_type); flush_prev_message(); - viewwindow(true, false); // don't do for leaving/winning characters + viewwindow(false); // don't do for leaving/winning characters if (Options.tutorial_left) tutorial_death_screen(); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e48b4a5422..379e9cb751 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -165,7 +165,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, if (trap_def* ptrap = find_trap(p)) ptrap->reveal(); - viewwindow(true, false); + viewwindow(false); mprf(MSGCH_WARN, "Wait a moment, %s! Do you really want to step there?", @@ -295,7 +295,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, // Have to move now so fall_into_a_pool will work. you.moveto(p); - viewwindow( true, false ); + viewwindow(false); // If true, we were shifted and so we're done. if (fall_into_a_pool( entry, allow_shift, new_grid )) @@ -330,7 +330,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, init_player_doll(); #endif - viewwindow(true, false); + viewwindow(false); // Other Effects: // Clouds -- do we need this? (always seems to double up with acr.cc call) @@ -7067,7 +7067,7 @@ void player::put_to_sleep(int) stop_delay(); flash_colour = DARKGREY; - viewwindow(true, false); + viewwindow(false); // Do this *after* redrawing the view, or viewwindow() will no-op. duration[DUR_SLEEP] = 3 + random2avg(5, 2); @@ -7080,7 +7080,7 @@ void player::awake() duration[DUR_SLEEP] = 0; mpr("You wake up."); this->flash_colour = BLACK; - viewwindow(true, false); + viewwindow(false); } void player::check_awaken(int disturbance) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 605e13f8ec..37a597371a 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4276,7 +4276,7 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour) mpr("Your weapon shines brightly!", MSGCH_GOD); you.flash_colour = colour; - viewwindow(true, false); + viewwindow(false); simple_god_message(" booms: Use this gift wisely!"); diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 2768394649..552984f20c 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -284,7 +284,7 @@ void cast_fire_storm(int pow, bolt &beam) if (beam.explode(false)) mpr("A raging storm of fire appears!"); - viewwindow(true, false); + viewwindow(false); } // No setup/cast split here as monster hellfire is completely different. diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index e157ca688f..ddc46bf4a2 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -518,7 +518,7 @@ void cast_toxic_radiance() mpr("You radiate a sickly green light!"); you.flash_colour = GREEN; - viewwindow(true, false); + viewwindow(false); more(); mesclr(); @@ -586,7 +586,7 @@ void cast_refrigeration(int pow) mpr("The heat is drained from your surroundings."); you.flash_colour = LIGHTCYAN; - viewwindow(true, false); + viewwindow(false); more(); mesclr(); @@ -673,7 +673,7 @@ void drain_life(int pow) ASSERT(pow <= 27); you.flash_colour = DARKGREY; - viewwindow(true, false); + viewwindow(false); more(); mesclr(); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 3266512406..facffd8eb8 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1412,7 +1412,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area) // Update what we can see at the current location as well as its stash, // in case something happened in the exact turn that we teleported // (like picking up/dropping an item). - viewwindow(true, false); + viewwindow(false); StashTrack.update_stash(); if (you.duration[DUR_CONDENSATION_SHIELD] > 0) @@ -1825,7 +1825,7 @@ bool cast_sanctuary(const int power) mpr("You are suddenly bathed in radiance!"); you.flash_colour = WHITE; - viewwindow(true, false); + viewwindow(false); holy_word(100, HOLY_WORD_ZIN, you.pos(), true); diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 44db4ff667..627f1cd136 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -599,7 +599,7 @@ static int _ignite_poison_monsters(coord_def where, int pow, int, actor *) void cast_ignite_poison(int pow) { you.flash_colour = RED; - viewwindow(true, true); + viewwindow(true); // Poison branding becomes fire branding. if (you.weapon() @@ -748,7 +748,7 @@ void cast_ignite_poison(int pow) delay(100); // show a brief flash #endif you.flash_colour = 0; - viewwindow(true, false); + viewwindow(false); } void cast_silence(int pow) diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index c605a7bda2..88350b834c 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -768,10 +768,10 @@ bool cast_a_spell(bool check_range, spell_type spell) if (Options.target_range != -1) { Options.target_range = _calc_spell_range(spell); - viewwindow(true, false); + viewwindow(false); delay(500); Options.target_range = 0; - viewwindow(true, false); + viewwindow(false); } return (false); } diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 097e6e0a60..9ca0204e12 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -437,7 +437,7 @@ void redraw_screen(void) update_turn_count(); activate_notes(note_status); - viewwindow(true, false); + viewwindow(false); } // STEPDOWN FUNCTION to replace conditional chains in spells2.cc 12jan2000 {dlb} diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 1d4fe0b75b..16b7db05b7 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -972,12 +972,12 @@ bool swap_features(const coord_def &pos1, const coord_def &pos2, if (pos1 == you.pos()) { you.set_position(pos2); - viewwindow(true, false); + viewwindow(false); } else if (pos2 == you.pos()) { you.set_position(pos1); - viewwindow(true, false); + viewwindow(false); } set_terrain_changed(pos1); diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index a3f69c1507..df1dbbd627 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -1050,7 +1050,7 @@ command_type travel() if (!you.running && Options.travel_delay == -1 && (!you.running.is_explore() || Options.explore_delay == -1)) { - viewwindow(true, false); + viewwindow(false); } if (!you.running) @@ -3846,7 +3846,7 @@ void runrest::stop() stop_delay(); if (need_redraw) - viewwindow(true, false); + viewwindow(false); _reset_zigzag_info(); } diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index a9c72e35f5..d7ef041d35 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -1339,7 +1339,7 @@ void tutorial_first_monster(const monsters &mon) "death by misclicking."; #endif - viewwindow(true, false); + viewwindow(false); formatted_message_history(text, MSGCH_TUTORIAL, 0, _get_tutorial_cols()); if (Options.tutorial_type == TUT_RANGER_CHAR) @@ -1435,7 +1435,7 @@ void tutorial_first_item(const item_def &item) tiles.add_text_tag(TAG_TUTORIAL, item.name(DESC_CAP_A), gc); #endif - viewwindow(true, false); + viewwindow(false); text += "is an item. If you move there and press g or " ", you will pick it up. " #ifndef USE_TILE @@ -2032,7 +2032,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, "Stairs", gc); #endif - viewwindow(true, false); + viewwindow(false); text << "are some downstairs. You can enter the next (deeper) " "level by following them down (>). To get back to " "this level again, press << while standing on the " @@ -2064,7 +2064,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, "Escape hatch", gc); #endif - viewwindow(true, false); + viewwindow(false); text << "are some kind of escape hatch. You can use them to " "quickly leave a level with << and >, " "respectively " @@ -2092,7 +2092,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, "Branch stairs", gc); #endif - viewwindow(true, false); + viewwindow(false); text << "is the entrance to a different branch of the dungeon, " "which might have different terrain, level layout and " "monsters from the current main branch you're in. Branches " @@ -2130,7 +2130,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, "Portal", gc); #endif - viewwindow(true, false); + viewwindow(false); text << _describe_portal(gc); break; @@ -2139,7 +2139,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (actor_at(gc)) DELAY_EVENT; - viewwindow(true, false); + viewwindow(false); #ifdef USE_TILE text << "A small question mark on a stair tile signifies that there " "are items in that position that you may want to check out."; @@ -2156,7 +2156,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (actor_at(gc)) DELAY_EVENT; - viewwindow(true, false); + viewwindow(false); #ifdef USE_TILE text << "A small question mark on an item tile signifies that there " "is at least one other item in the same heap that you may want " @@ -2178,7 +2178,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (actor_at(gc)) DELAY_EVENT; - viewwindow(true, false); + viewwindow(false); text << "If any items are covering a trap, then that will be " "indicated by highlighting the ^ symbol, instead of " "hiding the trap symbol with an item glyph."; @@ -2223,7 +2223,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.add_text_tag(TAG_TUTORIAL, altar, gc); } #endif - viewwindow(true, false); + viewwindow(false); text << "is an altar. You can get information about it by pressing " "p while standing on the square. Before taking up " "the corresponding faith you'll be asked for confirmation."; @@ -2242,7 +2242,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, shop_name(gc), gc); #endif - viewwindow(true, false); + viewwindow(false); text << "That " #ifndef USE_TILE << _colourize_glyph(YELLOW, get_screen_glyph(gc)) << " " @@ -2263,7 +2263,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.place_cursor(CURSOR_TUTORIAL, gc); tiles.add_text_tag(TAG_TUTORIAL, "Closed door", gc); #endif - viewwindow(true, false); + viewwindow(false); text << "That " #ifndef USE_TILE @@ -2413,7 +2413,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_YOU_ENCHANTED: - viewwindow(true, false); + viewwindow(false); text << "Enchantments of all types can befall you temporarily. " "Brief descriptions of these appear at the lower end of the " "stats area. Press @ for more details. A list of all " @@ -2479,7 +2479,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_YOU_CURSED: - viewwindow(true, false); + viewwindow(false); text << "Curses are comparatively harmless, but they do mean that " "you cannot remove cursed equipment and will have to suffer " "the (possibly) bad effects until you find and read a scroll " @@ -2557,7 +2557,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_HEAVY_LOAD: - viewwindow(true, false); + viewwindow(false); if (you.burden_state != BS_UNENCUMBERED) { text << "It is not usually a good idea to run around encumbered; " @@ -2746,7 +2746,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) case TUT_AUTO_EXCLUSION: // In the highly unlikely case the player encounters a // hostile statue or oklob plant during the tutorial... - viewwindow(true, false); + viewwindow(false); if (Options.tut_explored) { // Hack: Reset tut_just_triggered, to force recursive calling of @@ -2823,7 +2823,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_POSTBERSERK: - viewwindow(true, false); + viewwindow(false); text << "Berserking is extremely exhausting! It burns a lot of " "nutrition, and afterwards you are slowed down and " "occasionally even pass out. Press @ to see your " @@ -3079,7 +3079,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (Options.tutorial_type != TUT_BERSERK_CHAR) return; - viewwindow(true, false); + viewwindow(false); text << "Now that monster is scared of you! Note that you do not " "absolutely have to follow it. Rather, you can let it run " "away. Sometimes, though, it can be useful to attack a " @@ -3095,7 +3095,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (const monsters *m = monster_at(gc)) tiles.add_text_tag(TAG_TUTORIAL, m->name(DESC_CAP_A), gc); #endif - viewwindow(true, false); + viewwindow(false); text << "That monster looks a bit unusual. You might wish to examine " "it a bit more closely by " #ifdef USE_TILE @@ -3147,7 +3147,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) tiles.add_text_tag(TAG_TUTORIAL, m->name(DESC_CAP_A), gc); } #endif - viewwindow(true, false); + viewwindow(false); if (!vis) { text << "Uh-oh, some monster noticed you, either one that's " @@ -3181,7 +3181,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) if (!m || !you.can_see(m)) DELAY_EVENT; - viewwindow(true, false); + viewwindow(false); text << m->name(DESC_CAP_THE, true) << " didn't vanish, but merely " "moved onto a square which you can't currently see. It's still " "nearby, unless something happens to it in the short amount of " @@ -3254,7 +3254,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_GLOWING: - viewwindow(true, false); + viewwindow(false); text << "You've accumulated so much magical contamination that you're " "glowing! You usually acquire magical contamination from using " "some powerful magics, like invisibility, haste or potions of " @@ -3299,7 +3299,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) break; case TUT_CAUGHT_IN_NET: - viewwindow(true, false); + viewwindow(false); text << "While you are held in a net, you cannot move around or engage " "monsters in combat. Instead, any movement you take is counted " "as an attempt to struggle free from the net. With a wielded " @@ -3325,7 +3325,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) case TUT_LOAD_SAVED_GAME: { - viewwindow(true, false); + viewwindow(false); text << "Welcome back! If it's been a while since you last played this " "character, you should take some time to refresh your memory " "of your character's progress. It is recommended to at least " diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 8968ea16fc..9c9deba2ac 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1203,7 +1203,7 @@ bool view_update() { if (you.num_turns > you.last_view_update) { - viewwindow(true, false); + viewwindow(false); return (true); } return (false); @@ -1213,7 +1213,6 @@ static void _debug_pane_bounds() { #if DEBUG_PANE_BOUNDS // Doesn't work for HUD because print_stats() overwrites it. - // To debug HUD, add viewwindow(false,false) at end of _prep_input. if (crawl_view.mlistsz.y > 0) { @@ -1255,7 +1254,7 @@ static void _debug_pane_bounds() // monsters). // //--------------------------------------------------------------- -void viewwindow(bool draw_it, bool do_updates) +void viewwindow(bool do_updates) { if (you.duration[DUR_TIME_STEP]) return; @@ -1288,276 +1287,269 @@ void viewwindow(bool draw_it, bool do_updates) tiles.clear_overlays(); #endif - if (draw_it) - { - cursor_control cs(false); + cursor_control cs(false); - const bool map = player_in_mappable_area(); - const bool draw = -#ifdef USE_TILE - !is_resting() && -#endif - (!you.running || Options.travel_delay > -1 - || you.running.is_explore() && Options.explore_delay > -1) - && !you.asleep(); + const bool map = player_in_mappable_area(); - int bufcount = 0; + int bufcount = 0; - int flash_colour = you.flash_colour; - if (flash_colour == BLACK) - flash_colour = _viewmap_flash_colour(); + int flash_colour = you.flash_colour; + if (flash_colour == BLACK) + flash_colour = _viewmap_flash_colour(); - std::vector update_excludes; - for (count_y = crawl_view.viewp.y; - count_y < crawl_view.viewp.y + crawl_view.viewsz.y; count_y++) + std::vector update_excludes; + for (count_y = crawl_view.viewp.y; + count_y < crawl_view.viewp.y + crawl_view.viewsz.y; count_y++) + { + for (count_x = crawl_view.viewp.x; + count_x < crawl_view.viewp.x + crawl_view.viewsz.x; count_x++) { - for (count_x = crawl_view.viewp.x; - count_x < crawl_view.viewp.x + crawl_view.viewsz.x; count_x++) + // in grid coords + const coord_def gc(view2grid(coord_def(count_x, count_y))); + const coord_def ep = view2show(grid2view(gc)); + + if (in_bounds(gc) && you.see_cell(gc)) + maybe_remove_autoexclusion(gc); + + // Print tutorial messages for features in LOS. + if (Options.tutorial_left + && in_bounds(gc) + && crawl_view.in_grid_los(gc) + && env.show(ep)) + { + tutorial_observe_cell(gc); + } + + // Order is important here. + if (!map_bounds(gc)) + { + // off the map + buffy[bufcount] = 0; + buffy[bufcount + 1] = DARKGREY; +#ifdef USE_TILE + tileidx_unseen(tileb[bufcount], tileb[bufcount+1], ' ', gc); +#endif + } + else if (!crawl_view.in_grid_los(gc)) { - // in grid coords - const coord_def gc(view2grid(coord_def(count_x, count_y))); - const coord_def ep = view2show(grid2view(gc)); - - if (in_bounds(gc) && you.see_cell(gc)) - maybe_remove_autoexclusion(gc); - - // Print tutorial messages for features in LOS. - if (Options.tutorial_left - && in_bounds(gc) - && crawl_view.in_grid_los(gc) - && env.show(ep)) + // Outside the env.show area. + buffy[bufcount] = get_map_knowledge_char(gc); + buffy[bufcount + 1] = DARKGREY; + + if (Options.colour_map) { - tutorial_observe_cell(gc); + buffy[bufcount + 1] = + colour_code_map(gc, Options.item_colour); } - // Order is important here. - if (!map_bounds(gc)) - { - // off the map - buffy[bufcount] = 0; - buffy[bufcount + 1] = DARKGREY; #ifdef USE_TILE - tileidx_unseen(tileb[bufcount], tileb[bufcount+1], ' ', gc); + unsigned int bg = env.tile_bk_bg(gc); + unsigned int fg = env.tile_bk_fg(gc); + if (bg == 0 && fg == 0) + tileidx_unseen(fg, bg, get_map_knowledge_char(gc), gc); + + tileb[bufcount] = fg; + tileb[bufcount + 1] = bg | tile_unseen_flag(gc); #endif - } - else if (!crawl_view.in_grid_los(gc)) - { - // Outside the env.show area. - buffy[bufcount] = get_map_knowledge_char(gc); - buffy[bufcount + 1] = DARKGREY; + } + else if (gc == you.pos() && !crawl_state.arena + && !crawl_state.arena_suspended) + { + show_type object = env.show(ep); + unsigned short colour = object.colour; + unsigned ch; + get_symbol(gc, object, &ch, &colour); - if (Options.colour_map) - { - buffy[bufcount + 1] = - colour_code_map(gc, Options.item_colour); - } + if (map) + { + set_map_knowledge_glyph(gc, object, colour); + if (is_terrain_changed(gc) || !is_terrain_seen(gc)) + update_excludes.push_back(gc); + set_terrain_seen(gc); + set_map_knowledge_detected_mons(gc, false); + set_map_knowledge_detected_item(gc, false); + } #ifdef USE_TILE - unsigned int bg = env.tile_bk_bg(gc); - unsigned int fg = env.tile_bk_fg(gc); - if (bg == 0 && fg == 0) - tileidx_unseen(fg, bg, get_map_knowledge_char(gc), gc); + if (map) + { + env.tile_bk_bg(gc) = env.tile_bg(ep); + env.tile_bk_fg(gc) = env.tile_fg(ep); + } - tileb[bufcount] = fg; - tileb[bufcount + 1] = bg | tile_unseen_flag(gc); + tileb[bufcount] = env.tile_fg(ep) = + tileidx_player(you.char_class); + tileb[bufcount+1] = env.tile_bg(ep); #endif + + // Player overrides everything in cell. + buffy[bufcount] = you.symbol; + buffy[bufcount + 1] = you.colour; + if (you.swimming()) + { + if (grd(gc) == DNGN_DEEP_WATER) + buffy[bufcount + 1] = BLUE; + else + buffy[bufcount + 1] = CYAN; } - else if (gc == you.pos() && !crawl_state.arena - && !crawl_state.arena_suspended) + } + else + { + show_type object = env.show(ep); + unsigned short colour = object.colour; + unsigned ch; + + get_symbol( gc, object, &ch, &colour ); + + buffy[bufcount] = ch; + buffy[bufcount + 1] = colour; +#ifdef USE_TILE + tileb[bufcount] = env.tile_fg(ep); + tileb[bufcount+1] = env.tile_bg(ep); +#endif + + if (map) { - show_type object = env.show(ep); - unsigned short colour = object.colour; - unsigned ch; - get_symbol(gc, object, &ch, &colour); + // This section is very tricky because it + // duplicates the old code (which was horrid). - if (map) + // If the grid is in LoS env.show was set and + // we set the buffer already, so... + if (buffy[bufcount] != 0) { - set_map_knowledge_glyph(gc, object, colour); + // ... map that we've seen this if (is_terrain_changed(gc) || !is_terrain_seen(gc)) update_excludes.push_back(gc); set_terrain_seen(gc); + set_map_knowledge_glyph(gc, object, colour ); set_map_knowledge_detected_mons(gc, false); set_map_knowledge_detected_item(gc, false); - } #ifdef USE_TILE - if (map) - { + // We remove any references to mcache when + // writing to the background. + if (Options.clean_map) + env.tile_bk_fg(gc) = + get_clean_map_idx(env.tile_fg(ep)); + else + env.tile_bk_fg(gc) = env.tile_fg(ep); env.tile_bk_bg(gc) = env.tile_bg(ep); - env.tile_bk_fg(gc) = env.tile_fg(ep); - } - - tileb[bufcount] = env.tile_fg(ep) = - tileidx_player(you.char_class); - tileb[bufcount+1] = env.tile_bg(ep); #endif + } - // Player overrides everything in cell. - buffy[bufcount] = you.symbol; - buffy[bufcount + 1] = you.colour; - - if (you.swimming()) + // Check if we're looking to clean_map... + // but don't touch the buffer to clean it, + // instead we modify the env.map_knowledge itself so + // that the map stays clean as it moves out + // of the env.show radius. + // + // Note: show_backup is 0 on every square which + // is inside the env.show radius and doesn't + // have a monster or cloud on it, and is equal + // to the grid before monsters and clouds were + // added otherwise. + if (Options.clean_map + && env.show.get_backup(ep) + && is_terrain_seen(gc)) { - if (grd(gc) == DNGN_DEEP_WATER) - buffy[bufcount + 1] = BLUE; - else - buffy[bufcount + 1] = CYAN; + get_symbol(gc, env.show.get_backup(ep), &ch, &colour); + set_map_knowledge_glyph(gc, env.show.get_backup(ep), colour); } - } - else - { - show_type object = env.show(ep); - unsigned short colour = object.colour; - unsigned ch; - - get_symbol( gc, object, &ch, &colour ); - buffy[bufcount] = ch; - buffy[bufcount + 1] = colour; -#ifdef USE_TILE - tileb[bufcount] = env.tile_fg(ep); - tileb[bufcount+1] = env.tile_bg(ep); -#endif - - if (map) + // Now we get to filling in both the unseen + // grids in the env.show radius area as + // well doing the clean_map. The clean_map + // is done by having the env.map_knowledge set to the + // backup character above, and down here we + // procede to override that character if it's + // out of LoS! If it wasn't, buffy would have + // already been set (but we'd still have + // clobbered env.map_knowledge... which is important + // to do for when we move away from the area!) + if (buffy[bufcount] == 0) { - // This section is very tricky because it - // duplicates the old code (which was horrid). + // Show map. + buffy[bufcount] = get_map_knowledge_char(gc); + buffy[bufcount + 1] = DARKGREY; - // If the grid is in LoS env.show was set and - // we set the buffer already, so... - if (buffy[bufcount] != 0) + if (Options.colour_map) { - // ... map that we've seen this - if (is_terrain_changed(gc) || !is_terrain_seen(gc)) - update_excludes.push_back(gc); - - set_terrain_seen(gc); - set_map_knowledge_glyph(gc, object, colour ); - set_map_knowledge_detected_mons(gc, false); - set_map_knowledge_detected_item(gc, false); -#ifdef USE_TILE - // We remove any references to mcache when - // writing to the background. - if (Options.clean_map) - { - env.tile_bk_fg(gc) = - get_clean_map_idx(env.tile_fg(ep)); - } - else - { - env.tile_bk_fg(gc) = env.tile_fg(ep); - } - env.tile_bk_bg(gc) = env.tile_bg(ep); -#endif + buffy[bufcount + 1] = + colour_code_map(gc, Options.item_colour); } - - // Check if we're looking to clean_map... - // but don't touch the buffer to clean it, - // instead we modify the env.map_knowledge itself so - // that the map stays clean as it moves out - // of the env.show radius. - // - // Note: show_backup is 0 on every square which - // is inside the env.show radius and doesn't - // have a monster or cloud on it, and is equal - // to the grid before monsters and clouds were - // added otherwise. - if (Options.clean_map - && env.show.get_backup(ep) - && is_terrain_seen(gc)) +#ifdef USE_TILE + if (env.tile_bk_fg(gc) != 0 + || env.tile_bk_bg(gc) != 0) { - get_symbol(gc, env.show.get_backup(ep), &ch, &colour); - set_map_knowledge_glyph(gc, env.show.get_backup(ep), colour); - } + tileb[bufcount] = env.tile_bk_fg(gc); - // Now we get to filling in both the unseen - // grids in the env.show radius area as - // well doing the clean_map. The clean_map - // is done by having the env.map_knowledge set to the - // backup character above, and down here we - // procede to override that character if it's - // out of LoS! If it wasn't, buffy would have - // already been set (but we'd still have - // clobbered env.map_knowledge... which is important - // to do for when we move away from the area!) - if (buffy[bufcount] == 0) + tileb[bufcount + 1] = + env.tile_bk_bg(gc) | tile_unseen_flag(gc); + } + else { - // Show map. - buffy[bufcount] = get_map_knowledge_char(gc); - buffy[bufcount + 1] = DARKGREY; - - if (Options.colour_map) - { - buffy[bufcount + 1] = - colour_code_map(gc, Options.item_colour); - } -#ifdef USE_TILE - if (env.tile_bk_fg(gc) != 0 - || env.tile_bk_bg(gc) != 0) - { - tileb[bufcount] = env.tile_bk_fg(gc); - - tileb[bufcount + 1] = - env.tile_bk_bg(gc) | tile_unseen_flag(gc); - } - else - { - tileidx_unseen(tileb[bufcount], - tileb[bufcount+1], - get_map_knowledge_char(gc), - gc); - } -#endif + tileidx_unseen(tileb[bufcount], + tileb[bufcount+1], + get_map_knowledge_char(gc), + gc); } +#endif } } + } - // Alter colour if flashing the characters vision. - if (flash_colour && buffy[bufcount]) - { - buffy[bufcount + 1] = - observe_cell(gc) ? real_colour(flash_colour) - : DARKGREY; - } - else if (Options.target_range > 0 && buffy[bufcount] - && (grid_distance(you.pos(), gc) > Options.target_range - || !observe_cell(gc))) - { - buffy[bufcount + 1] = DARKGREY; + // Alter colour if flashing the characters vision. + if (flash_colour && buffy[bufcount]) + { + buffy[bufcount + 1] = + observe_cell(gc) ? real_colour(flash_colour) + : DARKGREY; + } + else if (Options.target_range > 0 && buffy[bufcount] + && (grid_distance(you.pos(), gc) > Options.target_range + || !observe_cell(gc))) + { + buffy[bufcount + 1] = DARKGREY; #ifdef USE_TILE - if (observe_cell(gc)) - tileb[bufcount + 1] |= TILE_FLAG_OOR; + if (observe_cell(gc)) + tileb[bufcount + 1] |= TILE_FLAG_OOR; #endif - } - - bufcount += 2; } + + bufcount += 2; } + } - update_exclusion_los(update_excludes); + update_exclusion_los(update_excludes); - // Leaving it this way because short flashes can occur in long ones, - // and this simply works without requiring a stack. - you.flash_colour = BLACK; + // Leaving it this way because short flashes can occur in long ones, + // and this simply works without requiring a stack. + you.flash_colour = BLACK; - // Avoiding unneeded draws when running. - if (draw) - { + // Avoiding unneeded draws when running. + const bool draw = #ifdef USE_TILE - tiles.set_need_redraw(); - tiles.load_dungeon(&tileb[0], crawl_view.vgrdc); - tiles.update_inventory(); + !is_resting() && +#endif + (!you.running || Options.travel_delay > -1 + || you.running.is_explore() && Options.explore_delay > -1) + && !you.asleep(); + + if (draw) + { +#ifdef USE_TILE + tiles.set_need_redraw(); + tiles.load_dungeon(&tileb[0], crawl_view.vgrdc); + tiles.update_inventory(); #else - you.last_view_update = you.num_turns; - puttext(crawl_view.viewp.x, crawl_view.viewp.y, - crawl_view.viewp.x + crawl_view.viewsz.x - 1, - crawl_view.viewp.y + crawl_view.viewsz.y - 1, - buffy); + you.last_view_update = you.num_turns; + puttext(crawl_view.viewp.x, crawl_view.viewp.y, + crawl_view.viewp.x + crawl_view.viewsz.x - 1, + crawl_view.viewp.y + crawl_view.viewsz.y - 1, + buffy); - update_monster_pane(); + update_monster_pane(); #endif - } } _debug_pane_bounds(); diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index 9c8445f508..5a9c9577e7 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -49,7 +49,7 @@ 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 draw_it, bool do_updates); +void viewwindow(bool do_updates); void update_monsters_in_view(); void handle_seen_interrupt(monsters* monster); void flush_comes_into_view(); diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index 4a691c7725..5d178d02c1 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -214,7 +214,7 @@ static void _wizard_go_to_level(const level_pos &pos) if (!crawl_state.test) save_game_state(); new_level(); - viewwindow(true, true); + viewwindow(true); // Tell stash-tracker and travel that we've changed levels. trackers_init_new_level(true); @@ -620,7 +620,7 @@ static void _debug_kill_traps() static int _debug_time_explore() { - viewwindow(true, false); + viewwindow(false); start_explore(false); unwind_var es(Options.explore_stop, 0); diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc index 269032a152..d6c15acbd4 100644 --- a/crawl-ref/source/wiz-mon.cc +++ b/crawl-ref/source/wiz-mon.cc @@ -1110,7 +1110,7 @@ void debug_pathfind(int mid) static void _miscast_screen_update() { - viewwindow(true, false); + viewwindow(false); you.redraw_status_flags = REDRAW_LINE_1_MASK | REDRAW_LINE_2_MASK | REDRAW_LINE_3_MASK; diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index b648367698..335349b10a 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3034,7 +3034,7 @@ bool move_stair(coord_def stair_pos, bool away, bool allow_under) beam.fire(); // Clear out "missile trails" - viewwindow(true, false); + viewwindow(false); if (!swap_features(stair_pos, ray.pos(), false, false)) { -- cgit v1.2.3-54-g00ecf