diff options
author | Brian Paul <[email protected]> | 2000-04-17 17:57:04 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-04-17 17:57:04 +0000 |
commit | 4bdcfe50f8886e43714f9b7edd25cbff19e6a97d (patch) | |
tree | a3853f9e9100dd9492db094ab5a8fc59acb98e4f /src/mesa/main/texobj.c | |
parent | 0bb0c7cc85f8b41a36d8a7b723ac3d6755954879 (diff) |
dynamically allocate color table data, uses less memory
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index bafac922aae..330943b5794 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++) { |