diff options
author | Daniel Borca <[email protected]> | 2003-12-23 14:11:22 +0000 |
---|---|---|
committer | Daniel Borca <[email protected]> | 2003-12-23 14:11:22 +0000 |
commit | 0ee5f6203c125898fdffbec8d5eea9269aa1559e (patch) | |
tree | 7120d157cec96a80d4515a79f3c2c83675a23806 /src/mesa/drivers/glide/fxsetup.c | |
parent | fabb9734ddd1a9b43e7835190f2f4828add2db3c (diff) |
reverted TMUs for proper multitexturing
Diffstat (limited to 'src/mesa/drivers/glide/fxsetup.c')
-rw-r--r-- | src/mesa/drivers/glide/fxsetup.c | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 9738d6ea606..c00bd83f786 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -868,8 +868,8 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) struct tdfx_texcombine tex0, tex1; GrCombineLocal_t localc, locala; tfxTexInfo *ti0, *ti1; - struct gl_texture_object *tObj0 = ctx->Texture.Unit[0].Current2D; - struct gl_texture_object *tObj1 = ctx->Texture.Unit[1].Current2D; + struct gl_texture_object *tObj0 = ctx->Texture.Unit[1].Current2D; + struct gl_texture_object *tObj1 = ctx->Texture.Unit[0].Current2D; GLuint envmode, ifmt, unitsmode; int tmu0 = 0, tmu1 = 1; @@ -973,7 +973,7 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) break; } case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */ - if (tmu1 == FX_TMU1) { + if (tmu0 == FX_TMU1) { tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; @@ -1087,6 +1087,48 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; break; } + + case (FX_UM_E0_REPLACE | FX_UM_E1_ADD): /* Vulpine Sky */ + { + GLboolean isalpha[FX_NUM_TMU]; + + isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); + isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); + + if (isalpha[FX_TMU1]) { + tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; + tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; + tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; + tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; + tex1.InvertRGB = FXTRUE; + } else { + tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; + tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; + tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; + tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; + } + + if (isalpha[FX_TMU0]) { + tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER; + tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; + tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; + tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; + } else { + tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; + tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; + tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; + tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; + } + + colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; + colorComb.Factor = GR_COMBINE_FACTOR_ONE; + colorComb.Other = GR_COMBINE_OTHER_TEXTURE; + + alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; + alphaComb.Factor = GR_COMBINE_FACTOR_ONE; + alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; + break; + } default: fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock: Unexpected dual texture mode encountered\n"); return; |