summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-09 18:27:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-09 18:27:32 +0100
commit5907a8902e6f01774cebbb515349a66c86a47fb3 (patch)
tree7d3f90a38e038e0f4acbaf62b328fb23446ab7c7 /shaders/tile.cpp
parent1febb02d958fa4cf8c15e3ca18f9d644f9fc80fb (diff)
allow drawing walls in random order
Diffstat (limited to 'shaders/tile.cpp')
-rw-r--r--shaders/tile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/shaders/tile.cpp b/shaders/tile.cpp
index c8261acd..22a91497 100644
--- a/shaders/tile.cpp
+++ b/shaders/tile.cpp
@@ -66,11 +66,11 @@ void tile_shader::_draw()
}
}
-float tile_shader::depth_value(const local_coords& xy) noexcept
+float tile_shader::depth_value(const local_coords& xy, float offset) noexcept
{
constexpr float max = (TILE_MAX_DIM+1)*(TILE_MAX_DIM+1) * .5f;
constexpr float min = -1 + 1.f/256;
- float value = min + xy.to_index()/max;
+ float value = min + (xy.to_index() + offset)/max;
fm_assert(value > -1 && value < 1);
return value;
}