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.
318 lines
8.3 KiB
318 lines
8.3 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 "rgb_pch.h"
|
|
#include "attrs_mh.h"
|
|
#pragma hdrstop
|
|
|
|
dnl
|
|
dnl d_AddAttrs
|
|
dnl
|
|
dnl Macro to build attribute adder.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex 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;
|
|
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
pAttr->fUoW[i] += pDelta->fUoW[i];
|
|
pAttr->fVoW[i] += pDelta->fVoW[i];
|
|
}
|
|
')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;
|
|
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
pAttr->iUoW[i] += pDelta->iUoW[i];
|
|
pAttr->iVoW[i] += pDelta->iVoW[i];
|
|
}
|
|
')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_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_AddScaledAttrs
|
|
dnl
|
|
dnl Macro to build scaled attribute adder.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex 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;
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
pAttr->fUoW[i] += pDelta->fUoW[i] * fScale;
|
|
pAttr->fVoW[i] += pDelta->fVoW[i] * fScale;
|
|
}
|
|
')dnl
|
|
')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_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_FillSpanAttrs
|
|
dnl
|
|
dnl Macro to build attribute span store routine.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex 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;
|
|
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
pSpan->UVoW[i].iUoW = FTOI(pAttrs->fUoW[i]);
|
|
pSpan->UVoW[i].iVoW = FTOI(pAttrs->fVoW[i]);
|
|
}
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
pSpan->uB = (UINT16)FTOI(pAttrs->fB);
|
|
pSpan->uG = (UINT16)FTOI(pAttrs->fG);
|
|
pSpan->uR = (UINT16)FTOI(pAttrs->fR);
|
|
pSpan->uA = (UINT16)FTOI(pAttrs->fA);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
pSpan->uBS = (UINT16)FTOI(pAttrs->fBS);
|
|
pSpan->uGS = (UINT16)FTOI(pAttrs->fGS);
|
|
pSpan->uRS = (UINT16)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;
|
|
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
pSpan->UVoW[i].iUoW = pAttrs->iUoW[i];
|
|
pSpan->UVoW[i].iVoW = pAttrs->iVoW[i];
|
|
}
|
|
')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_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
|
|
dnl
|
|
dnl d_FloatAttrsToFixed
|
|
dnl
|
|
dnl Macro to build attribute conversion routine.
|
|
dnl
|
|
dnl $1 contains substrings Z, Diff, Spec, Tex 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);
|
|
|
|
for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
|
|
{
|
|
piAttrs->iUoW[i] = FTOI(pfAttrs->fUoW[i]);
|
|
piAttrs->iVoW[i] = FTOI(pfAttrs->fVoW[i]);
|
|
}
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
|
|
`
|
|
piAttrs->uB = (UINT16)FTOI(pfAttrs->fB);
|
|
piAttrs->uG = (UINT16)FTOI(pfAttrs->fG);
|
|
piAttrs->uR = (UINT16)FTOI(pfAttrs->fR);
|
|
piAttrs->uA = (UINT16)FTOI(pfAttrs->fA);
|
|
')dnl
|
|
ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
|
|
`
|
|
piAttrs->uBS = (UINT16)FTOI(pfAttrs->fBS);
|
|
piAttrs->uGS = (UINT16)FTOI(pfAttrs->fGS);
|
|
piAttrs->uRS = (UINT16)FTOI(pfAttrs->fRS);
|
|
')dnl
|
|
}
|
|
#endif
|
|
')dnl
|
|
d_RepStr(`d_FloatAttrsToFixed(AA)', `AA',
|
|
`Z_Diff', `Z_Diff_Spec',
|
|
`Z_Diff_Tex', `Z_Diff_Spec_Tex',
|
|
`Z_Tex')dnl
|