diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-05-26 04:00:15 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-05-26 04:00:15 +0200 |
commit | a63ab2444733ffd039f4609982256142cf724600 (patch) | |
tree | 5804fd0996ce42875b984de573d46dd3aa1a5f1a /src/GPU3D_Soft.cpp | |
parent | 911888f1e09bf05d45393cfb3d830c50153579f9 (diff) |
fix crapoed shadows
Diffstat (limited to 'src/GPU3D_Soft.cpp')
-rw-r--r-- | src/GPU3D_Soft.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index d022e8a..fe97b5f 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -38,6 +38,7 @@ u32 AttrBuffer[256*192]; // bit30: translucent flag u8 StencilBuffer[256*2]; +bool PrevIsShadowMask; // threading @@ -84,6 +85,8 @@ void Reset() memset(DepthBuffer, 0, 256*192 * 4); memset(AttrBuffer, 0, 256*192 * 4); + PrevIsShadowMask = false; + // TODO: make it configurable if (!RenderThreadRunning) { @@ -803,9 +806,11 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y) else fnDepthTest = DepthTest<false>; - if (polygon->ClearStencil) + if (polygon->IsShadowMask && !PrevIsShadowMask) memset(&StencilBuffer[256 * (y&0x1)], 0, 256); + PrevIsShadowMask = polygon->IsShadowMask; + if (polygon->YTop != polygon->YBottom) { if (y >= polygon->Vertices[rp->NextVL]->FinalPosition[1] && rp->CurVL != polygon->VBottom) |