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.
332 lines
8.5 KiB
332 lines
8.5 KiB
//-----------------------------------------------------------------------------
|
|
//
|
|
// This file contains C++ attribute adders.
|
|
//
|
|
// 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
|
|
|
|
dnl
|
|
dnl d_AddAttrs
|
|
dnl
|
|
dnl Macro to build attribute adder.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex1 and Tex2 in any mix.
|
|
dnl
|
|
define(`d_AddAttrs', `
|
|
void FASTCALL
|
|
AddFloatAttrs_$1(PATTRSET pAttr, PATTRSET pDelta, PSETUPCTX pStpCtx)
|
|
{
|
|
pAttr->pSurface += pDelta->ipSurface;
|
|
pAttr->pZ += pDelta->ipZ;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
pAttr->fZ += pDelta->fZ;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
pAttr->fOoW += pDelta->fOoW;
|
|
|
|
pAttr->fUoW1 += pDelta->fUoW1;
|
|
pAttr->fVoW1 += pDelta->fVoW1;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
pAttr->fUoW2 += pDelta->fUoW2;
|
|
pAttr->fVoW2 += pDelta->fVoW2;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pAttr->fB += pDelta->fB;
|
|
pAttr->fG += pDelta->fG;
|
|
pAttr->fR += pDelta->fR;
|
|
pAttr->fA += pDelta->fA;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pAttr->fBS += pDelta->fBS;
|
|
pAttr->fGS += pDelta->fGS;
|
|
pAttr->fRS += pDelta->fRS;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
|
|
`
|
|
pAttr->fDIdx += pDelta->fDIdx;
|
|
pAttr->fDIdxA += pDelta->fDIdxA;
|
|
')dnl
|
|
}
|
|
|
|
#ifdef STEP_FIXED
|
|
void FASTCALL
|
|
AddFixedAttrs_$1(PATTRSET pAttr, PATTRSET pDelta)
|
|
{
|
|
pAttr->pSurface += pDelta->ipSurface;
|
|
pAttr->pZ += pDelta->ipZ;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
pAttr->uZ += pDelta->iZ;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
pAttr->iOoW += pDelta->iOoW;
|
|
|
|
pAttr->iUoW1 += pDelta->iUoW1;
|
|
pAttr->iVoW1 += pDelta->iVoW1;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
pAttr->iUoW2 += pDelta->iUoW2;
|
|
pAttr->iVoW2 += pDelta->iVoW2;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pAttr->uB += pDelta->iB;
|
|
pAttr->uG += pDelta->iG;
|
|
pAttr->uR += pDelta->iR;
|
|
pAttr->uA += pDelta->iA;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pAttr->uBS += pDelta->iBS;
|
|
pAttr->uGS += pDelta->iGS;
|
|
pAttr->uRS += pDelta->iRS;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
|
|
`
|
|
pAttr->uDIdx += pDelta->iDIdx;
|
|
pAttr->uDIdxA += pDelta->iDIdxA;
|
|
')dnl
|
|
}
|
|
#endif
|
|
')dnl
|
|
dnl
|
|
d_RepStr(`d_AddAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
|
|
`Z_Tex1_Tex2',
|
|
`Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
|
|
dnl
|
|
dnl d_AddScaledAttrs
|
|
dnl
|
|
dnl Macro to build scaled attribute adder.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex1 and Tex2 in any mix.
|
|
dnl
|
|
define(`d_AddScaledAttrs', `
|
|
void FASTCALL
|
|
AddScaledFloatAttrs_$1(PATTRSET pAttr, PATTRSET pDelta,
|
|
PSETUPCTX pStpCtx, INT iScale)
|
|
{
|
|
FLOAT fScale = (FLOAT)iScale;
|
|
|
|
pAttr->pSurface += pDelta->ipSurface * iScale;
|
|
pAttr->pZ += pDelta->ipZ * iScale;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
pAttr->fZ += pDelta->fZ * fScale;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`ifelse(eval(d_index(`$1', `Pwl') >= 0), `1',
|
|
`
|
|
pAttr->fOoW = pStpCtx->fNextOoW;
|
|
pAttr->fUoW1 = pStpCtx->fNextUoW1;
|
|
pAttr->fVoW1 = pStpCtx->fNextVoW1;
|
|
',
|
|
`
|
|
pAttr->fOoW += pDelta->fOoW * fScale;
|
|
pAttr->fUoW1 += pDelta->fUoW1 * fScale;
|
|
pAttr->fVoW1 += pDelta->fVoW1 * fScale;
|
|
')dnl
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
pAttr->fUoW2 += pDelta->fUoW2 * fScale;
|
|
pAttr->fVoW2 += pDelta->fVoW2 * fScale;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pAttr->fB += pDelta->fB * fScale;
|
|
pAttr->fG += pDelta->fG * fScale;
|
|
pAttr->fR += pDelta->fR * fScale;
|
|
pAttr->fA += pDelta->fA * fScale;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pAttr->fBS += pDelta->fBS * fScale;
|
|
pAttr->fGS += pDelta->fGS * fScale;
|
|
pAttr->fRS += pDelta->fRS * fScale;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
|
|
`
|
|
pAttr->fDIdx += pDelta->fDIdx * fScale;
|
|
pAttr->fDIdxA += pDelta->fDIdxA * fScale;
|
|
')dnl
|
|
}
|
|
')dnl
|
|
dnl
|
|
d_RepStr(`d_AddScaledAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
|
|
`Z_Tex1_Tex2',
|
|
`Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
|
|
dnl
|
|
dnl d_FillSpanAttrs
|
|
dnl
|
|
dnl Macro to build attribute span store routine.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex1 and Tex2 in any mix.
|
|
dnl
|
|
define(`d_FillSpanAttrs', `
|
|
void FASTCALL
|
|
FillSpanFloatAttrs_$1(PATTRSET pAttrs, PD3DI_RASTSPAN pSpan, PSETUPCTX pStpCtx,
|
|
INT cPix)
|
|
{
|
|
pSpan->pSurface = pAttrs->pSurface;
|
|
pSpan->pZ = pAttrs->pZ;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
pSpan->uZ = FTOI(pAttrs->fZ);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
pSpan->iOoW = FTOI(pAttrs->fOoW);
|
|
pSpan->iW = FTOI(OOW_W_SCALE / pAttrs->fOoW);
|
|
|
|
pSpan->iLOD = 0;
|
|
pSpan->iDLOD = 0;
|
|
|
|
pSpan->iUoW1 = FTOI(pAttrs->fUoW1);
|
|
pSpan->iVoW1 = FTOI(pAttrs->fVoW1);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
pSpan->iUoW2 = FTOI(pAttrs->fUoW2);
|
|
pSpan->iVoW2 = FTOI(pAttrs->fVoW2);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pSpan->uB = FTOI(pAttrs->fB);
|
|
pSpan->uG = FTOI(pAttrs->fG);
|
|
pSpan->uR = FTOI(pAttrs->fR);
|
|
pSpan->uA = FTOI(pAttrs->fA);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pSpan->uBS = FTOI(pAttrs->fBS);
|
|
pSpan->uGS = FTOI(pAttrs->fGS);
|
|
pSpan->uRS = FTOI(pAttrs->fRS);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
|
|
`
|
|
pSpan->iIdx = FTOI(pAttrs->fDIdx);
|
|
pSpan->iIdxA = FTOI(pAttrs->fDIdx);
|
|
')dnl
|
|
}
|
|
|
|
#ifdef STEP_FIXED
|
|
void FASTCALL
|
|
FillSpanFixedAttrs_$1(PATTRSET pAttrs, PD3DI_RASTSPAN pSpan, PSETUPCTX pStpCtx,
|
|
INT cPix)
|
|
{
|
|
pSpan->pSurface = pAttrs->pSurface;
|
|
pSpan->pZ = pAttrs->pZ;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
pSpan->uZ = pAttrs->uZ;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
pSpan->iOoW = pAttrs->iOoW;
|
|
pSpan->iW = FTOI(OOW_W_SCALE / (FLOAT)pAttrs->iOoW);
|
|
|
|
pSpan->iLOD = 0;
|
|
pSpan->iDLOD = 0;
|
|
|
|
pSpan->iUoW1 = pAttrs->iUoW1;
|
|
pSpan->iVoW1 = pAttrs->iVoW1;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
pSpan->iUoW2 = pAttrs->iUoW2;
|
|
pSpan->iVoW2 = pAttrs->iVoW2;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pSpan->uB = (UINT16)pAttrs->uB;
|
|
pSpan->uG = (UINT16)pAttrs->uG;
|
|
pSpan->uR = (UINT16)pAttrs->uR;
|
|
pSpan->uA = (UINT16)pAttrs->uA;
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pSpan->uBS = (UINT16)pAttrs->uBS;
|
|
pSpan->uGS = (UINT16)pAttrs->uGS;
|
|
pSpan->uRS = (UINT16)pAttrs->uRS;
|
|
')dnl
|
|
}
|
|
#endif
|
|
')dnl
|
|
d_RepStr(`d_FillSpanAttrs(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
|
|
`Z_Tex1_Tex2',
|
|
`Z_DIdx', `Z_DIdx_Tex1', `Z_Tex1')dnl
|
|
dnl
|
|
dnl d_FloatAttrsToFixed
|
|
dnl
|
|
dnl Macro to build attribute conversion routine.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, Tex1 and Tex2 in any mix.
|
|
dnl
|
|
define(`d_FloatAttrsToFixed', `
|
|
#ifdef STEP_FIXED
|
|
void FASTCALL
|
|
FloatAttrsToFixed_$1(PATTRSET pfAttrs, PATTRSET piAttrs, PSETUPCTX pStpCtx)
|
|
{
|
|
piAttrs->pSurface = pfAttrs->pSurface;
|
|
piAttrs->pZ = pfAttrs->pZ;
|
|
ifelse(eval(d_index(`$1', `Z') >= 0), `1',
|
|
`
|
|
piAttrs->uZ = FTOI(pfAttrs->fZ);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
|
|
`
|
|
piAttrs->iOoW = FTOI(pfAttrs->fOoW);
|
|
|
|
piAttrs->iUoW1 = FTOI(pfAttrs->fUoW1);
|
|
piAttrs->iVoW1 = FTOI(pfAttrs->fVoW1);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Tex2') >= 0), `1',
|
|
`
|
|
piAttrs->iUoW2 = FTOI(pfAttrs->fUoW2);
|
|
piAttrs->iVoW2 = FTOI(pfAttrs->fVoW2);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
piAttrs->uB = FTOI(pfAttrs->fB);
|
|
piAttrs->uG = FTOI(pfAttrs->fG);
|
|
piAttrs->uR = FTOI(pfAttrs->fR);
|
|
piAttrs->uA = FTOI(pfAttrs->fA);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
piAttrs->uBS = FTOI(pfAttrs->fBS);
|
|
piAttrs->uGS = FTOI(pfAttrs->fGS);
|
|
piAttrs->uRS = FTOI(pfAttrs->fRS);
|
|
')dnl
|
|
}
|
|
#endif
|
|
')dnl
|
|
d_RepStr(`d_FloatAttrsToFixed(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex1', `Z_Diff_Spec_Tex1',
|
|
`Z_Tex1_Tex2')dnl
|