diff options
| author | degasus <wickmarkus@web.de> | 2016-03-06 10:24:28 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2016-03-06 10:24:28 +0100 |
| commit | 7a154181b4f020d16f9c851bb115eb29b4c6757a (patch) | |
| tree | 64634ed9f5c370e15fdd91464f1eb387ef1df373 /Source/Core/VideoBackends/Software/Rasterizer.cpp | |
| parent | 8b0fd623e5b594ad5ca8d8de43e93f5dcd4be818 (diff) | |
VideoSW: Drop SetScissor().
Just access the global state directly.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Rasterizer.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/Rasterizer.cpp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index e2f97ad347..4020d4b646 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -29,11 +29,6 @@ static s32 vertex0Y; static float vertexOffsetX; static float vertexOffsetY; -static s32 scissorLeft = 0; -static s32 scissorTop = 0; -static s32 scissorRight = 0; -static s32 scissorBottom = 0; - static Tev tev; static RasterBlock rasterBlock; @@ -69,28 +64,6 @@ static inline int iround(float x) return t; } -void SetScissor() -{ - int xoff = bpmem.scissorOffset.x * 2 - 342; - int yoff = bpmem.scissorOffset.y * 2 - 342; - - scissorLeft = bpmem.scissorTL.x - xoff - 342; - if (scissorLeft < 0) - scissorLeft = 0; - - scissorTop = bpmem.scissorTL.y - yoff - 342; - if (scissorTop < 0) - scissorTop = 0; - - scissorRight = bpmem.scissorBR.x - xoff - 341; - if (scissorRight > EFB_WIDTH) - scissorRight = EFB_WIDTH; - - scissorBottom = bpmem.scissorBR.y - yoff - 341; - if (scissorBottom > EFB_HEIGHT) - scissorBottom = EFB_HEIGHT; -} - void SetTevReg(int reg, int comp, bool konst, s16 color) { tev.SetRegColor(reg, comp, konst, color); @@ -330,6 +303,25 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer s32 maxy = (std::max(std::max(Y1, Y2), Y3) + 0xF) >> 4; // scissor + int xoff = bpmem.scissorOffset.x * 2 - 342; + int yoff = bpmem.scissorOffset.y * 2 - 342; + + s32 scissorLeft = bpmem.scissorTL.x - xoff - 342; + if (scissorLeft < 0) + scissorLeft = 0; + + s32 scissorTop = bpmem.scissorTL.y - yoff - 342; + if (scissorTop < 0) + scissorTop = 0; + + s32 scissorRight = bpmem.scissorBR.x - xoff - 341; + if (scissorRight > EFB_WIDTH) + scissorRight = EFB_WIDTH; + + s32 scissorBottom = bpmem.scissorBR.y - yoff - 341; + if (scissorBottom > EFB_HEIGHT) + scissorBottom = EFB_HEIGHT; + minx = std::max(minx, scissorLeft); maxx = std::min(maxx, scissorRight); miny = std::max(miny, scissorTop); |
