Skip to content

Commit

Permalink
- wall sprite positioning tweaks.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
coelckers committed Jun 8, 2021
1 parent 89344a6 commit a32489b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/core/rendering/scene/hw_walls.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit a32489b

Please sign in to comment.