Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

101 lines
3.3 KiB

//-----------------------------------------------------------------------------
//
// 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 "rgb_pch.h"
#pragma hdrstop
#include "ctstf_mh.h"
#include "cspnutil.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)
{dnl
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)), `1', `
pS->iLOD += pS->iDLOD;
pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
pCtx->SI.TexUV[0].iU = pS->UVoW[0].iUoW>>TEX_TO_FINAL_SHIFT;
pCtx->SI.TexUV[0].iV = pS->UVoW[0].iVoW>>TEX_TO_FINAL_SHIFT;')
ifelse(`$2', `Tex2', `
pS->iLOD += pS->iDLOD;
for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
{
pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
pCtx->SI.TexUV[i].iU = pS->UVoW[i].iUoW>>TEX_TO_FINAL_SHIFT;
pCtx->SI.TexUV[i].iV = pS->UVoW[i].iVoW>>TEX_TO_FINAL_SHIFT;
}')
ifelse(eval((d_index(`$2', `PerspTex1') == 0)), `1', `
pS->iLOD += pS->iDLOD;
pS->iOoW += pP->iDOoWDX;
INT32 iOoW = pS->iOoW>>16; // 1.15
d_WDivide()
pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
pCtx->SI.TexUV[0].iU = d_WTimesUVoW(pS->iW,pS->UVoW[0].iUoW);
pCtx->SI.TexUV[0].iV = d_WTimesUVoW(pS->iW,pS->UVoW[0].iVoW);')
ifelse(`$2', `PerspTex2', `
pS->iLOD += pS->iDLOD;
pS->iOoW += pP->iDOoWDX;
INT32 iOoW = pS->iOoW>>16; // 1.15
d_WDivide()
for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
{
pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
pCtx->SI.TexUV[i].iU = d_WTimesUVoW(pS->iW,pS->UVoW[i].iUoW);
pCtx->SI.TexUV[i].iV = d_WTimesUVoW(pS->iW,pS->UVoW[i].iVoW);
}')
ifelse(`$3', `SpecularFog', `
if (pCtx->pdwRenderState[D3DRS_SPECULARENABLE])
{
pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
pS->uRS += pP->iDRSDX;
}
if (pCtx->pdwRenderState[D3DRS_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')