diff options
author | Pete Hurst <pete@streamuniverse.tv> | 2013-05-24 00:19:30 +0100 |
---|---|---|
committer | Pete Hurst <pete@streamuniverse.tv> | 2013-05-25 17:05:48 +0100 |
commit | 8f2e336bb97bcaf7a0193c443bb682424dc52b7e (patch) | |
tree | 0367ec5a5d7ecf353212e951622526694cf9ef82 /crawl-ref/source/tileview.cc | |
parent | 60f276de766666d1f2852beb8c5f3a2159ce8750 (diff) | |
download | crawl-ref-8f2e336bb97bcaf7a0193c443bb682424dc52b7e.tar.gz crawl-ref-8f2e336bb97bcaf7a0193c443bb682424dc52b7e.zip |
Implement cloud alpha overlay tiles layer
This works very well for the most part with
two small problems:
- Webtiles will not support this yet (in probability,
this will stop any clouds showing in webtiles)
- Floor items interact strangely and will draw over
the top of clouds instead of behind them
Diffstat (limited to 'crawl-ref/source/tileview.cc')
-rw-r--r-- | crawl-ref/source/tileview.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc index 6d2e2447f9..e7a8d0a45f 100644 --- a/crawl-ref/source/tileview.cc +++ b/crawl-ref/source/tileview.cc @@ -40,6 +40,7 @@ void tile_new_level(bool first_time, bool init_unseen) { env.tile_bk_fg[x][y] = 0; env.tile_bk_bg[x][y] = TILE_DNGN_UNSEEN; + env.tile_bk_cloud[x][y] = 0; } } @@ -752,12 +753,14 @@ void tile_draw_floor() // init tiles env.tile_bg(ep) = bg; env.tile_fg(ep) = 0; + env.tile_cloud(ep) = 0; } } void tile_clear_map(const coord_def& gc) { env.tile_bk_fg(gc) = 0; + env.tile_bk_cloud(gc) = 0; tiles.update_minimap(gc); } @@ -765,6 +768,7 @@ void tile_forget_map(const coord_def &gc) { env.tile_bk_fg(gc) = 0; env.tile_bk_bg(gc) = 0; + env.tile_bk_cloud(gc) = 0; tiles.update_minimap(gc); } @@ -928,13 +932,10 @@ static void _tile_place_cloud(const coord_def &gc, const cloud_info &cl) if (you.see_cell(gc)) { const coord_def ep = grid2show(gc); - if (env.tile_fg(ep) != 0) - return; - - env.tile_fg(ep) = tileidx_cloud(cl, disturbance); + env.tile_cloud(ep) = tileidx_cloud(cl, disturbance); } else - env.tile_bk_fg(gc) = tileidx_cloud(cl, disturbance); + env.tile_bk_cloud(gc) = tileidx_cloud(cl, disturbance); if (env.map_knowledge(gc).item()) _tile_place_item_marker(gc, *env.map_knowledge(gc).item()); @@ -985,8 +986,6 @@ void tile_draw_map_cell(const coord_def& gc, bool foreground_only) _tile_place_invisible_monster(gc); else if (cell.monsterinfo()) _tile_place_monster(gc, *cell.monsterinfo()); - else if (cell.cloud() != CLOUD_NONE) - _tile_place_cloud(gc, *cell.cloudinfo()); else if (cell.item()) { if (feat_is_stair(cell.feat())) @@ -996,6 +995,10 @@ void tile_draw_map_cell(const coord_def& gc, bool foreground_only) } else env.tile_bk_fg(gc) = 0; + + // Always place clouds now they have their own layer + if (cell.cloud() != CLOUD_NONE) + _tile_place_cloud(gc, *cell.cloudinfo()); } void tile_wizmap_terrain(const coord_def &gc) |