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.
 
 
 
 
 
 

71 lines
2.2 KiB

//-----------------------------------------------------------------------------
//
// This file contains color generation 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 "mcrgn_mh.h"
define(`d_ColorGen', `
void CMMX_ColorGen_$1_$2_$3_$4(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(`$2', `Specular', `
// This is an add with saturate in MMX
// ATTENTION if we really care, one could argue that saturation after fog is better
pCtx->SI.uBB = (UINT16)min((UINT32)pCtx->SI.uBB + (UINT32)pS->uBS, 0xffff);
pCtx->SI.uBG = (UINT16)min((UINT32)pCtx->SI.uBG + (UINT32)pS->uGS, 0xffff);
pCtx->SI.uBR = (UINT16)min((UINT32)pCtx->SI.uBR + (UINT32)pS->uRS, 0xffff);
pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
pS->uRS += pP->iDRSDX;')
ifelse(`$3', `VertexFog', `
UINT16 uFog = pS->uFog >> 8; // 0.8
pCtx->SI.uBB = (pCtx->SI.uBB>>8)*uFog; // 8.0 * 0.8 = 8.8
pCtx->SI.uBG = (pCtx->SI.uBG>>8)*uFog;
pCtx->SI.uBR = (pCtx->SI.uBR>>8)*uFog;
pCtx->SI.uBB += pCtx->SI.uFogB;
pCtx->SI.uBG += pCtx->SI.uFogG;
pCtx->SI.uBR += pCtx->SI.uFogR;
pS->uFog += (INT16)pS->iDFog;
pCtx->SI.uFogB += pCtx->SI.iFogBDX;
pCtx->SI.uFogG += pCtx->SI.iFogGDX;
pCtx->SI.uFogR += pCtx->SI.iFogRDX;')
pCtx->pfnColorGenEnd(pCtx, pP, pS);
}')dnl
dnl
d_RepStr(`d_RepStr(`d_RepStr(`d_ColorGen(AA, BB, CC, NoMonochrome)',
`AA', `Flat', `Gouraud')',
`BB', `NoSpecular', `Specular')',
`CC', `NoFog', `VertexFog')
void CMMX_ColorGen_All_Monochrome(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP,
PD3DI_RASTSPAN pS)
{
// ATTENTION, need to implement this
// ATTENTION, fix DPFs
// DPF(0, "ColorGen_All_Monochrome unimplemented");
DDASSERT(0);
}