|
|
//----------------------------------------------------------------------------- // // This file contains Z compare fail 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 "ctstf_mh.h" include(`ctexaddr.mh')dnl for W divide
dnl dnl d_TestFail dnl dnl Macro to build test fail term incrementing routines dnl dnl $1 is one of Flat Gouraud dnl $2 is one of NoTex Tex1 PerspTex1 Tex2 PerspTex2 dnl $3 is one of NoSpecularFog SpecularFog dnl define(`d_TestFail', ` void C_TestFail_$1_$2_$3(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP, PD3DI_RASTSPAN pS) { ifelse(`$1', `Gouraud', ` pS->uB += pP->iDBDX; pS->uG += pP->iDGDX; pS->uR += pP->iDRDX; pS->uA += pP->iDADX;')
ifelse(eval((d_index(`$2', `Tex1') == 0) || (d_index(`$2', `Tex2') == 0)), `1', ` pS->iLOD += pS->iDLOD; pS->iUoW1 += pP->iDUoW1DX; pS->iVoW1 += pP->iDVoW1DX; pCtx->SI.iU1 = pS->iUoW1>>TEX_TO_FINAL_SHIFT; pCtx->SI.iV1 = pS->iVoW1>>TEX_TO_FINAL_SHIFT;') ifelse(`$2', `Tex2', ` pS->iUoW2 += pP->iDUoW2DX; pS->iVoW2 += pP->iDVoW2DX; pCtx->SI.iU2 = pS->iUoW2>>TEX_TO_FINAL_SHIFT; pCtx->SI.iV2 = pS->iVoW2>>TEX_TO_FINAL_SHIFT;') ifelse(eval((d_index(`$2', `PerspTex1') == 0) || (d_index(`$2', `PerspTex2') == 0)), `1', ` pS->iLOD += pS->iDLOD; pS->iOoW += pP->iDOoWDX; INT32 iOoW = pS->iOoW>>16; // 1.15 d_WDivide() pS->iUoW1 += pP->iDUoW1DX; pS->iVoW1 += pP->iDVoW1DX; pCtx->SI.iU1 = d_WTimesUVoW(pS->iW,pS->iUoW1); pCtx->SI.iV1 = d_WTimesUVoW(pS->iW,pS->iVoW1);') ifelse(`$2', `PerspTex2', ` pS->iUoW2 += pP->iDUoW2DX; pS->iVoW2 += pP->iDVoW2DX; pCtx->SI.iU2 = d_WTimesUVoW(pS->iW,pS->iUoW2); pCtx->SI.iV2 = d_WTimesUVoW(pS->iW,pS->iVoW2);')
ifelse(`$3', `SpecularFog', ` if (pCtx->pdwRenderState[D3DRENDERSTATE_SPECULARENABLE]) { pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX; pS->uRS += pP->iDRSDX; }
if (pCtx->pdwRenderState[D3DRENDERSTATE_FOGENABLE]) { pS->uFog += (INT16)pS->iDFog;
pCtx->SI.uFogB += pCtx->SI.iFogBDX; pCtx->SI.uFogG += pCtx->SI.iFogGDX; pCtx->SI.uFogR += pCtx->SI.iFogRDX; }')
// just returns for C, since we really can not loop with function calls }')
d_RepStr(`d_RepStr(`d_RepStr(`d_TestFail(AA, BB, CC)', `AA', `Flat', `Gouraud')', `BB', `NoTex', `Tex1', `PerspTex1', `Tex2', `PerspTex2')', `CC', `NoSpecularFog', `SpecularFog')
|