summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-12 15:53:09 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-12 16:28:43 +0200
commit506f87c554153eb0bbc3bc9e4fb0f26792f8bfca (patch)
tree0b9af737ab98b44b0e59a2b6fb4d2d94d01f460c /shaders/tile.cpp
parent903e1644fce5652a621803a6eb3617d605d22434 (diff)
depth buffer fixes
Diffstat (limited to 'shaders/tile.cpp')
-rw-r--r--shaders/tile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/tile.cpp b/shaders/tile.cpp
index d5f6b7d3..d774ddf0 100644
--- a/shaders/tile.cpp
+++ b/shaders/tile.cpp
@@ -2,6 +2,7 @@
#include "loader/loader.hpp"
#include "compat/assert.hpp"
#include "local-coords.hpp"
+#include <cmath>
#include <Corrade/Containers/Iterable.h>
#include <Corrade/Containers/StringStl.h>
#include <Magnum/Math/Vector4.h>
@@ -74,7 +75,7 @@ void tile_shader::_draw()
float tile_shader::depth_value(const local_coords& xy, float offset) noexcept
{
- return depth_tile_size + (xy.to_index() + offset)*depth_tile_size;
+ return (float)((xy.to_index() + (double)offset) * depth_tile_size);
}
} // namespace floormat