* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
*/\r
\r
-static void clear_color_generic(GLcontext *ctx,\r
- GLubyte red, GLubyte green,\r
- GLubyte blue, GLubyte alpha)\r
+static void clear_color_generic(GLcontext *ctx, const GLfloat color[4])\r
{\r
AMesaContext context = (AMesaContext)(ctx->DriverCtx);\r
-\r
- context->ClearColor = makecol(red, green, blue);\r
+ GLubyte r, g, b;\r
+ CLAMPED_FLOAT_TO_UBYTE(r, color[0]);\r
+ CLAMPED_FLOAT_TO_UBYTE(g, color[1]);\r
+ CLAMPED_FLOAT_TO_UBYTE(b, color[2]);\r
+ context->ClearColor = makecol(r, g, b);\r
}\r
\r
\r
\r
static void clear_color (GLcontext *ctx, const GLchan color[4])\r
{\r
+ const GLubyte col[4];\r
DMesaContext c = (DMesaContext)ctx->DriverCtx;\r
- c->ClearColor = vl_mixrgba(color);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]);\r
+ c->ClearColor = vl_mixrgba(col);\r
}\r
\r
\r
ggi_ctx->clearcolor = (ggi_pixel)ci;
}
-static void gl_ggiSetClearColor(GLcontext *ctx, const GLchan color[4])
+static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4])
{
ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx;
ggi_color rgb;
ggi_pixel col;
-
+ GLubyte byteColor[3];
+
GGIMESADPRINT_CORE("gl_ggiSetClearColor() called\n");
- rgb.r = (uint16)color[0] << SHIFT;
- rgb.g = (uint16)color[1] << SHIFT;
- rgb.b = (uint16)color[2] << SHIFT;
+ CLAMPED_FLOAT_TO_UBYTE(byteColor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(byteColor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(byteColor[2], color[2]);
+
+ rgb.r = (uint16)byteColor[0] << SHIFT;
+ rgb.g = (uint16)byteColor[1] << SHIFT;
+ rgb.b = (uint16)byteColor[2] << SHIFT;
col = ggiMapColor(ggi_ctx->ggi_visual, &rgb);
ggiSetGCForeground(ggi_ctx->ggi_visual, col);
ggi_ctx->clearcolor = col;
-/* $Id: fxdd.c,v 1.91 2002/09/27 02:45:38 brianp Exp $ */
+/* $Id: fxdd.c,v 1.92 2002/10/04 19:10:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Implements glClearColor() */
static void
-fxDDClearColor(GLcontext * ctx, const GLchan color[4])
+fxDDClearColor(GLcontext * ctx, const GLfloat color[4])
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
GLubyte col[4];
if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxDDClearColor(%d,%d,%d,%d)\n",
+ fprintf(stderr, "fxmesa: fxDDClearColor(%f,%f,%f,%f)\n",
color[0], color[1], color[2], color[3]);
}
- ASSIGN_4V(col, color[0], color[1], color[2], 255);
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]);
+
fxMesa->clearC = FXCOLOR4(col);
fxMesa->clearA = color[3];
}
-/* $Id: svgamesa15.c,v 1.9 2001/02/06 00:03:47 brianp Exp $ */
+/* $Id: svgamesa15.c,v 1.10 2002/10/04 19:10:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
return shortBuffer[offset];
}
-void __clear_color15( GLcontext *ctx, const GLchan color[4] )
+void __clear_color15( GLcontext *ctx, const GLfloat color[4] )
{
- SVGAMesa->clear_hicolor=(color[0]>>3)<<10 | (color[1]>>3)<<5 | (color[2]>>3);
+ GLubyte col[3];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ SVGAMesa->clear_hicolor=(col[0]>>3)<<10 | (col[1]>>3)<<5 | (col[2]>>3);
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
}
-/* $Id: svgamesa16.c,v 1.9 2001/02/06 00:03:48 brianp Exp $ */
+/* $Id: svgamesa16.c,v 1.10 2002/10/04 19:10:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
void __clear_color16( GLcontext *ctx, const GLchan color[4] )
{
- SVGAMesa->clear_hicolor = (color[0] >> 3) << 11 |
- (color[1] >> 2) << 5 |
- (color[2] >> 3);
+ GLubyte col[3];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ SVGAMesa->clear_hicolor = (col[0] >> 3) << 11 |
+ (col[1] >> 2) << 5 |
+ (col[2] >> 3);
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
}
-/* $Id: svgamesa24.c,v 1.10 2001/02/06 00:03:48 brianp Exp $ */
+/* $Id: svgamesa24.c,v 1.11 2002/10/04 19:10:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
void __clear_color24( GLcontext *ctx, const GLchan color[4] )
{
- SVGAMesa->clear_red = color[0];
- SVGAMesa->clear_green = color[1];
- SVGAMesa->clear_blue = color[2];
+ GLubyte col[3];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ SVGAMesa->clear_red = col[0];
+ SVGAMesa->clear_green = col[1];
+ SVGAMesa->clear_blue = col[2];
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
}
-/* $Id: svgamesa32.c,v 1.10 2001/02/06 00:03:48 brianp Exp $ */
+/* $Id: svgamesa32.c,v 1.11 2002/10/04 19:10:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
void __clear_color32( GLcontext *ctx, const GLchan color[4] )
{
- SVGAMesa->clear_truecolor = (color[0] << 16) | (color[1] << 8) | color[2];
+ GLubyte col[3];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2];
}
void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
-/* $Id: wmesa.c,v 1.37 2002/10/04 15:58:33 kschultz Exp $ */
+/* $Id: wmesa.c,v 1.38 2002/10/04 19:10:11 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
/*
* Set the color used to clear the color buffer.
*/
-static void clear_color( GLcontext* ctx, const GLchan color[4] )
+static void clear_color( GLcontext* ctx, const GLfloat color[4] )
{
- Current->clearpixel = RGB(color[0], color[1], color[2]);
+ GLubyte col[4];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ Current->clearpixel = RGB(col[0], col[1], col[2]);
}
/*\r
* Set the color used to clear the color buffer.\r
*/\r
-static void clear_color( GLcontext* ctx, const GLchan color[4] )\r
+static void clear_color( GLcontext* ctx, const GLfloat color[4] )\r
{\r
STARTPROFILE\r
- Current->clearpixel = RGB(color[0], color[1], color[2]);\r
+ GLubyte col[4];\r
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);\r
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);\r
+ Current->clearpixel = RGB(col[0], col[1], col[2]);\r
ENDPROFILE(clear_color)\r
}\r
\r
-/* $Id: xm_dd.c,v 1.36 2002/09/27 02:45:39 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.37 2002/10/04 19:10:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glxheader.h"
#include "context.h"
+#include "colormac.h"
#include "depth.h"
#include "drawpix.h"
#include "extensions.h"
static void
-clear_color( GLcontext *ctx, const GLchan color[4] )
+clear_color( GLcontext *ctx, const GLfloat color[4] )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- xmesa->clearcolor[0] = color[0];
- xmesa->clearcolor[1] = color[1];
- xmesa->clearcolor[2] = color[2];
- xmesa->clearcolor[3] = color[3];
- xmesa->clearpixel = xmesa_color_to_pixel( xmesa, color[0], color[1],
- color[2], color[3],
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
+ xmesa->clearpixel = xmesa_color_to_pixel( xmesa,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2],
+ xmesa->clearcolor[3],
xmesa->xm_visual->undithered_pf );
_glthread_LOCK_MUTEX(_xmesa_lock);
XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc,
-/* $Id: xm_span.c,v 1.15 2002/07/09 01:22:52 brianp Exp $ */
+/* $Id: xm_span.c,v 1.16 2002/10/04 19:10:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* $XFree86: xc/extras/Mesa/src/X/xm_span.c,v 1.3 2002/02/27 21:07:54 tsi Exp $ */
#include "glxheader.h"
+#include "colormac.h"
#include "context.h"
-#include "drawpix.h"
-#include "mem.h"
-#include "state.h"
#include "depth.h"
+#include "drawpix.h"
+#include "extensions.h"
#include "macros.h"
+#include "mem.h"
#include "mtypes.h"
+#include "state.h"
#include "xmesaP.h"
-#include "extensions.h"
#include "swrast/swrast.h"
static void
-clear_color_HPCR_ximage( GLcontext *ctx, const GLchan color[4] )
+clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- COPY_4V(xmesa->clearcolor, color);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
- if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
+ if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) {
/* black is black */
MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 ,
sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern));
else {
/* build clear pattern */
for (i=0; i<16; i++) {
- xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
- DITHER_HPCR(i, 0, color[0], color[1], color[2]);
+ xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] =
+ DITHER_HPCR(i, 0,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]);
xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] =
- DITHER_HPCR(i, 1, color[0], color[1], color[2]);
+ DITHER_HPCR(i, 1,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]);
}
}
}
static void
-clear_color_HPCR_pixmap( GLcontext *ctx, const GLchan color[4] )
+clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] )
{
int i;
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- COPY_4V(xmesa->clearcolor, color);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]);
+ CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]);
- if (color[0] == 0 && color[1] == 0 && color[2] == 0) {
+ if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) {
/* black is black */
for (i=0; i<16; i++) {
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0);
else {
for (i=0; i<16; i++) {
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0,
- DITHER_HPCR(i, 0, color[0], color[1], color[2]));
+ DITHER_HPCR(i, 0,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]));
XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1,
- DITHER_HPCR(i, 1, color[0], color[1], color[2]));
+ DITHER_HPCR(i, 1,
+ xmesa->clearcolor[0],
+ xmesa->clearcolor[1],
+ xmesa->clearcolor[2]));
}
}
/* change tile pixmap content */
-/* $Id: attrib.c,v 1.71 2002/09/06 02:56:08 brianp Exp $ */
+/* $Id: attrib.c,v 1.72 2002/10/04 19:10:06 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
if (ctx->Extensions.SGIX_shadow_ambient) {
_mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX,
- CHAN_TO_FLOAT(obj->ShadowAmbient));
+ obj->ShadowAmbient);
}
}
const struct gl_colorbuffer_attrib *color;
color = (const struct gl_colorbuffer_attrib *) attr->data;
_mesa_ClearIndex((GLfloat) color->ClearIndex);
- _mesa_ClearColor(CHAN_TO_FLOAT(color->ClearColor[0]),
- CHAN_TO_FLOAT(color->ClearColor[1]),
- CHAN_TO_FLOAT(color->ClearColor[2]),
- CHAN_TO_FLOAT(color->ClearColor[3]));
+ _mesa_ClearColor(color->ClearColor[0],
+ color->ClearColor[1],
+ color->ClearColor[2],
+ color->ClearColor[3]);
_mesa_IndexMask(color->IndexMask);
_mesa_ColorMask((GLboolean) (color->ColorMask[0] != 0),
(GLboolean) (color->ColorMask[1] != 0),
(GLboolean) (color->ColorMask[3] != 0));
_mesa_DrawBuffer(color->DrawBuffer);
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
- _mesa_AlphaFunc(color->AlphaFunc,
- CHAN_TO_FLOAT(color->AlphaRef));
+ _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
_mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled);
_mesa_BlendFuncSeparateEXT(color->BlendSrcRGB,
color->BlendDstRGB,
-/* $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
_mesa_AlphaFunc( GLenum func, GLclampf ref )
{
GET_CURRENT_CONTEXT(ctx);
- GLchan cref;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (func) {
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:
-/* $Id: buffers.c,v 1.37 2002/07/09 01:22:50 brianp Exp $ */
+/* $Id: buffers.c,v 1.38 2002/10/04 19:10:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
void
_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
- GLchan tmp[4];
+ GLfloat tmp[4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[0], red);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[1], green);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[2], blue);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[3], alpha);
+ tmp[0] = CLAMP(red, 0.0F, 1.0F);
+ tmp[1] = CLAMP(green, 0.0F, 1.0F);
+ tmp[2] = CLAMP(blue, 0.0F, 1.0F);
+ tmp[3] = CLAMP(alpha, 0.0F, 1.0F);
if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
- return;
+ return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
- COPY_CHAN4(ctx->Color.ClearColor, tmp);
+ COPY_4V(ctx->Color.ClearColor, tmp);
if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) {
/* it's OK to call glClearColor in CI mode but it should be a NOP */
-/* $Id: dd.h,v 1.72 2002/09/27 02:45:37 brianp Exp $ */
+/* $Id: dd.h,v 1.73 2002/10/04 19:10:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
*** They're ALSO called by the gl_PopAttrib() function!!!
*** May add more functions like these to the device driver in the future.
***/
-#if 1
- void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLchan ref);
-#else
void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLfloat ref);
-#endif
void (*BlendColor)(GLcontext *ctx, const GLfloat color[4]);
void (*BlendEquation)(GLcontext *ctx, GLenum mode);
void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor);
void (*BlendFuncSeparate)(GLcontext *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
-#if 1
- void (*ClearColor)(GLcontext *ctx, const GLchan color[4]);
-#else
void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]);
-#endif
void (*ClearDepth)(GLcontext *ctx, GLclampd d);
void (*ClearIndex)(GLcontext *ctx, GLuint index);
void (*ClearStencil)(GLcontext *ctx, GLint s);
-/* $Id: get.c,v 1.92 2002/09/27 02:45:37 brianp Exp $ */
+/* $Id: get.c,v 1.93 2002/10/04 19:10:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
*params = ENUM_TO_BOOL(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / CHAN_MAXF);
+ *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = INT_TO_BOOL(ctx->AttribStackDepth);
*params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLdouble) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLdouble) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLdouble ) (ctx->AttribStackDepth);
*params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = (GLdouble) ctx->Color.ClearColor[0];
+ params[1] = (GLdouble) ctx->Color.ClearColor[1];
+ params[2] = (GLdouble) ctx->Color.ClearColor[2];
+ params[3] = (GLdouble) ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLdouble) ctx->Light.ColorMaterialEnabled;
*params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc);
break;
case GL_ALPHA_TEST_REF:
- *params = (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF;
+ *params = (GLfloat) ctx->Color.AlphaRef;
break;
case GL_ATTRIB_STACK_DEPTH:
*params = (GLfloat) (ctx->AttribStackDepth);
*params = 0.0;
break;
case GL_COLOR_CLEAR_VALUE:
- params[0] = CHAN_TO_FLOAT(ctx->Color.ClearColor[0]);
- params[1] = CHAN_TO_FLOAT(ctx->Color.ClearColor[1]);
- params[2] = CHAN_TO_FLOAT(ctx->Color.ClearColor[2]);
- params[3] = CHAN_TO_FLOAT(ctx->Color.ClearColor[3]);
+ params[0] = ctx->Color.ClearColor[0];
+ params[1] = ctx->Color.ClearColor[1];
+ params[2] = ctx->Color.ClearColor[2];
+ params[3] = ctx->Color.ClearColor[3];
break;
case GL_COLOR_MATERIAL:
*params = (GLfloat) ctx->Light.ColorMaterialEnabled;
*params = (GLint) ctx->Color.AlphaEnabled;
break;
case GL_ALPHA_TEST_REF:
- *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF );
+ *params = FLOAT_TO_INT(ctx->Color.AlphaRef);
break;
case GL_ALPHA_TEST_FUNC:
*params = (GLint) ctx->Color.AlphaFunc;
-/* $Id: mtypes.h,v 1.92 2002/10/02 23:24:04 brianp Exp $ */
+/* $Id: mtypes.h,v 1.93 2002/10/04 19:10:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
struct gl_colorbuffer_attrib {
GLuint ClearIndex; /* Index to use for glClear */
-#if 1
- GLchan ClearColor[4]; /* Color to use for glClear */
-#else
GLclampf ClearColor[4]; /* Color to use for glClear */
-#endif
GLuint IndexMask; /* Color index write mask */
GLubyte ColorMask[4]; /* Each flag is 0xff or 0x0 */
/* alpha testing */
GLboolean AlphaEnabled; /* Alpha test enabled flag */
GLenum AlphaFunc; /* Alpha test function */
-#if 1
- GLchan AlphaRef; /* Alpha ref value as GLchan */
-#else
GLclampf AlphaRef;
-#endif
/* blending */
GLboolean BlendEnabled; /* Blending enabled flag */
GLuint Name; /* an unsigned integer */
GLenum Target; /* GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
GLfloat Priority; /* in [0,1] */
- GLfloat BorderValues[4]; /* unclamped */
-#if 1
- /* omit someday */
- GLchan BorderColor[4]; /* clamped, as GLchan */
-#endif
+ GLfloat BorderColor[4]; /* unclamped */
+ GLchan _BorderChan[4]; /* clamped, as GLchan */
GLenum WrapS; /* Wrap modes are: GL_CLAMP, REPEAT */
GLenum WrapT; /* GL_CLAMP_TO_EDGE, and */
GLenum WrapR; /* GL_CLAMP_TO_BORDER_ARB */
GLfloat MaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
GLboolean CompareFlag; /* GL_SGIX_shadow */
GLenum CompareOperator; /* GL_SGIX_shadow */
-#if 1
- GLchan ShadowAmbient; /* GL_SGIX/ARB_shadow_ambient */
-#else
GLfloat ShadowAmbient;
-#endif
GLenum CompareMode; /* GL_ARB_shadow */
GLenum CompareFunc; /* GL_ARB_shadow */
GLenum DepthMode; /* GL_ARB_depth_texture */
GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */
/* Software alpha planes */
-#if 1
- GLchan *FrontLeftAlpha; /* array [Width*Height] of GLubyte */
- GLchan *BackLeftAlpha; /* array [Width*Height] of GLubyte */
- GLchan *FrontRightAlpha; /* array [Width*Height] of GLubyte */
- GLchan *BackRightAlpha; /* array [Width*Height] of GLubyte */
-#else
GLvoid *FrontLeftAlpha; /* array [Width*Height] of GLubyte */
GLvoid *BackLeftAlpha; /* array [Width*Height] of GLubyte */
GLvoid *FrontRightAlpha; /* array [Width*Height] of GLubyte */
GLvoid *BackRightAlpha; /* array [Width*Height] of GLubyte */
-#endif
+
/* Drawing bounds: intersection of window size and scissor box */
GLint _Xmin, _Ymin; /* inclusive */
GLint _Xmax, _Ymax; /* exclusive */
-/* $Id: texobj.c,v 1.57 2002/06/29 19:48:16 brianp Exp $ */
+/* $Id: texobj.c,v 1.58 2002/10/04 19:10:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
obj->CompareMode = GL_LUMINANCE; /* ARB_shadow */
obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */
obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
- obj->ShadowAmbient = 0; /* ARB/SGIX_shadow_ambient */
+ obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */
_mesa_init_colortable(&obj->Palette);
/* insert into linked list */
-/* $Id: texstate.c,v 1.79 2002/09/27 02:45:38 brianp Exp $ */
+/* $Id: texstate.c,v 1.80 2002/10/04 19:10:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
}
break;
-#if 0 /* someday */
- case GL_TEXTUER_BORDER_VALUES_NV:
- /* don't clamp */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- COPY_4V(texObj->BorderValues, params);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[0], params[0]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[1], params[1]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[2], params[2]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], params[3]);
- break;
-#endif
case GL_TEXTURE_BORDER_COLOR:
- /* clamp */
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texObj->BorderValues[0] = CLAMP(params[0], 0.0F, 1.0F);
- texObj->BorderValues[1] = CLAMP(params[1], 0.0F, 1.0F);
- texObj->BorderValues[2] = CLAMP(params[2], 0.0F, 1.0F);
- texObj->BorderValues[3] = CLAMP(params[3], 0.0F, 1.0F);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[0], texObj->BorderValues[0]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[1], texObj->BorderValues[1]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[2], texObj->BorderValues[2]);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], texObj->BorderValues[3]);
+ texObj->BorderColor[RCOMP] = params[0];
+ texObj->BorderColor[GCOMP] = params[1];
+ texObj->BorderColor[BCOMP] = params[2];
+ texObj->BorderColor[ACOMP] = params[3];
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]);
break;
case GL_TEXTURE_MIN_LOD:
if (texObj->MinLod == params[0])
case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- UNCLAMPED_FLOAT_TO_CHAN(texObj->ShadowAmbient, params[0]);
+ texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
case GL_TEXTURE_WRAP_R_EXT:
*params = ENUM_TO_FLOAT(obj->WrapR);
return;
-#if 0 /* someday */
- case GL_TEXTURE_BORDER_VALUES_NV:
- /* unclamped */
- params[0] = obj->BorderValues[0];
- params[1] = obj->BorderValues[1];
- params[2] = obj->BorderValues[2];
- params[3] = obj->BorderValues[3];
- return;
-#endif
case GL_TEXTURE_BORDER_COLOR:
- /* clamped */
- params[0] = obj->BorderColor[0] / CHAN_MAXF;
- params[1] = obj->BorderColor[1] / CHAN_MAXF;
- params[2] = obj->BorderColor[2] / CHAN_MAXF;
- params[3] = obj->BorderColor[3] / CHAN_MAXF;
+ params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
+ params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
+ params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
+ params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
return;
case GL_TEXTURE_RESIDENT:
{
break;
case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
- *params = CHAN_TO_FLOAT(obj->ShadowAmbient);
+ *params = obj->ShadowAmbient;
return;
}
break;
case GL_TEXTURE_WRAP_R_EXT:
*params = (GLint) obj->WrapR;
return;
-#if 0 /* someday */
- case GL_TEXTURE_BORDER_VALUES_NV:
- /* unclamped */
- params[0] = FLOAT_TO_INT(obj->BorderValues[0]);
- params[1] = FLOAT_TO_INT(obj->BorderValues[1]);
- params[2] = FLOAT_TO_INT(obj->BorderValues[2]);
- params[3] = FLOAT_TO_INT(obj->BorderValues[3]);
- return;
-#endif
case GL_TEXTURE_BORDER_COLOR:
- /* clamped */
{
GLfloat b[4];
- b[0] = CLAMP(obj->BorderValues[0], 0.0F, 1.0F);
- b[1] = CLAMP(obj->BorderValues[1], 0.0F, 1.0F);
- b[2] = CLAMP(obj->BorderValues[2], 0.0F, 1.0F);
- b[3] = CLAMP(obj->BorderValues[3], 0.0F, 1.0F);
+ b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
+ b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
+ b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
+ b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
params[0] = FLOAT_TO_INT(b[0]);
params[1] = FLOAT_TO_INT(b[1]);
params[2] = FLOAT_TO_INT(b[2]);
break;
case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
- GLfloat a = CHAN_TO_FLOAT(obj->ShadowAmbient);
- *params = (GLint) FLOAT_TO_INT(a);
+ *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient);
return;
}
break;
-/* $Id: s_alpha.c,v 1.11 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_alpha.c,v 1.12 2002/10/04 19:10:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_alpha_test( const GLcontext *ctx, struct sw_span *span )
{
const GLchan (*rgba)[4] = (const GLchan (*)[4]) span->array->rgba;
- const GLchan ref = ctx->Color.AlphaRef;
+ GLchan ref;
const GLuint n = span->end;
GLubyte *mask = span->array->mask;
GLuint i;
+ CLAMPED_FLOAT_TO_CHAN(ref, ctx->Color.AlphaRef);
+
if (span->arrayMask & SPAN_RGBA) {
/* Use the array values */
switch (ctx->Color.AlphaFunc) {
-/* $Id: s_alphabuf.c,v 1.11 2002/07/09 01:22:52 brianp Exp $ */
+/* $Id: s_alphabuf.c,v 1.12 2002/10/04 19:10:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
if (buffer->FrontLeftAlpha) {
MESA_PBUFFER_FREE( buffer->FrontLeftAlpha );
}
- buffer->FrontLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->FrontLeftAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->FrontLeftAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
if (buffer->BackLeftAlpha) {
MESA_PBUFFER_FREE( buffer->BackLeftAlpha );
}
- buffer->BackLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->BackLeftAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->BackLeftAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
if (buffer->FrontRightAlpha) {
MESA_PBUFFER_FREE( buffer->FrontRightAlpha );
}
- buffer->FrontRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->FrontRightAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->FrontRightAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
if (buffer->BackRightAlpha) {
MESA_PBUFFER_FREE( buffer->BackRightAlpha );
}
- buffer->BackRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes );
+ buffer->BackRightAlpha = MESA_PBUFFER_ALLOC( bytes );
if (!buffer->BackRightAlpha) {
/* out of memory */
_mesa_error( NULL, GL_OUT_OF_MEMORY,
if (bufferBit & ctx->Color._DrawDestMask) {
GLchan *buffer;
if (bufferBit == FRONT_LEFT_BIT) {
- buffer = ctx->DrawBuffer->FrontLeftAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
}
else if (bufferBit == FRONT_RIGHT_BIT) {
- buffer = ctx->DrawBuffer->FrontRightAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->FrontRightAlpha;
}
else if (bufferBit == BACK_LEFT_BIT) {
- buffer = ctx->DrawBuffer->BackLeftAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->BackLeftAlpha;
}
else {
- buffer = ctx->DrawBuffer->BackRightAlpha;
+ buffer = (GLchan *) ctx->DrawBuffer->BackRightAlpha;
}
if (ctx->Scissor.Enabled) {
{
switch (ctx->Color._DriverDrawBuffer) {
case GL_FRONT_LEFT:
- return ctx->DrawBuffer->FrontLeftAlpha;
+ return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
break;
case GL_BACK_LEFT:
- return ctx->DrawBuffer->BackLeftAlpha;
+ return (GLchan *) ctx->DrawBuffer->BackLeftAlpha;
break;
case GL_FRONT_RIGHT:
- return ctx->DrawBuffer->FrontRightAlpha;
+ return (GLchan *) ctx->DrawBuffer->FrontRightAlpha;
break;
case GL_BACK_RIGHT:
- return ctx->DrawBuffer->BackRightAlpha;
+ return (GLchan *) ctx->DrawBuffer->BackRightAlpha;
break;
default:
_mesa_problem(ctx, "Bad DriverDrawBuffer in _mesa_write_alpha_span()");
- return ctx->DrawBuffer->FrontLeftAlpha; /* aribitrary */
+ return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha; /* aribitrary */
}
}
-/* $Id: s_buffers.c,v 1.12 2002/07/09 01:22:52 brianp Exp $ */
+/* $Id: s_buffers.c,v 1.13 2002/10/04 19:10:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
+#include "colormac.h"
#include "macros.h"
#include "mem.h"
if (ctx->Visual.rgbMode) {
/* RGBA mode */
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
- const GLchan a = ctx->Color.ClearColor[3];
+ GLchan clearColor[4];
GLint i;
+ CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]);
for (i = 0; i < height; i++) {
GLchan rgba[MAX_WIDTH][4];
GLint j;
for (j = 0; j < width; j++) {
- rgba[j][RCOMP] = r;
- rgba[j][GCOMP] = g;
- rgba[j][BCOMP] = b;
- rgba[j][ACOMP] = a;
+ COPY_CHAN4(rgba[j], clearColor);
}
_mesa_mask_rgba_array( ctx, width, x, y + i, rgba );
(*swrast->Driver.WriteRGBASpan)( ctx, width, x, y + i,
if (ctx->Visual.rgbMode) {
/* RGBA mode */
- const GLchan r = ctx->Color.ClearColor[0];
- const GLchan g = ctx->Color.ClearColor[1];
- const GLchan b = ctx->Color.ClearColor[2];
- const GLchan a = ctx->Color.ClearColor[3];
+ GLchan clearColor[4];
GLchan span[MAX_WIDTH][4];
GLint i;
+ CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]);
+
ASSERT(*((GLuint *) &ctx->Color.ColorMask) == 0xffffffff);
for (i = 0; i < width; i++) {
- span[i][RCOMP] = r;
- span[i][GCOMP] = g;
- span[i][BCOMP] = b;
- span[i][ACOMP] = a;
+ COPY_CHAN4(span[i], clearColor);
}
for (i = 0; i < height; i++) {
(*swrast->Driver.WriteRGBASpan)( ctx, width, x, y + i,
-/* $Id: s_texture.c,v 1.67 2002/09/23 16:37:15 brianp Exp $ */
+/* $Id: s_texture.c,v 1.68 2002/10/04 19:10:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (i < 0 || i >= (GLint) img->Width) {
/* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, 0, 0, (GLvoid *) rgba);
GLchan t0[4], t1[4]; /* texels */
if (useBorderColor & I0BIT) {
- COPY_CHAN4(t0, tObj->BorderColor);
+ COPY_CHAN4(t0, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, 0, 0, (GLvoid *) t0);
}
}
if (useBorderColor & I1BIT) {
- COPY_CHAN4(t1, tObj->BorderColor);
+ COPY_CHAN4(t1, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, 0, 0, (GLvoid *) t1);
if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) {
/* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, j, 0, (GLvoid *) rgba);
GLchan t11[4];
if (useBorderColor & (I0BIT | J0BIT)) {
- COPY_CHAN4(t00, tObj->BorderColor);
+ COPY_CHAN4(t00, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, 0, (GLvoid *) t00);
}
}
if (useBorderColor & (I1BIT | J0BIT)) {
- COPY_CHAN4(t10, tObj->BorderColor);
+ COPY_CHAN4(t10, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, 0, (GLvoid *) t10);
}
}
if (useBorderColor & (I0BIT | J1BIT)) {
- COPY_CHAN4(t01, tObj->BorderColor);
+ COPY_CHAN4(t01, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, 0, (GLvoid *) t01);
}
}
if (useBorderColor & (I1BIT | J1BIT)) {
- COPY_CHAN4(t11, tObj->BorderColor);
+ COPY_CHAN4(t11, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, 0, (GLvoid *) t11);
j < 0 || j >= (GLint) img->Height ||
k < 0 || k >= (GLint) img->Depth) {
/* Need this test for GL_CLAMP_TO_BORDER_ARB mode */
- COPY_CHAN4(rgba, tObj->BorderColor);
+ COPY_CHAN4(rgba, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i, j, k, (GLvoid *) rgba);
GLchan t100[4], t110[4], t101[4], t111[4];
if (useBorderColor & (I0BIT | J0BIT | K0BIT)) {
- COPY_CHAN4(t000, tObj->BorderColor);
+ COPY_CHAN4(t000, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, k0, (GLvoid *) t000);
}
}
if (useBorderColor & (I1BIT | J0BIT | K0BIT)) {
- COPY_CHAN4(t100, tObj->BorderColor);
+ COPY_CHAN4(t100, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, k0, (GLvoid *) t100);
}
}
if (useBorderColor & (I0BIT | J1BIT | K0BIT)) {
- COPY_CHAN4(t010, tObj->BorderColor);
+ COPY_CHAN4(t010, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, k0, (GLvoid *) t010);
}
}
if (useBorderColor & (I1BIT | J1BIT | K0BIT)) {
- COPY_CHAN4(t110, tObj->BorderColor);
+ COPY_CHAN4(t110, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, k0, (GLvoid *) t110);
}
if (useBorderColor & (I0BIT | J0BIT | K1BIT)) {
- COPY_CHAN4(t001, tObj->BorderColor);
+ COPY_CHAN4(t001, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j0, k1, (GLvoid *) t001);
}
}
if (useBorderColor & (I1BIT | J0BIT | K1BIT)) {
- COPY_CHAN4(t101, tObj->BorderColor);
+ COPY_CHAN4(t101, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j0, k1, (GLvoid *) t101);
}
}
if (useBorderColor & (I0BIT | J1BIT | K1BIT)) {
- COPY_CHAN4(t011, tObj->BorderColor);
+ COPY_CHAN4(t011, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i0, j1, k1, (GLvoid *) t011);
}
}
if (useBorderColor & (I1BIT | J1BIT | K1BIT)) {
- COPY_CHAN4(t111, tObj->BorderColor);
+ COPY_CHAN4(t111, tObj->_BorderChan);
}
else {
(*img->FetchTexel)(img, i1, j1, k1, (GLvoid *) t111);
const struct gl_texture_image *texImage = tObj->Image[baseLevel];
const GLuint width = texImage->Width;
const GLuint height = texImage->Height;
- const GLchan ambient = tObj->ShadowAmbient;
+ const GLchan ambient;
GLenum function;
GLchan result;
tObj->Target == GL_TEXTURE_2D ||
tObj->Target == GL_TEXTURE_RECTANGLE_NV);
+ UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient);
+
/* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */
/* XXX this could be precomputed and saved in the texture object */
const struct gl_texture_image *texImage = texObj->Image[baseLevel];
const GLuint width = texImage->Width;
const GLuint height = texImage->Height;
- const GLchan ambient = texObj->ShadowAmbient;
+ GLchan ambient;
GLboolean lequal, gequal;
if (texObj->Target != GL_TEXTURE_2D) {
return;
}
+ UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->ShadowAmbient);
+
if (texObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) {
lequal = GL_TRUE;
gequal = GL_FALSE;