rearranged order of some functions
[mesa.git] / src / mesa / main / colortab.c
index 798eda44c8cc266de1bf77fe5a831c041b3627d2..713e7c66202df62646a4792923eff5b9146998b8 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: colortab.c,v 1.4 1999/11/11 01:22:25 brianp Exp $ */
+/* $Id: colortab.c,v 1.9 2000/02/28 20:38:37 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.1
+ * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  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"),
@@ -119,7 +119,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
    struct gl_texture_object *texObj;
-   struct gl_palette *palette;
+   struct gl_color_table *palette;
    GLboolean proxy = GL_FALSE;
 
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable");
@@ -216,7 +216,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
    struct gl_texture_object *texObj;
-   struct gl_palette *palette;
+   struct gl_color_table *palette;
    GLint comps;
    GLubyte *dest;
 
@@ -290,11 +290,11 @@ _mesa_GetColorTable( GLenum target, GLenum format,
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
-   struct gl_palette *palette;
+   struct gl_color_table *palette;
    GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4];
    GLint i;
 
-   ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv");
+   ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTable");
 
    switch (target) {
       case GL_TEXTURE_1D:
@@ -373,7 +373,6 @@ _mesa_GetColorTable( GLenum target, GLenum format,
    gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
                      format, type, table, &ctx->Pack, GL_FALSE);
 
-   gl_problem(ctx, "glGetColorTable not implemented!");
    (void) format;
    (void) type;
    (void) table;
@@ -396,7 +395,7 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
-   struct gl_palette *palette;
+   struct gl_color_table *palette;
 
    ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter");
 
@@ -410,6 +409,15 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
       case GL_TEXTURE_3D:
          palette = &texUnit->CurrentD[3]->Palette;
          break;
+      case GL_PROXY_TEXTURE_1D:
+         palette = &ctx->Texture.Proxy1D->Palette;
+         break;
+      case GL_PROXY_TEXTURE_2D:
+         palette = &ctx->Texture.Proxy2D->Palette;
+         break;
+      case GL_PROXY_TEXTURE_3D:
+         palette = &ctx->Texture.Proxy3D->Palette;
+         break;
       case GL_SHARED_TEXTURE_PALETTE_EXT:
          palette = &ctx->Texture.Palette;
          break;