git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@487 c06c8d41-db1a-0410-9941-cceddc491573
D27U7RT2C77NEUBP6JCSQJ2DRCJVHOXUO2PFZ45VFYMEVMKI4TSAC
}
void set_envmap_col( int x, int y, int colour )
{
env.map_col[x - 1][y - 1].colour = colour;
env.map_col[x - 1][y - 1].flags = 0;
}
void set_envmap_col( int x, int y, int colour, int flags )
{
env.map_col[x - 1][y - 1].colour = colour;
env.map_col[x - 1][y - 1].flags = flags;
}
inline void set_envmap_item(int x, int y, bool isitem)
{
if (isitem)
env.map_col[x - 1][y - 1].flags |= MC_ITEM;
else
env.map_col[x - 1][y - 1].flags &= ~MC_ITEM;
}
inline void set_envmap_mons(int x, int y, bool ismons)
{
if (ismons)
env.map_col[x - 1][y - 1].flags |= MC_MONS;
else
env.map_col[x - 1][y - 1].flags &= ~MC_MONS;
}
bool is_envmap_item(int x, int y)
{
return (env.map_col[x - 1][y - 1].flags & MC_ITEM);
}
bool is_envmap_mons(int x, int y)
{
return (env.map_col[x - 1][y - 1].flags & MC_MONS);
}
static int get_viewobj_flags(int object)
{
// Check for monster glyphs.
if (object >= DNGN_START_OF_MONSTERS)
return (MC_MONS);
// Check for item glyphs.
if (object >= DNGN_ITEM_ORB && object < DNGN_CLOUD)
return (MC_ITEM);
// We don't care to look further; we could check for
// clouds here as well.
return (0);
// XXX: Yeah, this is ugly, but until we have stored layers in the
// map we can't tell if we've seen a square, detected it, or just
// detected the item or monster on top... giving colour here will
// result in detect creature/item detecting features like stairs. -- bwr
if (map_value != get_sightmap_char(grid_value))
{
// If there's an item on this square, change colour to indicate
// that, iff the item's glyph matches map_value. XXX: Potentially
// abusable? -- ds
int item = igrd[x + 1][y + 1];
if (item_colour && item != NON_ITEM
&& map_value ==
get_sightmap_char(get_item_dngn_code(mitm[item])))
{
unsigned ic = mitm[item].colour;
if (mitm[item].link != NON_ITEM )
ic |= COLFLAG_ITEM_HEAP;
// If the item colour is the background colour, tweak it to WHITE
// instead to catch the player's eye.
return fix_colour( ic == tc? WHITE : ic );
}
}
if (item_colour && is_envmap_item(x + 1, y + 1))
return get_envmap_col(x + 1, y + 1);