From 37290c844cbe14f7af15ff9b54d67258fc0e5406 Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Tue, 5 Oct 1999 19:49:41 +0000 Subject: [PATCH] Added packed ARGB support. --- src/mesa/drivers/glide/fxsetup.c | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 9996499316e..ce70b472d5c 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -167,6 +167,9 @@ GLuint fxGetTexSetConfiguration(GLcontext *ctx, case GL_BLEND: envmode|=FX_UM_E0_BLEND; break; + case GL_ADD: + envmode|=FX_UM_E0_ADD; + break; default: /* do nothing */ break; @@ -213,6 +216,9 @@ GLuint fxGetTexSetConfiguration(GLcontext *ctx, case GL_BLEND: envmode|=FX_UM_E1_BLEND; break; + case GL_ADD: + envmode|=FX_UM_E1_ADD; + break; default: /* do nothing */ break; @@ -786,6 +792,57 @@ static void fxSetupTextureDoubleTMU(GLcontext *ctx) GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; + + + case (FX_UM_E0_MODULATE | FX_UM_E1_ADD): /* Quake 3 Sky */ + { + GLboolean isalpha[FX_NUM_TMU]; + + if(ti0->baseLevelInternalFormat==GL_ALPHA) + isalpha[ti0->tmi.whichTMU]=GL_TRUE; + else + isalpha[ti0->tmi.whichTMU]=GL_FALSE; + + if(ti1->baseLevelInternalFormat==GL_ALPHA) + isalpha[ti1->tmi.whichTMU]=GL_TRUE; + else + isalpha[ti1->tmi.whichTMU]=GL_FALSE; + + if(isalpha[FX_TMU1]) + grTexCombine(GR_TMU1, + GR_COMBINE_FUNCTION_ZERO,GR_COMBINE_FACTOR_NONE, + GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE, + FXTRUE,FXFALSE); + else + grTexCombine(GR_TMU1, + GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE, + GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE, + FXFALSE,FXFALSE); + + if(isalpha[FX_TMU0]) + grTexCombine(GR_TMU0, + GR_COMBINE_FUNCTION_SCALE_OTHER,GR_COMBINE_FACTOR_ONE, + GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,GR_COMBINE_FACTOR_ONE, + FXFALSE,FXFALSE); + else + grTexCombine(GR_TMU0, + GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,GR_COMBINE_FACTOR_ONE, + GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,GR_COMBINE_FACTOR_ONE, + FXFALSE,FXFALSE); + + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + GR_COMBINE_FACTOR_LOCAL, + localc, + GR_COMBINE_OTHER_TEXTURE, + FXFALSE); + + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + GR_COMBINE_FACTOR_LOCAL, + locala, GR_COMBINE_OTHER_TEXTURE, + FXFALSE); + break; + } + } if (MESA_VERBOSE&VERBOSE_DRIVER) { -- 2.30.2