drivers: don't include texformat.h
[mesa.git] / src / mesa / drivers / dri / r200 / r200_tex.c
index 19a6cad80bd4f239344c1a1a0365281069d22ca9..5a21a8b9c5a8213423e9b58b985c924f17186cd3 100644 (file)
@@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/enums.h"
 #include "main/image.h"
 #include "main/simple_list.h"
-#include "main/texformat.h"
 #include "main/texstore.h"
 #include "main/teximage.h"
 #include "main/texobj.h"
@@ -270,15 +269,16 @@ static void r200SetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf )
    }
 }
 
-static void r200SetTexBorderColor( radeonTexObjPtr t, GLubyte c[4] )
+static void r200SetTexBorderColor( radeonTexObjPtr t, const GLfloat color[4] )
 {
+   GLubyte c[4];
+   CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+   CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+   CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+   CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]);
    t->pp_border_color = radeonPackColor( 4, c[0], c[1], c[2], c[3] );
 }
 
-
-
-
-
 static void r200TexEnv( GLcontext *ctx, GLenum target,
                          GLenum pname, const GLfloat *param )
 {
@@ -286,7 +286,7 @@ static void r200TexEnv( GLcontext *ctx, GLenum target,
    GLuint unit = ctx->Texture.CurrentUnit;
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
 
-   if ( R200_DEBUG & DEBUG_STATE ) {
+   if ( R200_DEBUG & RADEON_STATE ) {
       fprintf( stderr, "%s( %s )\n",
               __FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
    }
@@ -358,7 +358,7 @@ static void r200TexParameter( GLcontext *ctx, GLenum target,
 {
    radeonTexObj* t = radeon_tex_obj(texObj);
 
-   if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
+   if ( R200_DEBUG & (RADEON_STATE|RADEON_TEXTURE) ) {
       fprintf( stderr, "%s( %s )\n", __FUNCTION__,
               _mesa_lookup_enum_by_nr( pname ) );
    }
@@ -378,7 +378,7 @@ static void r200TexParameter( GLcontext *ctx, GLenum target,
       break;
 
    case GL_TEXTURE_BORDER_COLOR:
-      r200SetTexBorderColor( t, texObj->_BorderChan );
+      r200SetTexBorderColor( t, texObj->BorderColor );
       break;
 
    case GL_TEXTURE_BASE_LEVEL:
@@ -408,7 +408,7 @@ static void r200DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj)
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
    radeonTexObj* t = radeon_tex_obj(texObj);
 
-   if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_TEXTURE)) {
+   if (RADEON_DEBUG & (RADEON_STATE | RADEON_TEXTURE)) {
       fprintf(stderr, "%s( %p (target = %s) )\n", __FUNCTION__,
              (void *)texObj,
              _mesa_lookup_enum_by_nr(texObj->Target));
@@ -469,7 +469,7 @@ static struct gl_texture_object *r200NewTextureObject(GLcontext * ctx,
    radeonTexObj* t = CALLOC_STRUCT(radeon_tex_obj);
 
 
-   if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_TEXTURE)) {
+   if (RADEON_DEBUG & (RADEON_STATE | RADEON_TEXTURE)) {
      fprintf(stderr, "%s( %p (target = %s) )\n", __FUNCTION__,
             t, _mesa_lookup_enum_by_nr(target));
    }
@@ -481,7 +481,7 @@ static struct gl_texture_object *r200NewTextureObject(GLcontext * ctx,
    r200SetTexWrap( t, t->base.WrapS, t->base.WrapT, t->base.WrapR );
    r200SetTexMaxAnisotropy( t, t->base.MaxAnisotropy );
    r200SetTexFilter(t, t->base.MinFilter, t->base.MagFilter);
-   r200SetTexBorderColor(t, t->base._BorderChan);
+   r200SetTexBorderColor(t, t->base.BorderColor);
 
    return &t->base;
 }
@@ -493,7 +493,7 @@ void r200InitTextureFuncs( struct dd_function_table *functions )
    /* Note: we only plug in the functions we implement in the driver
     * since _mesa_init_driver_functions() was already called.
     */
-   functions->ChooseTextureFormat      = radeonChooseTextureFormat;
+   functions->ChooseTextureFormat      = radeonChooseTextureFormat_mesa;
    functions->TexImage1D               = radeonTexImage1D;
    functions->TexImage2D               = radeonTexImage2D;
 #if ENABLE_HW_3D_TEXTURE