projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d14fce0
)
added divide by zero check
author
Brian Paul
<brian.paul@tungstengraphics.com>
Wed, 3 Jan 2001 22:56:23 +0000
(22:56 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Wed, 3 Jan 2001 22:56:23 +0000
(22:56 +0000)
src/mesa/tnl/t_vb_fog.c
patch
|
blob
|
history
diff --git
a/src/mesa/tnl/t_vb_fog.c
b/src/mesa/tnl/t_vb_fog.c
index 38a80702ab29ebc779eae4b26dd3c7d34416f66e..2adb8d1850006b5c6f7904f5834291956dbdcb37 100644
(file)
--- a/
src/mesa/tnl/t_vb_fog.c
+++ b/
src/mesa/tnl/t_vb_fog.c
@@
-1,4
+1,4
@@
-/* $Id: t_vb_fog.c,v 1.
1 2000/12/26 05:09:33 keithw
Exp $ */
+/* $Id: t_vb_fog.c,v 1.
2 2001/01/03 22:56:23 brianp
Exp $ */
/*
* Mesa 3-D graphics library
@@
-68,7
+68,10
@@
static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
switch (ctx->Fog.Mode) {
case GL_LINEAR:
- d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ if (ctx->Fog.Start == ctx->Fog.End)
+ d = 1.0F;
+ else
+ d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride))
data[i] = (end - ABSF(*v)) * d;
break;