diff options
author | ontoclasm <yokomeshi@gmail.com> | 2014-06-25 17:05:02 -0500 |
---|---|---|
committer | ontoclasm <yokomeshi@gmail.com> | 2014-06-25 17:05:02 -0500 |
commit | 9442d7426d22aade1064671dc77622506baf6064 (patch) | |
tree | 57104bc0950b11a06e6c8c4a84e39d781c84dd6f /crawl-ref/source/tilecell.cc | |
parent | 4192df1434bdfe4b7a540b8c810de697f157c5be (diff) | |
download | crawl-ref-9442d7426d22aade1064671dc77622506baf6064.tar.gz crawl-ref-9442d7426d22aade1064671dc77622506baf6064.zip |
Hopefully fix shoals coastlines & ink
They should draw underneath features now; it remains to be seen how
WebTiles will work out.
Diffstat (limited to 'crawl-ref/source/tilecell.cc')
-rw-r--r-- | crawl-ref/source/tilecell.cc | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/crawl-ref/source/tilecell.cc b/crawl-ref/source/tilecell.cc index 384a0e1fad..17b9d0b830 100644 --- a/crawl-ref/source/tilecell.cc +++ b/crawl-ref/source/tilecell.cc @@ -82,11 +82,6 @@ enum wave_type WV_DEEP, }; -static wave_type _get_wave_type(bool shallow) -{ - return shallow ? WV_SHALLOW : WV_DEEP; -} - static void _add_overlay(int tileidx, packed_cell *cell) { cell->dngn_overlay[cell->num_dngn_overlay++] = tileidx; @@ -155,11 +150,8 @@ static void _pack_shoal_waves(const coord_def &gc, packed_cell *cell) return; } - if (feat != DNGN_FLOOR && feat != DNGN_UNDISCOVERED_TRAP - && feat != DNGN_SHALLOW_WATER && feat != DNGN_DEEP_WATER) - { + if (feat <= DNGN_LAVA) return; - } const bool ink_only = (feat == DNGN_DEEP_WATER); @@ -178,7 +170,7 @@ static void _pack_shoal_waves(const coord_def &gc, packed_cell *cell) const bool ink = (cloud_type_at(coord_def(*ri)) == CLOUD_INK); - bool shallow = false; + wave_type wt = WV_NONE; if (env.map_knowledge(*ri).feat() == DNGN_SHALLOW_WATER) { // Adjacent shallow water is only interesting for @@ -186,9 +178,12 @@ static void _pack_shoal_waves(const coord_def &gc, packed_cell *cell) if (!ink && feat == DNGN_SHALLOW_WATER) continue; - shallow = true; + if (feat != DNGN_SHALLOW_WATER) + wt = WV_SHALLOW; } - else if (env.map_knowledge(*ri).feat() != DNGN_DEEP_WATER) + else if (env.map_knowledge(*ri).feat() == DNGN_DEEP_WATER) + wt = WV_DEEP; + else continue; if (!ink_only) @@ -196,32 +191,32 @@ static void _pack_shoal_waves(const coord_def &gc, packed_cell *cell) if (ri->x == gc.x) // orthogonals { if (ri->y < gc.y) - north = _get_wave_type(shallow); + north = wt; else - south = _get_wave_type(shallow); + south = wt; } else if (ri->y == gc.y) { if (ri->x < gc.x) - west = _get_wave_type(shallow); + west = wt; else - east = _get_wave_type(shallow); + east = wt; } else // diagonals { if (ri->x < gc.x) { if (ri->y < gc.y) - nw = _get_wave_type(shallow); + nw = wt; else - sw = _get_wave_type(shallow); + sw = wt; } else { if (ri->y < gc.y) - ne = _get_wave_type(shallow); + ne = wt; else - se = _get_wave_type(shallow); + se = wt; } } } |