-/* $Id: colortab.c,v 1.35 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: colortab.c,v 1.36 2001/03/07 05:06:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
return;
}
- if (width > ctx->Const.MaxColorTableSize) {
+ if (width > (GLsizei) ctx->Const.MaxColorTableSize) {
if (proxy) {
table->Size = 0;
table->IntFormat = (GLenum) 0;
if (floatTable) {
GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
GLfloat *tableF;
- GLuint i;
+ GLint i;
_mesa_unpack_float_color_span(ctx, width, table->Format,
tempTab, /* dest */
return;
}
_mesa_unpack_chan_color_span(ctx, width, table->Format,
- table->Table, /* dest */
+ (GLchan *) table->Table, /* dest */
format, type, data,
&ctx->Unpack, 0);
} /* floatTable */
comps = _mesa_components_in_format(table->Format);
assert(comps > 0); /* error should have been caught sooner */
- if (start + count > table->Size) {
+ if (start + count > (GLint) table->Size) {
_mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
return;
}
else {
GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4];
GLfloat *tableF;
- GLuint i;
+ GLint i;
ASSERT(table->FloatTable);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
struct gl_color_table *table = NULL;
GLchan rgba[MAX_COLOR_TABLE_SIZE][4];
- GLint i;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState) {
case GL_ALPHA:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = 0;
rgba[i][GCOMP] = 0;
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = 0;
rgba[i][GCOMP] = 0;
case GL_LUMINANCE:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
rgba[i][GCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = tableUB[i];
rgba[i][GCOMP] = tableUB[i];
case GL_LUMINANCE_ALPHA:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = (GLint) (tableF[i*2+0] * CHAN_MAXF);
rgba[i][GCOMP] = (GLint) (tableF[i*2+0] * CHAN_MAXF);
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = tableUB[i*2+0];
rgba[i][GCOMP] = tableUB[i*2+0];
case GL_INTENSITY:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
rgba[i][GCOMP] = (GLint) (tableF[i] * CHAN_MAXF);
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = tableUB[i];
rgba[i][GCOMP] = tableUB[i];
case GL_RGB:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = (GLint) (tableF[i*3+0] * CHAN_MAXF);
rgba[i][GCOMP] = (GLint) (tableF[i*3+1] * CHAN_MAXF);
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = tableUB[i*3+0];
rgba[i][GCOMP] = tableUB[i*3+1];
case GL_RGBA:
if (table->FloatTable) {
const GLfloat *tableF = (const GLfloat *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = (GLint) (tableF[i*4+0] * CHAN_MAXF + 0.5F);
rgba[i][GCOMP] = (GLint) (tableF[i*4+1] * CHAN_MAXF + 0.5F);
}
else {
const GLchan *tableUB = (const GLchan *) table->Table;
+ GLuint i;
for (i = 0; i < table->Size; i++) {
rgba[i][RCOMP] = tableUB[i*4+0];
rgba[i][GCOMP] = tableUB[i*4+1];