summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-10-04 19:10:06 +0000
committerBrian Paul <[email protected]>2002-10-04 19:10:06 +0000
commitfc80ad6e62fb2b53d53756593099330477a44c52 (patch)
tree0b47f3ee84d613dfa2264d6f23e5c2a60cecc9ba /src/mesa/main/blend.c
parentf782b8189e718974a40d72ac4f6b8d213ca99e1e (diff)
Changed a number of context fields from GLchan to GLfloat (such as ClearColor).
Also changed parameter types for some driver functions (like ctx->Driver.Clear- Color). Updated all the device drivers. Someday, we want to support 8, 16 and 32-bit channels dynamically at runtime.
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r--src/mesa/main/blend.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 97b11872c42..98385e0a70a 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -1,4 +1,4 @@
-/* $Id: blend.c,v 1.36 2002/06/15 02:38:15 brianp Exp $ */
+/* $Id: blend.c,v 1.37 2002/10/04 19:10:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -346,7 +346,6 @@ void
_mesa_AlphaFunc( GLenum func, GLclampf ref )
{
GET_CURRENT_CONTEXT(ctx);
- GLchan cref;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (func) {
@@ -358,18 +357,17 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
case GL_NOTEQUAL:
case GL_GEQUAL:
case GL_ALWAYS:
- /* convert float alpha ref to GLchan type */
- UNCLAMPED_FLOAT_TO_CHAN(cref, ref);
+ ref = CLAMP(ref, 0.0F, 1.0F);
- if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == cref)
- return;
+ if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == ref)
+ return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.AlphaFunc = func;
- ctx->Color.AlphaRef = cref;
+ ctx->Color.AlphaRef = ref;
if (ctx->Driver.AlphaFunc)
- ctx->Driver.AlphaFunc(ctx, func, cref);
+ ctx->Driver.AlphaFunc(ctx, func, ref);
return;
default: