From dfeb416833e93a9ec95714762793d85ca2d9f2d3 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 19 Mar 2010 05:46:55 +0000 Subject: [PATCH] zzogl-pg: Fix Linux after my last few commits. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2749 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2-codeblocks.workspace | 4 +- .../opengl/Linux/zzogl-pg/zzogl-pg.cbp | 1 + plugins/zzogl-pg/opengl/Makefile.am | 2 +- plugins/zzogl-pg/opengl/zerogs.cpp | 50 ++++++++----------- 4 files changed, 24 insertions(+), 33 deletions(-) diff --git a/pcsx2-codeblocks.workspace b/pcsx2-codeblocks.workspace index 16d92eb170..b1dfb8dc1c 100644 --- a/pcsx2-codeblocks.workspace +++ b/pcsx2-codeblocks.workspace @@ -1,7 +1,7 @@ - + @@ -30,6 +30,6 @@ - + diff --git a/plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp b/plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp index 845d4b0a53..b9659b4c01 100644 --- a/plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp +++ b/plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp @@ -57,6 +57,7 @@ + diff --git a/plugins/zzogl-pg/opengl/Makefile.am b/plugins/zzogl-pg/opengl/Makefile.am index 910becdc1c..679a611d0b 100644 --- a/plugins/zzogl-pg/opengl/Makefile.am +++ b/plugins/zzogl-pg/opengl/Makefile.am @@ -1,7 +1,7 @@ # Create a shared library libzzoglpg AUTOMAKE_OPTIONS = foreign noinst_LIBRARIES = libzzoglpg.a -INCLUDES = -I@srcdir@/../../../common/include -I@srcdir@/common +INCLUDES = -I@srcdir@/../../../common/include -I@srcdir@/common -I@srcdir@/../../../3rdparty/ libzzoglpg_a_CPPFLAGS = $(shell pkg-config --cflags gtk+-2.0) libzzoglpg_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) diff --git a/plugins/zzogl-pg/opengl/zerogs.cpp b/plugins/zzogl-pg/opengl/zerogs.cpp index 33328fd465..6d764ebe38 100644 --- a/plugins/zzogl-pg/opengl/zerogs.cpp +++ b/plugins/zzogl-pg/opengl/zerogs.cpp @@ -506,11 +506,7 @@ void ZeroGS::RenderCustom(float fAlpha) ProcessMessages(); -#ifdef _WIN32 - SwapBuffers(hDC); -#else - GLWin.SwapBuffers(); -#endif + GLWin.SwapGLBuffers(); glEnable(GL_SCISSOR_TEST); glEnable(GL_STENCIL_TEST); @@ -596,10 +592,14 @@ __forceinline void SET_VERTEX(VertexGPU *p, int Index, const VB& curvb) } } -#define OUTPUT_VERT(fn, vert, id) { \ - fn("%c%d(%d): xyzf=(%4d,%4d,0x%x,%3d), rgba=0x%8.8x, stq = (%2.5f,%2.5f,%2.5f)\n", id==0?'*':' ', id, prim->prim, vert.x/8, vert.y/8, vert.z, vert.f/128, \ - vert.rgba, Clamp(vert.s, -10, 10), Clamp(vert.t, -10, 10), Clamp(vert.q, -10, 10)); \ -} \ +static __forceinline void OUTPUT_VERT(VertexGPU vert, u32 id) +{ +#ifdef PRIM_LOG + PRIM_LOG("%c%d(%d): xyzf=(%4d,%4d,0x%x,%3d), rgba=0x%8.8x, stq = (%2.5f,%2.5f,%2.5f)\n", + id==0?'*':' ', id, prim->prim, vert.x/8, vert.y/8, vert.z, vert.f/128, + vert.rgba, Clamp(vert.s, -10, 10), Clamp(vert.t, -10, 10), Clamp(vert.q, -10, 10)); +#endif +} void ZeroGS::KickPoint() { @@ -623,9 +623,7 @@ void ZeroGS::KickPoint() SET_VERTEX(&p[0], last, curvb); curvb.nCount++; -#ifdef PRIM_LOG - OUTPUT_VERT(PRIM_LOG, p[0], 0); -#endif + OUTPUT_VERT(p[0], 0); } void ZeroGS::KickLine() @@ -653,10 +651,8 @@ void ZeroGS::KickLine() curvb.nCount += 2; -#ifdef PRIM_LOG - OUTPUT_VERT(PRIM_LOG, p[0], 0); - OUTPUT_VERT(PRIM_LOG, p[1], 1); -#endif + OUTPUT_VERT(p[0], 0); + OUTPUT_VERT(p[1], 1); } void ZeroGS::KickTriangle() @@ -681,11 +677,9 @@ void ZeroGS::KickTriangle() curvb.nCount += 3; -#ifdef PRIM_LOG - OUTPUT_VERT(PRIM_LOG, p[0], 0); - OUTPUT_VERT(PRIM_LOG, p[1], 1); - OUTPUT_VERT(PRIM_LOG, p[2], 2); -#endif + OUTPUT_VERT(p[0], 0); + OUTPUT_VERT(p[1], 1); + OUTPUT_VERT(p[2], 2); } void ZeroGS::KickTriangleFan() @@ -714,11 +708,9 @@ void ZeroGS::KickTriangleFan() if (gs.primIndex == gs.nTriFanVert) gs.primIndex = (gs.primIndex+1)%ARRAY_SIZE(gs.gsvertex); -#ifdef PRIM_LOG - OUTPUT_VERT(PRIM_LOG, p[0], 0); - OUTPUT_VERT(PRIM_LOG, p[1], 1); - OUTPUT_VERT(PRIM_LOG, p[2], 2); -#endif + OUTPUT_VERT(p[0], 0); + OUTPUT_VERT(p[1], 1); + OUTPUT_VERT(p[2], 2); } __forceinline void SetKickVertex(VertexGPU *p, Vertex v, int next, const VB& curvb) @@ -775,10 +767,8 @@ void ZeroGS::KickSprite() curvb.nCount += 6; -#ifdef PRIM_LOG - OUTPUT_VERT(PRIM_LOG, p[0], 0); - OUTPUT_VERT(PRIM_LOG, p[1], 1); -#endif + OUTPUT_VERT(p[0], 0); + OUTPUT_VERT(p[1], 1); } void ZeroGS::KickDummy()