#include "glheader.h"
#include "imports.h"
+#include "colormac.h"
#include "context.h"
#include "macros.h"
#include "texformat.h"
int unit )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
-
+ GLubyte c[4];
+
__GLSiSHardware *prev = &smesa->prev;
__GLSiSHardware *current = &smesa->current;
switch (texture_unit->EnvMode)
{
case GL_REPLACE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
switch (t->format)
{
case GL_ALPHA:
break;
case GL_MODULATE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
switch (t->format)
{
case GL_ALPHA:
break;
case GL_DECAL:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
switch (t->format)
{
case GL_RGB:
break;
case GL_BLEND:
-#if 1 /* XXX Blending broken */
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 1);
-#else
- FALLBACK(smesa, SIS_FALLBACK_TEXENV0, 0);
- current->hwTexEnvColor =
- ((GLint) (texture_unit->EnvColor[3])) << 24 |
- ((GLint) (texture_unit->EnvColor[0])) << 16 |
- ((GLint) (texture_unit->EnvColor[1])) << 8 |
- ((GLint) (texture_unit->EnvColor[2]));
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c, texture_unit->EnvColor);
+ current->hwTexEnvColor = ((GLint) (c[3])) << 24 |
+ ((GLint) (c[0])) << 16 |
+ ((GLint) (c[1])) << 8 |
+ ((GLint) (c[2]));
switch (t->format)
{
case GL_ALPHA:
break;
}
break;
-#endif
}
if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) ||
int unit)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
+ GLubyte c[4];
__GLSiSHardware *prev = &smesa->prev;
__GLSiSHardware *current = &smesa->current;
switch (texture_unit->EnvMode)
{
case GL_REPLACE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
switch (t->format)
{
case GL_ALPHA:
break;
case GL_MODULATE:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
switch (t->format)
{
case GL_ALPHA:
break;
case GL_DECAL:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 0);
switch (t->format)
{
case GL_RGB:
break;
case GL_BLEND:
- FALLBACK(smesa, SIS_FALLBACK_TEXENV1, 1);
-#if 0 /* XXX Blending broken */
- current->hwTexEnvColor =
- ((GLint) (texture_unit->EnvColor[3])) << 24 |
- ((GLint) (texture_unit->EnvColor[0])) << 16 |
- ((GLint) (texture_unit->EnvColor[1])) << 8 |
- ((GLint) (texture_unit->EnvColor[2]));
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN(c, texture_unit->EnvColor);
+ current->hwTexEnvColor = ((GLint) (c[3])) << 24 |
+ ((GLint) (c[0])) << 16 |
+ ((GLint) (c[1])) << 8 |
+ ((GLint) (c[2]));
switch (t->format)
{
case GL_ALPHA:
break;
}
break;
-#endif
}
if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) ||