summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-05-10 04:33:28 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-05-10 04:33:28 +0000
commitd002f1899f26f64ef506282334b5c9b0a9442e0e (patch)
treef77ce95f04c0cc2dfcc69beaba222f48dba861cf
parentb8554f9a93399bba51b8e13d5e70b4fb037d2c4c (diff)
clamp fog color
-rw-r--r--src/mesa/main/fog.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 8a65ffaed2..028922ce72 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.0.3
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 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"),
@@ -130,10 +129,10 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
if (TEST_EQ_4V(ctx->Fog.Color, params))
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.Color[0] = params[0];
- ctx->Fog.Color[1] = params[1];
- ctx->Fog.Color[2] = params[2];
- ctx->Fog.Color[3] = params[3];
+ ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F);
+ ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F);
+ ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F);
+ ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F);
break;
case GL_FOG_COORDINATE_SOURCE_EXT: {
GLenum p = (GLenum) (GLint) *params;