diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-05-10 04:34:15 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-05-10 04:34:15 +0000 |
commit | baa42c3364b58a7eaf08856c7d213d9ae0e3b021 (patch) | |
tree | ea37fe1d9f675781f4b592f99e8899c3d23d4b12 /src/mesa/main/fog.c | |
parent | a96d596be9349d83eda992235eedd26746fa46ee (diff) |
clamp fog color
Diffstat (limited to 'src/mesa/main/fog.c')
-rw-r--r-- | src/mesa/main/fog.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 632a8ed32b..79f480db37 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -1,10 +1,8 @@ -/* $Id: fog.c,v 1.36 2002/10/24 23:57:20 brianp Exp $ */ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 5.1 * - * 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"), @@ -131,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; |