From b14f789fbe96e2dc2599d01fdc168737cca66c12 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 6 Dec 2005 02:20:11 +0000 Subject: [PATCH] Convert q3 flares to dynamic flashblendable lights git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1672 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_ppl.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_ppl.c b/engine/gl/gl_ppl.c index af7768e0..f6366671 100644 --- a/engine/gl/gl_ppl.c +++ b/engine/gl/gl_ppl.c @@ -1425,8 +1425,26 @@ static void PPL_BaseTextureChain(msurface_t *first) int dlb; glRect_t *theRect; - // if (first->texinfo->texture->shader->flags & SHADER_FLARE ) - // return; + if (first->texinfo->texture->shader->flags & SHADER_FLARE ) + { + dlight_t *dl; + while(first) + { //a quick hack to convert to a dlight + dl = CL_AllocDlight(0); + VectorCopy(first->mesh->xyz_array[0], dl->origin); + dl->color[0] = 0.2; + dl->color[1] = 0.2; + dl->color[2] = 0.2; + dl->radius = 50; + + //flashblend only + dl->noppl = true; + dl->nodynamic = true; + + first = first->texturechain; + } + return; + } if (!varrayactive) R_IBrokeTheArrays(); @@ -1619,6 +1637,8 @@ void PPL_BaseTextures(model_t *model) msurface_t *s; texture_t *t; + currententity = &r_worldentity; + GL_DoSwap(); qglDisable(GL_BLEND);