summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-30 22:41:34 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-30 22:41:34 +0100
commite0e44091de168f61efac2938a15e23cf27b4c116 (patch)
tree70159d4a2f87f699e2d0cdbb145ad56e41e0cb2e
parentf5cf60aa3d03183567b8349ac9a43822261d64ab (diff)
downloadcrawl-ref-e0e44091de168f61efac2938a15e23cf27b4c116.tar.gz
crawl-ref-e0e44091de168f61efac2938a15e23cf27b4c116.zip
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.
-rw-r--r--crawl-ref/source/rltiles/dc-dngn.txt12
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.pngbin0 -> 1038 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.pngbin0 -> 1024 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.pngbin0 -> 1018 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.pngbin0 -> 1080 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.pngbin0 -> 959 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.pngbin0 -> 971 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.pngbin0 -> 955 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.pngbin0 -> 955 bytes
-rw-r--r--crawl-ref/source/tilereg.cc71
10 files changed, 83 insertions, 0 deletions
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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_E.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_N.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_S.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_W.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NE.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_NW.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SE.png
Binary files 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
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/water/shallow_water_wave_corner_SW.png
Binary files 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);