From a32489be310712e9aeece9e17970bc0856fcad05 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 8 Jun 2021 22:43:11 +0200 Subject: [PATCH] - wall sprite positioning tweaks. Turns out that a distance of one Build unit from a wall alone is not enough to render them glitch-free, some depth bias is still needed. --- source/core/rendering/scene/hw_walls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index 9c9df27a9..30dfda141 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -62,7 +62,7 @@ static int GetClosestPointOnWall(spritetype* spr, walltype* wal, vec2_t* const n else if (d.x == 0) { // line is vertical. - if (pos.x == w.x && (spr->ang & 0x3ff) == 0) + if (abs(pos.x - w.x) <= 1 && (spr->ang & 0x3ff) == 0) { *n = pos.vec2; return 0; @@ -72,7 +72,7 @@ static int GetClosestPointOnWall(spritetype* spr, walltype* wal, vec2_t* const n else if (d.y == 0) { // line is horizontal. - if (pos.y == w.y && (spr->ang & 0x3ff) == 0x200) + if (abs(pos.y - w.y) <= 1 && (spr->ang & 0x3ff) == 0x200) { *n = pos.vec2; return 0;