From 5b8bd44c2444e68bb6a9584734b45e5e0223f276 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:28:42 -0400 Subject: [PATCH] very very minor optimization? --- src/GPU3D_Soft.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/GPU3D_Soft.h b/src/GPU3D_Soft.h index 55a698b0..e2c2fa1b 100644 --- a/src/GPU3D_Soft.h +++ b/src/GPU3D_Soft.h @@ -101,15 +101,15 @@ private: if ((w0 & 0x1) && !(w1 & 0x1)) { - this->w0n = w0 - 1; - this->w0d = w0 + 1; - this->w1d = w1; + this->w0n = w0 - 1 >> 1; + this->w0d = w0 + 1 >> 1; + this->w1d = w1 >> 1; } else { - this->w0n = w0 & 0xFFFE; - this->w0d = w0 & 0xFFFE; - this->w1d = w1 & 0xFFFE; + this->w0n = w0 >> 1; + this->w0d = w0 >> 1; + this->w1d = w1 >> 1; } this->shift = 9; @@ -138,7 +138,7 @@ private: // this seems to be a proper division on hardware :/ // I haven't been able to find cases that produce imperfect output if (den == 0) yfactor = 0; - else yfactor = (s32)(num / den); + else yfactor = ((u32)num / den); } }