summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-08-28 17:12:07 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-08-28 17:12:07 +0000
commit49fd874f24b983f7730513545fb0d6c24058e10b (patch)
tree92fd2194479e375720cdee3c68ead45a656258bb /src
parent082501a74c16d7b16ea4fb17b3d47aa24d05f4e3 (diff)
fix a few proxy color table bugs (bug 4270)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/colortab.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index 600ebd2fb9..2cd1094fb3 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -102,13 +102,13 @@ set_component_sizes( struct gl_color_table *table )
switch (table->Type) {
case GL_UNSIGNED_BYTE:
- sz = sizeof(GLubyte);
+ sz = 8 * sizeof(GLubyte);
break;
case GL_UNSIGNED_SHORT:
- sz = sizeof(GLushort);
+ sz = 8 * sizeof(GLushort);
break;
case GL_FLOAT:
- sz = sizeof(GLfloat);
+ sz = 8 * sizeof(GLfloat);
break;
default:
_mesa_problem(NULL, "bad color table type in set_component_sizes 0x%x", table->Type);
@@ -363,6 +363,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
+ tableType = GL_FLOAT;
break;
case GL_COLOR_TABLE:
table = &ctx->ColorTable;
@@ -402,6 +403,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
return;
}
table = &(texUnit->ProxyColorTable);
+ tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE:
@@ -418,6 +420,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE:
table = &ctx->ProxyPostConvolutionColorTable;
+ tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE:
@@ -434,6 +437,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
break;
case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE:
table = &ctx->ProxyPostColorMatrixColorTable;
+ tableType = GL_FLOAT;
proxy = GL_TRUE;
break;
default:
@@ -483,6 +487,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
table->Size = width;
table->IntFormat = internalFormat;
table->Format = (GLenum) baseFormat;
+ table->Type = (tableType == GL_FLOAT) ? GL_FLOAT : CHAN_TYPE;
comps = _mesa_components_in_format(table->Format);
assert(comps > 0); /* error should have been caught sooner */
@@ -495,12 +500,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
}
if (width > 0) {
- if (tableType == GL_FLOAT) {
- table->Type = GL_FLOAT;
+ if (table->Type == GL_FLOAT) {
table->Table = MALLOC(comps * width * sizeof(GLfloat));
}
else {
- table->Type = CHAN_TYPE;
table->Table = MALLOC(comps * width * sizeof(GLchan));
}