mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 22:59:58 -06:00
fix crapoed shadows
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user