|
|
//----------------------------------------------------------------------------- // // This file contains color blend functions. // // Copyright (C) Microsoft Corporation, 1997. // // WARNING WARNING WARNING // This cpp file generated from mcp file. // EDIT THE MCP FILE. // I warned you. // WARNING WARNING WARNING // //-----------------------------------------------------------------------------
include(`m4hdr.mh')dnl #include "pch.cpp" #pragma hdrstop #include "matest_mh.h"
extern UINT16 g_uDitherTable[16]; dnl dnl d_DoZWrite dnl dnl Inserts conditional Z Defered write code dnl $1 the function type, $2 is the format of the Z buffer. dnl define(`d_DoZWrite', `ifelse(`$1', `NoZWrite', `', `*((UINT$2*)pS->pZ) = (UINT$2)pCtx->SI.uZDeferred;')')dnl dnl d_DoAlphaDitherTest dnl dnl Inserts conditional AlphaDither Test code dnl $1 the function type, $2 is the ZWrite type, dnl and $3 is the format of the Z buffer. dnl define(`d_DoAlphaDitherTest', `ifelse(`$1', `NoAlphaDither', `', ` INT32 Alpha; UINT16 uDither = g_uDitherTable[pCtx->SI.uDitherOffset]; if (pCtx->cActTex != 0) { Alpha = RGBA_GETALPHA(pCtx->SI.TexCol[0]); } else { Alpha = pS->uA >> COLOR_SHIFT; } if ((Alpha & 0xff) > uDither) { d_DoZWrite($2, $3) pCtx->pfnAlphaTestPassEnd(pCtx, pP, pS); }')')dnl define(`d_AlphaHdr', ` void CMMX_AlphaTest_$1_$2_$3_$4(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS) { ifelse(`$1', `NoAlpha', `d_DoAlphaDitherTest(`$2', `$3', `$4')', ` if (ACMP(pCtx, pCtx->SI.uBA, pCtx->iARef)) { ifelse($2, `NoAlphaDither', ` d_DoZWrite(`$3', `$4') pCtx->pfnAlphaTestPassEnd(pCtx, pP, pS);', `d_DoAlphaDitherTest(`$2', `$3', `$4')') } else { // in the C code this does a return, since this is the // last bead before write // pCtx->pfnAlphaTestFailEnd(pCtx, pP, pS); }') dnl }') dnl d_RepStr(`d_RepStr(`d_RepStr(`d_RepStr(`d_AlphaHdr(AA, BB, CC, DD)', `AA', `NoAlpha', `Alpha')', `BB', `NoAlphaDither', `AlphaDither')', `CC', `NoZWrite', `ZWrite')', `DD', `16', `32')
|