From 5dbb8dd78602f4b9c7d4e1a92b831fac032db8a6 Mon Sep 17 00:00:00 2001 From: iCatButler Date: Fri, 24 Mar 2017 12:10:18 +0000 Subject: [PATCH] Add texture only visualisation --- plugins/peopsxgl/pgxp_gpu.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/peopsxgl/pgxp_gpu.c b/plugins/peopsxgl/pgxp_gpu.c index 02a3fa7b..184c7452 100644 --- a/plugins/peopsxgl/pgxp_gpu.c +++ b/plugins/peopsxgl/pgxp_gpu.c @@ -521,6 +521,7 @@ enum PGXP_vDebugMode vDEBUG_W, vDEBUG_OTZ, vDEBUG_COLOUR, + vDEBUG_TEXTURE, vDEBUG_PRIMTYPE, vDEBUG_MAX, @@ -672,6 +673,10 @@ void PGXP_colour(OGLVertex* vertex, GLubyte alpha, int prim, int isTextured, int break; } + break; + case vDEBUG_TEXTURE: + // Texture only + glColor4ub(255, 255, 255, 255); break; case vDEBUG_PRIMTYPE: // Primitive type @@ -728,7 +733,8 @@ int DrawDebugPrim(int prim, OGLVertex* vertex1, OGLVertex* vertex2, OGLVertex* v glGetIntegerv(GL_SHADE_MODEL, &iShadeModel); glGetFloatv(GL_CURRENT_COLOR, fColour); - glDisable(GL_TEXTURE_2D); + if(PGXP_vDebug != vDEBUG_TEXTURE) + glDisable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); switch (prim) @@ -745,24 +751,28 @@ int DrawDebugPrim(int prim, OGLVertex* vertex1, OGLVertex* vertex2, OGLVertex* v } PGXP_colour(vertex1, alpha, prim, isTextured, colourMode, vertex1->c.col); + glTexCoord2fv(&vertex1->sow); PGXP_glVertexfv(&vertex1->x); PGXP_colour(vertex2, alpha, prim, isTextured, colourMode, vertex1->c.col); + glTexCoord2fv(&vertex2->sow); PGXP_glVertexfv(&vertex2->x); PGXP_colour(vertex3, alpha, prim, isTextured, colourMode, vertex1->c.col); + glTexCoord2fv(&vertex3->sow); PGXP_glVertexfv(&vertex3->x); if (prim != DRAW_TRI) { PGXP_colour(vertex4, alpha, prim, isTextured, colourMode, vertex1->c.col); + glTexCoord2fv(&vertex4->sow); PGXP_glVertexfv(&vertex4->x); } glEnd(); - if (bBlend == GL_TRUE) +// if (bBlend == GL_TRUE) // glDisable(GL_BLEND); glLineWidth(1.f);