From b38903cc6aa576f1b2a78bb883f3d3fc5a347353 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 17 Nov 2000 07:19:47 +0000 Subject: [PATCH] add the center points of the sky polys to the debug info. --- source/gl_sky_clip.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/source/gl_sky_clip.c b/source/gl_sky_clip.c index e2f8af2..5f1e22d 100644 --- a/source/gl_sky_clip.c +++ b/source/gl_sky_clip.c @@ -451,9 +451,10 @@ R_DrawSkyChain (msurface_t *sky_chain) } #if 1 glDisable (GL_TEXTURE_2D); + sc = sky_chain; glColor3f (1, 1, 1); - while (sky_chain) { - glpoly_t *p = sky_chain->polys; + while (sc) { + glpoly_t *p = sc->polys; while (p) { int i; glBegin (GL_LINE_LOOP); @@ -463,8 +464,28 @@ R_DrawSkyChain (msurface_t *sky_chain) glEnd(); p = p->next; } - sky_chain = sky_chain->texturechain; + sc = sc->texturechain; } + sc = sky_chain; + glColor3f (0, 1, 0); + glBegin (GL_POINTS); + while (sc) { + glpoly_t *p = sc->polys; + while (p) { + int i; + vec3_t x, c = {0, 0, 0}; + for (i=0; inumverts; i++) { + VectorSubtract (p->verts[i], r_refdef.vieworg, x); + VectorAdd (x, c, c); + } + VectorScale (c, 1.0/p->numverts, c); + VectorAdd (c, r_refdef.vieworg, c); + glVertex3fv (c); + p = p->next; + } + sc = sc->texturechain; + } + glEnd (); if (skyloaded) { int i,j; glColor3f (1, 0, 0);