summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-30 20:43:15 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-30 20:43:15 +0000
commitf116902db8e7f917df91a3a1e775cc43cf7dd47a (patch)
tree8ce9e5477928410e415ac3244babeed341a40f09
parenta932874b76f5657f943d879c2a0b36dab2cc3f68 (diff)
downloadcrawl-ref-f116902db8e7f917df91a3a1e775cc43cf7dd47a.tar.gz
crawl-ref-f116902db8e7f917df91a3a1e775cc43cf7dd47a.zip
Fix 1921769: Exclusion squares on the tiles minimap sometimes
not being updated. Also add yet another minimap colour option for the centre of an exclusion (defaults to darkblue). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3958 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/options_guide.txt8
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc6
-rw-r--r--crawl-ref/source/libgui.cc17
-rw-r--r--crawl-ref/source/misc.cc29
-rw-r--r--crawl-ref/source/player.cc22
-rw-r--r--crawl-ref/source/travel.cc5
8 files changed, 56 insertions, 33 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index 3f2b03239a..236de53e2e 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -82,7 +82,8 @@ The contents of this text are:
tile_item_col, tile_unseen_col, tile_floor_col, tile_wall_col,
tile_mapped_wall_col, tile_door_col, tile_downstairs_col,
tile_upstairs_col, tile_feature_col, tile_trap_col,
- tile_water_col, tile_lava_col, tile_excluded_col
+ tile_water_col, tile_lava_col, tile_excluded_col,
+ tile_excl_centre_col
5- Character Dump.
5-a Items and Kills.
kill_map, dump_kill_places, dump_item_origins,
@@ -1317,6 +1318,7 @@ tile_trap_col = yellow
tile_water_col = grey
tile_lava_col = grey
tile_excluded_col = darkcyan
+tile_excl_centre_col = darkblue
These options allow configuring the colours used for the minimap of
the dungeon level.
@@ -1339,6 +1341,8 @@ tile_excluded_col = darkcyan
tile_lava_col - colour of lava
tile_excluded_col - colour of squares excluded for autotravel
(will only override tile_floor_col colour)
+ tile_excl_centre_col - colour of exclusion centre (overrides
+ tile_floor_col and tile_item_col, only)
5- Character Dump.
@@ -1753,4 +1757,4 @@ just a particularly useful way to use the previously discussed features.
Example:
# Set the monster glyphs back to the way they were in 0.3.4
-: crawl.read_options('docs/034_monster_glyphs.txt') \ No newline at end of file
+: crawl.read_options('docs/034_monster_glyphs.txt')
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index 9e67e95c61..879ecad3dd 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -294,6 +294,7 @@ tile_show_items = !?/%=([)X}+\_.
# tile_water_col = grey
# tile_lava_col = grey
# tile_excluded_col = darkcyan
+# tile_excl_centre = darkblue
##### 5- Dump File #################################################
#
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index ff31e69961..7bebed1085 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1784,6 +1784,7 @@ public:
char tile_water_col;
char tile_lava_col;
char tile_excluded_col;
+ char tile_excl_centre_col;
#endif
#ifdef WIN32TILES
bool use_dos_char;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index fa50bf5ab3..35582ac183 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -825,6 +825,7 @@ void game_options::reset_options()
tile_water_col = MAP_MDGREY;
tile_lava_col = MAP_MDGREY;
tile_excluded_col = MAP_DKCYAN;
+ tile_excl_centre_col = MAP_DKBLUE;
#endif
#ifdef WIN32TILES
@@ -2834,6 +2835,11 @@ void game_options::read_option_line(const std::string &str, bool runscript)
tile_excluded_col =
_str_to_tile_colour(field);
}
+ else if (key == "tile_excl_centre_col" || key == "tile_excl_center_col")
+ {
+ tile_excl_centre_col =
+ _str_to_tile_colour(field);
+ }
#endif
#ifdef WIN32TILES
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index 7bb0cfa5d4..311a4a22d4 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -311,7 +311,7 @@ InvAction inv_action = INV_NUMACTIONS;
static void _gui_set_mouse_inv(int idx, InvAction act)
{
- inv_idx = idx;
+ inv_idx = idx;
inv_action = act;
}
@@ -377,8 +377,13 @@ void GmapUpdate(int x, int y, int what, bool upd_tile)
}
}
- if (c == Options.tile_floor_col && is_excluded( coord_def(x,y) ))
- c = Options.tile_excluded_col;
+ if (c == Options.tile_floor_col || c == Options.tile_item_col)
+ {
+ if (is_exclude_root( coord_def(x,y) ))
+ c = Options.tile_excl_centre_col;
+ else if (c == Options.tile_floor_col && is_excluded(coord_def(x,y)))
+ c = Options.tile_excluded_col;
+ }
}
int oldc = gmap_data[x][y];
@@ -430,12 +435,8 @@ void GmapInit(bool upd_tile)
gmap_min_y = gmap_max_y = you.y_pos - 1;
for (y = 0; y < GYM; y++)
- {
for (x = 0; x < GXM; x++)
- {
GmapUpdate(x, y, env.map[x][y].glyph(), upd_tile);
- }
- }
}
void GmapDisplay(int linex, int liney)
@@ -445,9 +446,7 @@ void GmapDisplay(int linex, int liney)
int ox, oy;
for (int x = 0; x < GXM*GYM; x++)
- {
buf2[x] = 0;
- }
ox = ( gmap_min_x + (GXM - 1 - gmap_max_x) ) / 2;
oy = ( gmap_min_y + (GYM - 1 - gmap_max_y) ) / 2;
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 1b4a9c1cc1..90f3d53e9e 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -911,8 +911,10 @@ void up_stairs(dungeon_feature_type force_stair,
exit_stair_message(stair_find, true);
if (old_where != you.where_are_you && you.level_type == LEVEL_DUNGEON)
+ {
mprf("Welcome back to %s!",
branches[you.where_are_you].longname);
+ }
#ifdef USE_TILE
const bool newlevel =
@@ -925,10 +927,6 @@ void up_stairs(dungeon_feature_type force_stair,
you.turn_is_over = true;
-#ifdef USE_TILE
- TileNewLevel(newlevel);
-#endif // USE_TILE
-
save_game_state();
new_level();
@@ -956,6 +954,10 @@ void up_stairs(dungeon_feature_type force_stair,
// Tell stash-tracker and travel that we've changed levels.
trackers_init_new_level(true);
+#ifdef USE_TILE
+ TileNewLevel(newlevel);
+#endif // USE_TILE
+
if (collect_travel_data)
{
// Update stair information for the stairs we just ascended, and the
@@ -986,8 +988,8 @@ void up_stairs(dungeon_feature_type force_stair,
// to Hell as shortcuts between dungeon levels, which won't work,
// and will confuse the dickens out of the player (well, it confused
// the dickens out of me when it happened).
- if (new_level_id.branch == BRANCH_MAIN_DUNGEON &&
- old_level_id.branch == BRANCH_VESTIBULE_OF_HELL)
+ if (new_level_id.branch == BRANCH_MAIN_DUNGEON
+ && old_level_id.branch == BRANCH_VESTIBULE_OF_HELL)
{
lp.id.depth = -1;
lp.pos.x = lp.pos.y = -1;
@@ -1019,7 +1021,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
entry_cause_type entry_cause )
{
int i;
- const level_area_type old_level_type = you.level_type;
+ const level_area_type old_level_type = you.level_type;
const dungeon_feature_type stair_find =
force_stair? force_stair : grd[you.x_pos][you.y_pos];
@@ -1425,7 +1427,9 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
you.your_level++;
else if (level_type_exits_down(you.level_type)
&& !level_type_exits_down(old_level_type))
+ {
you.your_level--;
+ }
switch (you.level_type)
@@ -1469,10 +1473,6 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
break;
}
-#ifdef USE_TILE
- TileNewLevel(newlevel);
-#endif
-
you.turn_is_over = true;
save_game_state();
@@ -1492,6 +1492,11 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
mpr( "You sense a powerful magical force warping space.", MSGCH_WARN );
trackers_init_new_level(true);
+
+#ifdef USE_TILE
+ TileNewLevel(newlevel);
+#endif // USE_TILE
+
if (collect_travel_data)
{
// Update stair information for the stairs we just descended, and the
@@ -1506,7 +1511,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
// First we update the old level's stair.
level_pos lp;
- lp.id = new_level_id;
+ lp.id = new_level_id;
lp.pos.x = you.x_pos;
lp.pos.y = you.y_pos;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index a23525e898..bdc7ba2615 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2762,7 +2762,6 @@ void forget_map(unsigned char chance_forgotten, bool force)
return;
for (unsigned char xcount = 0; xcount < GXM; xcount++)
- {
for (unsigned char ycount = 0; ycount < GYM; ycount++)
{
if (!see_grid(xcount, ycount) &&
@@ -2771,7 +2770,7 @@ void forget_map(unsigned char chance_forgotten, bool force)
env.map[xcount][ycount].clear();
}
}
- }
+
#ifdef USE_TILE
GmapInit(false);
tile_clear_buf();
@@ -5120,9 +5119,12 @@ int count_worn_ego( int which_ego )
{
int result = 0;
for ( int slot = EQ_CLOAK; slot <= EQ_BODY_ARMOUR; ++slot )
- if (you.equip[slot] != -1 &&
- get_armour_ego_type(you.inv[you.equip[slot]]) == which_ego)
+ if (you.equip[slot] != -1
+ && get_armour_ego_type(you.inv[you.equip[slot]]) == which_ego)
+ {
result++;
+ }
+
return result;
}
@@ -6643,17 +6645,21 @@ std::vector<PlaceInfo> player::get_all_place_info(bool visited_only,
for (int i = 0; i < NUM_BRANCHES; i++)
{
- if ((visited_only && branch_info[i].num_visits == 0) ||
- (dungeon_only && branch_info[i].level_type != LEVEL_DUNGEON))
+ if (visited_only && branch_info[i].num_visits == 0
+ || dungeon_only && branch_info[i].level_type != LEVEL_DUNGEON)
+ {
continue;
+ }
list.push_back(branch_info[i]);
}
for (int i = 0; i < (NUM_LEVEL_AREA_TYPES - 1); i++)
{
- if ((visited_only && non_branch_info[i].num_visits == 0) ||
- (dungeon_only && non_branch_info[i].level_type != LEVEL_DUNGEON))
+ if (visited_only && non_branch_info[i].num_visits == 0
+ || dungeon_only && non_branch_info[i].level_type != LEVEL_DUNGEON)
+ {
continue;
+ }
list.push_back(non_branch_info[i]);
}
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 1a1363d7ea..d3315077c2 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -251,13 +251,14 @@ bool is_exclude_root(const coord_def &p)
// update Gmap for squares surrounding exclude centre
static void tile_exclude_gmap_update(const coord_def p)
{
- for (int x = -8; x < 8; x++)
- for (int y = -8; y < 8; y++)
+ for (int x = -8; x <= 8; x++)
+ for (int y = -8; y <= 8; y++)
{
int px = p.x+x, py = p.y+y;
if (in_bounds(coord_def(px,py)))
GmapUpdate(px, py, env.map[px][py].glyph(), true);
}
+
GmapDisplay(p.x,p.y);
}
#endif