From e0e44091de168f61efac2938a15e23cf27b4c116 Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Wed, 30 Dec 2009 22:41:34 +0100 Subject: Add wave tiles to smoothen the transition between shallow water and floor. Currently only applies to Shoals, partly because the relevant base tiles are only used in the Shoals, partly because it's experimental. The checks needed for adjacent water tiles increase the drawing time, but I'm not sure by how much, seeing how in my test runs I only measured the seconds used for &O and came up with no noticeable difference. Still might increase lags on computers already prone to slow tiles, in which case we'll need to revert this change. Making the dungeon look less "gridlike" greatly improves the graphics and makes me want to extend the concept to floor/floor transitions, but it could potentially harm the interface. Not sure where to draw the line, and in any case the lag appears to be the more imminent problem. I've also played around with also adding waves for the shallow/deep water transitions but this would require special behaviour also for the water masks used for monsters and items, which is not a problem for floor tiles. --- crawl-ref/source/rltiles/dc-dngn.txt | 12 ++++ .../rltiles/dc-dngn/water/shallow_water_wave_E.png | Bin 0 -> 1038 bytes .../rltiles/dc-dngn/water/shallow_water_wave_N.png | Bin 0 -> 1024 bytes .../rltiles/dc-dngn/water/shallow_water_wave_S.png | Bin 0 -> 1018 bytes .../rltiles/dc-dngn/water/shallow_water_wave_W.png | Bin 0 -> 1080 bytes .../dc-dngn/water/shallow_water_wave_corner_NE.png | Bin 0 -> 959 bytes .../dc-dngn/water/shallow_water_wave_corner_NW.png | Bin 0 -> 971 bytes .../dc-dngn/water/shallow_water_wave_corner_SE.png | Bin 0 -> 955 bytes .../dc-dngn/water/shallow_water_wave_corner_SW.png | Bin 0 -> 955 bytes crawl-ref/source/tilereg.cc | 71 +++++++++++++++++++++ 10 files changed, 83 insertions(+) create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.png create mode 100644 crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.png diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt index f306cfd048..ef8e062e57 100644 --- a/crawl-ref/source/rltiles/dc-dngn.txt +++ b/crawl-ref/source/rltiles/dc-dngn.txt @@ -994,6 +994,18 @@ dngn_shoals_shallow_water_disturbance1 SHOALS_SHALLOW_WATER_DISTURBANCE dngn_shoals_shallow_water_disturbance2 dngn_shoals_shallow_water_disturbance3 +# corner waves (diagonals) +shallow_water_wave_corner_NE WAVE_CORNER_NE +shallow_water_wave_corner_NW WAVE_CORNER_NW +shallow_water_wave_corner_SE WAVE_CORNER_SE +shallow_water_wave_corner_SW WAVE_CORNER_SW + +# orthogonal waves +shallow_water_wave_N WAVE_N +shallow_water_wave_S WAVE_S +shallow_water_wave_E WAVE_E +shallow_water_wave_W WAVE_W + %sdir dc-dngn/gateways dngn_entrance DNGN_UNSEEN_ENTRANCE %rim 1 diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.png new file mode 100644 index 0000000000..d0d4a5eb24 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.png new file mode 100644 index 0000000000..75d75529c3 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.png new file mode 100644 index 0000000000..e043b1f083 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.png new file mode 100644 index 0000000000..8cdb9890ec Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.png new file mode 100644 index 0000000000..ba4bd301a5 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.png new file mode 100644 index 0000000000..e86b45a553 Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.png new file mode 100644 index 0000000000..3f1db4464e Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.png differ diff --git a/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.png b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.png new file mode 100644 index 0000000000..a187598d4c Binary files /dev/null and b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.png differ diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 65383f46b4..01552659d8 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -12,6 +12,7 @@ #include "cio.h" #include "cloud.h" #include "coord.h" +#include "coordit.h" #include "debug.h" #include "describe.h" #include "directn.h" @@ -303,6 +304,76 @@ void DungeonRegion::pack_background(unsigned int bg, int x, int y) m_buf_dngn.add(TILE_BLOOD + offset, x, y); } + if (player_in_branch(BRANCH_SHOALS)) + { + // Add wave tiles on floor adjacent to shallow water. + const coord_def pos = coord_def(x + m_cx_to_gx, y + m_cy_to_gy); + const dungeon_feature_type feat = env.map_knowledge(pos).feat(); + if (feat == DNGN_FLOOR || feat == DNGN_UNDISCOVERED_TRAP) + { + const coord_def pos = coord_def(x + m_cx_to_gx, y + m_cy_to_gy); + bool north = false, south = false, east = false, west = false; + bool ne = false, nw = false, se = false, sw = false; + for (radius_iterator ri(pos, 1, true, false, true); ri; ++ri) + { + if (env.map_knowledge(*ri).feat() != DNGN_SHALLOW_WATER) + continue; + + if (!is_terrain_seen(*ri) && !is_terrain_mapped(*ri)) + continue; + + if (ri->x == pos.x) // orthogonals + { + if (ri->y < pos.y) + north = true; + else + south = true; + } + else if (ri->y == pos.y) + { + if (ri->x < pos.x) + west = true; + else + east = true; + } + else // diagonals + { + if (ri->x < pos.x) + { + if (ri->y < pos.y) + nw = true; + else + sw = true; + } + else + { + if (ri->y < pos.y) + ne = true; + else + se = true; + } + } + } + + if (north) + m_buf_dngn.add(TILE_WAVE_N, x, y); + if (south) + m_buf_dngn.add(TILE_WAVE_S, x, y); + if (east) + m_buf_dngn.add(TILE_WAVE_E, x, y); + if (west) + m_buf_dngn.add(TILE_WAVE_W, x, y); + if (ne && !north && !east) + m_buf_dngn.add(TILE_WAVE_CORNER_NE, x, y); + if (nw && !north && !west) + m_buf_dngn.add(TILE_WAVE_CORNER_NW, x, y); + if (se && !south && !east) + m_buf_dngn.add(TILE_WAVE_CORNER_SE, x, y); + if (sw && !south && !west) + m_buf_dngn.add(TILE_WAVE_CORNER_SW, x, y); + } + } + if (bg & TILE_FLAG_HALO) m_buf_dngn.add(TILE_HALO, x, y); -- cgit v1.2.3-54-g00ecf