diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-10 17:42:55 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-10 17:42:55 +0000 |
commit | 9d879dbda0fd96b079aac0905d83f7c289e97a36 (patch) | |
tree | 7736bf0e5f422e21be5f47a5b253769c10bb49b9 /crawl-ref/source | |
parent | 1beb0abbfd7972efabd7817a0359b2c57cd91524 (diff) | |
download | crawl-ref-9d879dbda0fd96b079aac0905d83f7c289e97a36.tar.gz crawl-ref-9d879dbda0fd96b079aac0905d83f7c289e97a36.zip |
Some whitespace changes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4179 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/effects.cc | 108 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 130 |
2 files changed, 119 insertions, 119 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 31f93b6854..e050246104 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -299,7 +299,7 @@ void banished(dungeon_feature_type gate_type, const std::string &who) case DNGN_ENTER_DIS: case DNGN_ENTER_GEHENNA: case DNGN_ENTER_COCYTUS: - case DNGN_ENTER_TARTARUS: + case DNGN_ENTER_TARTARUS: if (player_in_hell() || player_in_branch(BRANCH_VESTIBULE_OF_HELL)) { mpr("You feel dizzy for a moment."); @@ -450,7 +450,7 @@ bool lose_stat(unsigned char which_stat, unsigned char stat_loss, bool force, // Actually, that code was somewhat flawed. Several race-class combos // can start with a stat lower than three, and this block (which // used to say '!=' would actually cause stat gain with the '< 3' - // check that used to be above. Crawl has stat-death code and I + // check that used to be above. Crawl has stat-death code and I // don't see why we shouldn't be using it here. -- bwr if (newValue < *ptr_stat) { @@ -754,7 +754,7 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2) static armour_type random_nonbody_armour_type() { const armour_type at = - static_cast<armour_type>( + static_cast<armour_type>( random_choose(ARM_SHIELD, ARM_CLOAK, ARM_HELMET, ARM_GLOVES, ARM_BOOTS, -1)); return (at); @@ -764,7 +764,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, int &quantity) { ASSERT(class_wanted != OBJ_RANDOM); - + int type_wanted = OBJ_RANDOM; int iteration = 0; @@ -807,7 +807,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, type_wanted = POT_BLOOD; quantity = 2 + random2(4); } - else + else { // Meat is better than bread (except for herbivores), and // by choosing it as the default we don't have to worry @@ -815,12 +815,12 @@ static int find_acquirement_subtype(object_class_type class_wanted, type_wanted = FOOD_MEAT_RATION; if (you.mutation[MUT_HERBIVOROUS]) - type_wanted = FOOD_BREAD_RATION; + type_wanted = FOOD_BREAD_RATION; // If we have some regular rations, then we're probably more - // interested in faster foods (especially royal jelly)... + // interested in faster foods (especially royal jelly)... // otherwise the regular rations should be a good enough offer. - if (already_has[FOOD_MEAT_RATION] + if (already_has[FOOD_MEAT_RATION] + already_has[FOOD_BREAD_RATION] >= 2 || coinflip()) { type_wanted = one_chance_in(5) ? FOOD_HONEYCOMB @@ -868,7 +868,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, item_considered.sub_type = i; const int acqweight = property(item_considered, PWPN_ACQ_WEIGHT); - + if (!acqweight) continue; @@ -907,7 +907,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, case SK_CROSSBOWS: type_wanted = MI_DART; - for (int i = 0; i < ENDOFPACK; i++) + for (int i = 0; i < ENDOFPACK; i++) { // Assuming that crossbow in inventory means that they // want bolts for it (not darts for a hand crossbow)... @@ -925,7 +925,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, case SK_DARTS: type_wanted = MI_DART; - for (int i = 0; i < ENDOFPACK; i++) + for (int i = 0; i < ENDOFPACK; i++) { if (is_valid_item( you.inv[i] ) && you.inv[i].base_type == OBJ_WEAPONS @@ -944,7 +944,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, default: type_wanted = MI_DART; break; - } + } } else if (class_wanted == OBJ_ARMOUR) { @@ -1003,7 +1003,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, break; default: - if (type_wanted == ARM_CENTAUR_BARDING + if (type_wanted == ARM_CENTAUR_BARDING || type_wanted == ARM_NAGA_BARDING) { type_wanted = ARM_BOOTS; @@ -1037,9 +1037,9 @@ static int find_acquirement_subtype(object_class_type class_wanted, if (type_wanted == OBJ_RANDOM || type_wanted == ARM_ROBE) { // start with normal base armour - if (type_wanted == ARM_ROBE) + if (type_wanted == ARM_ROBE) type_wanted = coinflip() ? ARM_ROBE : ARM_ANIMAL_SKIN; - else + else { type_wanted = ARM_ROBE + random2(8); @@ -1097,7 +1097,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, iteration = 1; type_wanted = NUM_BOOKS; - best_spell = best_skill( SK_SPELLCASTING, (NUM_SKILLS - 1), + best_spell = best_skill( SK_SPELLCASTING, (NUM_SKILLS - 1), best_spell ); which_book: @@ -1209,7 +1209,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, type_wanted = give_first_conjuration_book(); else if (!you.had_book[BOOK_TEMPESTS]) type_wanted = BOOK_TEMPESTS; - + // now a Vehumet special -- bwr // else if (!you.had_book[BOOK_ANNIHILATIONS]) // type_wanted = BOOK_ANNIHILATIONS; @@ -1308,7 +1308,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, best_spell = best_skill( SK_SPELLCASTING, (NUM_SKILLS-1), 99 ); - // If we're going to give out an enhancer stave, + // If we're going to give out an enhancer stave, // we should at least bias things towards the // best spell skill. -- bwr switch (best_spell) @@ -1400,7 +1400,7 @@ static int find_acquirement_subtype(object_class_type class_wanted, } break; - case OBJ_MISCELLANY: + case OBJ_MISCELLANY: do type_wanted = random2(NUM_MISCELLANY); while (type_wanted == MISC_HORN_OF_GERYON @@ -1968,7 +1968,7 @@ void yell(bool force) bool forget_inventory(bool quiet) { int items_forgotten = 0; - + for (int i = 0; i < ENDOFPACK; i++) { item_def& item(you.inv[i]); @@ -2022,7 +2022,7 @@ bool vitrify_area(int radius) { if (radius < 2) return (false); - + const int radius2 = radius * radius; // this hinges on clear wall types having the same order as non-clear ones const int clear_plus = DNGN_CLEAR_ROCK_WALL - DNGN_ROCK_WALL; @@ -2033,7 +2033,7 @@ bool vitrify_area(int radius) if ( distance(x,y,you.x_pos,you.y_pos) < radius2 ) { dungeon_feature_type grid = grd[x][y]; - + if (grid == DNGN_ROCK_WALL || grid == DNGN_STONE_WALL || grid == DNGN_PERMAROCK_WALL ) @@ -2044,7 +2044,7 @@ bool vitrify_area(int radius) } } } - + return (something_happened); } @@ -2161,7 +2161,7 @@ static void hell_effects() // try to summon at least one and up to five random monsters {dlb} if (one_chance_in(3)) { - create_monster( RANDOM_MONSTER, 0, BEH_HOSTILE, + create_monster( RANDOM_MONSTER, 0, BEH_HOSTILE, you.x_pos, you.y_pos, MHITYOU, MONS_PROGRAM_BUG ); for (int i = 0; i < 4; i++) @@ -2204,7 +2204,7 @@ static bool food_item_needs_time_check(item_def &item) { return false; } - + return true; } @@ -2342,7 +2342,7 @@ static void rot_inventory_food(long time_delta) if (num_blood_coagulates) { ASSERT(affected_potion != -1); - + std::string msg = ""; if (num_total_blood == num_blood_coagulates) @@ -2363,9 +2363,9 @@ static void rot_inventory_food(long time_delta) if (num_blood_coagulates == 1) msg += "s"; msg += "."; - + mpr(msg.c_str(), MSGCH_ROTTEN_MEAT); - + const bool known_blood = item_type_known(you.inv[affected_potion]); you.inv[affected_potion].sub_type = POT_BLOOD_COAGULATED; you.inv[affected_potion].plus @@ -2382,7 +2382,7 @@ static void rot_inventory_food(long time_delta) mpr(you.inv[affected_potion].name(DESC_INVENTORY, false).c_str()); } } - + if (burden_changed_by_rot) { mpr("Your equipment suddenly weighs less.", MSGCH_ROTTEN_MEAT); @@ -2468,7 +2468,7 @@ void handle_time( long time_delta ) // index of 2 does about 0.58 points of contamination per turn. // A randart with a mutagen index of 5 does about 0.7 points of // contamination per turn. - + const int mean_glow = 500 + randart_glow * 40; const int actual_glow = mean_glow / 2 + random2(mean_glow); added_contamination += div_rand_round(actual_glow, 1000); @@ -2603,7 +2603,7 @@ void handle_time( long time_delta ) if (random2(100) < total_skill) { item_def& item = you.inv[you.equip[EQ_WEAPON]]; - + set_ident_type( OBJ_STAVES, item.sub_type, ID_KNOWN_TYPE ); set_ident_flags( item, ISFLAG_IDENT_MASK ); @@ -2683,23 +2683,23 @@ static void catchup_monster_moves(monsters *mon, int turns) // const bool short_time = (range >= 5 + random2(10)); const bool long_time = (range >= (500 + roll_dice( 2, 500 ))); - const bool ranged_attack = (mons_has_ranged_spell( mon ) - || mons_has_ranged_attack( mon )); + const bool ranged_attack = (mons_has_ranged_spell( mon ) + || mons_has_ranged_attack( mon )); #if DEBUG_DIAGNOSTICS // probably too annoying even for DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "mon #%d: range %d; long %d; " - "pos (%d,%d); targ %d(%d,%d); flags %ld", - monster_index(mon), range, long_time, mon->x, mon->y, + "pos (%d,%d); targ %d(%d,%d); flags %ld", + monster_index(mon), range, long_time, mon->x, mon->y, mon->foe, mon->target_x, mon->target_y, mon->flags ); -#endif +#endif if (range <= 0) return; - if (long_time - && (mon->behaviour == BEH_FLEE + if (long_time + && (mon->behaviour == BEH_FLEE || mon->behaviour == BEH_CORNERED || testbits( mon->flags, MF_BATTY ) || ranged_attack @@ -2709,20 +2709,20 @@ static void catchup_monster_moves(monsters *mon, int turns) { mon->behaviour = BEH_WANDER; mon->foe = MHITNOT; - mon->target_x = 10 + random2( GXM - 10 ); - mon->target_y = 10 + random2( GYM - 10 ); + mon->target_x = 10 + random2( GXM - 10 ); + mon->target_y = 10 + random2( GYM - 10 ); } - else + else { // monster will be sleeping after we move it - mon->behaviour = BEH_SLEEP; + mon->behaviour = BEH_SLEEP; } } else if (ranged_attack) { - // if we're doing short time movement and the monster has a + // if we're doing short time movement and the monster has a // ranged attack (missile or spell), then the monster will - // flee to gain distance if its "too close", else it will + // flee to gain distance if its "too close", else it will // just shift its position rather than charge the player. -- bwr if (grid_distance(mon->x, mon->y, mon->target_x, mon->target_y) < 3) { @@ -2794,7 +2794,7 @@ static void catchup_monster_moves(monsters *mon, int turns) #if DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "moved to (%d,%d)", mon->x, mon->y ); -#endif +#endif } //--------------------------------------------------------------- @@ -2815,7 +2815,7 @@ void update_level( double elapsedTime ) #endif update_corpses( elapsedTime ); - + if (env.sanctuary_time) { if (turns >= env.sanctuary_time) @@ -2848,7 +2848,7 @@ void update_level( double elapsedTime ) // This is the monster healing code, moved here from tag.cc: if (monster_descriptor( mon->type, MDSC_REGENERATES ) || mon->type == MONS_PLAYER_GHOST) - { + { heal_monster( mon, turns, false ); } else @@ -2856,13 +2856,13 @@ void update_level( double elapsedTime ) // Set a lower ceiling of 0.1 on the regen rate. const int regen_rate = std::max(mons_natural_regen_rate(mon) * 2, 5); - + heal_monster( mon, div_rand_round(turns * regen_rate, 50), false ); } catchup_monster_moves( mon, turns ); - + if (turns >= 10 && mon->alive()) mon->timeout_enchantments( turns / 10 ); } @@ -2937,10 +2937,10 @@ void update_corpses(double elapsedTime) for (int c = 0; c < MAX_ITEMS; c++) { item_def &it = mitm[c]; - + if (!food_item_needs_time_check(it)) continue; - + if (rot_time >= it.special && !is_being_butchered(it)) { if (it.base_type == OBJ_FOOD || it.base_type == OBJ_POTIONS) @@ -2967,16 +2967,16 @@ void update_corpses(double elapsedTime) // potions of blood have a longer rot time if (it.base_type != OBJ_POTIONS) ASSERT(rot_time < 256); - + it.special -= rot_time; - + if (it.base_type == OBJ_POTIONS && it.sub_type == POT_BLOOD && it.special < 200) { ASSERT(rot_time < 1200); it.sub_type = POT_BLOOD_COAGULATED; - + it.plus = you.item_description[IDESC_POTIONS][POT_BLOOD_COAGULATED]; } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 37676e3e81..31cb53b01f 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -539,7 +539,7 @@ static unsigned short _dos_reverse_brand(unsigned short colour) // background high-intensity bit is actually a blink bit. Blinking is // evil, so we strip the background high-intensity bit. This, sadly, // limits us to 7 background colours. - + // Strip off high-intensity bit. Special case DARKGREY, since it's the // high-intensity counterpart of black, and we don't want black on // black. @@ -1050,7 +1050,7 @@ void handle_monster_shouts(monsters* monster, bool force) { msg = do_mon_str_replacements(msg, monster); msg_channel_type channel = MSGCH_TALK; - + std::string param = ""; std::string::size_type pos = msg.find(":"); @@ -1106,7 +1106,7 @@ inline static bool _update_monster_grid(const monsters *monster) { _set_show_backup(ex, ey); env.show[ex][ey] = DNGN_INVIS_EXPOSED; - env.show_col[ex][ey] = BLUE; + env.show_col[ex][ey] = BLUE; } return (false); } @@ -1145,7 +1145,7 @@ void monster_grid(bool do_updates) #ifdef USE_TILE tile_place_monster(monster->x, monster->y, s, true); #endif - + if (player_monster_visible(monster) && !mons_is_submerged(monster) && !mons_friendly(monster) @@ -1262,7 +1262,7 @@ bool check_awaken(monsters* monster) } else // unnatural creature { - // Unnatural monsters don't actually "sleep", they just + // Unnatural monsters don't actually "sleep", they just // haven't noticed an intruder yet... we'll assume that // they're diligently on guard. mons_perc += 10; @@ -1476,7 +1476,7 @@ void cloud_grid(void) { // can anyone explain this??? {dlb} // its an optimization to avoid looking past the last cloud -bwr - if (mnc >= env.cloud_no) + if (mnc >= env.cloud_no) break; if (env.cloud[s].type != CLOUD_NONE) @@ -1488,7 +1488,7 @@ void cloud_grid(void) } } -// Noisy now has a messenging service for giving messages to the +// Noisy now has a messenging service for giving messages to the // player is appropriate. // // Returns true if the PC heard the noise. @@ -1524,7 +1524,7 @@ bool noisy( int loudness, int nois_x, int nois_y, const char *msg ) ret = true; } - + for (int p = 0; p < MAX_MONSTERS; p++) { monster = &menv[p]; @@ -1825,7 +1825,7 @@ void ray_def::advance_and_bounce() const bool blocked_x = grid_is_solid(grd[oldx][newy]); const bool blocked_y = grid_is_solid(grd[newx][oldy]); - + if ( double_is_zero(slope) || slope > 100.0 ) quadrant = bouncequad[quadrant][2]; else if ( rc != 2 ) @@ -1861,16 +1861,16 @@ int ray_def::advance(bool shortest_possible, const coord_def *target) { if (!shortest_possible) return (raw_advance()); - + // If we want to minimize the number of moves on the ray, look one // step ahead and see if we can get a diagonal. - + const coord_def old(static_cast<int>(accx), static_cast<int>(accy)); const int ret = raw_advance(); if (ret == 2 || (target && pos() == *target)) return (ret); - + const double maccx = accx, maccy = accy; if (raw_advance() != 2) { @@ -1908,13 +1908,13 @@ int ray_def::raw_advance() accy = 100.0 - EPSILON_VALUE/10.0 - accy; rc = _find_next_intercept( &accx, &accy, slope ); accx = 100.0 - EPSILON_VALUE/10.0 - accx; - accy = 100.0 - EPSILON_VALUE/10.0 - accy; + accy = 100.0 - EPSILON_VALUE/10.0 - accy; return rc; case 3: // going up-right accy = 100.0 - EPSILON_VALUE/10.0 - accy; rc = _find_next_intercept( &accx, &accy, slope ); - accy = 100.0 - EPSILON_VALUE/10.0 - accy; + accy = 100.0 - EPSILON_VALUE/10.0 - accy; return rc; default: return -1; @@ -2140,7 +2140,7 @@ static void _create_blockrays() for ( unsigned int i = 0; i < num_nondupe_rays; ++i ) if ( get_bit_in_long_array(oldptr, nondupe_cellrays[i]) ) _set_bit_in_long_array(newptr, i); - + oldptr += num_words; newptr += num_nondupe_words; } @@ -2150,7 +2150,7 @@ static void _create_blockrays() dead_rays = new unsigned long[num_nondupe_words]; smoke_rays = new unsigned long[num_nondupe_words]; - + #ifdef DEBUG_DIAGNOSTICS mprf( MSGCH_DIAGNOSTICS, "Cellrays: %d Fullrays: %u Compressed: %u", num_cellrays, raylengths.size(), num_nondupe_rays ); @@ -2182,9 +2182,9 @@ void raycast() static bool done_raycast = false; if ( done_raycast ) return; - + // Creating all rays for first quadrant - // We have a considerable amount of overkill. + // We have a considerable amount of overkill. done_raycast = true; // register perpendiculars FIRST, to make them top choice @@ -2223,8 +2223,8 @@ void raycast() xstart += EPSILON_VALUE / 10.0; if ( intercept == yangle ) xstart -= EPSILON_VALUE / 10.0; - - // y should be "about to change" + + // y should be "about to change" _register_ray( xstart, 1.0 - EPSILON_VALUE / 10.0, slope ); // also draw the identical ray in octant 2 _register_ray( 1.0 - EPSILON_VALUE / 10.0, xstart, rslope ); @@ -2283,7 +2283,7 @@ static double _slope_factor(const ray_def &ray) if (double_is_zero(xdiff) && double_is_zero(ydiff)) return ray.slope; - + const double slope = _calc_slope(ydiff, xdiff); return (slope + ray.slope) / 2.0; } @@ -2327,7 +2327,7 @@ bool find_ray( int sourcex, int sourcey, int targetx, int targety, const double want_slope = _calc_slope(absx, absy); double slope_diff = VERTICAL_SLOPE * 10.0; std::vector<coord_def> unaliased_ray; - + for ( unsigned int fray = 0; fray < fullrays.size(); ++fray ) { const int fullray = _cyclic_offset( fray, cycle_dir, ray.fullray_idx, @@ -2382,7 +2382,7 @@ bool find_ray( int sourcex, int sourcey, int targetx, int targety, } else ++real_length; - + unaliased_ray.push_back(c3); c1 = unaliased_ray[real_length - 1]; } @@ -2402,7 +2402,7 @@ bool find_ray( int sourcex, int sourcey, int targetx, int targety, { const int dist = (unaliased_ray[i] - unaliased_ray[i - 1]).abs(); - + if (dist == 2) { straights = 0; @@ -2451,7 +2451,7 @@ bool find_ray( int sourcex, int sourcey, int targetx, int targety, if (find_shortest && shortest != INFINITE_DISTANCE) return (true); - + if ( allow_fallback ) { ray.accx = sourcex + 0.5; @@ -2581,7 +2581,7 @@ void losight(env_show_grid &sh, for (int ydiff = 0; ydiff <= LOS_MAX_RANGE_Y; ++ydiff, inptr += num_words ) { - + const int realx = x_p + xdiff * xmult; const int realy = y_p + ydiff * ymult; @@ -2591,7 +2591,7 @@ void losight(env_show_grid &sh, dungeon_feature_type dfeat = gr[realx][realy]; if (dfeat == DNGN_SECRET_DOOR) dfeat = grid_secret_door_appearance(realx, realy); - + // if this cell is opaque... if ( grid_is_opaque(dfeat) || (clear_walls_block && grid_is_wall(dfeat))) @@ -2777,7 +2777,7 @@ bool is_feature(int feature, int x, int y) default: return false; } - default: + default: return get_envmap_char(x, y) == (unsigned) feature; } } @@ -2952,16 +2952,16 @@ static void _draw_level_map(int start_x, int start_y, bool travel_mode) else { colour = colour_code_map(c.x, c.y, - Options.item_colour, + Options.item_colour, travel_mode); buffer2[bufcount2 + 1] = colour; buffer2[bufcount2] = env.map(c).glyph(); - + if (c == you.pos()) { // [dshaligram] Draw the @ symbol on the level-map. It's no - // longer saved into the env.map, so we need to draw it + // longer saved into the env.map, so we need to draw it // directly. buffer2[bufcount2 + 1] = WHITE; buffer2[bufcount2] = you.symbol; @@ -2980,10 +2980,10 @@ static void _draw_level_map(int start_x, int start_y, bool travel_mode) bc = ch; } } - + bufcount2 += 2; } - + puttext(1, top, num_cols, top + num_lines - 1, buffer2); } #endif // USE_TILE @@ -3062,7 +3062,7 @@ void show_map( coord_def &spec_place, bool travel_mode ) // // The num_lines comparisons are done to keep things neat, by // keeping things at the top of the screen. By shifting an - // additional one in the num_lines > map_lines case, we can + // additional one in the num_lines > map_lines case, we can // keep the top line clear... which makes things look a whole // lot better for small maps. if (num_lines > map_lines) @@ -3130,7 +3130,7 @@ void show_map( coord_def &spec_place, bool travel_mode ) case CONTROL('F'): forget_map(100, true); break; - + case CONTROL('W'): travel_cache.add_waypoint(start_x + curs_x - 1, start_y + curs_y - 1); @@ -3149,7 +3149,7 @@ void show_map( coord_def &spec_place, bool travel_mode ) const coord_def p(start_x + curs_x - 1, start_y + curs_y - 1); if (is_exclude_root(p)) cycle_exclude_radius(p); - + _reset_travel_colours(features); move_x = move_y = 0; break; @@ -3322,14 +3322,14 @@ void show_map( coord_def &spec_place, bool travel_mode ) case CK_MOUSE_MOVE: move_x = move_y = 0; break; - + case CK_MOUSE_CLICK: { const c_mouse_event cme = get_mouse_event(); const coord_def curp(start_x + curs_x - 1, start_y + curs_y - 1); const coord_def grdp = cme.pos + coord_def(start_x - 1, start_y - top); - + if (cme.left_clicked() && in_bounds(grdp)) { spec_place = grdp; @@ -3405,7 +3405,7 @@ void show_map( coord_def &spec_place, bool travel_mode ) if (num_lines < map_lines) { - // Scrolling only happens when we don't have a large enough + // Scrolling only happens when we don't have a large enough // display to show the known map. if (scroll_y < 0 && ((screen_y += scroll_y) <= min_y + half_screen)) screen_y = min_y + half_screen; @@ -3414,7 +3414,7 @@ void show_map( coord_def &spec_place, bool travel_mode ) screen_y = max_y - half_screen; scroll_y = 0; - + if (curs_y + move_y < 1) { screen_y += move_y; @@ -3632,7 +3632,7 @@ bool trans_wall_blocking( const coord_def &p ) return see_grid(p) && !see_grid_no_trans(p); } -static const unsigned dchar_table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = +static const unsigned dchar_table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = { // CSET_ASCII { @@ -3687,7 +3687,7 @@ dungeon_char_type dchar_by_name(const std::string &name) "item_stave", "item_miscellany", "item_corpse", "item_gold", "item_amulet", "cloud" }; - + for (unsigned i = 0; i < sizeof(dchar_names) / sizeof(*dchar_names); ++i) if (dchar_names[i] == name) return dungeon_char_type(i); @@ -3908,20 +3908,20 @@ void init_feature_table( void ) case DNGN_ENTER_PORTAL_VAULT: Feature[i].flags |= FFT_NOTABLE; // fall through - + case DNGN_EXIT_PORTAL_VAULT: Feature[i].dchar = DCHAR_ARCH; Feature[i].colour = EC_SHIMMER_BLUE; Feature[i].map_colour = LIGHTGREY; Feature[i].seen_colour = EC_SHIMMER_BLUE; - break; + break; case DNGN_ESCAPE_HATCH_DOWN: Feature[i].dchar = DCHAR_STAIRS_DOWN; Feature[i].colour = BROWN; Feature[i].map_colour = BROWN; break; - + case DNGN_STONE_STAIRS_DOWN_I: case DNGN_STONE_STAIRS_DOWN_II: case DNGN_STONE_STAIRS_DOWN_III: @@ -3937,7 +3937,7 @@ void init_feature_table( void ) Feature[i].colour = BROWN; Feature[i].map_colour = BROWN; break; - + case DNGN_STONE_STAIRS_UP_I: case DNGN_STONE_STAIRS_UP_II: case DNGN_STONE_STAIRS_UP_III: @@ -4354,7 +4354,7 @@ int multibyte_strlen(const std::string &s) } // Returns a string containing an ASCII representation of the map. If fullscreen -// is set to false, only the viewable area is returned. Leading and trailing +// is set to false, only the viewable area is returned. Leading and trailing // spaces are trimmed from each line. Leading and trailing empty lines are also // snipped. std::string screenshot( bool fullscreen ) @@ -4402,12 +4402,12 @@ std::string screenshot( bool fullscreen ) _get_symbol( gc.x, gc.y, object, &glych, &glycol ); ch = glych; } - + // More mangling to accommodate C strings. if (!ch) ch = ' '; - if (ch != ' ') + if (ch != ' ') { lastnonspace = count_x; lastpopline = count_y; @@ -4666,7 +4666,7 @@ void viewwindow(bool draw_it, bool do_updates) if (Options.colour_map) { - buffy[bufcount + 1] = + buffy[bufcount + 1] = colour_code_map(gc.x, gc.y, Options.item_colour); } @@ -4699,7 +4699,7 @@ void viewwindow(bool draw_it, bool do_updates) #ifdef USE_TILE if (map) { - env.tile_bk_bg[gc.x][gc.y] = + env.tile_bk_bg[gc.x][gc.y] = env.tile_bg[ep.x-1][ep.y-1]; } @@ -4716,7 +4716,7 @@ void viewwindow(bool draw_it, bool do_updates) { if (grd(gc) == DNGN_DEEP_WATER) buffy[bufcount + 1] = BLUE; - else + else buffy[bufcount + 1] = CYAN; } } @@ -4740,9 +4740,9 @@ void viewwindow(bool draw_it, bool do_updates) if (map) { - // This section is very tricky because it + // This section is very tricky because it // duplicates the old code (which was horrid). - + // if the grid is in LoS env.show was set and // we set the buffer already, so... if (buffy[bufcount] != 0) @@ -4793,14 +4793,14 @@ void viewwindow(bool draw_it, bool do_updates) colour ); } - // Now we get to filling in both the unseen - // grids in the env.show radius area as + // 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 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 + // already been set (but we'd still have // clobbered env.map... which is important // to do for when we move away from the area!) if (buffy[bufcount] == 0) @@ -4810,8 +4810,8 @@ void viewwindow(bool draw_it, bool do_updates) buffy[bufcount + 1] = DARKGREY; if (Options.colour_map) - { - buffy[bufcount + 1] = + { + buffy[bufcount + 1] = colour_code_map(gc.x, gc.y, Options.item_colour); } @@ -4937,7 +4937,7 @@ class _layout mlistp(-1,-1), mlistsz(MLIST_MIN_WIDTH, 0), hud_gutter(HUD_MIN_GUTTER), valid(false) {} - + protected: void _assert_validity() const { @@ -5036,7 +5036,7 @@ class _inline_layout : public _layout // ll vvvvvvghhh v=view, g=hud gutter, h=hud, l=list, m=msg // ll vvvvvvghhh -// ll vvvvvv +// ll vvvvvv // mmmmmmmmmmmmm class _mlist_col_layout : public _layout { @@ -5057,7 +5057,7 @@ class _mlist_col_layout : public _layout _increment(mlistsz.x, leftover_x(), MLIST_MAX_WIDTH); _increment(hud_gutter, leftover_x(), HUD_MAX_GUTTER); msgsz.x = termsz.x-1; // Can't use last character - + // y: View gets leftover; then message if (leftover_y() < 0) return false; _increment(viewsz.y, leftover_y(), Options.view_max_height); @@ -5122,7 +5122,7 @@ void crawl_view_geometry::set_player_at(const coord_def &c, bool centre) Options.scroll_margin_y + LOS_RADIUS <= viewhalfsz.y ? Options.scroll_margin_y : viewhalfsz.y - LOS_RADIUS; - + if (Options.view_lock_x) vgrdc.x = c.x; else if (c.x - LOS_RADIUS < vgrdc.x - viewhalfsz.x + xmarg) @@ -5217,12 +5217,12 @@ void crawl_view_geometry::init_geometry() void handle_terminal_resize(bool redraw) { crawl_state.terminal_resized = false; - + if (crawl_state.terminal_resize_handler) (*crawl_state.terminal_resize_handler)(); else crawl_view.init_geometry(); - + if (redraw) redraw_screen(); } |