From 3c88fd5a5dd6ecca737d4728ba6794a6865f91c6 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 6 Nov 2006 18:16:24 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@503 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/renderextras.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index f4f935af..1c0c5863 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -560,24 +560,34 @@ VAR(shotline_duration, 0, 75, 10000); void rendershotlines() { + int lines = 0; loopi(MAXSHOTLINES) { shotline *s = &shotlines[i]; if(!s->inuse) continue; if(lastmillis-s->millis > shotline_duration) { s->inuse = false; continue; } - glPushMatrix(); - glDisable(GL_TEXTURE_2D); + + if(!lines) + { + glPushMatrix(); + glDisable(GL_TEXTURE_2D); - glDepthMask(GL_FALSE); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); - glDisable(GL_FOG); + glDepthMask(GL_FALSE); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); + glDisable(GL_FOG); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glBegin(GL_LINES); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glBegin(GL_LINES); glColor4f(1.0f, 1.0f, 0.7f, 0.5f); - glVertex3f(s->from.x, s->from.z, s->from.y); - glVertex3f(s->to.x, s->to.z, s->to.y); + }; + ++lines; + + glVertex3f(s->from.x, s->from.z, s->from.y); + glVertex3f(s->to.x, s->to.z, s->to.y); + }; + if(lines) + { glEnd(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);