summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-03-04 19:16:47 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-03-04 19:16:47 +0000
commitcc9464e082b82179e3c4b51ea460212c10b2bf0c (patch)
treef9adc3eeac73b2c4d7fb2a2e04654dfbefd55c5a /src/mesa/swrast/s_texture.c
parent612cf792dbcb8b69819751c62f8df5fe47aae9b4 (diff)
fix GLchan=GLfloat problems
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index e63f49c742..e497f9bba7 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -1,4 +1,4 @@
-/* $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
@@ -321,7 +321,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -331,7 +332,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;
@@ -357,7 +360,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -366,7 +370,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;
@@ -391,7 +397,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -399,7 +406,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;
@@ -427,7 +436,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -438,7 +448,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;
@@ -469,7 +481,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -479,7 +492,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;
@@ -512,7 +527,8 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
}
}
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;
@@ -523,7 +539,9 @@ _swrast_texture_table_lookup(const struct gl_color_table *table,
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;