Team Fortress 2 Source Code as on 22/4/2020
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.

712 lines
15 KiB

  1. #include "shaderlib/cshader.h"
  2. class lightmappedgeneric_ps20_Static_Index
  3. {
  4. private:
  5. int m_nMASKEDBLENDING;
  6. #ifdef _DEBUG
  7. bool m_bMASKEDBLENDING;
  8. #endif
  9. public:
  10. void SetMASKEDBLENDING( int i )
  11. {
  12. Assert( i >= 0 && i <= 1 );
  13. m_nMASKEDBLENDING = i;
  14. #ifdef _DEBUG
  15. m_bMASKEDBLENDING = true;
  16. #endif
  17. }
  18. void SetMASKEDBLENDING( bool i )
  19. {
  20. m_nMASKEDBLENDING = i ? 1 : 0;
  21. #ifdef _DEBUG
  22. m_bMASKEDBLENDING = true;
  23. #endif
  24. }
  25. private:
  26. int m_nBASETEXTURE2;
  27. #ifdef _DEBUG
  28. bool m_bBASETEXTURE2;
  29. #endif
  30. public:
  31. void SetBASETEXTURE2( int i )
  32. {
  33. Assert( i >= 0 && i <= 1 );
  34. m_nBASETEXTURE2 = i;
  35. #ifdef _DEBUG
  36. m_bBASETEXTURE2 = true;
  37. #endif
  38. }
  39. void SetBASETEXTURE2( bool i )
  40. {
  41. m_nBASETEXTURE2 = i ? 1 : 0;
  42. #ifdef _DEBUG
  43. m_bBASETEXTURE2 = true;
  44. #endif
  45. }
  46. private:
  47. int m_nDETAILTEXTURE;
  48. #ifdef _DEBUG
  49. bool m_bDETAILTEXTURE;
  50. #endif
  51. public:
  52. void SetDETAILTEXTURE( int i )
  53. {
  54. Assert( i >= 0 && i <= 1 );
  55. m_nDETAILTEXTURE = i;
  56. #ifdef _DEBUG
  57. m_bDETAILTEXTURE = true;
  58. #endif
  59. }
  60. void SetDETAILTEXTURE( bool i )
  61. {
  62. m_nDETAILTEXTURE = i ? 1 : 0;
  63. #ifdef _DEBUG
  64. m_bDETAILTEXTURE = true;
  65. #endif
  66. }
  67. private:
  68. int m_nBUMPMAP;
  69. #ifdef _DEBUG
  70. bool m_bBUMPMAP;
  71. #endif
  72. public:
  73. void SetBUMPMAP( int i )
  74. {
  75. Assert( i >= 0 && i <= 2 );
  76. m_nBUMPMAP = i;
  77. #ifdef _DEBUG
  78. m_bBUMPMAP = true;
  79. #endif
  80. }
  81. void SetBUMPMAP( bool i )
  82. {
  83. m_nBUMPMAP = i ? 1 : 0;
  84. #ifdef _DEBUG
  85. m_bBUMPMAP = true;
  86. #endif
  87. }
  88. private:
  89. int m_nBUMPMAP2;
  90. #ifdef _DEBUG
  91. bool m_bBUMPMAP2;
  92. #endif
  93. public:
  94. void SetBUMPMAP2( int i )
  95. {
  96. Assert( i >= 0 && i <= 1 );
  97. m_nBUMPMAP2 = i;
  98. #ifdef _DEBUG
  99. m_bBUMPMAP2 = true;
  100. #endif
  101. }
  102. void SetBUMPMAP2( bool i )
  103. {
  104. m_nBUMPMAP2 = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bBUMPMAP2 = true;
  107. #endif
  108. }
  109. private:
  110. int m_nCUBEMAP;
  111. #ifdef _DEBUG
  112. bool m_bCUBEMAP;
  113. #endif
  114. public:
  115. void SetCUBEMAP( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nCUBEMAP = i;
  119. #ifdef _DEBUG
  120. m_bCUBEMAP = true;
  121. #endif
  122. }
  123. void SetCUBEMAP( bool i )
  124. {
  125. m_nCUBEMAP = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bCUBEMAP = true;
  128. #endif
  129. }
  130. private:
  131. int m_nENVMAPMASK;
  132. #ifdef _DEBUG
  133. bool m_bENVMAPMASK;
  134. #endif
  135. public:
  136. void SetENVMAPMASK( int i )
  137. {
  138. Assert( i >= 0 && i <= 1 );
  139. m_nENVMAPMASK = i;
  140. #ifdef _DEBUG
  141. m_bENVMAPMASK = true;
  142. #endif
  143. }
  144. void SetENVMAPMASK( bool i )
  145. {
  146. m_nENVMAPMASK = i ? 1 : 0;
  147. #ifdef _DEBUG
  148. m_bENVMAPMASK = true;
  149. #endif
  150. }
  151. private:
  152. int m_nBASEALPHAENVMAPMASK;
  153. #ifdef _DEBUG
  154. bool m_bBASEALPHAENVMAPMASK;
  155. #endif
  156. public:
  157. void SetBASEALPHAENVMAPMASK( int i )
  158. {
  159. Assert( i >= 0 && i <= 1 );
  160. m_nBASEALPHAENVMAPMASK = i;
  161. #ifdef _DEBUG
  162. m_bBASEALPHAENVMAPMASK = true;
  163. #endif
  164. }
  165. void SetBASEALPHAENVMAPMASK( bool i )
  166. {
  167. m_nBASEALPHAENVMAPMASK = i ? 1 : 0;
  168. #ifdef _DEBUG
  169. m_bBASEALPHAENVMAPMASK = true;
  170. #endif
  171. }
  172. private:
  173. int m_nSELFILLUM;
  174. #ifdef _DEBUG
  175. bool m_bSELFILLUM;
  176. #endif
  177. public:
  178. void SetSELFILLUM( int i )
  179. {
  180. Assert( i >= 0 && i <= 1 );
  181. m_nSELFILLUM = i;
  182. #ifdef _DEBUG
  183. m_bSELFILLUM = true;
  184. #endif
  185. }
  186. void SetSELFILLUM( bool i )
  187. {
  188. m_nSELFILLUM = i ? 1 : 0;
  189. #ifdef _DEBUG
  190. m_bSELFILLUM = true;
  191. #endif
  192. }
  193. private:
  194. int m_nNORMALMAPALPHAENVMAPMASK;
  195. #ifdef _DEBUG
  196. bool m_bNORMALMAPALPHAENVMAPMASK;
  197. #endif
  198. public:
  199. void SetNORMALMAPALPHAENVMAPMASK( int i )
  200. {
  201. Assert( i >= 0 && i <= 1 );
  202. m_nNORMALMAPALPHAENVMAPMASK = i;
  203. #ifdef _DEBUG
  204. m_bNORMALMAPALPHAENVMAPMASK = true;
  205. #endif
  206. }
  207. void SetNORMALMAPALPHAENVMAPMASK( bool i )
  208. {
  209. m_nNORMALMAPALPHAENVMAPMASK = i ? 1 : 0;
  210. #ifdef _DEBUG
  211. m_bNORMALMAPALPHAENVMAPMASK = true;
  212. #endif
  213. }
  214. private:
  215. int m_nDIFFUSEBUMPMAP;
  216. #ifdef _DEBUG
  217. bool m_bDIFFUSEBUMPMAP;
  218. #endif
  219. public:
  220. void SetDIFFUSEBUMPMAP( int i )
  221. {
  222. Assert( i >= 0 && i <= 1 );
  223. m_nDIFFUSEBUMPMAP = i;
  224. #ifdef _DEBUG
  225. m_bDIFFUSEBUMPMAP = true;
  226. #endif
  227. }
  228. void SetDIFFUSEBUMPMAP( bool i )
  229. {
  230. m_nDIFFUSEBUMPMAP = i ? 1 : 0;
  231. #ifdef _DEBUG
  232. m_bDIFFUSEBUMPMAP = true;
  233. #endif
  234. }
  235. private:
  236. int m_nBASETEXTURENOENVMAP;
  237. #ifdef _DEBUG
  238. bool m_bBASETEXTURENOENVMAP;
  239. #endif
  240. public:
  241. void SetBASETEXTURENOENVMAP( int i )
  242. {
  243. Assert( i >= 0 && i <= 1 );
  244. m_nBASETEXTURENOENVMAP = i;
  245. #ifdef _DEBUG
  246. m_bBASETEXTURENOENVMAP = true;
  247. #endif
  248. }
  249. void SetBASETEXTURENOENVMAP( bool i )
  250. {
  251. m_nBASETEXTURENOENVMAP = i ? 1 : 0;
  252. #ifdef _DEBUG
  253. m_bBASETEXTURENOENVMAP = true;
  254. #endif
  255. }
  256. private:
  257. int m_nBASETEXTURE2NOENVMAP;
  258. #ifdef _DEBUG
  259. bool m_bBASETEXTURE2NOENVMAP;
  260. #endif
  261. public:
  262. void SetBASETEXTURE2NOENVMAP( int i )
  263. {
  264. Assert( i >= 0 && i <= 1 );
  265. m_nBASETEXTURE2NOENVMAP = i;
  266. #ifdef _DEBUG
  267. m_bBASETEXTURE2NOENVMAP = true;
  268. #endif
  269. }
  270. void SetBASETEXTURE2NOENVMAP( bool i )
  271. {
  272. m_nBASETEXTURE2NOENVMAP = i ? 1 : 0;
  273. #ifdef _DEBUG
  274. m_bBASETEXTURE2NOENVMAP = true;
  275. #endif
  276. }
  277. private:
  278. int m_nWARPLIGHTING;
  279. #ifdef _DEBUG
  280. bool m_bWARPLIGHTING;
  281. #endif
  282. public:
  283. void SetWARPLIGHTING( int i )
  284. {
  285. Assert( i >= 0 && i <= 1 );
  286. m_nWARPLIGHTING = i;
  287. #ifdef _DEBUG
  288. m_bWARPLIGHTING = true;
  289. #endif
  290. }
  291. void SetWARPLIGHTING( bool i )
  292. {
  293. m_nWARPLIGHTING = i ? 1 : 0;
  294. #ifdef _DEBUG
  295. m_bWARPLIGHTING = true;
  296. #endif
  297. }
  298. private:
  299. int m_nFANCY_BLENDING;
  300. #ifdef _DEBUG
  301. bool m_bFANCY_BLENDING;
  302. #endif
  303. public:
  304. void SetFANCY_BLENDING( int i )
  305. {
  306. Assert( i >= 0 && i <= 1 );
  307. m_nFANCY_BLENDING = i;
  308. #ifdef _DEBUG
  309. m_bFANCY_BLENDING = true;
  310. #endif
  311. }
  312. void SetFANCY_BLENDING( bool i )
  313. {
  314. m_nFANCY_BLENDING = i ? 1 : 0;
  315. #ifdef _DEBUG
  316. m_bFANCY_BLENDING = true;
  317. #endif
  318. }
  319. private:
  320. int m_nSEAMLESS;
  321. #ifdef _DEBUG
  322. bool m_bSEAMLESS;
  323. #endif
  324. public:
  325. void SetSEAMLESS( int i )
  326. {
  327. Assert( i >= 0 && i <= 1 );
  328. m_nSEAMLESS = i;
  329. #ifdef _DEBUG
  330. m_bSEAMLESS = true;
  331. #endif
  332. }
  333. void SetSEAMLESS( bool i )
  334. {
  335. m_nSEAMLESS = i ? 1 : 0;
  336. #ifdef _DEBUG
  337. m_bSEAMLESS = true;
  338. #endif
  339. }
  340. private:
  341. int m_nOUTLINE;
  342. #ifdef _DEBUG
  343. bool m_bOUTLINE;
  344. #endif
  345. public:
  346. void SetOUTLINE( int i )
  347. {
  348. Assert( i >= 0 && i <= 1 );
  349. m_nOUTLINE = i;
  350. #ifdef _DEBUG
  351. m_bOUTLINE = true;
  352. #endif
  353. }
  354. void SetOUTLINE( bool i )
  355. {
  356. m_nOUTLINE = i ? 1 : 0;
  357. #ifdef _DEBUG
  358. m_bOUTLINE = true;
  359. #endif
  360. }
  361. private:
  362. int m_nSOFTEDGES;
  363. #ifdef _DEBUG
  364. bool m_bSOFTEDGES;
  365. #endif
  366. public:
  367. void SetSOFTEDGES( int i )
  368. {
  369. Assert( i >= 0 && i <= 1 );
  370. m_nSOFTEDGES = i;
  371. #ifdef _DEBUG
  372. m_bSOFTEDGES = true;
  373. #endif
  374. }
  375. void SetSOFTEDGES( bool i )
  376. {
  377. m_nSOFTEDGES = i ? 1 : 0;
  378. #ifdef _DEBUG
  379. m_bSOFTEDGES = true;
  380. #endif
  381. }
  382. private:
  383. int m_nBUMPMASK;
  384. #ifdef _DEBUG
  385. bool m_bBUMPMASK;
  386. #endif
  387. public:
  388. void SetBUMPMASK( int i )
  389. {
  390. Assert( i >= 0 && i <= 1 );
  391. m_nBUMPMASK = i;
  392. #ifdef _DEBUG
  393. m_bBUMPMASK = true;
  394. #endif
  395. }
  396. void SetBUMPMASK( bool i )
  397. {
  398. m_nBUMPMASK = i ? 1 : 0;
  399. #ifdef _DEBUG
  400. m_bBUMPMASK = true;
  401. #endif
  402. }
  403. private:
  404. int m_nNORMAL_DECODE_MODE;
  405. #ifdef _DEBUG
  406. bool m_bNORMAL_DECODE_MODE;
  407. #endif
  408. public:
  409. void SetNORMAL_DECODE_MODE( int i )
  410. {
  411. Assert( i >= 0 && i <= 0 );
  412. m_nNORMAL_DECODE_MODE = i;
  413. #ifdef _DEBUG
  414. m_bNORMAL_DECODE_MODE = true;
  415. #endif
  416. }
  417. void SetNORMAL_DECODE_MODE( bool i )
  418. {
  419. m_nNORMAL_DECODE_MODE = i ? 1 : 0;
  420. #ifdef _DEBUG
  421. m_bNORMAL_DECODE_MODE = true;
  422. #endif
  423. }
  424. private:
  425. int m_nNORMALMASK_DECODE_MODE;
  426. #ifdef _DEBUG
  427. bool m_bNORMALMASK_DECODE_MODE;
  428. #endif
  429. public:
  430. void SetNORMALMASK_DECODE_MODE( int i )
  431. {
  432. Assert( i >= 0 && i <= 0 );
  433. m_nNORMALMASK_DECODE_MODE = i;
  434. #ifdef _DEBUG
  435. m_bNORMALMASK_DECODE_MODE = true;
  436. #endif
  437. }
  438. void SetNORMALMASK_DECODE_MODE( bool i )
  439. {
  440. m_nNORMALMASK_DECODE_MODE = i ? 1 : 0;
  441. #ifdef _DEBUG
  442. m_bNORMALMASK_DECODE_MODE = true;
  443. #endif
  444. }
  445. private:
  446. int m_nDETAIL_BLEND_MODE;
  447. #ifdef _DEBUG
  448. bool m_bDETAIL_BLEND_MODE;
  449. #endif
  450. public:
  451. void SetDETAIL_BLEND_MODE( int i )
  452. {
  453. Assert( i >= 0 && i <= 11 );
  454. m_nDETAIL_BLEND_MODE = i;
  455. #ifdef _DEBUG
  456. m_bDETAIL_BLEND_MODE = true;
  457. #endif
  458. }
  459. void SetDETAIL_BLEND_MODE( bool i )
  460. {
  461. m_nDETAIL_BLEND_MODE = i ? 1 : 0;
  462. #ifdef _DEBUG
  463. m_bDETAIL_BLEND_MODE = true;
  464. #endif
  465. }
  466. public:
  467. lightmappedgeneric_ps20_Static_Index( )
  468. {
  469. #ifdef _DEBUG
  470. m_bMASKEDBLENDING = false;
  471. #endif // _DEBUG
  472. m_nMASKEDBLENDING = 0;
  473. #ifdef _DEBUG
  474. m_bBASETEXTURE2 = false;
  475. #endif // _DEBUG
  476. m_nBASETEXTURE2 = 0;
  477. #ifdef _DEBUG
  478. m_bDETAILTEXTURE = false;
  479. #endif // _DEBUG
  480. m_nDETAILTEXTURE = 0;
  481. #ifdef _DEBUG
  482. m_bBUMPMAP = false;
  483. #endif // _DEBUG
  484. m_nBUMPMAP = 0;
  485. #ifdef _DEBUG
  486. m_bBUMPMAP2 = false;
  487. #endif // _DEBUG
  488. m_nBUMPMAP2 = 0;
  489. #ifdef _DEBUG
  490. m_bCUBEMAP = false;
  491. #endif // _DEBUG
  492. m_nCUBEMAP = 0;
  493. #ifdef _DEBUG
  494. m_bENVMAPMASK = false;
  495. #endif // _DEBUG
  496. m_nENVMAPMASK = 0;
  497. #ifdef _DEBUG
  498. m_bBASEALPHAENVMAPMASK = false;
  499. #endif // _DEBUG
  500. m_nBASEALPHAENVMAPMASK = 0;
  501. #ifdef _DEBUG
  502. m_bSELFILLUM = false;
  503. #endif // _DEBUG
  504. m_nSELFILLUM = 0;
  505. #ifdef _DEBUG
  506. m_bNORMALMAPALPHAENVMAPMASK = false;
  507. #endif // _DEBUG
  508. m_nNORMALMAPALPHAENVMAPMASK = 0;
  509. #ifdef _DEBUG
  510. m_bDIFFUSEBUMPMAP = false;
  511. #endif // _DEBUG
  512. m_nDIFFUSEBUMPMAP = 0;
  513. #ifdef _DEBUG
  514. m_bBASETEXTURENOENVMAP = false;
  515. #endif // _DEBUG
  516. m_nBASETEXTURENOENVMAP = 0;
  517. #ifdef _DEBUG
  518. m_bBASETEXTURE2NOENVMAP = false;
  519. #endif // _DEBUG
  520. m_nBASETEXTURE2NOENVMAP = 0;
  521. #ifdef _DEBUG
  522. m_bWARPLIGHTING = false;
  523. #endif // _DEBUG
  524. m_nWARPLIGHTING = 0;
  525. #ifdef _DEBUG
  526. m_bFANCY_BLENDING = false;
  527. #endif // _DEBUG
  528. m_nFANCY_BLENDING = 0;
  529. #ifdef _DEBUG
  530. m_bSEAMLESS = false;
  531. #endif // _DEBUG
  532. m_nSEAMLESS = 0;
  533. #ifdef _DEBUG
  534. m_bOUTLINE = false;
  535. #endif // _DEBUG
  536. m_nOUTLINE = 0;
  537. #ifdef _DEBUG
  538. m_bSOFTEDGES = false;
  539. #endif // _DEBUG
  540. m_nSOFTEDGES = 0;
  541. #ifdef _DEBUG
  542. m_bBUMPMASK = false;
  543. #endif // _DEBUG
  544. m_nBUMPMASK = 0;
  545. #ifdef _DEBUG
  546. m_bNORMAL_DECODE_MODE = false;
  547. #endif // _DEBUG
  548. m_nNORMAL_DECODE_MODE = 0;
  549. #ifdef _DEBUG
  550. m_bNORMALMASK_DECODE_MODE = false;
  551. #endif // _DEBUG
  552. m_nNORMALMASK_DECODE_MODE = 0;
  553. #ifdef _DEBUG
  554. m_bDETAIL_BLEND_MODE = false;
  555. #endif // _DEBUG
  556. m_nDETAIL_BLEND_MODE = 0;
  557. }
  558. int GetIndex()
  559. {
  560. // Asserts to make sure that we aren't using any skipped combinations.
  561. // Asserts to make sure that we are setting all of the combination vars.
  562. #ifdef _DEBUG
  563. bool bAllStaticVarsDefined = m_bMASKEDBLENDING && m_bBASETEXTURE2 && m_bDETAILTEXTURE && m_bBUMPMAP && m_bBUMPMAP2 && m_bCUBEMAP && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bNORMALMAPALPHAENVMAPMASK && m_bDIFFUSEBUMPMAP && m_bBASETEXTURENOENVMAP && m_bBASETEXTURE2NOENVMAP && m_bWARPLIGHTING && m_bFANCY_BLENDING && m_bSEAMLESS && m_bOUTLINE && m_bSOFTEDGES && m_bBUMPMASK && m_bNORMAL_DECODE_MODE && m_bNORMALMASK_DECODE_MODE && m_bDETAIL_BLEND_MODE;
  564. Assert( bAllStaticVarsDefined );
  565. #endif // _DEBUG
  566. return ( 48 * m_nMASKEDBLENDING ) + ( 96 * m_nBASETEXTURE2 ) + ( 192 * m_nDETAILTEXTURE ) + ( 384 * m_nBUMPMAP ) + ( 1152 * m_nBUMPMAP2 ) + ( 2304 * m_nCUBEMAP ) + ( 4608 * m_nENVMAPMASK ) + ( 9216 * m_nBASEALPHAENVMAPMASK ) + ( 18432 * m_nSELFILLUM ) + ( 36864 * m_nNORMALMAPALPHAENVMAPMASK ) + ( 73728 * m_nDIFFUSEBUMPMAP ) + ( 147456 * m_nBASETEXTURENOENVMAP ) + ( 294912 * m_nBASETEXTURE2NOENVMAP ) + ( 589824 * m_nWARPLIGHTING ) + ( 1179648 * m_nFANCY_BLENDING ) + ( 2359296 * m_nSEAMLESS ) + ( 4718592 * m_nOUTLINE ) + ( 9437184 * m_nSOFTEDGES ) + ( 18874368 * m_nBUMPMASK ) + ( 37748736 * m_nNORMAL_DECODE_MODE ) + ( 37748736 * m_nNORMALMASK_DECODE_MODE ) + ( 37748736 * m_nDETAIL_BLEND_MODE ) + 0;
  567. }
  568. };
  569. #define shaderStaticTest_lightmappedgeneric_ps20 psh_forgot_to_set_static_MASKEDBLENDING + psh_forgot_to_set_static_BASETEXTURE2 + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_BUMPMAP + psh_forgot_to_set_static_BUMPMAP2 + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_NORMALMAPALPHAENVMAPMASK + psh_forgot_to_set_static_DIFFUSEBUMPMAP + psh_forgot_to_set_static_BASETEXTURENOENVMAP + psh_forgot_to_set_static_BASETEXTURE2NOENVMAP + psh_forgot_to_set_static_WARPLIGHTING + psh_forgot_to_set_static_FANCY_BLENDING + psh_forgot_to_set_static_SEAMLESS + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_SOFTEDGES + psh_forgot_to_set_static_BUMPMASK + psh_forgot_to_set_static_NORMAL_DECODE_MODE + psh_forgot_to_set_static_NORMALMASK_DECODE_MODE + psh_forgot_to_set_static_DETAIL_BLEND_MODE + 0
  570. class lightmappedgeneric_ps20_Dynamic_Index
  571. {
  572. private:
  573. int m_nFASTPATHENVMAPCONTRAST;
  574. #ifdef _DEBUG
  575. bool m_bFASTPATHENVMAPCONTRAST;
  576. #endif
  577. public:
  578. void SetFASTPATHENVMAPCONTRAST( int i )
  579. {
  580. Assert( i >= 0 && i <= 1 );
  581. m_nFASTPATHENVMAPCONTRAST = i;
  582. #ifdef _DEBUG
  583. m_bFASTPATHENVMAPCONTRAST = true;
  584. #endif
  585. }
  586. void SetFASTPATHENVMAPCONTRAST( bool i )
  587. {
  588. m_nFASTPATHENVMAPCONTRAST = i ? 1 : 0;
  589. #ifdef _DEBUG
  590. m_bFASTPATHENVMAPCONTRAST = true;
  591. #endif
  592. }
  593. private:
  594. int m_nFASTPATH;
  595. #ifdef _DEBUG
  596. bool m_bFASTPATH;
  597. #endif
  598. public:
  599. void SetFASTPATH( int i )
  600. {
  601. Assert( i >= 0 && i <= 1 );
  602. m_nFASTPATH = i;
  603. #ifdef _DEBUG
  604. m_bFASTPATH = true;
  605. #endif
  606. }
  607. void SetFASTPATH( bool i )
  608. {
  609. m_nFASTPATH = i ? 1 : 0;
  610. #ifdef _DEBUG
  611. m_bFASTPATH = true;
  612. #endif
  613. }
  614. private:
  615. int m_nWRITEWATERFOGTODESTALPHA;
  616. #ifdef _DEBUG
  617. bool m_bWRITEWATERFOGTODESTALPHA;
  618. #endif
  619. public:
  620. void SetWRITEWATERFOGTODESTALPHA( int i )
  621. {
  622. Assert( i >= 0 && i <= 1 );
  623. m_nWRITEWATERFOGTODESTALPHA = i;
  624. #ifdef _DEBUG
  625. m_bWRITEWATERFOGTODESTALPHA = true;
  626. #endif
  627. }
  628. void SetWRITEWATERFOGTODESTALPHA( bool i )
  629. {
  630. m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
  631. #ifdef _DEBUG
  632. m_bWRITEWATERFOGTODESTALPHA = true;
  633. #endif
  634. }
  635. private:
  636. int m_nPIXELFOGTYPE;
  637. #ifdef _DEBUG
  638. bool m_bPIXELFOGTYPE;
  639. #endif
  640. public:
  641. void SetPIXELFOGTYPE( int i )
  642. {
  643. Assert( i >= 0 && i <= 1 );
  644. m_nPIXELFOGTYPE = i;
  645. #ifdef _DEBUG
  646. m_bPIXELFOGTYPE = true;
  647. #endif
  648. }
  649. void SetPIXELFOGTYPE( bool i )
  650. {
  651. m_nPIXELFOGTYPE = i ? 1 : 0;
  652. #ifdef _DEBUG
  653. m_bPIXELFOGTYPE = true;
  654. #endif
  655. }
  656. private:
  657. int m_nLIGHTING_PREVIEW;
  658. #ifdef _DEBUG
  659. bool m_bLIGHTING_PREVIEW;
  660. #endif
  661. public:
  662. void SetLIGHTING_PREVIEW( int i )
  663. {
  664. Assert( i >= 0 && i <= 2 );
  665. m_nLIGHTING_PREVIEW = i;
  666. #ifdef _DEBUG
  667. m_bLIGHTING_PREVIEW = true;
  668. #endif
  669. }
  670. void SetLIGHTING_PREVIEW( bool i )
  671. {
  672. m_nLIGHTING_PREVIEW = i ? 1 : 0;
  673. #ifdef _DEBUG
  674. m_bLIGHTING_PREVIEW = true;
  675. #endif
  676. }
  677. public:
  678. lightmappedgeneric_ps20_Dynamic_Index()
  679. {
  680. #ifdef _DEBUG
  681. m_bFASTPATHENVMAPCONTRAST = false;
  682. #endif // _DEBUG
  683. m_nFASTPATHENVMAPCONTRAST = 0;
  684. #ifdef _DEBUG
  685. m_bFASTPATH = false;
  686. #endif // _DEBUG
  687. m_nFASTPATH = 0;
  688. #ifdef _DEBUG
  689. m_bWRITEWATERFOGTODESTALPHA = false;
  690. #endif // _DEBUG
  691. m_nWRITEWATERFOGTODESTALPHA = 0;
  692. #ifdef _DEBUG
  693. m_bPIXELFOGTYPE = false;
  694. #endif // _DEBUG
  695. m_nPIXELFOGTYPE = 0;
  696. #ifdef _DEBUG
  697. m_bLIGHTING_PREVIEW = false;
  698. #endif // _DEBUG
  699. m_nLIGHTING_PREVIEW = 0;
  700. }
  701. int GetIndex()
  702. {
  703. // Asserts to make sure that we aren't using any skipped combinations.
  704. // Asserts to make sure that we are setting all of the combination vars.
  705. #ifdef _DEBUG
  706. bool bAllDynamicVarsDefined = m_bFASTPATHENVMAPCONTRAST && m_bFASTPATH && m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bLIGHTING_PREVIEW;
  707. Assert( bAllDynamicVarsDefined );
  708. #endif // _DEBUG
  709. return ( 1 * m_nFASTPATHENVMAPCONTRAST ) + ( 2 * m_nFASTPATH ) + ( 4 * m_nWRITEWATERFOGTODESTALPHA ) + ( 8 * m_nPIXELFOGTYPE ) + ( 16 * m_nLIGHTING_PREVIEW ) + 0;
  710. }
  711. };
  712. #define shaderDynamicTest_lightmappedgeneric_ps20 psh_forgot_to_set_dynamic_FASTPATHENVMAPCONTRAST + psh_forgot_to_set_dynamic_FASTPATH + psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + 0