diff options
Diffstat (limited to 'src/mesa/main/light.h')
-rw-r--r-- | src/mesa/main/light.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h index f737abf4e45..b39aa002d87 100644 --- a/src/mesa/main/light.h +++ b/src/mesa/main/light.h @@ -1,4 +1,4 @@ -/* $Id: light.h,v 1.8 2000/12/26 05:09:29 keithw Exp $ */ +/* $Id: light.h,v 1.9 2001/02/06 04:06:35 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -82,13 +82,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); #define GET_SHINE_TAB_ENTRY( table, dp, result ) \ do { \ struct gl_shine_tab *_tab = table; \ - if (dp>1.0) \ + float f = (dp * (SHINE_TABLE_SIZE-1)); \ + int k = (int) f; \ + if (k > SHINE_TABLE_SIZE-2) \ result = pow( dp, _tab->shininess ); \ - else { \ - float f = (dp * (SHINE_TABLE_SIZE-1)); \ - int k = (int) f; \ + else \ result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]); \ - } \ } while (0) |