diff options
author | Brian Paul <[email protected]> | 2001-02-13 23:59:34 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-02-13 23:59:34 +0000 |
commit | b5fb4fd55bb49fb969ae483f77aa6f9db8348c20 (patch) | |
tree | d71df86f488e8c9c136082638b22ee96c8486c6b /src | |
parent | 88c5ceb6500d6cb442b4e675f0d7928ddd99b1cf (diff) |
fixed a CI mode segfault, minor clean-ups
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/tnl/t_vb_lighttmp.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 1fe896c6068..3aa9cf32691 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -1,10 +1,10 @@ -/* $Id: t_vb_lighttmp.h,v 1.4 2001/01/24 00:05:00 brianp Exp $ */ +/* $Id: t_vb_lighttmp.h,v 1.5 2001/02/13 23:59:34 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -766,14 +766,14 @@ static void TAG(light_ci)( GLcontext *ctx, { struct light_stage_data *store = LIGHT_STAGE_DATA(stage); GLuint j; - GLuint vstride = input->stride; + GLuint vstride = input->stride; const GLfloat *vertex = (GLfloat *) input->data; - GLuint nstride = VB->NormalPtr->stride; + GLuint nstride = VB->NormalPtr->stride; const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; GLchan (*CMcolor)[4]; GLuint CMstride; GLuint *flags = VB->Flag; - GLuint *indexResult[2]; + GLuint *indexResult[2]; struct gl_material (*new_material)[2] = VB->Material; GLuint *new_material_mask = VB->MaterialMask; GLuint nr = VB->Count; @@ -790,7 +790,8 @@ static void TAG(light_ci)( GLcontext *ctx, return; indexResult[0] = VB->IndexPtr[0]->data; - indexResult[1] = VB->IndexPtr[1]->data; + if (IDX & LIGHT_TWOSIDE) + indexResult[1] = VB->IndexPtr[1]->data; if (IDX & LIGHT_COLORMATERIAL) { CMcolor = VB->ColorPtr[0]->data; @@ -852,7 +853,7 @@ static void TAG(light_ci)( GLcontext *ctx, /* spotlight attenuation */ if (light->_Flags & LIGHT_SPOT) { GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); - if (PV_dot_dir<light->_CosCutoff) { + if (PV_dot_dir < light->_CosCutoff) { continue; /* this light makes no contribution */ } else { @@ -901,9 +902,7 @@ static void TAG(light_ci)( GLcontext *ctx, } n_dot_h = correction * DOT3(normal, h); - - if (n_dot_h > 0.0F) - { + if (n_dot_h > 0.0F) { GLfloat spec_coef; struct gl_shine_tab *tab = ctx->_ShineTable[side]; GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef); |