Skip to content

Commit

Permalink
very very minor optimization?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaklyy committed Aug 6, 2024
1 parent dd386d1 commit 5b8bd44
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/GPU3D_Soft.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ class SoftRenderer : public Renderer3D

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;
Expand Down Expand Up @@ -138,7 +138,7 @@ class SoftRenderer : public Renderer3D
// 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);
}
}

Expand Down

0 comments on commit 5b8bd44

Please sign in to comment.