summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-11 13:35:19 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-11 13:35:19 +0100
commit8da414ed881af4f30905c1e20fc4d579ed1fb2f1 (patch)
tree42c28927373e2382c7b73a638f144f7196d28969 /shaders
parent0b6a28eaf5973f0485ae8a6f869ebb543b1e470c (diff)
fix wall corner depth value vs critter/scenery
Diffstat (limited to 'shaders')
-rw-r--r--shaders/shader.cpp7
-rw-r--r--shaders/shader.hpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/shaders/shader.cpp b/shaders/shader.cpp
index a276f053..a4ec9dad 100644
--- a/shaders/shader.cpp
+++ b/shaders/shader.cpp
@@ -98,7 +98,12 @@ void tile_shader::draw_post(GL::AbstractTexture& tex) // NOLINT(*-convert-member
float tile_shader::depth_value(const local_coords& xy, float offset) noexcept
{
- return ((float)xy.x + (float)xy.y + offset) * depth_tile_size;
+ return depth_value((float)xy.x, (float)xy.y, offset);
+}
+
+float tile_shader::depth_value(float x, float y, float offset) noexcept
+{
+ return (x + y + offset) * depth_tile_size;
}
} // namespace floormat
diff --git a/shaders/shader.hpp b/shaders/shader.hpp
index cb79fe94..56659218 100644
--- a/shaders/shader.hpp
+++ b/shaders/shader.hpp
@@ -31,6 +31,7 @@ struct tile_shader final : private GL::AbstractShaderProgram
tile_shader& set_tint(const Vector4& tint);
float depth_offset() const { return _depth_offset; }
static float depth_value(const local_coords& xy, float offset = 0) noexcept;
+ static float depth_value(float x, float y, float offset = 0) noexcept;
bool is_lightmap_enabled() const { return _enable_lightmap; }
tile_shader& set_lightmap_enabled(bool value);