summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-12 17:21:26 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-12 17:21:26 +0100
commit0c04d8ad550a179adae54a5a0130e7887f8727b6 (patch)
tree648ea37cabb7b04fff44a3796228fec78b73bfb8 /crawl-ref
parent02dff308318725784e0821c3d57efd118cb02c1e (diff)
downloadcrawl-ref-0c04d8ad550a179adae54a5a0130e7887f8727b6.tar.gz
crawl-ref-0c04d8ad550a179adae54a5a0130e7887f8727b6.zip
Also add wave tiles for deep water. The water masks still look wonky.
When it comes to drawing waves, deep water always trumps shallow water.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/rltiles/dc-dngn.txt12
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_E.pngbin0 -> 1097 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_N.pngbin0 -> 1101 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_S.pngbin0 -> 1099 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_W.pngbin0 -> 1108 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NE.pngbin0 -> 1083 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NW.pngbin0 -> 1097 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SE.pngbin0 -> 1085 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SW.pngbin0 -> 1090 bytes
-rw-r--r--crawl-ref/source/tilereg.cc84
10 files changed, 75 insertions, 21 deletions
diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt
index 2a92489295..ff26bd0314 100644
--- a/crawl-ref/source/rltiles/dc-dngn.txt
+++ b/crawl-ref/source/rltiles/dc-dngn.txt
@@ -1003,6 +1003,18 @@ dngn_shoals_shallow_water_disturbance2
dngn_shoals_shallow_water_disturbance3
# corner waves (diagonals)
+deep_water_wave_corner_NE WAVE_DEEP_CORNER_NE
+deep_water_wave_corner_NW WAVE_DEEP_CORNER_NW
+deep_water_wave_corner_SE WAVE_DEEP_CORNER_SE
+deep_water_wave_corner_SW WAVE_DEEP_CORNER_SW
+
+# orthogonal waves
+deep_water_wave_N WAVE_DEEP_N
+deep_water_wave_S WAVE_DEEP_S
+deep_water_wave_E WAVE_DEEP_E
+deep_water_wave_W WAVE_DEEP_W
+
+# 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
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_E.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_E.png
new file mode 100644
index 0000000000..819526e1f7
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_E.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_N.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_N.png
new file mode 100644
index 0000000000..5093a00024
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_N.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_S.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_S.png
new file mode 100644
index 0000000000..9d7e6179ef
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_S.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_W.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_W.png
new file mode 100644
index 0000000000..8ca03b8a5d
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_W.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NE.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NE.png
new file mode 100644
index 0000000000..c8869eff13
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NE.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NW.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NW.png
new file mode 100644
index 0000000000..4a04f0b018
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_NW.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SE.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SE.png
new file mode 100644
index 0000000000..ab44f8fd78
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SE.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SW.png b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SW.png
new file mode 100644
index 0000000000..b3a0966cae
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/deep_water_wave_corner_SW.png
Binary files differ
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 97e491d2f7..7c5eaaca62 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -281,6 +281,13 @@ void DungeonRegion::load_dungeon(unsigned int* tileb, int cx_to_gx, int cy_to_gy
place_cursor(CURSOR_TUTORIAL, m_cursor[CURSOR_TUTORIAL]);
}
+enum wave_type
+{
+ WV_NONE = 0,
+ WV_SHALLOW,
+ WV_DEEP
+};
+
void DungeonRegion::pack_background(unsigned int bg, int x, int y)
{
unsigned int bg_idx = bg & TILE_FLAG_MASK;
@@ -309,67 +316,102 @@ void DungeonRegion::pack_background(unsigned int bg, int x, int y)
// 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)
+ if (feat == DNGN_FLOOR || feat == DNGN_UNDISCOVERED_TRAP
+ || feat == DNGN_SHALLOW_WATER)
{
- bool north = false, south = false, east = false, west = false;
- bool ne = false, nw = false, se = false, sw = false;
+ wave_type north = WV_NONE, south = WV_NONE,
+ east = WV_NONE, west = WV_NONE,
+ ne = WV_NONE, nw = WV_NONE,
+ se = WV_NONE, sw = WV_NONE;
+
for (radius_iterator ri(pos, 1, true, false, true); ri; ++ri)
{
- if (env.map_knowledge(*ri).feat() != DNGN_SHALLOW_WATER)
+ if (!is_terrain_seen(*ri) && !is_terrain_mapped(*ri))
continue;
- if (!is_terrain_seen(*ri) && !is_terrain_mapped(*ri))
+ bool shallow = false;
+ if (env.map_knowledge(*ri).feat() == DNGN_SHALLOW_WATER)
+ {
+ // Adjacent shallow water is only interesting for
+ // floor cells.
+ if (feat == DNGN_SHALLOW_WATER)
+ continue;
+
+ shallow = true;
+ }
+ else if (env.map_knowledge(*ri).feat() != DNGN_DEEP_WATER)
continue;
if (ri->x == pos.x) // orthogonals
{
if (ri->y < pos.y)
- north = true;
+ north = (shallow ? WV_SHALLOW : WV_DEEP);
else
- south = true;
+ south = (shallow ? WV_SHALLOW : WV_DEEP);
}
else if (ri->y == pos.y)
{
if (ri->x < pos.x)
- west = true;
+ west = (shallow ? WV_SHALLOW : WV_DEEP);
else
- east = true;
+ east = (shallow ? WV_SHALLOW : WV_DEEP);
}
else // diagonals
{
if (ri->x < pos.x)
{
if (ri->y < pos.y)
- nw = true;
+ nw = (shallow ? WV_SHALLOW : WV_DEEP);
else
- sw = true;
+ sw = (shallow ? WV_SHALLOW : WV_DEEP);
}
else
{
if (ri->y < pos.y)
- ne = true;
+ ne = (shallow ? WV_SHALLOW : WV_DEEP);
else
- se = true;
+ se = (shallow ? WV_SHALLOW : WV_DEEP);
}
}
}
- if (north)
+ // First check for shallow water.
+ if (north == WV_SHALLOW)
m_buf_dngn.add(TILE_WAVE_N, x, y);
- if (south)
+ if (south == WV_SHALLOW)
m_buf_dngn.add(TILE_WAVE_S, x, y);
- if (east)
+ if (east == WV_SHALLOW)
m_buf_dngn.add(TILE_WAVE_E, x, y);
- if (west)
+ if (west == WV_SHALLOW)
m_buf_dngn.add(TILE_WAVE_W, x, y);
- if (ne && !north && !east)
+
+ // Then check for deep water, overwriting shallow
+ // corner waves, if necessary.
+ if (north == WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_N, x, y);
+ if (south == WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_S, x, y);
+ if (east == WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_E, x, y);
+ if (west == WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_W, x, y);
+
+ if (ne == WV_SHALLOW && !north && !east)
m_buf_dngn.add(TILE_WAVE_CORNER_NE, x, y);
- if (nw && !north && !west)
+ else if (ne == WV_DEEP && north != WV_DEEP && east != WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_CORNER_NE, x, y);
+ if (nw == WV_SHALLOW && !north && !west)
m_buf_dngn.add(TILE_WAVE_CORNER_NW, x, y);
- if (se && !south && !east)
+ else if (nw == WV_DEEP && north != WV_DEEP && west != WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_CORNER_NW, x, y);
+ if (se == WV_SHALLOW && !south && !east)
m_buf_dngn.add(TILE_WAVE_CORNER_SE, x, y);
- if (sw && !south && !west)
+ else if (se == WV_DEEP && south != WV_DEEP && east != WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_CORNER_SE, x, y);
+ if (sw == WV_SHALLOW && !south && !west)
m_buf_dngn.add(TILE_WAVE_CORNER_SW, x, y);
+ else if (sw == WV_DEEP && south != WV_DEEP && west != WV_DEEP)
+ m_buf_dngn.add(TILE_WAVE_DEEP_CORNER_SW, x, y);
}
}