VideoSW: Drop SetViewOffset.

Just use the global state.
This commit is contained in:
degasus 2016-03-06 10:22:44 +01:00
parent 965d1236d2
commit 8b0fd623e5
3 changed files with 2 additions and 13 deletions

View File

@ -52,8 +52,6 @@ namespace Clipper
NUM_INDICES = NUM_CLIPPED_VERTICES + 3
};
static float m_ViewOffset[2];
static OutputVertexData ClippedVertices[NUM_CLIPPED_VERTICES];
static OutputVertexData *Vertices[NUM_INDICES];
@ -63,12 +61,6 @@ namespace Clipper
Vertices[i+3] = &ClippedVertices[i];
}
void SetViewOffset()
{
m_ViewOffset[0] = xfmem.viewport.xOrig - 342;
m_ViewOffset[1] = xfmem.viewport.yOrig - 342;
}
enum
{
@ -444,8 +436,8 @@ namespace Clipper
Vec3 &screen = vertex->screenPosition;
float wInverse = 1.0f/projected.w;
screen.x = projected.x * wInverse * xfmem.viewport.wd + m_ViewOffset[0];
screen.y = projected.y * wInverse * xfmem.viewport.ht + m_ViewOffset[1];
screen.x = projected.x * wInverse * xfmem.viewport.wd + xfmem.viewport.xOrig - 342;
screen.y = projected.y * wInverse * xfmem.viewport.ht + xfmem.viewport.yOrig - 342;
screen.z = projected.z * wInverse * xfmem.viewport.zRange + xfmem.viewport.farZ;
}

View File

@ -10,8 +10,6 @@ namespace Clipper
{
void Init();
void SetViewOffset();
void ProcessTriangle(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2);
void ProcessLine(OutputVertexData *v0, OutputVertexData *v1);

View File

@ -79,7 +79,6 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
m_SetupUnit->Init(primitiveType);
// set all states with are stored within video sw
Clipper::SetViewOffset();
Rasterizer::SetScissor();
for (int i = 0; i < 4; i++)
{