summaryrefslogtreecommitdiff
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-04-17 17:57:04 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-04-17 17:57:04 +0000
commit4bdcfe50f8886e43714f9b7edd25cbff19e6a97d (patch)
treea3853f9e9100dd9492db094ab5a8fc59acb98e4f /src/mesa/main/texobj.c
parent0bb0c7cc85f8b41a36d8a7b723ac3d6755954879 (diff)
dynamically allocate color table data, uses less memory
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index bafac922aa..330943b579 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -28,6 +28,7 @@
#include "all.h"
#else
#include "glheader.h"
+#include "colortab.h"
#include "context.h"
#include "enums.h"
#include "hash.h"
@@ -73,13 +74,7 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name,
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
obj->MinMagThresh = 0.0F;
- obj->Palette.Table[0] = 255;
- obj->Palette.Table[1] = 255;
- obj->Palette.Table[2] = 255;
- obj->Palette.Table[3] = 255;
- obj->Palette.Size = 1;
- obj->Palette.IntFormat = GL_RGBA;
- obj->Palette.Format = GL_RGBA;
+ _mesa_init_colortable(&obj->Palette);
/* insert into linked list */
if (shared) {
@@ -143,7 +138,9 @@ void gl_free_texture_object( struct gl_shared_state *shared,
_mesa_HashRemove(shared->TexObjects, t->Name);
}
- /* free texture image */
+ _mesa_free_colortable_data(&t->Palette);
+
+ /* free texture images */
{
GLuint i;
for (i=0;i<MAX_TEXTURE_LEVELS;i++) {