diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index ba70b3a8..f65885c6 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -591,6 +591,7 @@ void SoftRenderer::PlotTranslucentPixel(const GPU3D& gpu3d, u32 pixeladdr, u32 c AttrBuffer[pixeladdr] = attr; } +template void SoftRenderer::SetupPolygonLeftEdge(SoftRenderer::RendererPolygon* rp, s32 y) const { Polygon* polygon = rp->PolyData; @@ -623,11 +624,12 @@ void SoftRenderer::SetupPolygonLeftEdge(SoftRenderer::RendererPolygon* rp, s32 y if (y1 < polygon->Vertices[rp->CurVL]->FinalPosition[1]) y1 += 256; - rp->XL = rp->SlopeL.Setup(polygon->Vertices[rp->CurVL]->FinalPosition[0], polygon->Vertices[rp->NextVL]->FinalPosition[0], - polygon->Vertices[rp->CurVL]->FinalPosition[1], y1, - polygon->FinalW[rp->CurVL], polygon->FinalW[rp->NextVL], y); + rp->XL = rp->SlopeL.Setup(polygon->Vertices[rp->CurVL]->FinalPosition[0], polygon->Vertices[rp->NextVL]->FinalPosition[0], + polygon->Vertices[rp->CurVL]->FinalPosition[1], y1, + polygon->FinalW[rp->CurVL], polygon->FinalW[rp->NextVL], y); } +template void SoftRenderer::SetupPolygonRightEdge(SoftRenderer::RendererPolygon* rp, s32 y) const { Polygon* polygon = rp->PolyData; @@ -660,9 +662,9 @@ void SoftRenderer::SetupPolygonRightEdge(SoftRenderer::RendererPolygon* rp, s32 if (y1 < polygon->Vertices[rp->CurVR]->FinalPosition[1]) y1 += 256; - rp->XR = rp->SlopeR.Setup(polygon->Vertices[rp->CurVR]->FinalPosition[0], polygon->Vertices[rp->NextVR]->FinalPosition[0], - polygon->Vertices[rp->CurVR]->FinalPosition[1], y1, - polygon->FinalW[rp->CurVR], polygon->FinalW[rp->NextVR], y); + rp->XR = rp->SlopeR.Setup(polygon->Vertices[rp->CurVR]->FinalPosition[0], polygon->Vertices[rp->NextVR]->FinalPosition[0], + polygon->Vertices[rp->CurVR]->FinalPosition[1], y1, + polygon->FinalW[rp->CurVR], polygon->FinalW[rp->NextVR], y); } void SoftRenderer::SetupPolygon(SoftRenderer::RendererPolygon* rp, Polygon* polygon) const @@ -769,12 +771,12 @@ void SoftRenderer::RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon* { if ((y >= polygon->SlopePosition[rp->NextVL][1] || y == polygon->Vertices[rp->CurVL]->FinalPosition[1]) && rp->CurVL != polygon->VBottom) { - SetupPolygonLeftEdge(rp, y); + SetupPolygonLeftEdge(rp, y); } if ((y >= polygon->SlopePosition[rp->NextVR][1] || y == polygon->Vertices[rp->CurVR]->FinalPosition[1]) && rp->CurVR != polygon->VBottom) { - SetupPolygonRightEdge(rp, y); + SetupPolygonRightEdge(rp, y); } } @@ -1010,12 +1012,12 @@ void SoftRenderer::RenderPolygonScanline(const GPU& gpu, RendererPolygon* rp, s3 { if ((y >= polygon->SlopePosition[rp->NextVL][1] || y == polygon->Vertices[rp->CurVL]->FinalPosition[1]) && rp->CurVL != polygon->VBottom) { - SetupPolygonLeftEdge(rp, y); + SetupPolygonLeftEdge(rp, y); } if ((y >= polygon->SlopePosition[rp->NextVR][1] || y == polygon->Vertices[rp->CurVR]->FinalPosition[1]) && rp->CurVR != polygon->VBottom) { - SetupPolygonRightEdge(rp, y); + SetupPolygonRightEdge(rp, y); } } diff --git a/src/GPU3D_Soft.h b/src/GPU3D_Soft.h index c3d68e4b..380d797d 100644 --- a/src/GPU3D_Soft.h +++ b/src/GPU3D_Soft.h @@ -465,8 +465,8 @@ private: void TextureLookup(const GPU& gpu, u32 texparam, u32 texpal, s16 s, s16 t, u16* color, u8* alpha) const; u32 RenderPixel(const GPU& gpu, const Polygon* polygon, u8 vr, u8 vg, u8 vb, s16 s, s16 t) const; void PlotTranslucentPixel(const GPU3D& gpu3d, u32 pixeladdr, u32 color, u32 z, u32 polyattr, u32 shadow); - void SetupPolygonLeftEdge(RendererPolygon* rp, s32 y) const; - void SetupPolygonRightEdge(RendererPolygon* rp, s32 y) const; + template void SetupPolygonLeftEdge(RendererPolygon* rp, s32 y) const; + template void SetupPolygonRightEdge(RendererPolygon* rp, s32 y) const; void SetupPolygon(RendererPolygon* rp, Polygon* polygon) const; template void RenderShadowMaskScanline(const GPU3D& gpu3d, RendererPolygon* rp, s32 y); template void RenderPolygonScanline(const GPU& gpu, RendererPolygon* rp, s32 y);