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.

87 lines
2.8 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. {
  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) || (d_index(`$2', `Tex2') == 0)), `1', `
  36. pS->iLOD += pS->iDLOD;
  37. pS->iUoW1 += pP->iDUoW1DX;
  38. pS->iVoW1 += pP->iDVoW1DX;
  39. pCtx->SI.iU1 = pS->iUoW1>>TEX_TO_FINAL_SHIFT;
  40. pCtx->SI.iV1 = pS->iVoW1>>TEX_TO_FINAL_SHIFT;')
  41. ifelse(`$2', `Tex2', `
  42. pS->iUoW2 += pP->iDUoW2DX;
  43. pS->iVoW2 += pP->iDVoW2DX;
  44. pCtx->SI.iU2 = pS->iUoW2>>TEX_TO_FINAL_SHIFT;
  45. pCtx->SI.iV2 = pS->iVoW2>>TEX_TO_FINAL_SHIFT;')
  46. ifelse(eval((d_index(`$2', `PerspTex1') == 0) || (d_index(`$2', `PerspTex2') == 0)), `1', `
  47. pS->iLOD += pS->iDLOD;
  48. pS->iOoW += pP->iDOoWDX;
  49. INT32 iOoW = pS->iOoW>>16; // 1.15
  50. d_WDivide()
  51. pS->iUoW1 += pP->iDUoW1DX;
  52. pS->iVoW1 += pP->iDVoW1DX;
  53. pCtx->SI.iU1 = d_WTimesUVoW(pS->iW,pS->iUoW1);
  54. pCtx->SI.iV1 = d_WTimesUVoW(pS->iW,pS->iVoW1);')
  55. ifelse(`$2', `PerspTex2', `
  56. pS->iUoW2 += pP->iDUoW2DX;
  57. pS->iVoW2 += pP->iDVoW2DX;
  58. pCtx->SI.iU2 = d_WTimesUVoW(pS->iW,pS->iUoW2);
  59. pCtx->SI.iV2 = d_WTimesUVoW(pS->iW,pS->iVoW2);')
  60. ifelse(`$3', `SpecularFog', `
  61. if (pCtx->pdwRenderState[D3DRENDERSTATE_SPECULARENABLE])
  62. {
  63. pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
  64. pS->uRS += pP->iDRSDX;
  65. }
  66. if (pCtx->pdwRenderState[D3DRENDERSTATE_FOGENABLE])
  67. {
  68. pS->uFog += (INT16)pS->iDFog;
  69. pCtx->SI.uFogB += pCtx->SI.iFogBDX;
  70. pCtx->SI.uFogG += pCtx->SI.iFogGDX;
  71. pCtx->SI.uFogR += pCtx->SI.iFogRDX;
  72. }')
  73. // just returns for C, since we really can not loop with function calls
  74. }')
  75. d_RepStr(`d_RepStr(`d_RepStr(`d_TestFail(AA, BB, CC)',
  76. `AA', `Flat', `Gouraud')',
  77. `BB', `NoTex', `Tex1', `PerspTex1', `Tex2', `PerspTex2')',
  78. `CC', `NoSpecularFog', `SpecularFog')