From cfe4d607b3ab26ee3dbb9402000b5253a026c4d9 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 17 Jul 2010 00:12:07 +0000 Subject: [PATCH] zzogl-pg: Working more on the new register code. Combined the KickVertex functions. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3506 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/NewRegs.cpp | 45 +++++++---------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/plugins/zzogl-pg/opengl/NewRegs.cpp b/plugins/zzogl-pg/opengl/NewRegs.cpp index bf670b0e31..b47d0ce938 100644 --- a/plugins/zzogl-pg/opengl/NewRegs.cpp +++ b/plugins/zzogl-pg/opengl/NewRegs.cpp @@ -125,27 +125,16 @@ void __fastcall GIFPackedRegHandlerUV(u32* data) ZZLog::Greg_Log("Packed UV: 0x%x, 0x%x", r->U, r->V); } -void __forceinline KICK_VERTEX2() +void __forceinline KickVertex(bool adc) { FUNCLOG - - if (++gs.primC >= (int)g_primmult[prim->prim]) - { - if (NoHighlights(prim->ctxt)) (*ZeroGS::drawfn[prim->prim])(); - - gs.primC -= g_primsub[prim->prim]; - } -} - -void __forceinline KICK_VERTEX3() -{ - FUNCLOG - if (++gs.primC >= (int)g_primmult[prim->prim]) { + if (!adc && NoHighlights(prim->ctxt)) (*ZeroGS::drawfn[prim->prim])(); + gs.primC -= g_primsub[prim->prim]; - if (prim->prim == 5) + if (adc && prim->prim == 5) { /* tri fans need special processing */ if (gs.nTriFanVert == gs.primIndex) @@ -161,14 +150,7 @@ void __fastcall GIFPackedRegHandlerXYZF2(u32* data) gs.add_vertex(r->X, r->Y,r->Z, r->F); // Fix Vertexes up later. - if (data[3] & 0x8000) - { - KICK_VERTEX3(); - } - else - { - KICK_VERTEX2(); - } + KickVertex(!!(r->ADC)); ZZLog::Greg_Log("Packed XYZF2: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F); } @@ -179,14 +161,7 @@ void __fastcall GIFPackedRegHandlerXYZ2(u32* data) gs.add_vertex(r->X, r->Y,r->Z); // Fix Vertexes up later. - if (data[3] & 0x8000) - { - KICK_VERTEX3(); - } - else - { - KICK_VERTEX2(); - } + KickVertex(!!(r->ADC)); ZZLog::Greg_Log("Packed XYZ2: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z); } @@ -285,7 +260,7 @@ void __fastcall GIFRegHandlerXYZF2(u32* data) GIFRegXYZF* r = (GIFRegXYZF*)(data); gs.add_vertex(r->X, r->Y,r->Z, r->F); - KICK_VERTEX2(); + KickVertex(false); ZZLog::Greg_Log("XYZF2: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F); } @@ -295,7 +270,7 @@ void __fastcall GIFRegHandlerXYZ2(u32* data) GIFRegXYZ* r = (GIFRegXYZ*)(data); gs.add_vertex(r->X, r->Y,r->Z); - KICK_VERTEX2(); + KickVertex(false); ZZLog::Greg_Log("XYZF2: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z); } @@ -382,7 +357,7 @@ void __fastcall GIFRegHandlerXYZF3(u32* data) GIFRegXYZF* r = (GIFRegXYZF*)(data); gs.add_vertex(r->X, r->Y,r->Z, r->F); - KICK_VERTEX3(); + KickVertex(true); ZZLog::Greg_Log("XYZF3: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F); } @@ -392,7 +367,7 @@ void __fastcall GIFRegHandlerXYZ3(u32* data) GIFRegXYZ* r = (GIFRegXYZ*)(data); gs.add_vertex(r->X, r->Y,r->Z); - KICK_VERTEX3(); + KickVertex(true); ZZLog::Greg_Log("XYZ3: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z); }