r200: remove unneeded #include "util/simple_list.h"
[mesa.git] / src / mesa / drivers / dri / r200 / r200_tex.c
index 31a65c86748b362273ca204df19068b70efd9f19..0ddb686a43a8e44d8dfdb1caf0bed792f1c2d3ea 100644 (file)
@@ -28,16 +28,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 /*
  * Authors:
- *   Keith Whitwell <keith@tungstengraphics.com>
+ *   Keith Whitwell <keithw@vmware.com>
  */
 
 #include "main/glheader.h"
 #include "main/imports.h"
-#include "main/colormac.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/image.h"
-#include "main/simple_list.h"
 #include "main/teximage.h"
 #include "main/texobj.h"
 #include "main/samplerobj.h"
@@ -68,9 +66,9 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap, GLenu
    radeon_print(RADEON_TEXTURE, RADEON_TRACE,
                "%s(tex %p) sw %s, tw %s, rw %s\n",
                __func__, t,
-               _mesa_lookup_enum_by_nr(swrap),
-               _mesa_lookup_enum_by_nr(twrap),
-               _mesa_lookup_enum_by_nr(rwrap));
+               _mesa_enum_to_string(swrap),
+               _mesa_enum_to_string(twrap),
+               _mesa_enum_to_string(rwrap));
 
    t->pp_txfilter &= ~(R200_CLAMP_S_MASK | R200_CLAMP_T_MASK | R200_BORDER_MODE_D3D);
 
@@ -104,7 +102,7 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap, GLenu
       is_clamp_to_border = GL_TRUE;
       break;
    default:
-      _mesa_problem(NULL, "bad S wrap mode in %s", __FUNCTION__);
+      _mesa_problem(NULL, "bad S wrap mode in %s", __func__);
    }
 
    if (tObj->Target != GL_TEXTURE_1D) {
@@ -138,7 +136,7 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap, GLenu
          is_clamp_to_border = GL_TRUE;
          break;
       default:
-         _mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
+         _mesa_problem(NULL, "bad T wrap mode in %s", __func__);
       }
    }
 
@@ -174,7 +172,7 @@ static void r200SetTexWrap( radeonTexObjPtr t, GLenum swrap, GLenum twrap, GLenu
       is_clamp_to_border = GL_TRUE;
       break;
    default:
-      _mesa_problem(NULL, "bad R wrap mode in %s", __FUNCTION__);
+      _mesa_problem(NULL, "bad R wrap mode in %s", __func__);
    }
 
    if ( is_clamp_to_border ) {
@@ -225,8 +223,8 @@ static void r200SetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf )
    radeon_print(RADEON_TEXTURE, RADEON_TRACE,
        "%s(tex %p) minf %s, maxf %s, anisotropy %d.\n",
        __func__, t,
-       _mesa_lookup_enum_by_nr(minf),
-       _mesa_lookup_enum_by_nr(magf),
+       _mesa_enum_to_string(minf),
+       _mesa_enum_to_string(magf),
        anisotropy);
 
    if ( anisotropy == R200_MAX_ANISO_1_TO_1 ) {
@@ -302,11 +300,11 @@ static void r200TexEnv( struct gl_context *ctx, GLenum target,
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
 
    radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE, "%s( %s )\n",
-              __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
+              __func__, _mesa_enum_to_string( pname ) );
 
    /* This is incorrect: Need to maintain this data for each of
     * GL_TEXTURE_{123}D, GL_TEXTURE_RECTANGLE_NV, etc, and switch
-    * between them according to _ReallyEnabled.
+    * between them according to _Current->Target.
     */
    switch ( pname ) {
    case GL_TEXTURE_ENV_COLOR: {
@@ -375,17 +373,16 @@ void r200TexUpdateParameters(struct gl_context *ctx, GLuint unit)
  * Changes variables and flags for a state update, which will happen at the
  * next UpdateTextureState
  */
-static void r200TexParameter( struct gl_context *ctx, GLenum target,
-                               struct gl_texture_object *texObj,
-                               GLenum pname, const GLfloat *params )
+static void r200TexParameter(struct gl_context *ctx,
+                             struct gl_texture_object *texObj,
+                             GLenum pname)
 {
    radeonTexObj* t = radeon_tex_obj(texObj);
 
    radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_VERBOSE,
-               "%s(%p, tex %p)  target %s, pname %s\n",
-               __FUNCTION__, ctx, texObj,
-               _mesa_lookup_enum_by_nr( target ),
-              _mesa_lookup_enum_by_nr( pname ) );
+               "%s(%p, tex %p)  pname %s\n",
+               __func__, ctx, texObj,
+              _mesa_enum_to_string( pname ) );
 
    switch ( pname ) {
    case GL_TEXTURE_MIN_FILTER:
@@ -414,9 +411,9 @@ static void r200DeleteTexture(struct gl_context * ctx, struct gl_texture_object
    radeonTexObj* t = radeon_tex_obj(texObj);
 
    radeon_print(RADEON_TEXTURE | RADEON_STATE, RADEON_NORMAL,
-           "%s( %p (target = %s) )\n", __FUNCTION__,
+           "%s( %p (target = %s) )\n", __func__,
           (void *)texObj,
-          _mesa_lookup_enum_by_nr(texObj->Target));
+          _mesa_enum_to_string(texObj->Target));
 
    if (rmesa) {
       int i;
@@ -473,10 +470,10 @@ static struct gl_texture_object *r200NewTextureObject(struct gl_context * ctx,
 
    radeon_print(RADEON_STATE | RADEON_TEXTURE, RADEON_NORMAL,
            "%s(%p) target %s, new texture %p.\n",
-          __FUNCTION__, ctx,
-          _mesa_lookup_enum_by_nr(target), t);
+          __func__, ctx,
+          _mesa_enum_to_string(target), t);
 
-   _mesa_initialize_texture_object(&t->base, name, target);
+   _mesa_initialize_texture_object(ctx, &t->base, name, target);
    t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
 
    /* Initialize hardware state */