#include "main/colormac.h"
#include "main/context.h"
#include "main/macros.h"
-#include "main/texformat.h"
#include "sis_context.h"
-#include "sis_state.h"
#include "sis_tex.h"
#include "sis_tris.h"
#include "sis_alloc.h"
/* Handle texenv stuff, called from validate_texture (renderstart) */
static void
-sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj,
+sis_set_texture_env0( struct gl_context *ctx, struct gl_texture_object *texObj,
int unit )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
/* Handle texenv stuff, called from validate_texture (renderstart) */
static void
-sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj,
+sis_set_texture_env1( struct gl_context *ctx, struct gl_texture_object *texObj,
int unit)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
/* Returns 0 if a software fallback is necessary */
static GLboolean
-sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj,
+sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj,
int hw_unit )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
break;
}
- current->texture[hw_unit].hwTextureBorderColor =
- ((GLuint) texObj->_BorderChan[3] << 24) +
- ((GLuint) texObj->_BorderChan[0] << 16) +
- ((GLuint) texObj->_BorderChan[1] << 8) +
- ((GLuint) texObj->_BorderChan[2]);
+ {
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor.f[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor.f[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]);
+
+ current->texture[hw_unit].hwTextureBorderColor =
+ PACK_COLOR_8888(c[3], c[0], c[1], c[2]);
+ }
if (current->texture[hw_unit].hwTextureBorderColor !=
prev->texture[hw_unit].hwTextureBorderColor)
/* Disable a texture unit, called from validate_texture */
static void
-sis_reset_texture_env (GLcontext *ctx, int hw_unit)
+sis_reset_texture_env (struct gl_context *ctx, int hw_unit)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
}
}
-static void updateTextureUnit( GLcontext *ctx, int unit )
+static void updateTextureUnit( struct gl_context *ctx, int unit )
{
sisContextPtr smesa = SIS_CONTEXT( ctx );
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
}
-void sisUpdateTextureState( GLcontext *ctx )
+void sisUpdateTextureState( struct gl_context *ctx )
{
sisContextPtr smesa = SIS_CONTEXT( ctx );
int i;