summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilecell.cc
diff options
context:
space:
mode:
authorontoclasm <yokomeshi@gmail.com>2014-07-09 21:56:50 +0100
committerontoclasm <yokomeshi@gmail.com>2014-07-09 21:56:50 +0100
commit218c981a63277d53e427c188436811bfcc53edb0 (patch)
tree284ba0c161e982521b7efd5465be9c5e50f2c6b2 /crawl-ref/source/tilecell.cc
parentba25090befcab519b019908d20584328a5c6334c (diff)
downloadcrawl-ref-218c981a63277d53e427c188436811bfcc53edb0.tar.gz
crawl-ref-218c981a63277d53e427c188436811bfcc53edb0.zip
Fix shadow logic.
Diffstat (limited to 'crawl-ref/source/tilecell.cc')
-rw-r--r--crawl-ref/source/tilecell.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/crawl-ref/source/tilecell.cc b/crawl-ref/source/tilecell.cc
index 17b9d0b830..6d8c11aa8f 100644
--- a/crawl-ref/source/tilecell.cc
+++ b/crawl-ref/source/tilecell.cc
@@ -437,40 +437,38 @@ static bool _is_seen_wall(coord_def gc)
static void _pack_wall_shadows(const coord_def &gc, packed_cell *cell,
tileidx_t tile)
{
- // 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;
+ bool ne = 0;
+ bool nw = 0;
int offset;
+
// orthogonals
if (_is_seen_wall(coord_def(gc.x - 1, gc.y)))
{
offset = _is_seen_wall(coord_def(gc.x - 1, gc.y - 1)) ? 0 : 5;
_add_overlay(tile + offset, cell);
- orth = 1;
+ nw = 1;
}
if (_is_seen_wall(coord_def(gc.x, gc.y - 1)))
{
_add_overlay(tile + 2, cell);
- orth = 1;
+ ne = 1;
+ nw = 1;
}
if (_is_seen_wall(coord_def(gc.x + 1, gc.y)))
{
- offset = _is_seen_wall(coord_def(gc.x - 1, gc.y - 1)) ? 4 : 6;
+ offset = _is_seen_wall(coord_def(gc.x + 1, gc.y - 1)) ? 4 : 6;
_add_overlay(tile + offset, cell);
- orth = 1;
+ ne = 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);
- }
+ if (nw == 0 && _is_seen_wall(coord_def(gc.x - 1, gc.y - 1)))
+ _add_overlay(tile + 1, cell);
+ if (ne == 0 && _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)