From ca61b53f6c99e49de4620395bc8dbe5b71c9e2db Mon Sep 17 00:00:00 2001 From: iCatButler Date: Fri, 6 May 2016 17:12:31 +0100 Subject: More fixes for persective correct build - Switch back to fixed point GTE - Only clamp w to h/2 after divide - Fix vertex function for multi-pass (was overwriting vertexon first pass) --- plugins/peopsxgl/pgxp_gpu.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/peopsxgl/pgxp_gpu.c b/plugins/peopsxgl/pgxp_gpu.c index 67b381d8..e8191e48 100644 --- a/plugins/peopsxgl/pgxp_gpu.c +++ b/plugins/peopsxgl/pgxp_gpu.c @@ -106,22 +106,25 @@ void PGXP_SetMatrix(float left, float right, float bottom, float top, float zNea void PGXP_glVertexfv(GLfloat* pV) { // If there are PGXP vertices expected - if (vertexIdx < numVertices) - { + //if (vertexIdx < numVertices) + //{ + float temp[4]; + memcpy(temp, pV, sizeof(float) * 4); + // pre-multiply each element by w (to negate perspective divide) for (unsigned int i = 0; i < 3; i++) - pV[i] *= pV[3]; + temp[i] *= temp[3]; // pass complete vertex to OpenGL - glVertex4fv(pV); + glVertex4fv(temp); vertexIdx++; - pV[3] = 1.f; - } - else - { - glVertex3fv(pV); - } + // pV[3] = 1.f; + //} + //else + //{ + // glVertex3fv(pV); + //} } // Get parallel vertex values -- cgit v1.2.3