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.

88 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 "mtstf_mh.h"
  18. #include "MMXEmul.h"
  19. include(`mtexaddr.mh')dnl for W divide
  20. dnl
  21. dnl d_TestFail
  22. dnl
  23. dnl Macro to build test fail term incrementing routines
  24. dnl
  25. dnl $1 is one of Flat Gouraud
  26. dnl $2 is one of NoTex Tex1 PerspTex1 Tex2 PerspTex2
  27. dnl $3 is one of NoSpecularFog SpecularFog
  28. dnl
  29. define(`d_TestFail', `
  30. void CMMX_TestFail_$1_$2_$3(PD3DI_RASTCTX pCtx, PD3DI_RASTPRIM pP,
  31. PD3DI_RASTSPAN pS)
  32. {
  33. ifelse(`$1', `Gouraud', `
  34. pS->uB += pP->iDBDX; pS->uG += pP->iDGDX;
  35. pS->uR += pP->iDRDX; pS->uA += pP->iDADX;')
  36. ifelse(eval((d_index(`$2', `Tex1') == 0) || (d_index(`$2', `Tex2') == 0)), `1', `
  37. pS->iLOD += pS->iDLOD;
  38. pS->iUoW1 += pP->iDUoW1DX;
  39. pS->iVoW1 += pP->iDVoW1DX;
  40. pCtx->SI.iU1 = pS->iUoW1>>TEX_TO_FINAL_SHIFT;
  41. pCtx->SI.iV1 = pS->iUoW1>>TEX_TO_FINAL_SHIFT;')
  42. ifelse(`$2', `Tex2', `
  43. pS->iUoW2 += pP->iDUoW2DX;
  44. pS->iVoW2 += pP->iDVoW2DX;
  45. pCtx->SI.iU2 = pS->iUoW2>>TEX_TO_FINAL_SHIFT;
  46. pCtx->SI.iV2 = pS->iVoW2>>TEX_TO_FINAL_SHIFT;')
  47. ifelse(eval((d_index(`$2', `PerspTex1') == 0) || (d_index(`$2', `PerspTex2') == 0)), `1', `
  48. pS->iLOD += pS->iDLOD;
  49. pS->iOoW += pP->iDOoWDX;
  50. INT32 iOoW = pS->iOoW>>16; // 1.15
  51. d_WDivide()
  52. pS->iUoW1 += pP->iDUoW1DX;
  53. pS->iVoW1 += pP->iDVoW1DX;
  54. pCtx->SI.iU1 = d_WTimesUVoW(pS->iW,pS->iUoW1);
  55. pCtx->SI.iV1 = d_WTimesUVoW(pS->iW,pS->iVoW1);')
  56. ifelse(`$2', `PerspTex2', `
  57. pS->iUoW2 += pP->iDUoW2DX;
  58. pS->iVoW2 += pP->iDVoW2DX;
  59. pCtx->SI.iU2 = d_WTimesUVoW(pS->iW,pS->iUoW2);
  60. pCtx->SI.iV2 = d_WTimesUVoW(pS->iW,pS->iVoW2);')
  61. ifelse(`$3', `SpecularFog', `
  62. if (pCtx->pdwRenderState[D3DRENDERSTATE_SPECULARENABLE])
  63. {
  64. pS->uBS += pP->iDBSDX; pS->uGS += pP->iDGSDX;
  65. pS->uRS += pP->iDRSDX;
  66. }
  67. if (pCtx->pdwRenderState[D3DRENDERSTATE_FOGENABLE])
  68. {
  69. pS->uFog += (INT16)pS->iDFog;
  70. pCtx->SI.uFogB += pCtx->SI.iFogBDX;
  71. pCtx->SI.uFogG += pCtx->SI.iFogGDX;
  72. pCtx->SI.uFogR += pCtx->SI.iFogRDX;
  73. }')
  74. // just returns for C, since we really can not loop with function calls
  75. }')
  76. d_RepStr(`d_RepStr(`d_RepStr(`d_TestFail(AA, BB, CC)',
  77. `AA', `Flat', `Gouraud')',
  78. `BB', `NoTex', `Tex1', `PerspTex1', `Tex2', `PerspTex2')',
  79. `CC', `NoSpecularFog', `SpecularFog')