From b6fa43b0cffb589165283600b14d682e935bb828 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:17:24 -0400 Subject: [PATCH] implement approximation of z0 > z1 case --- src/GPU3D_Soft.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GPU3D_Soft.h b/src/GPU3D_Soft.h index 06d132b0..989cebf3 100644 --- a/src/GPU3D_Soft.h +++ b/src/GPU3D_Soft.h @@ -183,7 +183,7 @@ private: if (dir) { - // seems like y dir does different interpolation? + // seems like y dir does different interpolation than x? // this probably isn't right... if (z0 < z1) return z0 + (z1-z0) * x / xdiff; @@ -195,7 +195,7 @@ private: if (z0 < z1) return z0 + (((z1-z0) / xdiff & ~0x1) * x); else - return z1 + (((z0-z1) / xdiff & ~0x1) * (xdiff-x) + ((z0-z1) & 0xFF)); + return z1 + (((z0-z1) / xdiff & ~0x1) * (xdiff-x)) + ((z0-z1) % (xdiff << 1)); } } }