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.

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