-/* $Id: osmesa.c,v 1.100 2003/03/01 01:50:23 brianp Exp $ */
+/* $Id: osmesa.c,v 1.101 2003/03/04 19:16:47 brianp Exp $ */
/*
* Mesa 3-D graphics library
#define INC_PIXEL_PTR(P) P += 4
#if CHAN_TYPE == GL_FLOAT
#define STORE_RGB_PIXEL(P, R, G, B) \
- P[0] = MAX2((R), 0.0F);
- P[1] = MAX2((G), 0.0F);
- P[2] = MAX2((B), 0.0F);
+ P[0] = MAX2((R), 0.0F); \
+ P[1] = MAX2((G), 0.0F); \
+ P[2] = MAX2((B), 0.0F); \
P[3] = CHAN_MAXF
#define STORE_RGBA_PIXEL(P, R, G, B, A) \
- P[0] = MAX2((R), 0.0F);
- P[1] = MAX2((G), 0.0F);
- P[2] = MAX2((B), 0.0F);
+ P[0] = MAX2((R), 0.0F); \
+ P[1] = MAX2((G), 0.0F); \
+ P[2] = MAX2((B), 0.0F); \
P[3] = CLAMP((A), 0.0F, CHAN_MAXF)
#else
#define STORE_RGB_PIXEL(P, R, G, B) \
#include "swrast/s_spantemp.h"
/* 16-bit BGR */
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
#define NAME(PREFIX) PREFIX##_RGB_565
#define SPAN_VARS \
const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \
A = CHAN_MAX
#include "swrast/s_spantemp.h"
+#endif
/* color index */
#define NAME(PREFIX) PREFIX##_CI
swdd->ReadRGBASpan = read_rgba_span_BGR;
swdd->ReadRGBAPixels = read_rgba_pixels_BGR;
}
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
else if (osmesa->format == OSMESA_RGB_565) {
swdd->WriteRGBASpan = write_rgba_span_RGB_565;
swdd->WriteRGBSpan = write_rgb_span_RGB_565;
swdd->ReadRGBASpan = read_rgba_span_RGB_565;
swdd->ReadRGBAPixels = read_rgba_pixels_RGB_565;
}
+#endif
else if (osmesa->format == OSMESA_RGBA) {
swdd->WriteRGBASpan = write_rgba_span_RGBA;
swdd->WriteRGBSpan = write_rgb_span_RGBA;
bind = 0;
rgbmode = GL_TRUE;
}
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
else if (format==OSMESA_RGB_565) {
indexBits = 0;
redBits = 5;
bind = 0;
rgbmode = GL_TRUE;
}
+#endif
else {
return NULL;
}
-/* $Id: s_texture.c,v 1.82 2003/03/01 01:50:26 brianp Exp $ */
+/* $Id: s_texture.c,v 1.83 2003/03/04 19:17:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][BCOMP] = rgba[i][ACOMP] = c;
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = c;
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][ACOMP] = lut[rgba[i][ACOMP]];
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][ACOMP] = a;
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][BCOMP] = lut[rgba[i][BCOMP] * 3 + 2];
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
}
}
else {
- if (CHAN_TYPE == GL_UNSIGNED_BYTE && table->Size == 256) {
+#if CHAN_TYPE == GL_UNSIGNED_BYTE
+ if (table->Size == 256) {
/* common case */
const GLchan *lut = (const GLchan *) table->Table;
GLuint i;
rgba[i][ACOMP] = lut[rgba[i][ACOMP] * 4 + 3];
}
}
- else {
+ else
+#endif
+ {
const GLfloat scale = (GLfloat) (table->Size - 1) / CHAN_MAXF;
const GLfloat *lut = (const GLfloat *) table->Table;
GLuint i;
-/* $Id: s_tritemp.h,v 1.43 2003/01/20 00:24:22 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.44 2003/03/04 19:17:34 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLfixed fa = 0, fdaOuter = 0, fdaInner;
#endif
#ifdef INTERP_FLOAT_RGBA
- GLfloat fr, fdrOuter, fdrInner;
- GLfloat fg, fdgOuter, fdgInner;
- GLfloat fb, fdbOuter, fdbInner;
- GLfloat fa, fdaOuter, fdaInner;
+ GLfloat fr = 0.0F, fdrOuter = 0.0F, fdrInner;
+ GLfloat fg = 0.0F, fdgOuter = 0.0F, fdgInner;
+ GLfloat fb = 0.0F, fdbOuter = 0.0F, fdbInner;
+ GLfloat fa = 0.0F, fdaOuter = 0.0F, fdaInner;
#endif
#ifdef INTERP_SPEC
GLfixed fsr=0, fdsrOuter=0, fdsrInner;