summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilecell.cc
diff options
context:
space:
mode:
authorontoclasm <yokomeshi@gmail.com>2014-06-25 13:45:48 -0500
committerontoclasm <yokomeshi@gmail.com>2014-06-25 14:38:45 -0500
commit4192df1434bdfe4b7a540b8c810de697f157c5be (patch)
treef7c9bf181320747e84a0d1a114fa31543adc6917 /crawl-ref/source/tilecell.cc
parent4d50fd935254d27d6ff31d0c5927c61d01553129 (diff)
downloadcrawl-ref-4192df1434bdfe4b7a540b8c810de697f157c5be.tar.gz
crawl-ref-4192df1434bdfe4b7a540b8c810de697f157c5be.zip
Improve wall shadow behavior
Corners were being drawn on top of other shadows, and shadows were drawing on top of grates. In addition, I deepened the normal shadows a little (they were almost invisible in many places), set Depths to use the darker shadows, and added shadows for the top corners of walls.
Diffstat (limited to 'crawl-ref/source/tilecell.cc')
-rw-r--r--crawl-ref/source/tilecell.cc37
1 files changed, 29 insertions, 8 deletions
diff --git a/crawl-ref/source/tilecell.cc b/crawl-ref/source/tilecell.cc
index 4ffe8507c3..384a0e1fad 100644
--- a/crawl-ref/source/tilecell.cc
+++ b/crawl-ref/source/tilecell.cc
@@ -442,19 +442,40 @@ static bool _is_seen_wall(coord_def gc)
static void _pack_wall_shadows(const coord_def &gc, packed_cell *cell,
tileidx_t tile)
{
- if (_is_seen_wall(gc) || _safe_feat(gc) == DNGN_OPEN_DOOR)
+ // XXX: why do shadows draw on top of grates when they draw
+ // underneath stairs and such?
+ if (_is_seen_wall(gc) || _safe_feat(gc) == DNGN_GRATE)
return;
+ bool orth = 0;
+ int offset;
+ // orthogonals
if (_is_seen_wall(coord_def(gc.x - 1, gc.y)))
- _add_overlay(tile, cell);
- if (_is_seen_wall(coord_def(gc.x - 1, gc.y - 1)))
- _add_overlay(tile + 1, cell);
+ {
+ offset = _is_seen_wall(coord_def(gc.x - 1, gc.y - 1)) ? 0 : 5;
+ _add_overlay(tile + offset, cell);
+ orth = 1;
+ }
if (_is_seen_wall(coord_def(gc.x, gc.y - 1)))
+ {
_add_overlay(tile + 2, cell);
- if (_is_seen_wall(coord_def(gc.x + 1, gc.y - 1)))
- _add_overlay(tile + 3, cell);
+ orth = 1;
+ }
if (_is_seen_wall(coord_def(gc.x + 1, gc.y)))
- _add_overlay(tile + 4, cell);
+ {
+ offset = _is_seen_wall(coord_def(gc.x - 1, gc.y - 1)) ? 4 : 6;
+ _add_overlay(tile + offset, cell);
+ orth = 1;
+ }
+
+ // corners
+ if (orth == 0)
+ {
+ if (_is_seen_wall(coord_def(gc.x - 1, gc.y - 1)))
+ _add_overlay(tile + 1, cell);
+ if (_is_seen_wall(coord_def(gc.x + 1, gc.y - 1)))
+ _add_overlay(tile + 3, cell);
+ }
}
static bool _is_seen_slimy_wall(const coord_def& gc)
@@ -483,7 +504,7 @@ void pack_cell_overlays(const coord_def &gc, packed_cell *cell)
else
{
tileidx_t shadow_tile = TILE_DNGN_WALL_SHADOW;
- if (player_in_branch(BRANCH_CRYPT))
+ if (player_in_branch(BRANCH_CRYPT) || player_in_branch(BRANCH_DEPTHS))
shadow_tile = TILE_DNGN_WALL_SHADOW_DARK;
_pack_wall_shadows(gc, cell, shadow_tile);
}