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.

317 lines
8.2 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // This file contains C++ attribute adders.
  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. dnl
  18. dnl d_AddAttrs
  19. dnl
  20. dnl Macro to build attribute adder.
  21. dnl
  22. dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex in any mix.
  23. dnl
  24. define(`d_AddAttrs', `
  25. void FASTCALL
  26. AddFloatAttrs_$1(PATTRSET pAttr, PATTRSET pDelta, PSETUPCTX pStpCtx)
  27. {
  28. pAttr->pSurface += pDelta->ipSurface;
  29. pAttr->pZ += pDelta->ipZ;
  30. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  31. `
  32. pAttr->fZ += pDelta->fZ;
  33. ')dnl
  34. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  35. `
  36. pAttr->fOoW += pDelta->fOoW;
  37. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  38. {
  39. pAttr->fUoW[i] += pDelta->fUoW[i];
  40. pAttr->fVoW[i] += pDelta->fVoW[i];
  41. }
  42. ')dnl
  43. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  44. `
  45. pAttr->fB += pDelta->fB;
  46. pAttr->fG += pDelta->fG;
  47. pAttr->fR += pDelta->fR;
  48. pAttr->fA += pDelta->fA;
  49. ')dnl
  50. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  51. `
  52. pAttr->fBS += pDelta->fBS;
  53. pAttr->fGS += pDelta->fGS;
  54. pAttr->fRS += pDelta->fRS;
  55. ')dnl
  56. ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
  57. `
  58. pAttr->fDIdx += pDelta->fDIdx;
  59. pAttr->fDIdxA += pDelta->fDIdxA;
  60. ')dnl
  61. }
  62. #ifdef STEP_FIXED
  63. void FASTCALL
  64. AddFixedAttrs_$1(PATTRSET pAttr, PATTRSET pDelta)
  65. {
  66. pAttr->pSurface += pDelta->ipSurface;
  67. pAttr->pZ += pDelta->ipZ;
  68. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  69. `
  70. pAttr->uZ += pDelta->iZ;
  71. ')dnl
  72. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  73. `
  74. pAttr->iOoW += pDelta->iOoW;
  75. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  76. {
  77. pAttr->iUoW[i] += pDelta->iUoW[i];
  78. pAttr->iVoW[i] += pDelta->iVoW[i];
  79. }
  80. ')dnl
  81. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  82. `
  83. pAttr->uB += pDelta->iB;
  84. pAttr->uG += pDelta->iG;
  85. pAttr->uR += pDelta->iR;
  86. pAttr->uA += pDelta->iA;
  87. ')dnl
  88. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  89. `
  90. pAttr->uBS += pDelta->iBS;
  91. pAttr->uGS += pDelta->iGS;
  92. pAttr->uRS += pDelta->iRS;
  93. ')dnl
  94. ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
  95. `
  96. pAttr->uDIdx += pDelta->iDIdx;
  97. pAttr->uDIdxA += pDelta->iDIdxA;
  98. ')dnl
  99. }
  100. #endif
  101. ')dnl
  102. dnl
  103. d_RepStr(`d_AddAttrs(AA)', `AA',
  104. `Z_Diff', `Z_Diff_Spec',
  105. `Z_Diff_Tex', `Z_Diff_Spec_Tex',
  106. `Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
  107. dnl
  108. dnl d_AddScaledAttrs
  109. dnl
  110. dnl Macro to build scaled attribute adder.
  111. dnl
  112. dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex in any mix.
  113. dnl
  114. define(`d_AddScaledAttrs', `
  115. void FASTCALL
  116. AddScaledFloatAttrs_$1(PATTRSET pAttr, PATTRSET pDelta,
  117. PSETUPCTX pStpCtx, INT iScale)
  118. {
  119. FLOAT fScale = (FLOAT)iScale;
  120. pAttr->pSurface += pDelta->ipSurface * iScale;
  121. pAttr->pZ += pDelta->ipZ * iScale;
  122. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  123. `
  124. pAttr->fZ += pDelta->fZ * fScale;
  125. ')dnl
  126. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  127. `ifelse(eval(d_index(`$1', `Pwl') >= 0), `1',
  128. `
  129. pAttr->fOoW = pStpCtx->fNextOoW;
  130. pAttr->fUoW1 = pStpCtx->fNextUoW1;
  131. pAttr->fVoW1 = pStpCtx->fNextVoW1;
  132. ',
  133. `
  134. pAttr->fOoW += pDelta->fOoW * fScale;
  135. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  136. {
  137. pAttr->fUoW[i] += pDelta->fUoW[i] * fScale;
  138. pAttr->fVoW[i] += pDelta->fVoW[i] * fScale;
  139. }
  140. ')dnl
  141. ')dnl
  142. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  143. `
  144. pAttr->fB += pDelta->fB * fScale;
  145. pAttr->fG += pDelta->fG * fScale;
  146. pAttr->fR += pDelta->fR * fScale;
  147. pAttr->fA += pDelta->fA * fScale;
  148. ')dnl
  149. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  150. `
  151. pAttr->fBS += pDelta->fBS * fScale;
  152. pAttr->fGS += pDelta->fGS * fScale;
  153. pAttr->fRS += pDelta->fRS * fScale;
  154. ')dnl
  155. ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
  156. `
  157. pAttr->fDIdx += pDelta->fDIdx * fScale;
  158. pAttr->fDIdxA += pDelta->fDIdxA * fScale;
  159. ')dnl
  160. }
  161. ')dnl
  162. dnl
  163. d_RepStr(`d_AddScaledAttrs(AA)', `AA',
  164. `Z_Diff', `Z_Diff_Spec',
  165. `Z_Diff_Tex', `Z_Diff_Spec_Tex',
  166. `Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
  167. dnl
  168. dnl d_FillSpanAttrs
  169. dnl
  170. dnl Macro to build attribute span store routine.
  171. dnl
  172. dnl $1 contains substrings Z, Diff, Spec, DIdx, Tex in any mix.
  173. dnl
  174. define(`d_FillSpanAttrs', `
  175. void FASTCALL
  176. FillSpanFloatAttrs_$1(PATTRSET pAttrs, PD3DI_RASTSPAN pSpan, PSETUPCTX pStpCtx,
  177. INT cPix)
  178. {
  179. pSpan->pSurface = pAttrs->pSurface;
  180. pSpan->pZ = pAttrs->pZ;
  181. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  182. `
  183. pSpan->uZ = FTOI(pAttrs->fZ);
  184. ')dnl
  185. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  186. `
  187. pSpan->iOoW = FTOI(pAttrs->fOoW);
  188. pSpan->iW = FTOI(OOW_W_SCALE / pAttrs->fOoW);
  189. pSpan->iLOD = 0;
  190. pSpan->iDLOD = 0;
  191. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  192. {
  193. pSpan->UVoW[i].iUoW = FTOI(pAttrs->fUoW[i]);
  194. pSpan->UVoW[i].iVoW = FTOI(pAttrs->fVoW[i]);
  195. }
  196. ')dnl
  197. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  198. `
  199. pSpan->uB = FTOI(pAttrs->fB);
  200. pSpan->uG = FTOI(pAttrs->fG);
  201. pSpan->uR = FTOI(pAttrs->fR);
  202. pSpan->uA = FTOI(pAttrs->fA);
  203. ')dnl
  204. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  205. `
  206. pSpan->uBS = FTOI(pAttrs->fBS);
  207. pSpan->uGS = FTOI(pAttrs->fGS);
  208. pSpan->uRS = FTOI(pAttrs->fRS);
  209. ')dnl
  210. ifelse(eval(d_index(`$1', `DIdx') >= 0), `1',
  211. `
  212. pSpan->iIdx = FTOI(pAttrs->fDIdx);
  213. pSpan->iIdxA = FTOI(pAttrs->fDIdx);
  214. ')dnl
  215. }
  216. #ifdef STEP_FIXED
  217. void FASTCALL
  218. FillSpanFixedAttrs_$1(PATTRSET pAttrs, PD3DI_RASTSPAN pSpan, PSETUPCTX pStpCtx,
  219. INT cPix)
  220. {
  221. pSpan->pSurface = pAttrs->pSurface;
  222. pSpan->pZ = pAttrs->pZ;
  223. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  224. `
  225. pSpan->uZ = pAttrs->uZ;
  226. ')dnl
  227. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  228. `
  229. pSpan->iOoW = pAttrs->iOoW;
  230. pSpan->iW = FTOI(OOW_W_SCALE / (FLOAT)pAttrs->iOoW);
  231. pSpan->iLOD = 0;
  232. pSpan->iDLOD = 0;
  233. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  234. {
  235. pSpan->UVoW[i].iUoW = pAttrs->iUoW[i];
  236. pSpan->UVoW[i].iVoW = pAttrs->iVoW[i];
  237. }
  238. ')dnl
  239. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  240. `
  241. pSpan->uB = (UINT16)pAttrs->uB;
  242. pSpan->uG = (UINT16)pAttrs->uG;
  243. pSpan->uR = (UINT16)pAttrs->uR;
  244. pSpan->uA = (UINT16)pAttrs->uA;
  245. ')dnl
  246. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  247. `
  248. pSpan->uBS = (UINT16)pAttrs->uBS;
  249. pSpan->uGS = (UINT16)pAttrs->uGS;
  250. pSpan->uRS = (UINT16)pAttrs->uRS;
  251. ')dnl
  252. }
  253. #endif
  254. ')dnl
  255. d_RepStr(`d_FillSpanAttrs(AA)', `AA',
  256. `Z_Diff', `Z_Diff_Spec',
  257. `Z_Diff_Tex', `Z_Diff_Spec_Tex',
  258. `Z_DIdx', `Z_DIdx_Tex', `Z_Tex')dnl
  259. dnl
  260. dnl d_FloatAttrsToFixed
  261. dnl
  262. dnl Macro to build attribute conversion routine.
  263. dnl
  264. dnl $1 contains substrings Z, Diff, Spec, Tex in any mix.
  265. dnl
  266. define(`d_FloatAttrsToFixed', `
  267. #ifdef STEP_FIXED
  268. void FASTCALL
  269. FloatAttrsToFixed_$1(PATTRSET pfAttrs, PATTRSET piAttrs, PSETUPCTX pStpCtx)
  270. {
  271. piAttrs->pSurface = pfAttrs->pSurface;
  272. piAttrs->pZ = pfAttrs->pZ;
  273. ifelse(eval(d_index(`$1', `Z') >= 0), `1',
  274. `
  275. piAttrs->uZ = FTOI(pfAttrs->fZ);
  276. ')dnl
  277. ifelse(eval(d_index(`$1', `Tex') >= 0), `1',
  278. `
  279. piAttrs->iOoW = FTOI(pfAttrs->fOoW);
  280. for (INT32 i = 0; i < (INT32)pStpCtx->pCtx->cActTex; i ++)
  281. {
  282. piAttrs->iUoW[i] = FTOI(pfAttrs->fUoW[i]);
  283. piAttrs->iVoW[i] = FTOI(pfAttrs->fVoW[i]);
  284. }
  285. ')dnl
  286. ifelse(eval(d_index(`$1', `Diff') >= 0), `1',
  287. `
  288. piAttrs->uB = FTOI(pfAttrs->fB);
  289. piAttrs->uG = FTOI(pfAttrs->fG);
  290. piAttrs->uR = FTOI(pfAttrs->fR);
  291. piAttrs->uA = FTOI(pfAttrs->fA);
  292. ')dnl
  293. ifelse(eval(d_index(`$1', `Spec') >= 0), `1',
  294. `
  295. piAttrs->uBS = FTOI(pfAttrs->fBS);
  296. piAttrs->uGS = FTOI(pfAttrs->fGS);
  297. piAttrs->uRS = FTOI(pfAttrs->fRS);
  298. ')dnl
  299. }
  300. #endif
  301. ')dnl
  302. d_RepStr(`d_FloatAttrsToFixed(AA)', `AA',
  303. `Z_Diff', `Z_Diff_Spec',
  304. `Z_Diff_Tex', `Z_Diff_Spec_Tex',
  305. `Z_Tex')dnl