summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilepick.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-04 10:04:17 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-04 16:50:18 +0100
commit6f10cd2574eeb8a1417eff84718edd309287ac0d (patch)
tree69a45fe0e35cb559a3285b08697c96c230fc0c0f /crawl-ref/source/tilepick.cc
parent9ad85435681ad82c7ef07d2083e40e525e2b0f55 (diff)
downloadcrawl-ref-6f10cd2574eeb8a1417eff84718edd309287ac0d.tar.gz
crawl-ref-6f10cd2574eeb8a1417eff84718edd309287ac0d.zip
Get rid of multiple-meaning "int object" in env.show.
env.show is now a class show_def that stores tagged unions of type show_type. For the moment, there's also env.show_los for use in LOS determination, but that should become an array of boolean at some point. This breaks save compatibility. Tiles and console version build and appear to work fine, but this kind of change is likely to have some side-effects.
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r--crawl-ref/source/tilepick.cc33
1 files changed, 14 insertions, 19 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 9e43162d58..8b696a0ae5 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -2343,11 +2343,9 @@ static int _tileidx_shop(coord_def where)
}
}
-int tileidx_feature(int object, int gx, int gy)
+int tileidx_feature(dungeon_feature_type feat, int gx, int gy)
{
- ASSERT(object < NUM_REAL_FEATURES);
-
- switch (object)
+ switch (feat)
{
case DNGN_UNSEEN:
return TILE_DNGN_UNSEEN;
@@ -2363,7 +2361,7 @@ int tileidx_feature(int object, int gx, int gy)
const dungeon_feature_type appear
= grid_secret_door_appearance(coord_def(gx, gy));
ASSERT(!feat_is_secret_door(appear));
- return tileidx_feature((int) appear, gx, gy);
+ return tileidx_feature(appear, gx, gy);
}
case DNGN_CLEAR_ROCK_WALL:
case DNGN_CLEAR_STONE_WALL:
@@ -2553,9 +2551,9 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_DRY_FOUNTAIN_BLOOD:
case DNGN_PERMADRY_FOUNTAIN:
return TILE_DNGN_DRY_FOUNTAIN;
+ default:
+ return TILE_DNGN_ERROR;
}
-
- return TILE_DNGN_ERROR;
}
static int _tileidx_cloud(int type, int decay)
@@ -4534,18 +4532,15 @@ void tile_draw_floor()
const coord_def gc = show2grid(ep);
int bg = TILE_DNGN_UNSEEN | tile_unseen_flag(gc);
- int object = show_appearance(ep);
- if (object != 0 && map_bounds(gc))
+ if (env.show_los(ep))
{
- bg = tileidx_feature(object, gc.x, gc.y);
+ dungeon_feature_type feat = grid_appearance(gc);
+ bg = tileidx_feature(feat, gc.x, gc.y);
- if (in_bounds(gc))
- {
- if (object == DNGN_DETECTED_SECRET_DOOR)
- bg |= TILE_FLAG_WAS_SECRET;
- else if (is_unknown_stair(gc))
- bg |= TILE_FLAG_NEW_STAIR;
- }
+ if (feat == DNGN_DETECTED_SECRET_DOOR)
+ bg |= TILE_FLAG_WAS_SECRET;
+ else if (is_unknown_stair(gc))
+ bg |= TILE_FLAG_NEW_STAIR;
}
// init tiles
@@ -4673,11 +4668,11 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground, bool detected)
// features.
if (is_terrain_mapped(gc))
{
- unsigned int feature = grd(gc);
+ dungeon_feature_type feature = grd(gc);
unsigned int grid_symbol;
unsigned short grid_colour;
- get_item_symbol(feature, &grid_symbol, &grid_colour);
+ get_show_symbol(show_type(feature), &grid_symbol, &grid_colour);
unsigned int fg;
unsigned int bg;