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.

100 lines
3.3 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // This file contains Z compare fail functions.
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997.
  6. //
  7. // WARNING WARNING WARNING
  8. // This cpp file generated from mcp file.
  9. // EDIT THE MCP FILE.
  10. // I warned you.
  11. // WARNING WARNING WARNING
  12. //
  13. //-----------------------------------------------------------------------------
  14. include(`m4hdr.mh')dnl
  15. #include "pch.cpp"
  16. #pragma hdrstop
  17. #include "ctstf_mh.h"
  18. include(`ctexaddr.mh')dnl for W divide
  19. dnl
  20. dnl d_TestFail
  21. dnl
  22. dnl Macro to build test fail term incrementing routines
  23. dnl
  24. dnl $1 is one of Flat Gouraud
  25. dnl $2 is one of NoTex Tex1 PerspTex1 Tex2 PerspTex2
  26. dnl $3 is one of NoSpecularFog SpecularFog
  27. dnl
  28. define(`d_TestFail', `
  29. void C_TestFail_$1_$2_$3(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP,
  30. PD3DI_RASTSPAN pS)
  31. {dnl
  32. ifelse(`$1', `Gouraud', `
  33. pS->uB += pP->iDBDX; pS->uG += pP->iDGDX;
  34. pS->uR += pP->iDRDX; pS->uA += pP->iDADX;')
  35. ifelse(eval((d_index(`$2', `Tex1') == 0)), `1', `
  36. pS->iLOD += pS->iDLOD;
  37. pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
  38. pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
  39. pCtx->SI.TexUV[0].iU = pS->UVoW[0].iUoW>>TEX_TO_FINAL_SHIFT;
  40. pCtx->SI.TexUV[0].iV = pS->UVoW[0].iVoW>>TEX_TO_FINAL_SHIFT;')
  41. ifelse(`$2', `Tex2', `
  42. pS->iLOD += pS->iDLOD;
  43. for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
  44. {
  45. pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
  46. pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
  47. pCtx->SI.TexUV[i].iU = pS->UVoW[i].iUoW>>TEX_TO_FINAL_SHIFT;
  48. pCtx->SI.TexUV[i].iV = pS->UVoW[i].iVoW>>TEX_TO_FINAL_SHIFT;
  49. }')
  50. ifelse(eval((d_index(`$2', `PerspTex1') == 0)), `1', `
  51. pS->iLOD += pS->iDLOD;
  52. pS->iOoW += pP->iDOoWDX;
  53. INT32 iOoW = pS->iOoW>>16; // 1.15
  54. d_WDivide()
  55. pS->UVoW[0].iUoW += pP->DUVoWDX[0].iDUoWDX;
  56. pS->UVoW[0].iVoW += pP->DUVoWDX[0].iDVoWDX;
  57. pCtx->SI.TexUV[0].iU = d_WTimesUVoW(pS->iW,pS->UVoW[0].iUoW);
  58. pCtx->SI.TexUV[0].iV = d_WTimesUVoW(pS->iW,pS->UVoW[0].iVoW);')
  59. ifelse(`$2', `PerspTex2', `
  60. pS->iLOD += pS->iDLOD;
  61. pS->iOoW += pP->iDOoWDX;
  62. INT32 iOoW = pS->iOoW>>16; // 1.15
  63. d_WDivide()
  64. for (INT32 i = 0; i < (INT32)pCtx->cActTex; i ++)
  65. {
  66. pS->UVoW[i].iUoW += pP->DUVoWDX[i].iDUoWDX;
  67. pS->UVoW[i].iVoW += pP->DUVoWDX[i].iDVoWDX;
  68. pCtx->SI.TexUV[i].iU = d_WTimesUVoW(pS->iW,pS->UVoW[i].iUoW);
  69. pCtx->SI.TexUV[i].iV = d_WTimesUVoW(pS->iW,pS->UVoW[i].iVoW);
  70. }')
  71. ifelse(`$3', `SpecularFog', `
  72. if (pCtx->pdwRenderState[D3DRENDERSTATE_SPECULARENABLE])
  73. {
  74. pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
  75. pS->uRS += pP->iDRSDX;
  76. }
  77. if (pCtx->pdwRenderState[D3DRENDERSTATE_FOGENABLE])
  78. {
  79. pS->uFog += (INT16)pS->iDFog;
  80. pCtx->SI.uFogB += pCtx->SI.iFogBDX;
  81. pCtx->SI.uFogG += pCtx->SI.iFogGDX;
  82. pCtx->SI.uFogR += pCtx->SI.iFogRDX;
  83. }')
  84. // just returns for C, since we really can not loop with function calls
  85. }')
  86. d_RepStr(`d_RepStr(`d_RepStr(`d_TestFail(AA, BB, CC)',
  87. `AA', `Flat', `Gouraud')',
  88. `BB', `NoTex', `Tex1', `PerspTex1', `Tex2', `PerspTex2')',
  89. `CC', `NoSpecularFog', `SpecularFog')