summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-14 11:58:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-14 11:58:23 +0200
commitf5c387da470ae43a2c8aff75b419e784c8bb3bc5 (patch)
tree744a80e82462849ae538b6c04e941ab6fd7d09fa /main
parente1ae8881918415ef13fdea7c7087d01d873ad07a (diff)
it probably renders correctly now
Diffstat (limited to 'main')
-rw-r--r--main/draw.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/draw.cpp b/main/draw.cpp
index 51031427..0e4ecc9f 100644
--- a/main/draw.cpp
+++ b/main/draw.cpp
@@ -127,7 +127,6 @@ void main_impl::draw_world() noexcept
GL::defaultFramebuffer.clearDepth(0);
#endif
GL::Renderer::enable(GL::Renderer::Feature::DepthTest);
-
GL::Renderer::setDepthMask(true);
for (int8_t z = z_max; z >= z_min; z--)
@@ -160,6 +159,11 @@ void main_impl::draw_world() noexcept
for (int16_t y = miny; y <= maxy; y++)
for (int16_t x = minx; x <= maxx; x++)
{
+ if (only && z != z_cur)
+ _shader.set_tint({1, 1, 1, 0.75});
+ else
+ _shader.set_tint({1, 1, 1, 1});
+
const chunk_coords_ pos{x, y, z};
auto* c_ = _world.at(pos);
if (!c_)
@@ -170,6 +174,7 @@ void main_impl::draw_world() noexcept
_anim_mesh.draw(_shader, sz, c, _clickable_scenery);
}
+ _shader.set_tint({1, 1, 1, 1});
GL::Renderer::setDepthMask(true);
GL::Renderer::disable(GL::Renderer::Feature::DepthTest);