aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03060.html
blob: 975a5befe3cb75c505699ca4b0da2e7ade37840b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NL3D::CPatchDLMContext class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CPatchDLMContext Class Reference</h1><code>#include &lt;<a class="el" href="a06164.html">patchdlm_context.h</a>&gt;</code>
<p>
<p>Inheritance diagram for NL3D::CPatchDLMContext:
<p><center><img src="a03060.png" usemap="#NL3D::CPatchDLMContext_map" border="0" alt=""></center>
<map name="NL3D::CPatchDLMContext_map">
<area href="a02718.html" alt="NL3D::CTessNodeList" shape="rect" coords="0,0,160,24">
</map>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A Dynamic LightMap (DLM) context for a patch. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00100">100</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4">TCompileType</a> { <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw2">ModulateTileColor</a> = 0, 
<a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw1">ModulateTextureFar</a>, 
<a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw0">ModulateConstant</a>, 
<a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw3">NoModulate</a>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">see <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta2">compileLighting()</a>  <a href="#NL3D_1_1CPatchDLMContextw4">More...</a><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta0">addPointLightInfluence</a> (const <a class="el" href="a03065.html">CPatchDLMPointLight</a> &amp;pl)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta1">clearLighting</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta2">compileLighting</a> (<a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4">TCompileType</a> compType, <a class="el" href="a03337.html">NLMISC::CRGBA</a> modulateCte=<a class="el" href="a03337.html#NLMISC_1_1CRGBAs6">NLMISC::CRGBA::White</a>)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta3">CPatchDLMContext</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NL3D_1_1CPatchDLMContexta3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta4">generate</a> (<a class="el" href="a03057.html">CPatch</a> *patch, <a class="el" href="a03493.html">CTextureDLM</a> *textureDLM, <a class="el" href="a03063.html">CPatchDLMContextList</a> *ctxList)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta5">getMemorySize</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03057.html">CPatch</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta6">getPatch</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta7">~CPatchDLMContext</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor: lightmap is released from _DLMTexture.  <a href="#NL3D_1_1CPatchDLMContexta7"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto0">CurPointLightCount</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto1">DLMUBias</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mapping to this rectangle from 0-1 basis.  <a href="#NL3D_1_1CPatchDLMContexto1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto2">DLMUScale</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mapping to this rectangle from 0-1 basis.  <a href="#NL3D_1_1CPatchDLMContexto2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto3">DLMVBias</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mapping to this rectangle from 0-1 basis.  <a href="#NL3D_1_1CPatchDLMContexto3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto4">DLMVScale</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mapping to this rectangle from 0-1 basis.  <a href="#NL3D_1_1CPatchDLMContexto4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto6">MaxU8</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping  <a href="#NL3D_1_1CPatchDLMContexto6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto7">MaxV8</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto8">MinU8</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping  <a href="#NL3D_1_1CPatchDLMContexto8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto9">MinV8</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02718.html">CTessNodeList</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02718.html#NL3D_1_1CVegetableSortBlocko0">Next</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto11">OldPointLightCount</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02718.html">CTessNodeList</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02718.html#NL3D_1_1CVegetableSortBlocko1">Prec</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto13">TextPosX</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto14">TextPosY</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a></td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextd0">computeTextureFar</a> ()</td></tr>

<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexth0">blendTileToTexture</a> (const <a class="el" href="a03337.html">CRGBA</a> *srcPixel, <a class="el" href="a04558.html#a14">sint</a> srcDeltaX, <a class="el" href="a04558.html#a14">sint</a> srcDeltaY, <a class="el" href="a03337.html">CRGBA</a> *dstPixel, <a class="el" href="a04558.html#a15">uint</a> dstStride)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexth1">computeTileFarSrcDeltas</a> (<a class="el" href="a04558.html#a14">sint</a> nRot, bool is256x256, <a class="el" href="a04558.html#a7">uint8</a> uvOff, const <a class="el" href="a03337.html">CRGBA</a> *srcPixel, <a class="el" href="a04558.html#a14">sint</a> &amp;srcDeltaX, <a class="el" href="a04558.html#a14">sint</a> &amp;srcDeltaY)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexth2">copyTileToTexture</a> (const <a class="el" href="a03337.html">CRGBA</a> *srcPixel, <a class="el" href="a04558.html#a14">sint</a> srcDeltaX, <a class="el" href="a04558.html#a14">sint</a> srcDeltaY, <a class="el" href="a03337.html">CRGBA</a> *dstPixel, <a class="el" href="a04558.html#a15">uint</a> dstStride)</td></tr>

<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt; <a class="el" href="a03061.html">CCluster</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bounding Sphere QuadTree (with NSkips paradigm).  <a href="#NL3D_1_1CPatchDLMContextr0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03063.html">CPatchDLMContextList</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03493.html">CTextureDLM</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The DLM texture (only one per landscape).  <a href="#NL3D_1_1CPatchDLMContextr2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr3">_IsDstTextureFullBlack</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt; <a class="el" href="a03337.html">CRGBA</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The computed lightmap: Width*Height.  <a href="#NL3D_1_1CPatchDLMContextr5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt; <a class="el" href="a04558.html#a9">uint16</a>,<br>
 false &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03057.html">CPatch</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The patch which owns us.  <a href="#NL3D_1_1CPatchDLMContextr7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt; <a class="el" href="a03337.html">CRGBA</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr8">_TextureFar</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt; <a class="el" href="a03062.html">CVertex</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bezier Patch Array information: Width*Height.  <a href="#NL3D_1_1CPatchDLMContextr9"></a><br><br></td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NL3D_1_1CPatchDLMContextw4" doxytag="NL3D::CPatchDLMContext::TCompileType" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> enum <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4">NL3D::CPatchDLMContext::TCompileType</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
see <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta2">compileLighting()</a> 
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw2" doxytag="ModulateTileColor" ></a>ModulateTileColor</em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw1" doxytag="ModulateTextureFar" ></a>ModulateTextureFar</em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw0" doxytag="ModulateConstant" ></a>ModulateConstant</em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw3" doxytag="NoModulate" ></a>NoModulate</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="a06164.html#l00111">111</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
<div class="fragment"><pre>00111 {<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw2">ModulateTileColor</a>=0, <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw1">ModulateTextureFar</a>, <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw0">ModulateConstant</a>, <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw3">NoModulate</a>};
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta3" doxytag="NL3D::CPatchDLMContext::CPatchDLMContext" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> NL3D::CPatchDLMContext::CPatchDLMContext </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor. 
<p>

<p>
Definition at line <a class="el" href="a06163.html#l00171">171</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00177">_DLMContextList</a>, <a class="el" href="a06164.html#l00175">_DLMTexture</a>, <a class="el" href="a06164.html#l00202">_IsDstTextureFullBlack</a>, <a class="el" href="a06164.html#l00200">_IsSrcTextureFullBlack</a>, <a class="el" href="a06164.html#l00128">CurPointLightCount</a>, and <a class="el" href="a06164.html#l00127">OldPointLightCount</a>.
<p>
<div class="fragment"><pre>00172 {
00173         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>= NULL;
00174         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>= NULL;
00175         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a>= NULL;
00176         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto11">OldPointLightCount</a>= 0;
00177         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto0">CurPointLightCount</a>= 0;
00178         <span class="comment">// By default there is crash in textures</span>
00179         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>= <span class="keyword">false</span>;
00180         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr3">_IsDstTextureFullBlack</a>= <span class="keyword">false</span>;
00181 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta7" doxytag="NL3D::CPatchDLMContext::~CPatchDLMContext" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> NL3D::CPatchDLMContext::~<a class="el" href="a03060.html">CPatchDLMContext</a> </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destructor: lightmap is released from _DLMTexture. 
<p>

<p>
Definition at line <a class="el" href="a06163.html#l00185">185</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00177">_DLMContextList</a>, <a class="el" href="a06164.html#l00175">_DLMTexture</a>, <a class="el" href="a06515.html#l00363">NL3D::CTextureDLM::releaseLightMap()</a>, <a class="el" href="a06496.html#l00087">NL3D::CTessList&lt; CPatchDLMContext &gt;::remove()</a>, <a class="el" href="a06164.html#l00117">TextPosX</a>, and <a class="el" href="a06164.html#l00117">TextPosY</a>.
<p>
<div class="fragment"><pre>00186 {
00187         <span class="comment">// release the lightmap in the texture</span>
00188         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>)
00189         {
00190                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;releaseLightMap(TextPosX, TextPosY);
00191         }
00192         <span class="comment">// exit</span>
00193         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>= NULL;
00194         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>= NULL;
00195 
00196         <span class="comment">// remove it from list.</span>
00197         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a>)
00198                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a>-&gt;remove(<span class="keyword">this</span>);
00199 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta0" doxytag="NL3D::CPatchDLMContext::addPointLightInfluence" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::addPointLightInfluence </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03065.html">CPatchDLMPointLight</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>pl</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Add a pointLight influence to the lighting: RAM texture is updated. NB: full src blackness is reseted.
<p>
Definition at line <a class="el" href="a06163.html#l00648">648</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00197">_Clusters</a>, <a class="el" href="a06164.html#l00200">_IsSrcTextureFullBlack</a>, <a class="el" href="a06164.html#l00183">_LightMap</a>, <a class="el" href="a06340.html#l00264">NLMISC::CRGBA::addRGBOnly()</a>, <a class="el" href="a06164.html#l00073">NL3D::CPatchDLMPointLight::AttMax</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a06164.html#l00059">NL3D::CPatchDLMPointLight::B</a>, <a class="el" href="a06164.html#l00081">NL3D::CPatchDLMPointLight::BSphere</a>, <a class="el" href="a06164.html#l00069">NL3D::CPatchDLMPointLight::CosMin</a>, <a class="el" href="a06164.html#l00065">NL3D::CPatchDLMPointLight::Dir</a>, <a class="el" href="a06163.html#l00641">NL3D::fastClamp01()</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06164.html#l00059">NL3D::CPatchDLMPointLight::G</a>, <a class="el" href="a06164.html#l00061">NL3D::CPatchDLMPointLight::IsSpot</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a06163.html#l00208">NL_DLM_CLIP_FACTOR</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06682.html#l00115">NLMISC::CVector::norm()</a>, <a class="el" href="a06164.html#l00107">NL3D::CPatchDLMContext::CVertex::Normal</a>, <a class="el" href="a06164.html#l00077">NL3D::CPatchDLMPointLight::OOAttDelta</a>, <a class="el" href="a06164.html#l00071">NL3D::CPatchDLMPointLight::OOCosDelta</a>, <a class="el" href="a05701.html#l00138">NLMISC::OptFastFloor24()</a>, <a class="el" href="a05701.html#l00136">NLMISC::OptFastFloorBegin24()</a>, <a class="el" href="a05701.html#l00137">NLMISC::OptFastFloorEnd24()</a>, <a class="el" href="a06164.html#l00063">NL3D::CPatchDLMPointLight::Pos</a>, <a class="el" href="a06164.html#l00106">NL3D::CPatchDLMContext::CVertex::Pos</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a06164.html#l00059">NL3D::CPatchDLMPointLight::R</a>, <a class="el" href="a05646.html#l00993">r</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CCluster &gt;::size()</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CRGBA &gt;::size()</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CVertex &gt;::size()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
Referenced by <a class="el" href="a06157.html#l02021">NL3D::CPatch::processDLMLight()</a>.
<p>
<div class="fragment"><pre>00649 {
00650         <a class="code" href="a04558.html#a15">uint</a>            nverts= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>();
00651         <a class="code" href="a04199.html#a6">nlassert</a>(nverts==<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>());
00652 
00653         <span class="keywordflow">if</span>(nverts==0)
00654                 <span class="keywordflow">return</span>;
00655         CVertex         *vert= &amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a>[0];
00656 
00657 
00658         <span class="comment">// precise clip: parse the quadTree of sphere</span>
00659         <span class="comment">//================</span>
00660         <a class="code" href="a04558.html#a15">uint</a>    i, <a class="code" href="a04223.html#a572">x</a>,<a class="code" href="a04223.html#a573">y</a>;
00661         <a class="code" href="a04558.html#a15">uint</a>    startX, startY, endX, endY;
00662         startX= 0xFFFFFFFF;
00663         startY= 0xFFFFFFFF;
00664         endX= 0;
00665         endY= 0;
00666         <span class="keywordflow">for</span>(i=0;i&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>();)
00667         {
00668                 <span class="comment">// If the sphere intersect pl, </span>
00669                 <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[i].BSphere.intersect(pl.BSphere) )
00670                 {
00671                         <span class="comment">// if this cluster is a leaf, extend start/end</span>
00672                         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[i].NSkips==0)
00673                         {
00674                                 <a class="code" href="a04223.html#a572">x</a>= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[i].X;
00675                                 <a class="code" href="a04223.html#a573">y</a>= _Clusters[i].Y;
00676                                 startX= <a class="code" href="a04061.html#a0">min</a>(startX, x);
00677                                 startY= <a class="code" href="a04061.html#a0">min</a>(startY, y);
00678                                 endX= max(endX, x+1);
00679                                 endY= max(endY, y+1);
00680                         }
00681                         <span class="comment">// go to next cluster (a brother, a parent or a son)</span>
00682                         i++;
00683                 }
00684                 <span class="keywordflow">else</span>
00685                 {
00686                         <span class="comment">// if this cluster is a leaf, just go to next cluster (a parent or a brother)</span>
00687                         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[i].NSkips==0)
00688                                 i++;
00689                         <span class="comment">// else, go to next brother or parent (NSkips say how to go)</span>
00690                         <span class="keywordflow">else</span>
00691                                 i+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[i].NSkips;
00692                 }
00693         }
00694         <span class="comment">// if never intersect, just quit.</span>
00695         <span class="keywordflow">if</span>(startX==0xFFFFFFFF)
00696                 <span class="keywordflow">return</span>;
00697 
00698         <span class="comment">// get vertices in array to process.</span>
00699         startX*=<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a>;
00700         startY*=<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a>;
00701         endX= <a class="code" href="a04061.html#a0">min</a>(endX*NL_DLM_CLIP_FACTOR+1, Width);
00702         endY= <a class="code" href="a04061.html#a0">min</a>(endY*NL_DLM_CLIP_FACTOR+1, Height);
00703 
00704         <span class="comment">// TestYoyo only.</span>
00705         <span class="comment">/*extern uint YOYO_LandDLCount;</span>
00706 <span class="comment">        YOYO_LandDLCount+= (endX - startX) * (endY - startY);*/</span>
00707         
00708         <span class="comment">// process all vertices</span>
00709         <span class="comment">//================</span>
00710         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a628">r</a>,g,b;
00711         <a class="code" href="a03337.html">CRGBA</a>   *dst= &amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>[0];
00712         CVertex         *originVert= vert;
00713         <a class="code" href="a03337.html">CRGBA</a>           *originDst= dst;
00714 
00715         <span class="comment">// TestYoyo: finally, precache does not seems to impact final result.</span>
00716         <span class="comment">// precache loading, for better cache use. NB: precache the entire line, ignoring clip result.</span>
00717         <span class="comment">// Precache only if interesting.</span>
00718         <span class="comment">/*if( (endX - startX)*4&gt;=Width &amp;&amp; (endY-startY)&gt;=2)</span>
00719 <span class="comment">        {</span>
00720 <span class="comment">                vert= originVert + startY*Width;</span>
00721 <span class="comment">                dst= originDst + startY*Width;</span>
00722 <span class="comment">                uint    nPixelLine= (endY-startY)*Width;</span>
00723 <span class="comment">                CFastMem::precacheBest(vert, nPixelLine * sizeof(CVertex));</span>
00724 <span class="comment">                CFastMem::precacheBest(dst, nPixelLine * sizeof(CRGBA));</span>
00725 <span class="comment">        }*/</span>
00726 
00727         <span class="comment">// Start 24 precision, for faster compute.</span>
00728         <a class="code" href="a05378.html#a399">OptFastFloorBegin24</a>();
00729 
00730         <span class="comment">// If the pointLight is a spot, compute is more complex/slower</span>
00731         <span class="keywordflow">if</span>(pl.IsSpot)
00732         {
00733                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=startY; <a class="code" href="a04223.html#a573">y</a>&lt;endY; <a class="code" href="a04223.html#a573">y</a>++)
00734                 {
00735                         nverts= endX - startX;
00736 
00737                         vert= originVert + startX + <a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>;
00738                         dst= originDst + startX + <a class="code" href="a04223.html#a573">y</a>*Width;
00739                         <span class="keywordflow">for</span>(;nverts&gt;0; nverts--, vert++, dst++)
00740                         {
00741                                 CVector dirToP= vert-&gt;Pos - pl.Pos;
00742                                 <span class="keywordtype">float</span>   dist= dirToP.norm();
00743                                 dirToP/= dist;
00744 
00745                                 <span class="comment">// compute cos for pl. attenuation</span>
00746                                 <span class="keywordtype">float</span>   cosSpot= dirToP * pl.Dir;
00747                                 <span class="keywordtype">float</span>   attSpot= (cosSpot-pl.CosMin) * pl.OOCosDelta;
00748                                 <a class="code" href="a05363.html#a454">fastClamp01</a>(attSpot);
00749 
00750                                 <span class="comment">// distance attenuation</span>
00751                                 <span class="keywordtype">float</span>   attDist= (dist-pl.AttMax) * pl.OOAttDelta;
00752                                 <a class="code" href="a05363.html#a454">fastClamp01</a>(attDist);
00753 
00754                                 <span class="comment">// compute diffuse lighting</span>
00755                                 <span class="keywordtype">float</span>   diff= -(vert-&gt;Normal * dirToP);
00756                                 <a class="code" href="a05363.html#a454">fastClamp01</a>(diff);
00757                                 
00758                                 <span class="comment">// compute colors.</span>
00759                                 diff*= attSpot * attDist;
00760                                 <a class="code" href="a04223.html#a628">r</a>= pl.R*diff;
00761                                 g= pl.G*diff;
00762                                 b= pl.B*diff;
00763 
00764                                 <a class="code" href="a03337.html">CRGBA</a>   col;
00765                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(r);
00766                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(g);
00767                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(b);
00768 
00769                                 <span class="comment">// add to map.</span>
00770 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00771 <span class="preprocessor"></span>                                <span class="comment">// Fast AddClamp.</span>
00772                                 __asm
00773                                 {
00774                                         mov     esi, dst
00775 
00776                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>
00777                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>
00778                                         sbb     cl, cl
00779                                         or      al, cl
00780                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>, al
00781 
00782                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>
00783                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>
00784                                         sbb     cl, cl
00785                                         or      al, cl
00786                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>, al
00787 
00788                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>
00789                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>
00790                                         sbb     cl, cl
00791                                         or      al, cl
00792                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>, al
00793                                 }
00794 <span class="preprocessor">#else</span>
00795 <span class="preprocessor"></span>                                <span class="comment">// add and clamp to map.</span>
00796                                 dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_0">addRGBOnly</a>(*dst, col);
00797 <span class="preprocessor">#endif</span>
00798 <span class="preprocessor"></span>                        }
00799                 }
00800         }
00801         <span class="comment">// else, pointLight with no Spot cone attenuation</span>
00802         <span class="keywordflow">else</span>
00803         {
00804                 <span class="comment">// TestYoyo</span>
00805                 <span class="comment">/*extern        void    YOYO_startDLMItCount();</span>
00806 <span class="comment">                YOYO_startDLMItCount();*/</span>
00807 
00808                 <span class="comment">// Compute lightmap pixels of interest </span>
00809                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=startY; <a class="code" href="a04223.html#a573">y</a>&lt;endY; <a class="code" href="a04223.html#a573">y</a>++)
00810                 {
00811                         nverts= endX - startX;
00812 
00813                         vert= originVert + startX + <a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>;
00814                         dst= originDst + startX + <a class="code" href="a04223.html#a573">y</a>*Width;
00815                         <span class="keywordflow">for</span>(;nverts&gt;0; nverts--, vert++, dst++)
00816                         {
00817                                 CVector dirToP= vert-&gt;Pos - pl.Pos;
00818                                 <span class="keywordtype">float</span>   dist= dirToP.norm();
00819                                 <span class="keywordtype">float</span>   OODist= 1.0f / dist;
00820                                 dirToP*= OODist;
00821 
00822                                 <span class="comment">// distance attenuation</span>
00823                                 <span class="keywordtype">float</span>   attDist= (dist-pl.AttMax) * pl.OOAttDelta;
00824                                 <a class="code" href="a05363.html#a454">fastClamp01</a>(attDist);
00825 
00826                                 <span class="comment">// compute diffuse lighting</span>
00827                                 <span class="keywordtype">float</span>   diff= -(vert-&gt;Normal * dirToP);
00828                                 <a class="code" href="a05363.html#a454">fastClamp01</a>(diff);
00829                                 
00830                                 <span class="comment">// compute colors.</span>
00831                                 diff*= attDist;
00832                                 <a class="code" href="a04223.html#a628">r</a>= pl.R*diff;
00833                                 g= pl.G*diff;
00834                                 b= pl.B*diff;
00835 
00836                                 <a class="code" href="a03337.html">CRGBA</a>   col;
00837                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(r);
00838                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(g);
00839                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a401">OptFastFloor24</a>(b);
00840 
00841                                 <span class="comment">// add to map.</span>
00842 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00843 <span class="preprocessor"></span>                                <span class="comment">// Fast AddClamp.</span>
00844                                 __asm
00845                                 {
00846                                         mov     esi, dst
00847 
00848                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>
00849                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>
00850                                         sbb     cl, cl
00851                                         or      al, cl
00852                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>, al
00853 
00854                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>
00855                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>
00856                                         sbb     cl, cl
00857                                         or      al, cl
00858                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>, al
00859 
00860                                         mov     al, [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>
00861                                         add     al, col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>
00862                                         sbb     cl, cl
00863                                         or      al, cl
00864                                         mov     [esi]dst.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>, al
00865                                 }
00866 <span class="preprocessor">#else</span>
00867 <span class="preprocessor"></span>                                <span class="comment">// add and clamp to map.</span>
00868                                 dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_0">addRGBOnly</a>(*dst, col);
00869 <span class="preprocessor">#endif</span>
00870 <span class="preprocessor"></span>                        }
00871                 }
00872 
00873                 <span class="comment">// TestYoyo</span>
00874                 <span class="comment">/*extern        void    YOYO_endDLMItCount();</span>
00875 <span class="comment">                YOYO_endDLMItCount();*/</span>
00876         }
00877 
00878         <span class="comment">// Stop 24 bit precision</span>
00879         <a class="code" href="a05378.html#a400">OptFastFloorEnd24</a>();
00880 
00881         <span class="comment">// Src texture is modified, hence it can't be black.</span>
00882         <span class="comment">//==============</span>
00883         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>= <span class="keyword">false</span>;
00884 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexth0" doxytag="NL3D::CPatchDLMContext::blendTileToTexture" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::blendTileToTexture </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>srcPixel</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaX</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaY</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>dstPixel</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>dstStride</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06163.html#l01237">1237</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06340.html#l00227">NLMISC::CRGBA::blendFromuiRGBOnly()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05646.html#l01124">src</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00964">computeTextureFar()</a>.
<p>
<div class="fragment"><pre>01238 {
01239         <span class="comment">// blend the 2x2 tile with the texture.</span>
01240         <a class="code" href="a03337.html">CRGBA</a>   *dst;
01241         <a class="code" href="a03337.html">CRGBA</a>   <a class="code" href="a04223.html#a652">src</a>;
01242 
01243         <span class="comment">// first line.</span>
01244         dst= &amp;dstPixel[0]; <a class="code" href="a04223.html#a652">src</a>= srcPixel[0];
01245         dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_3">blendFromuiRGBOnly</a>(*dst, src, <a class="code" href="a04223.html#a652">src</a>.A);
01246 
01247         dst= &amp;dstPixel[1]; <a class="code" href="a04223.html#a652">src</a>= srcPixel[srcDeltaX];
01248         dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_3">blendFromuiRGBOnly</a>(*dst, src, <a class="code" href="a04223.html#a652">src</a>.A);
01249 
01250         <span class="comment">// second line.</span>
01251         dst= &amp;dstPixel[0+dstStride]; <a class="code" href="a04223.html#a652">src</a>= srcPixel[srcDeltaY];
01252         dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_3">blendFromuiRGBOnly</a>(*dst, src, <a class="code" href="a04223.html#a652">src</a>.A);
01253 
01254         dst= &amp;dstPixel[1+dstStride]; <a class="code" href="a04223.html#a652">src</a>= srcPixel[srcDeltaY+srcDeltaX];
01255         dst-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAz2022_3">blendFromuiRGBOnly</a>(*dst, src, <a class="code" href="a04223.html#a652">src</a>.A);
01256 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta1" doxytag="NL3D::CPatchDLMContext::clearLighting" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::clearLighting </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Fill texture space with Black: RAM texture is updated. NB: full src blackness is cached.
<p>
Definition at line <a class="el" href="a06163.html#l00592">592</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00200">_IsSrcTextureFullBlack</a>, <a class="el" href="a06164.html#l00183">_LightMap</a>, <a class="el" href="a05646.html#l00240">count</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CRGBA &gt;::size()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06157.html#l02005">NL3D::CPatch::beginDLMLighting()</a>, and <a class="el" href="a06163.html#l00214">generate()</a>.
<p>
<div class="fragment"><pre>00593 {
00594         <span class="comment">// If the srcTexture is not already black.</span>
00595         <span class="keywordflow">if</span>(!<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>)
00596         {
00597                 <span class="comment">// Reset Lightmap with black.</span>
00598                 <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a577">count</a>= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>();
00599                 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a577">count</a>&gt;0)
00600                 {
00601                         memset(&amp;_LightMap[0], 0, count * <span class="keyword">sizeof</span>(<a class="code" href="a03337.html">CRGBA</a>));
00602                 }
00603 
00604                 <span class="comment">// Now the src lightmap is fully black</span>
00605                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>= <span class="keyword">true</span>;
00606         }
00607 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta2" doxytag="NL3D::CPatchDLMContext::compileLighting" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::compileLighting </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4">TCompileType</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>compType</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03337.html">NLMISC::CRGBA</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>modulateCte</em> = <a class="el" href="a03337.html#NLMISC_1_1CRGBAs6">NLMISC::CRGBA::White</a></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
update VRAM texture with RAM texture. Uploaded in 16 bits format. NB: full dst blackness is cached. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>compType</em>&nbsp;</td><td>say if, before writing to the texture, the lightmap is modulated with _Patch TileColor, _Patch textureFar (precomputed in the context), modulate with a constant or not modulated at all </td></tr>
    <tr><td valign=top><em>modulateCte</em>&nbsp;</td><td>used only if compType==ModulateConstant. this is the cte to be modulate by lightmap before copy to texture</td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="a06163.html#l00888">888</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00175">_DLMTexture</a>, <a class="el" href="a06164.html#l00202">_IsDstTextureFullBlack</a>, <a class="el" href="a06164.html#l00200">_IsSrcTextureFullBlack</a>, <a class="el" href="a06164.html#l00183">_LightMap</a>, <a class="el" href="a06164.html#l00208">_LowResTileColors</a>, <a class="el" href="a06164.html#l00215">_TextureFar</a>, <a class="el" href="a06515.html#l00241">NL3D::CTextureDLM::copyRect()</a>, <a class="el" href="a06515.html#l00257">NL3D::CTextureDLM::fillRect()</a>, <a class="el" href="a06515.html#l00273">NL3D::CTextureDLM::modulateAndfillRect565()</a>, <a class="el" href="a06515.html#l00305">NL3D::CTextureDLM::modulateAndfillRect8888()</a>, <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw0">ModulateConstant</a>, <a class="el" href="a06515.html#l00335">NL3D::CTextureDLM::modulateConstantAndfillRect()</a>, <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw1">ModulateTextureFar</a>, <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw2">ModulateTileColor</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CRGBA &gt;::size()</a>, <a class="el" href="a06164.html#l00117">TextPosX</a>, <a class="el" href="a06164.html#l00117">TextPosY</a>, <a class="el" href="a06156.html#l00343">NL3D::CPatch::TileColors</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
Referenced by <a class="el" href="a05862.html#l00939">NL3D::CLandscape::render()</a>.
<p>
<div class="fragment"><pre>00889 {
00890         <span class="comment">// If srcTexture is full black, and if dst texture is already full black too, don't need to update dst texture</span>
00891         <span class="keywordflow">if</span>(! (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a> &amp;&amp; <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr3">_IsDstTextureFullBlack</a>) )
00892         {
00893                 <span class="comment">// if lightMap allocated</span>
00894                 <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>()&gt;0 &amp;&amp; <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>)
00895                 {
00896                         <span class="comment">// If the srcTexture is full black (ie no pointLight influence touch it), </span>
00897                         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>)
00898                         {
00899                                 <span class="comment">// reset the texture to full black.</span>
00900                                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;fillRect(TextPosX, TextPosY, Width, Height, 0);
00901                         }
00902                         <span class="comment">// else the srcTexture is not full black (ie some pointLight influence touch it), </span>
00903                         <span class="keywordflow">else</span>
00904                         {
00905                                 <span class="comment">// if must modulate with tileColor</span>
00906                                 <span class="keywordflow">if</span>(compType == <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw2">ModulateTileColor</a>)
00907                                 {
00908                                         <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors.size()&gt;=0);
00909 <span class="preprocessor">                                        #ifdef NL_DLM_TILE_RES</span>
00910 <span class="preprocessor"></span>                                        <span class="comment">// retrieve userColor pointer.</span>
00911                                         <a class="code" href="a04558.html#a9">uint16</a>  *tileColor= (<a class="code" href="a04558.html#a9">uint16</a>*)(&amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors[0]);
00912 <span class="preprocessor">                                        #else</span>
00913 <span class="preprocessor"></span>                                        <a class="code" href="a04558.html#a9">uint16</a>  *tileColor= (<a class="code" href="a04558.html#a9">uint16</a>*)(&amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a>[0]);
00914 <span class="preprocessor">                                        #endif</span>
00915 <span class="preprocessor"></span>
00916                                         <span class="comment">// modulate and fill dest.</span>
00917                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;modulateAndfillRect565(TextPosX, TextPosY, Width, Height, &amp;_LightMap[0], tileColor);
00918                                 }
00919                                 <span class="comment">// else if must modulate with textureFar</span>
00920                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(compType == <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw1">ModulateTextureFar</a>)
00921                                 {
00922                                         <span class="comment">// modulate and fill dest.</span>
00923                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;modulateAndfillRect8888(TextPosX, TextPosY, Width, Height, &amp;_LightMap[0], &amp;_TextureFar[0]);
00924                                 }
00925                                 <span class="comment">// else if must modulate with constante</span>
00926                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(compType == <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextw4NL3D_1_1CPatchDLMContextw0">ModulateConstant</a>)
00927                                 {
00928                                         <span class="comment">// modulate and fill dest.</span>
00929                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;modulateConstantAndfillRect(TextPosX, TextPosY, Width, Height, &amp;_LightMap[0], modulateCte);
00930                                 }
00931                                 <span class="comment">// else, no Modulate.</span>
00932                                 <span class="keywordflow">else</span>
00933                                 {
00934                                         <span class="comment">// just copy lightmap to texture</span>
00935                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;copyRect(TextPosX, TextPosY, Width, Height, &amp;_LightMap[0]);
00936                                 }
00937                         }
00938                 }
00939 
00940 
00941                 <span class="comment">// copy full black state</span>
00942                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr3">_IsDstTextureFullBlack</a>= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr4">_IsSrcTextureFullBlack</a>;
00943         }
00944 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextd0" doxytag="NL3D::CPatchDLMContext::computeTextureFar" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::computeTextureFar </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06163.html#l00964">964</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00208">_LowResTileColors</a>, <a class="el" href="a06164.html#l00215">_TextureFar</a>, <a class="el" href="a06163.html#l01237">blendTileToTexture()</a>, <a class="el" href="a06163.html#l01140">computeTileFarSrcDeltas()</a>, <a class="el" href="a06163.html#l01224">copyTileToTexture()</a>, <a class="el" href="a06155.html#l02186">NL3D::CPatch::getLandscape()</a>, <a class="el" href="a06156.html#l00392">NL3D::CPatch::getOrderS()</a>, <a class="el" href="a06156.html#l00393">NL3D::CPatch::getOrderT()</a>, <a class="el" href="a06543.html#l00077">NL3D::CTileFarBank::CTileFar::getPixels()</a>, <a class="el" href="a06543.html#l00129">NL3D::CTileFarBank::getTile()</a>, <a class="el" href="a06540.html#l00064">NL3D::CTileElement::getTile256Info()</a>, <a class="el" href="a06540.html#l00046">NL3D::CTileElement::getTileOrient()</a>, <a class="el" href="a06543.html#l00083">NL3D::CTileFarBank::CTileFar::isFill()</a>, <a class="el" href="a06541.html#l00053">NL_TILE_ELM_LAYER_EMPTY</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector&lt; CRGBA &gt;::resize()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05646.html#l01124">src</a>, <a class="el" href="a06541.html#l00077">NL3D::CTileElement::Tile</a>, <a class="el" href="a06156.html#l00343">NL3D::CPatch::TileColors</a>, <a class="el" href="a05863.html#l00146">NL3D::CLandscape::TileFarBank</a>, <a class="el" href="a06156.html#l00340">NL3D::CPatch::Tiles</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00214">generate()</a>.
<p>
<div class="fragment"><pre>00965 {
00966         <span class="comment">// First compute Far at order1 Level (ie 2x2 pixels per tiles).</span>
00967         <span class="comment">//==================</span>
00968         <span class="keyword">static</span>  vector&lt;CRGBA&gt;   tileFars;
00969         <span class="comment">// Get the FarBank from landscape.</span>
00970         CTileFarBank    &amp;farBank= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getLandscape()-&gt;TileFarBank;
00971         <span class="comment">// size of the texture.</span>
00972         <a class="code" href="a04558.html#a15">uint</a>    os= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS();
00973         <a class="code" href="a04558.html#a15">uint</a>    ot= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderT();
00974         <span class="comment">// resize tmp texture. keep a border of 1 pixel around this texture (for average with border)</span>
00975         <a class="code" href="a04558.html#a15">uint</a>    tfWidth= os*2+2;
00976         <a class="code" href="a04558.html#a15">uint</a>    tfHeight= ot*2+2;
00977         <a class="code" href="a04558.html#a15">uint</a>    tfSize= tfWidth * tfHeight;
00978         tileFars.resize(tfSize);
00979         <a class="code" href="a03337.html">CRGBA</a>   *dst= &amp;tileFars[0];
00980 
00981         <span class="comment">// default: fill dst with black (for possible non-existing tiles).</span>
00982         memset(dst, 0, tfSize*<span class="keyword">sizeof</span>(<a class="code" href="a03337.html">CRGBA</a>));
00983 
00984         <span class="comment">// For all tiles.</span>
00985         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>;
00986         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a>&lt;ot; <a class="code" href="a04223.html#a573">y</a>++)
00987         {
00988                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;os;<a class="code" href="a04223.html#a572">x</a>++)
00989                 {
00990                         <span class="comment">// get the tile from patch.</span>
00991                         CTileElement    &amp;tileElm= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;Tiles[<a class="code" href="a04223.html#a573">y</a>*os + <a class="code" href="a04223.html#a572">x</a>];
00992 
00993                         <span class="comment">// For all layers</span>
00994                         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a05373.html#a2">l</a>=0; <a class="code" href="a05373.html#a2">l</a>&lt;3;<a class="code" href="a05373.html#a2">l</a>++)
00995                         {
00996                                 <a class="code" href="a04558.html#a9">uint16</a>          tileId= tileElm.Tile[0];
00997                                 <span class="keywordflow">if</span> (tileId!=<a class="code" href="a05118.html#a12">NL_TILE_ELM_LAYER_EMPTY</a>)
00998                                 {
00999                                         <span class="comment">// Get the read only pointer on the far tile</span>
01000                                         <span class="keyword">const</span> CTileFarBank::CTileFar*   pTile= farBank.getTile (tileId);
01001                                         <span class="comment">// if exist.</span>
01002                                         <span class="keywordflow">if</span>(pTile &amp;&amp; pTile-&gt;isFill (CTileFarBank::diffuse))
01003                                         {
01004                                                 <span class="comment">// get tile element information.</span>
01005                                                 <a class="code" href="a04558.html#a14">sint</a>    nRot= tileElm.getTileOrient(l);
01006                                                 <span class="keywordtype">bool</span>    is256x256;
01007                                                 <a class="code" href="a04558.html#a7">uint8</a>   uvOff;
01008                                                 tileElm.getTile256Info(is256x256, uvOff);
01009 
01010                                                 <span class="comment">// compute src pixel</span>
01011                                                 <span class="keyword">const</span> <a class="code" href="a03337.html">CRGBA</a>     *srcPixel= pTile-&gt;getPixels(CTileFarBank::diffuse, CTileFarBank::order1);
01012                                                 <span class="comment">// compute src info, for this tile rot and 256x256 context.</span>
01013                                                 <a class="code" href="a04558.html#a14">sint</a> srcDeltaX;
01014                                                 <a class="code" href="a04558.html#a14">sint</a> srcDeltaY;
01015                                                 srcPixel= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexth1">computeTileFarSrcDeltas</a>(nRot, is256x256, uvOff, srcPixel, srcDeltaX, srcDeltaY);
01016 
01017                                                 <span class="comment">// compute dst coordinate. start writing at pixel (1,1)</span>
01018                                                 <a class="code" href="a03337.html">CRGBA</a>   *dstPixel= dst + (<a class="code" href="a04223.html#a573">y</a>*2+1)*tfWidth + <a class="code" href="a04223.html#a572">x</a>*2+1;
01019 
01020                                                 <span class="keywordflow">if</span>(<a class="code" href="a05373.html#a2">l</a>==0)
01021                                                 {
01022                                                         <span class="comment">// copy the tile content to the texture.</span>
01023                                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexth2">copyTileToTexture</a>(srcPixel, srcDeltaX, srcDeltaY, dstPixel, tfWidth);
01024                                                 }
01025                                                 <span class="keywordflow">else</span>
01026                                                 {
01027                                                         <span class="comment">// blend the tile content to the texture.</span>
01028                                                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexth0">blendTileToTexture</a>(srcPixel, srcDeltaX, srcDeltaY, dstPixel, tfWidth);
01029                                                 }
01030                                         }
01031                                         <span class="keywordflow">else</span>
01032                                                 <span class="comment">// go to next tile.</span>
01033                                                 <span class="keywordflow">break</span>;
01034                                 }
01035                                 <span class="keywordflow">else</span>
01036                                         <span class="comment">// go to next tile.</span>
01037                                         <span class="keywordflow">break</span>;
01038                         }
01039                 }
01040         }
01041 
01042         <span class="comment">/* copy borders pixels from border of current patch</span>
01043 <span class="comment">                NB: this is not correct, but visually sufficient.</span>
01044 <span class="comment">                To look on neighbor would be more complex.</span>
01045 <span class="comment">        */</span>
01046 
01047         <span class="comment">// copy lines up and down.</span>
01048         <a class="code" href="a04223.html#a573">y</a>= tfHeight-1;
01049         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=1;<a class="code" href="a04223.html#a572">x</a>&lt;tfWidth-1;<a class="code" href="a04223.html#a572">x</a>++)
01050         {
01051                 <span class="comment">// copy line 0 from line 1.</span>
01052                 dst[0*tfWidth + <a class="code" href="a04223.html#a572">x</a>]= dst[1*tfWidth + <a class="code" href="a04223.html#a572">x</a>];
01053                 <span class="comment">// copy last line from last line-1.</span>
01054                 dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + <a class="code" href="a04223.html#a572">x</a>]= dst[(<a class="code" href="a04223.html#a573">y</a>-1)*tfWidth + <a class="code" href="a04223.html#a572">x</a>];
01055         }
01056 
01057         <span class="comment">// copy column left and right</span>
01058         <a class="code" href="a04223.html#a572">x</a>= tfWidth-1;
01059         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=1;<a class="code" href="a04223.html#a573">y</a>&lt;tfHeight-1;<a class="code" href="a04223.html#a573">y</a>++)
01060         {
01061                 <span class="comment">// copy column 0 from column 1.</span>
01062                 dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + 0]= dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + 1];
01063                 <span class="comment">// copy last column from last column-1.</span>
01064                 dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + <a class="code" href="a04223.html#a572">x</a>]= dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + <a class="code" href="a04223.html#a572">x</a>-1];
01065         }
01066 
01067         <span class="comment">// copy 4 corners</span>
01068         <a class="code" href="a04223.html#a572">x</a>= tfWidth-1;
01069         <a class="code" href="a04223.html#a573">y</a>= tfHeight-1;
01070         <span class="comment">// top-left corner</span>
01071         dst[0]= dst[1];
01072         <span class="comment">// top-right corner</span>
01073         dst[<a class="code" href="a04223.html#a572">x</a>]= dst[<a class="code" href="a04223.html#a572">x</a>-1];
01074         <span class="comment">// bottom-left corner</span>
01075         dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + 0]= dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + 1];
01076         <span class="comment">// bottom-right corner</span>
01077         dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + <a class="code" href="a04223.html#a572">x</a>]= dst[<a class="code" href="a04223.html#a573">y</a>*tfWidth + <a class="code" href="a04223.html#a572">x</a>-1];
01078 
01079 
01080         <span class="comment">// Average to DLM resolution (ie OrderS+1, OrderT+1)</span>
01081         <span class="comment">//==================</span>
01082         <span class="comment">// resize _TextureFar.</span>
01083         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr8">_TextureFar</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1982_1">resize</a>(Width*Height);
01084         <a class="code" href="a03337.html">CRGBA</a>   *<a class="code" href="a04223.html#a652">src</a>= &amp;tileFars[0];
01085         dst= &amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr8">_TextureFar</a>[0];
01086 
01087         <span class="comment">// for all pixels of dst texture.</span>
01088         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>;<a class="code" href="a04223.html#a573">y</a>++)
01089         {
01090                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>;<a class="code" href="a04223.html#a572">x</a>++, dst++)
01091                 {
01092                         <span class="comment">// compute coordinate in tileFars.</span>
01093                         <a class="code" href="a04558.html#a15">uint</a>    x2, y2;
01094 <span class="preprocessor">#ifdef  NL_DLM_TILE_RES</span>
01095 <span class="preprocessor"></span>                        x2= <a class="code" href="a04223.html#a572">x</a> * 2;
01096                         y2= <a class="code" href="a04223.html#a573">y</a> * 2;
01097 <span class="preprocessor">#else</span>
01098 <span class="preprocessor"></span>                        <span class="comment">// easiest method: sample every 2 tiles.</span>
01099                         x2= <a class="code" href="a04223.html#a572">x</a> * 4;
01100                         y2= <a class="code" href="a04223.html#a573">y</a> * 4;
01101 <span class="preprocessor">#endif</span>
01102 <span class="preprocessor"></span>
01103                         <span class="comment">// Average the 4 pixels around this tile corner</span>
01104                         dst-&gt;avg4RGBOnly(src[y2*tfWidth + x2], 
01105                                 src[y2*tfWidth + x2+1], 
01106                                 src[(y2+1)*tfWidth + x2], 
01107                                 src[(y2+1)*tfWidth + x2+1]);
01108                 }
01109         }
01110 
01111 
01112         <span class="comment">// Modulate result with TileColors.</span>
01113         <span class="comment">//==================</span>
01114         <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors.size()&gt;=0);
01115 <span class="preprocessor">        #ifdef NL_DLM_TILE_RES</span>
01116 <span class="preprocessor"></span>        <span class="comment">// retrieve userColor pointer.</span>
01117         <a class="code" href="a04558.html#a9">uint16</a>  *tileColor= (<a class="code" href="a04558.html#a9">uint16</a>*)(&amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors[0]);
01118 <span class="preprocessor">        #else</span>
01119 <span class="preprocessor"></span>        <a class="code" href="a04558.html#a9">uint16</a>  *tileColor= (<a class="code" href="a04558.html#a9">uint16</a>*)(&amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a>[0]);
01120 <span class="preprocessor">        #endif</span>
01121 <span class="preprocessor"></span>
01122         <span class="comment">// For all pixels</span>
01123         dst= &amp;_TextureFar[0];
01124         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> n= Width*Height; n&gt;0; n--, dst++, tileColor++)
01125         {
01126                 <a class="code" href="a04558.html#a9">uint16</a>  tc= *tileColor;
01127                 <span class="comment">// modulate R.</span>
01128                 dst-&gt;R= ( (tc&gt;&gt;11) * dst-&gt;R)&gt;&gt;5;
01129                 <span class="comment">// modulate G.</span>
01130                 dst-&gt;G= (((tc&gt;&gt;5)&amp;63) * dst-&gt;G)&gt;&gt;6;
01131                 <span class="comment">// modulate B.</span>
01132                 dst-&gt;B= ( (tc&amp;31) * dst-&gt;B)&gt;&gt;5;
01133         }
01134 
01135 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexth1" doxytag="NL3D::CPatchDLMContext::computeTileFarSrcDeltas" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const <a class="el" href="a03337.html">CRGBA</a> * NL3D::CPatchDLMContext::computeTileFarSrcDeltas </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>nRot</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>is256x256</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>uvOff</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>srcPixel</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaX</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaY</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06163.html#l01140">1140</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00964">computeTextureFar()</a>.
<p>
<div class="fragment"><pre>01141 {
01142         <span class="comment">// NB: code copied from CTextureFar::rebuildRectangle()</span>
01143 
01144         <span class="comment">// The tileSize at order1 is 2.</span>
01145         <a class="code" href="a04558.html#a15">uint</a>    tileSize= 2;
01146 
01147         <span class="comment">// Source size</span>
01148         <a class="code" href="a04558.html#a14">sint</a> sourceSize;
01149 
01150         <span class="comment">// Source offset (for 256)</span>
01151         <a class="code" href="a04558.html#a15">uint</a> sourceOffset=0;
01152 
01153         <span class="comment">// 256 ?</span>
01154         <span class="keywordflow">if</span> (is256x256)
01155         {
01156                 <span class="comment">// On the left ?</span>
01157                 <span class="keywordflow">if</span> (uvOff&amp;0x02)
01158                         sourceOffset+=tileSize;
01159 
01160                 <span class="comment">// On the bottom ?</span>
01161                 <span class="keywordflow">if</span> ((uvOff==1)||(uvOff==2))
01162                         sourceOffset+=2*tileSize*tileSize;
01163 
01164                 <span class="comment">// Yes, 256</span>
01165                 sourceSize=tileSize&lt;&lt;1;
01166         }
01167         <span class="keywordflow">else</span>
01168         {
01169                 <span class="comment">// No, 128</span>
01170                 sourceSize=tileSize;
01171         }
01172 
01173         <span class="comment">// Compute offset and deltas</span>
01174         <span class="keywordflow">switch</span> (nRot)
01175         {
01176         <span class="keywordflow">case</span> 0:
01177                 <span class="comment">// Source pointers</span>
01178                 srcPixel= srcPixel+sourceOffset;
01179 
01180                 <span class="comment">// Source delta</span>
01181                 srcDeltaX=1;
01182                 srcDeltaY=sourceSize;
01183                 <span class="keywordflow">break</span>;
01184         <span class="keywordflow">case</span> 1:
01185                 {
01186                         <span class="comment">// Source pointers</span>
01187                         <a class="code" href="a04558.html#a15">uint</a> newOffset=sourceOffset+(tileSize-1);
01188                         srcPixel=srcPixel+newOffset;
01189 
01190                         <span class="comment">// Source delta</span>
01191                         srcDeltaX=sourceSize;
01192                         srcDeltaY=-1;
01193                 }
01194                 <span class="keywordflow">break</span>;
01195         <span class="keywordflow">case</span> 2:
01196                 {
01197                         <span class="comment">// Destination pointer</span>
01198                         <a class="code" href="a04558.html#a15">uint</a> newOffset=sourceOffset+(tileSize-1)*sourceSize+tileSize-1;
01199                         srcPixel=srcPixel+newOffset;
01200 
01201                         <span class="comment">// Source delta</span>
01202                         srcDeltaX=-1;
01203                         srcDeltaY=-sourceSize;
01204                 }
01205                 <span class="keywordflow">break</span>;
01206         <span class="keywordflow">case</span> 3:
01207                 {
01208                         <span class="comment">// Destination pointer</span>
01209                         <a class="code" href="a04558.html#a15">uint</a> newOffset=sourceOffset+(tileSize-1)*sourceSize;
01210                         srcPixel=srcPixel+newOffset;
01211 
01212                         <span class="comment">// Source delta</span>
01213                         srcDeltaX=-sourceSize;
01214                         srcDeltaY=1;
01215                 }
01216                 <span class="keywordflow">break</span>;
01217         }
01218 
01219         <span class="keywordflow">return</span> srcPixel;
01220 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexth2" doxytag="NL3D::CPatchDLMContext::copyTileToTexture" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CPatchDLMContext::copyTileToTexture </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>srcPixel</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaX</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>srcDeltaY</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03337.html">CRGBA</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>dstPixel</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>dstStride</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06163.html#l01224">1224</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00964">computeTextureFar()</a>.
<p>
<div class="fragment"><pre>01225 {
01226         <span class="comment">// copy the 2x2 tile to the texture.</span>
01227 
01228         <span class="comment">// first line.</span>
01229         dstPixel[0]= srcPixel[0];
01230         dstPixel[1]= srcPixel[srcDeltaX];
01231         <span class="comment">// second line.</span>
01232         dstPixel[0+dstStride]= srcPixel[srcDeltaY];
01233         dstPixel[1+dstStride]= srcPixel[srcDeltaY+srcDeltaX];
01234 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta4" doxytag="NL3D::CPatchDLMContext::generate" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CPatchDLMContext::generate </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03057.html">CPatch</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03493.html">CTextureDLM</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>textureDLM</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03063.html">CPatchDLMContextList</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>ctxList</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
generate: link to patch and allocate texture space, compile vertices etc... The context is also linked to the list, and removed automaticllay at dtor Texture space is filled with black (RAM only) <dl compact><dt><b>Returns:</b></dt><dd>false if cannot allocate texture space for this patch</dd></dl>

<p>
Definition at line <a class="el" href="a06163.html#l00214">214</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00197">_Clusters</a>, <a class="el" href="a06164.html#l00177">_DLMContextList</a>, <a class="el" href="a06164.html#l00175">_DLMTexture</a>, <a class="el" href="a06164.html#l00183">_LightMap</a>, <a class="el" href="a06164.html#l00208">_LowResTileColors</a>, <a class="el" href="a06496.html#l00073">NL3D::CTessList&lt; CPatchDLMContext &gt;::append()</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a06163.html#l00592">clearLighting()</a>, <a class="el" href="a06539.html#l00048">NL3D::CTileColor::Color565</a>, <a class="el" href="a06163.html#l00964">computeTextureFar()</a>, <a class="el" href="a06515.html#l00164">NL3D::CTextureDLM::createLightMap()</a>, <a class="el" href="a06164.html#l00119">DLMUBias</a>, <a class="el" href="a06164.html#l00119">DLMUScale</a>, <a class="el" href="a06164.html#l00119">DLMVBias</a>, <a class="el" href="a06164.html#l00119">DLMVScale</a>, <a class="el" href="a05478.html#l00105">NL3D::CBezierPatch::eval()</a>, <a class="el" href="a05478.html#l00187">NL3D::CBezierPatch::evalNormal()</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05385.html#l00090">NLMISC::CAABBox::getCenter()</a>, <a class="el" href="a05486.html#l01388">NLMISC::CBitmap::getHeight()</a>, <a class="el" href="a06156.html#l00392">NL3D::CPatch::getOrderS()</a>, <a class="el" href="a06156.html#l00393">NL3D::CPatch::getOrderT()</a>, <a class="el" href="a05385.html#l00096">NLMISC::CAABBox::getRadius()</a>, <a class="el" href="a05486.html#l01363">NLMISC::CBitmap::getWidth()</a>, <a class="el" href="a06164.html#l00121">MaxU8</a>, <a class="el" href="a06164.html#l00122">MaxV8</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a06164.html#l00121">MinU8</a>, <a class="el" href="a06164.html#l00122">MinV8</a>, <a class="el" href="a06163.html#l00208">NL_DLM_CLIP_FACTOR</a>, <a class="el" href="a06163.html#l00211">NL_DLM_CLIP_NUM_LEVEL</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, <a class="el" href="a06164.html#l00107">NL3D::CPatchDLMContext::CVertex::Normal</a>, <a class="el" href="a06164.html#l00106">NL3D::CPatchDLMContext::CVertex::Pos</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector&lt; uint16, false &gt;::resize()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector&lt; CCluster &gt;::resize()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector&lt; CVertex &gt;::resize()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector&lt; CRGBA &gt;::resize()</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CCluster &gt;::size()</a>, <a class="el" href="a05646.html#l00985">t</a>, <a class="el" href="a06164.html#l00117">TextPosX</a>, <a class="el" href="a06164.html#l00117">TextPosY</a>, <a class="el" href="a06156.html#l00343">NL3D::CPatch::TileColors</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a06155.html#l00182">NL3D::CPatch::unpackIntoCache()</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
Referenced by <a class="el" href="a06157.html#l01950">NL3D::CPatch::addRefDLMContext()</a>.
<p>
<div class="fragment"><pre>00215 {
00216         <a class="code" href="a04199.html#a6">nlassert</a>(patch);
00217         <a class="code" href="a04199.html#a6">nlassert</a>(textureDLM);
00218         <a class="code" href="a04199.html#a6">nlassert</a>(ctxList);
00219 
00220         <span class="comment">// keep info on patch/landscape.</span>
00221         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>= patch;
00222         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>= textureDLM;
00223         <span class="comment">// append to the list.</span>
00224         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a>= ctxList;
00225         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr1">_DLMContextList</a>-&gt;append(<span class="keyword">this</span>);
00226 
00227         <span class="comment">// Get Texture Size info; </span>
00228 <span class="preprocessor">#ifdef NL_DLM_TILE_RES</span>
00229 <span class="preprocessor"></span>        <span class="comment">// get coord at cornes of tiles</span>
00230         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>= (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS())+1;
00231         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>= (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderT())+1;
00232 <span class="preprocessor">#else</span>
00233 <span class="preprocessor"></span>        <span class="comment">// get coord at cornes of tessBlocks</span>
00234         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>= (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS()/2)+1;
00235         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>= (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderT()/2)+1;
00236 <span class="preprocessor">#endif</span>
00237 <span class="preprocessor"></span>
00238         <span class="comment">// Allocate space in texture</span>
00239         <span class="keywordflow">if</span>(!<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;createLightMap(Width, Height, TextPosX, TextPosY))
00240         {
00241                 <span class="comment">// Mark as not allocated.</span>
00242                 <span class="comment">// NB: the context still work with NULL _DLMTexture, but do nothing (excpetionnal case)</span>
00243                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>= NULL;
00244         }
00245 
00246         <span class="comment">// If the lightmap is correclty allocated in the global texture, compute UVBias.</span>
00247         <span class="keywordflow">if</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>)
00248         {
00249                 <span class="comment">// Compute patch UV matrix from pixels. Must map to center of pixels.</span>
00250                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto2">DLMUScale</a>= (<span class="keywordtype">float</span>)(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>-1) / (<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;getWidth();
00251                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto4">DLMVScale</a>= (<span class="keywordtype">float</span>)(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>-1) / (<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;getHeight();
00252                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto1">DLMUBias</a>= ((<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto13">TextPosX</a>+0.5f) / (<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;getWidth();
00253                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto3">DLMVBias</a>= ((<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto14">TextPosY</a>+0.5f) / (<span class="keywordtype">float</span>)<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr2">_DLMTexture</a>-&gt;getHeight();
00254         }
00255         <span class="keywordflow">else</span>
00256         {
00257                 <span class="comment">// Build UVBias such that the UVs point to Black</span>
00258                 <span class="comment">// NB: TextureDLM ensure that point (MaxX,MaxY) of texture is black.</span>
00259                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto2">DLMUScale</a>= 0;
00260                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto4">DLMVScale</a>= 0;
00261                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto1">DLMUBias</a>= 1;
00262                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto3">DLMVBias</a>= 1;
00263         }
00264 
00265         <span class="comment">// TestYoyo: to see lightmap usage in the big texture</span>
00266         <span class="comment">/*DLMUScale= _Patch-&gt;getOrderS();</span>
00267 <span class="comment">        DLMVScale= _Patch-&gt;getOrderT();</span>
00268 <span class="comment">        DLMUBias= 0;</span>
00269 <span class="comment">        DLMVBias= 0;*/</span>
00270 
00271 
00272         <span class="comment">// Bound 8bits UV for Vegetable. This is to ensure vegetable Dlm UVs won't peek in neighbor lightmaps.</span>
00273         <a class="code" href="a04558.html#a14">sint</a>    tmpU, tmpV;
00274         <span class="comment">// Bound U minimum</span>
00275         tmpU= (<a class="code" href="a04558.html#a14">sint</a>)ceil ( (DLMUBias) * 255 );
00276         <a class="code" href="a05378.html#a374">clamp</a>(tmpU, 0, 255);
00277         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto8">MinU8</a>= tmpU;
00278         <span class="comment">// Bound U maximum</span>
00279         tmpU= (<a class="code" href="a04558.html#a14">sint</a>)floor( (DLMUBias+DLMUScale) * 255 );
00280         <a class="code" href="a05378.html#a374">clamp</a>(tmpU, (<a class="code" href="a04558.html#a14">sint</a>)MinU8, 255);
00281         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto6">MaxU8</a>= tmpU;
00282         <span class="comment">// Bound V minimum</span>
00283         tmpV= (<a class="code" href="a04558.html#a14">sint</a>)ceil ( (DLMVBias) * 255 );
00284         <a class="code" href="a05378.html#a374">clamp</a>(tmpV, 0, 255);
00285         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto9">MinV8</a>= tmpV;
00286         <span class="comment">// Bound V maximum</span>
00287         tmpV= (<a class="code" href="a04558.html#a14">sint</a>)floor( (DLMVBias+DLMVScale) * 255 );
00288         <a class="code" href="a05378.html#a374">clamp</a>(tmpV, (<a class="code" href="a04558.html#a14">sint</a>)MinV8, 255);
00289         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto7">MaxV8</a>= tmpV;
00290 
00291 
00292         <span class="comment">// Allocate RAM Lightmap</span>
00293         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1982_1">resize</a>(Width*Height);
00294 
00295         <span class="comment">// generate Vertices: pos and normals</span>
00296         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1982_1">resize</a>(Width*Height);
00297         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a626">s</a>, <a class="code" href="a04223.html#a627">t</a>;
00298         <span class="keywordtype">float</span>   ds= 1.0f / (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>-1);
00299         <span class="keywordtype">float</span>   dt= 1.0f / (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>-1);
00300         <span class="comment">// eval all the patch.</span>
00301         <a class="code" href="a04223.html#a627">t</a>= 0;
00302         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a572">x</a>,<a class="code" href="a04223.html#a573">y</a>;
00303         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a>&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto5">Height</a>; <a class="code" href="a04223.html#a573">y</a>++, <a class="code" href="a04223.html#a627">t</a>+=dt)
00304         {
00305                 <a class="code" href="a04223.html#a626">s</a>= 0;
00306                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0; <a class="code" href="a04223.html#a572">x</a>&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>; <a class="code" href="a04223.html#a572">x</a>++, <a class="code" href="a04223.html#a626">s</a>+=ds)
00307                 {
00308                         CVertex &amp;vert= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a>[<a class="code" href="a04223.html#a573">y</a>*Width+<a class="code" href="a04223.html#a572">x</a>];
00309                         <span class="comment">// NB: use the bezier patch, and don't take Noise into account, for speed reason.</span>
00310                         CBezierPatch    *bpatch= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;unpackIntoCache();
00311                         <span class="comment">// Eval pos.</span>
00312                         vert.Pos= bpatch-&gt;eval(s, t);
00313                         <span class="comment">// Eval Normal.</span>
00314                         vert.Normal= bpatch-&gt;evalNormal(s, t);
00315                 }
00316         }
00317 
00318         <span class="comment">// Build bounding Spheres QuadTree</span>
00319         <span class="comment">//============</span>
00320 
00321         <span class="comment">// Size of the cluster array (at level 0)</span>
00322         <a class="code" href="a04558.html#a15">uint</a>    bsx, bsy;
00323 <span class="preprocessor">#ifdef NL_DLM_TILE_RES</span>
00324 <span class="preprocessor"></span>        <span class="comment">// level 0 is at tile level.</span>
00325         bsx= max(1, (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS())/<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a> );
00326         bsy= max(1, (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderT())/<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a> );
00327 <span class="preprocessor">#else</span>
00328 <span class="preprocessor"></span>        <span class="comment">// level 0 is at tessBlock level.</span>
00329         bsx= max(1, (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS()/2)/<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a> );
00330         bsy= max(1, (<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderT()/2)/<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a> );
00331 <span class="preprocessor">#endif</span>
00332 <span class="preprocessor"></span>
00333         <span class="comment">// resize bboxes for level 0.</span>
00334         <span class="keyword">static</span>  vector&lt;CAABBox&gt;         tmpBBoxes[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00335         tmpBBoxes[0].resize(bsx * bsy);
00336 
00337         <span class="comment">// Extend all leaves clusters BBoxes with patch coordinates</span>
00338         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;bsy;<a class="code" href="a04223.html#a573">y</a>++)
00339         {
00340                 <span class="comment">// For Y, compute how many patch Positions used to extend bbox.</span>
00341                 <a class="code" href="a04558.html#a15">uint</a>    beginY= <a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a>;
00342                 <a class="code" href="a04558.html#a15">uint</a>    endY= <a class="code" href="a04061.html#a0">min</a>( (y+1)*NL_DLM_CLIP_FACTOR+1, Height);
00343                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;bsx;<a class="code" href="a04223.html#a572">x</a>++)
00344                 {
00345                         <span class="comment">// For X, compute how many patch Positions used to extend bbox.</span>
00346                         <a class="code" href="a04558.html#a15">uint</a>    beginX= <a class="code" href="a04223.html#a572">x</a>*<a class="code" href="a04740.html#a0">NL_DLM_CLIP_FACTOR</a>;
00347                         <a class="code" href="a04558.html#a15">uint</a>    endX= <a class="code" href="a04061.html#a0">min</a>((x+1)*NL_DLM_CLIP_FACTOR+1, Width);
00348                         <span class="comment">// Build a bbox.</span>
00349                         CAABBox         bbox;
00350                         bbox.setCenter(_Vertices[beginY*Width + beginX].Pos);
00351                         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> yi= beginY; yi&lt;endY; yi++)
00352                         {
00353                                 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> xi= beginX; xi&lt;endX; xi++)
00354                                 {
00355                                         bbox.extend(_Vertices[yi*Width + xi].Pos);
00356                                 }
00357                         }
00358                         <span class="comment">// Set the BBox info.</span>
00359                         tmpBBoxes[0][<a class="code" href="a04223.html#a573">y</a>*bsx + <a class="code" href="a04223.html#a572">x</a>]= bbox;
00360                 }
00361         }
00362 
00363         <span class="comment">// build parent BSpheres for quadTree hierarchy</span>
00364         <a class="code" href="a04558.html#a15">uint</a>    curLevel= 0;
00365         <a class="code" href="a04558.html#a15">uint</a>    nextLevel= 1;
00366         <a class="code" href="a04558.html#a15">uint</a>    nextBsx= max(1U, bsx/2);
00367         <a class="code" href="a04558.html#a15">uint</a>    nextBsy= max(1U, bsy/2);
00368         <span class="comment">// the number of cluster Sons, and descendants this cluster level owns.</span>
00369         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterNumToSkip[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00370         <span class="comment">// width for this cluster level.</span>
00371         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterWidth[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00372         <span class="comment">// Number of sons per line/column</span>
00373         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterWSon[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00374         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterHSon[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00375         <span class="comment">// Fill level 0 info</span>
00376         tmpClusterNumToSkip[0]= 0;
00377         tmpClusterWidth[0]= bsx;
00378         tmpClusterWSon[0]= 0;
00379         tmpClusterHSon[0]= 0;
00380         <a class="code" href="a04558.html#a15">uint</a>    finalClusterSize= bsx * bsy;
00381 
00382         <span class="comment">// If the next level has 1x1 cases, it is not usefull (since same sphere as entire Patch)</span>
00383         <span class="keywordflow">while</span>(nextBsx * nextBsy &gt; 1 &amp;&amp; nextLevel&lt;<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a> )
00384         {
00385                 finalClusterSize+= nextBsx * nextBsy;
00386 
00387                 <a class="code" href="a04558.html#a15">uint</a>    wSon= (bsx/nextBsx);
00388                 <a class="code" href="a04558.html#a15">uint</a>    hSon= (bsy/nextBsy);
00389                 <span class="comment">// compute cluster level info.</span>
00390                 tmpClusterWidth[nextLevel]= nextBsx;
00391                 tmpClusterWSon[nextLevel]= wSon;
00392                 tmpClusterHSon[nextLevel]= hSon;
00393                 <span class="comment">// NB: level 0 has 0 sons to skip, hence level1 must skip (1+0)*4= 4  (wSon==hSon==2)</span>
00394                 <span class="comment">// level2 must skip (1+4)*4= 20    (wSon==hSon==2)</span>
00395                 tmpClusterNumToSkip[nextLevel]= (1+tmpClusterNumToSkip[curLevel]) * wSon * hSon;
00396 
00397                 <span class="comment">// alloc bboxes.</span>
00398                 tmpBBoxes[nextLevel].resize(nextBsx * nextBsy);
00399 
00400                 <span class="comment">// For all cluster of upper level, build bb, as union of finers clusters</span>
00401                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;nextBsy;<a class="code" href="a04223.html#a573">y</a>++)
00402                 {
00403                         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;nextBsx;<a class="code" href="a04223.html#a572">x</a>++)
00404                         {
00405                                 <span class="comment">// compute coordinate in curLevel tmpBBoxes to look</span>
00406                                 <a class="code" href="a04558.html#a15">uint</a>    x2= <a class="code" href="a04223.html#a572">x</a>*wSon;
00407                                 <a class="code" href="a04558.html#a15">uint</a>    y2= <a class="code" href="a04223.html#a573">y</a>*hSon;
00408                                 <span class="comment">// Build a bbox for 4 (or 2) children clusters</span>
00409                                 <span class="keywordflow">if</span>(wSon&gt;1 &amp;&amp; hSon&gt;1)
00410                                 {
00411                                         CAABBox         bbox1;
00412                                         CAABBox         bbox2;
00413                                         bbox1= CAABBox::computeAABBoxUnion(
00414                                                 tmpBBoxes[curLevel][y2*bsx + x2], tmpBBoxes[curLevel][y2*bsx + x2+1]);
00415                                         bbox2= CAABBox::computeAABBoxUnion(
00416                                                 tmpBBoxes[curLevel][(y2+1)*bsx + x2], tmpBBoxes[curLevel][(y2+1)*bsx + x2+1]);
00417                                         <span class="comment">// final father bbox.</span>
00418                                         tmpBBoxes[nextLevel][<a class="code" href="a04223.html#a573">y</a>*nextBsx + <a class="code" href="a04223.html#a572">x</a>]= CAABBox::computeAABBoxUnion(bbox1, bbox2);
00419                                 }
00420                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(wSon==1)
00421                                 {
00422                                         CAABBox         bbox1;
00423                                         bbox1= CAABBox::computeAABBoxUnion(
00424                                                 tmpBBoxes[curLevel][y2*bsx + x2], tmpBBoxes[curLevel][(y2+1)*bsx + x2]);
00425                                         <span class="comment">// final father bbox.</span>
00426                                         tmpBBoxes[nextLevel][<a class="code" href="a04223.html#a573">y</a>*nextBsx + <a class="code" href="a04223.html#a572">x</a>]= bbox1;
00427                                 }
00428                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(hSon==1)
00429                                 {
00430                                         CAABBox         bbox1;
00431                                         bbox1= CAABBox::computeAABBoxUnion(
00432                                                 tmpBBoxes[curLevel][y2*bsx + x2], tmpBBoxes[curLevel][y2*bsx + x2+1]);
00433                                         <span class="comment">// final father bbox.</span>
00434                                         tmpBBoxes[nextLevel][<a class="code" href="a04223.html#a573">y</a>*nextBsx + <a class="code" href="a04223.html#a572">x</a>]= bbox1;
00435                                 }
00436                                 <span class="keywordflow">else</span>
00437                                         <span class="comment">// impossible...</span>
00438                                         <a class="code" href="a04199.html#a12">nlstop</a>;
00439                         }
00440                 }
00441 
00442                 <span class="comment">// upper level.</span>
00443                 bsx= nextBsx;
00444                 bsy= nextBsy;
00445                 nextBsx= max(1U, nextBsx/2);
00446                 nextBsy= max(1U, nextBsy/2);
00447                 curLevel++;
00448                 nextLevel++;
00449         }
00450 
00451 
00452         <span class="comment">// Resize clusters with size according to all levels</span>
00453         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1982_1">resize</a>(finalClusterSize);
00454         <a class="code" href="a04558.html#a15">uint</a>    iDstCluster= 0;
00455 
00456         <span class="comment">// Fill cluster hierarchy, in _Clusters.</span>
00457         <a class="code" href="a04558.html#a15">uint</a>    numLevels= nextLevel;
00458         <span class="comment">// NB: the principle is recursive, but it is "iterated", with a stack-like: tmpClusterX and tmpClusterY;</span>
00459         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterX[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00460         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterY[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00461         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterXMin[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00462         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterYMin[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00463         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterXMax[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00464         <a class="code" href="a04558.html#a15">uint</a>    tmpClusterYMax[<a class="code" href="a04740.html#a1">NL_DLM_CLIP_NUM_LEVEL</a>];
00465         <span class="comment">// we start at curLevel (the highest Level), and we must fill all the squares of this level</span>
00466         tmpClusterX[curLevel]= 0;
00467         tmpClusterY[curLevel]= 0;
00468         tmpClusterXMin[curLevel]= 0;
00469         tmpClusterYMin[curLevel]= 0;
00470         tmpClusterXMax[curLevel]= bsx;
00471         tmpClusterYMax[curLevel]= bsy;
00472         <span class="comment">// while the "root" level is not pop</span>
00473         <span class="keywordflow">while</span>(curLevel &lt; numLevels)
00474         {
00475                 <span class="comment">// If we ended with this level (all lines done).</span>
00476                 <span class="keywordflow">if</span>(tmpClusterY[curLevel] &gt;= tmpClusterYMax[curLevel])
00477                 {
00478                         <span class="comment">// Ok, finished with this level, pop up.</span>
00479                         curLevel++;
00480                         <span class="comment">// skip.</span>
00481                         <span class="keywordflow">continue</span>;
00482                 }
00483 
00484                 <a class="code" href="a04199.html#a6">nlassert</a>(iDstCluster&lt;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>());
00485 
00486                 <span class="comment">// get the bbox from current position.</span>
00487                 CAABBox bbox= tmpBBoxes[curLevel][ tmpClusterY[curLevel] * tmpClusterWidth[curLevel] + tmpClusterX[curLevel] ];
00488                 <span class="comment">// Fill _Clusters for this square.</span>
00489                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].BSphere.Center= bbox.getCenter(); 
00490                 <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].BSphere.Radius= bbox.getRadius(); 
00491                 <span class="comment">// If leaf level, fill special info</span>
00492                 <span class="keywordflow">if</span>(curLevel == 0)
00493                 {
00494                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].NSkips= 0;
00495                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].X= tmpClusterX[0];
00496                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].Y= tmpClusterY[0];
00497                 }
00498                 <span class="comment">// else, set total number of sons to skips if "invisible"</span>
00499                 <span class="keywordflow">else</span>
00500                         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>[iDstCluster].NSkips= tmpClusterNumToSkip[curLevel];
00501 
00502                 <span class="comment">// next dst cluster</span>
00503                 iDstCluster ++;
00504 
00505 
00506                 <span class="comment">// If not Leaf level, recurs. First pass, use curLevel params (tmpClusterX...)</span>
00507                 <span class="keywordflow">if</span>(curLevel &gt; 0)
00508                 {
00509                         <span class="comment">// compute info for next level.</span>
00510                         tmpClusterXMin[curLevel-1]= tmpClusterX[curLevel] * tmpClusterWSon[curLevel];
00511                         tmpClusterYMin[curLevel-1]= tmpClusterY[curLevel] * tmpClusterHSon[curLevel];
00512                         tmpClusterXMax[curLevel-1]= (tmpClusterX[curLevel]+1) * tmpClusterWSon[curLevel];
00513                         tmpClusterYMax[curLevel-1]= (tmpClusterY[curLevel]+1) * tmpClusterHSon[curLevel];
00514                         <span class="comment">// begin iteration of child level</span>
00515                         tmpClusterX[curLevel-1]= tmpClusterXMin[curLevel-1];
00516                         tmpClusterY[curLevel-1]= tmpClusterYMin[curLevel-1];
00517                 }
00518 
00519 
00520                 <span class="comment">// next square for this level</span>
00521                 tmpClusterX[curLevel]++;
00522                 <span class="comment">// if ended for X.</span>
00523                 <span class="keywordflow">if</span>(tmpClusterX[curLevel] &gt;= tmpClusterXMax[curLevel])
00524                 {
00525                         <span class="comment">// reset X.</span>
00526                         tmpClusterX[curLevel]= tmpClusterXMin[curLevel];
00527                         <span class="comment">// next line.</span>
00528                         tmpClusterY[curLevel]++;
00529                 }
00530 
00531 
00532                 <span class="comment">// If not Leaf level, recurs. Second pass, after tmpClusterX and tmpClusterY of curLevel are changed</span>
00533                 <span class="keywordflow">if</span>(curLevel &gt; 0)
00534                 {
00535                         <span class="comment">// descend in hierarchy. (recurs)</span>
00536                         curLevel--;
00537                 }
00538 
00539         }
00540 
00541         <span class="comment">// All dst clusters must have been filled</span>
00542         <a class="code" href="a04199.html#a6">nlassert</a>(iDstCluster == <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>());
00543 
00544 
00545         <span class="comment">// PreProcess Patch TileColors.</span>
00546         <span class="comment">//============</span>
00547         <span class="comment">// Verify that a CTileColor is nothing more than a 565 color.</span>
00548         <a class="code" href="a04199.html#a6">nlassert</a>(<span class="keyword">sizeof</span>(CTileColor)==<span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>));
00549 <span class="preprocessor">#ifndef NL_DLM_TILE_RES</span>
00550 <span class="preprocessor"></span>
00551         <span class="comment">// retrieve patch tileColor pointer.</span>
00552         <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors.size()&gt;0);
00553         CTileColor      *tileColor= &amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;TileColors[0];
00554 
00555         <span class="comment">// skip 1 tiles colors per column and per row</span>
00556         <a class="code" href="a04558.html#a15">uint</a>            wTileColor= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>-&gt;getOrderS()+1;
00557         CTileColor      *tcOrigin= tileColor;
00558         <span class="comment">// alloc _LowResTileColors at same resolution than lightmap</span>
00559         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1982_1">resize</a>(Width*Height);
00560         <a class="code" href="a04558.html#a9">uint16</a>  *dstLRtc= &amp;<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a>[0];
00561 
00562         <span class="comment">// For all lines of dst.</span>
00563         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;Height;<a class="code" href="a04223.html#a573">y</a>++)
00564         {
00565                 <span class="comment">// tileColor start of line.</span>
00566                 tileColor= tcOrigin + <a class="code" href="a04223.html#a573">y</a>*2* wTileColor;
00567                 <a class="code" href="a04558.html#a14">sint</a>    npix= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexto15">Width</a>;
00568                 <span class="comment">// for all pixels at corner of tessBlock.</span>
00569                 <span class="keywordflow">for</span>(;npix&gt;0; npix--, tileColor+=2, dstLRtc++)
00570                 {
00571                         *dstLRtc= tileColor-&gt;Color565;
00572                 }
00573 
00574         }
00575 <span class="preprocessor">#endif</span>
00576 <span class="preprocessor"></span>
00577 
00578         <span class="comment">// compute the TextureFar used for Far dynamic lightmaping.</span>
00579         <span class="comment">//============</span>
00580         <span class="comment">// NB: simpler to compute it at generate() time, even if not necessarly needed for near</span>
00581         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextd0">computeTextureFar</a>();
00582 
00583 
00584         <span class="comment">// fill texture with Black</span>
00585         <span class="comment">//============</span>
00586         <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexta1">clearLighting</a>();
00587 
00588         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00589 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta5" doxytag="NL3D::CPatchDLMContext::getMemorySize" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CPatchDLMContext::getMemorySize </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06163.html#l00948">948</a> of file <a class="el" href="a06163.html">patchdlm_context.cpp</a>.
<p>
References <a class="el" href="a06164.html#l00197">_Clusters</a>, <a class="el" href="a06164.html#l00183">_LightMap</a>, <a class="el" href="a06164.html#l00208">_LowResTileColors</a>, <a class="el" href="a06164.html#l00215">_TextureFar</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; uint16, false &gt;::size()</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CCluster &gt;::size()</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CRGBA &gt;::size()</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector&lt; CVertex &gt;::size()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
Referenced by <a class="el" href="a05862.html#l03583">NL3D::CLandscape::getDynamicLightingMemoryLoad()</a>.
<p>
<div class="fragment"><pre>00949 {
00950         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a587">size</a>= <span class="keyword">sizeof</span>(<a class="code" href="a03060.html#NL3D_1_1CPatchDLMContexta3">CPatchDLMContext</a>);
00951         <a class="code" href="a04223.html#a587">size</a>+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr9">_Vertices</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>() * <span class="keyword">sizeof</span>(CVertex);
00952         <a class="code" href="a04223.html#a587">size</a>+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr5">_LightMap</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>() * <span class="keyword">sizeof</span>(<a class="code" href="a03337.html">CRGBA</a>);
00953         <a class="code" href="a04223.html#a587">size</a>+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr0">_Clusters</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>() * <span class="keyword">sizeof</span>(CCluster);
00954         <a class="code" href="a04223.html#a587">size</a>+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr8">_TextureFar</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>() * <span class="keyword">sizeof</span>(<a class="code" href="a03337.html">CRGBA</a>);
00955 <span class="preprocessor">#ifndef NL_DLM_TILE_RES</span>
00956 <span class="preprocessor"></span>        <a class="code" href="a04223.html#a587">size</a>+= <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr6">_LowResTileColors</a>.<a class="code" href="a03000.html#NLMISC_1_1CObjectVectorz1984_3">size</a>() * <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>);
00957 <span class="preprocessor">#endif</span>
00958 <span class="preprocessor"></span>
00959         <span class="keywordflow">return</span> <a class="code" href="a04223.html#a587">size</a>;
00960 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexta6" doxytag="NL3D::CPatchDLMContext::getPatch" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03057.html">CPatch</a>* NL3D::CPatchDLMContext::getPatch </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00164">164</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a05862.html#l03489">NL3D::CLandscape::computeDynamicLighting()</a>, and <a class="el" href="a05862.html#l00939">NL3D::CLandscape::render()</a>.
<p>
<div class="fragment"><pre>00164 {<span class="keywordflow">return</span> <a class="code" href="a03060.html#NL3D_1_1CPatchDLMContextr7">_Patch</a>;}
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr0" doxytag="NL3D::CPatchDLMContext::_Clusters" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt;<a class="el" href="a03061.html">CCluster</a>&gt; <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr0">NL3D::CPatchDLMContext::_Clusters</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bounding Sphere QuadTree (with NSkips paradigm). 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00197">197</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00648">addPointLightInfluence()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00948">getMemorySize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr1" doxytag="NL3D::CPatchDLMContext::_DLMContextList" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03063.html">CPatchDLMContextList</a>* <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr1">NL3D::CPatchDLMContext::_DLMContextList</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00177">177</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00185">~CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr2" doxytag="NL3D::CPatchDLMContext::_DLMTexture" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03493.html">CTextureDLM</a>* <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr2">NL3D::CPatchDLMContext::_DLMTexture</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The DLM texture (only one per landscape). 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00175">175</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00185">~CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr3" doxytag="NL3D::CPatchDLMContext::_IsDstTextureFullBlack" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr3">NL3D::CPatchDLMContext::_IsDstTextureFullBlack</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00202">202</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, and <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr4" doxytag="NL3D::CPatchDLMContext::_IsSrcTextureFullBlack" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr4">NL3D::CPatchDLMContext::_IsSrcTextureFullBlack</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00200">200</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00648">addPointLightInfluence()</a>, <a class="el" href="a06163.html#l00592">clearLighting()</a>, <a class="el" href="a06163.html#l00888">compileLighting()</a>, and <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr5" doxytag="NL3D::CPatchDLMContext::_LightMap" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt;<a class="el" href="a03337.html">CRGBA</a>&gt; <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr5">NL3D::CPatchDLMContext::_LightMap</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The computed lightmap: Width*Height. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00183">183</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00648">addPointLightInfluence()</a>, <a class="el" href="a06163.html#l00592">clearLighting()</a>, <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00948">getMemorySize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr6" doxytag="NL3D::CPatchDLMContext::_LowResTileColors" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt;<a class="el" href="a04558.html#a9">uint16</a>, false&gt; <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr6">NL3D::CPatchDLMContext::_LowResTileColors</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00208">208</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00964">computeTextureFar()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00948">getMemorySize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr7" doxytag="NL3D::CPatchDLMContext::_Patch" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03057.html">CPatch</a>* <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr7">NL3D::CPatchDLMContext::_Patch</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The patch which owns us. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00173">173</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr8" doxytag="NL3D::CPatchDLMContext::_TextureFar" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt;<a class="el" href="a03337.html">CRGBA</a>&gt; <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr8">NL3D::CPatchDLMContext::_TextureFar</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The TextureFar (at tile level or less), which is always computed at <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexta4">generate()</a>. NB: Real compute is TextureFar*UserColor, so it need only to be modulated by lightmap each frame.
<p>
Definition at line <a class="el" href="a06164.html#l00215">215</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00964">computeTextureFar()</a>, and <a class="el" href="a06163.html#l00948">getMemorySize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContextr9" doxytag="NL3D::CPatchDLMContext::_Vertices" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03000.html">NLMISC::CObjectVector</a>&lt;<a class="el" href="a03062.html">CVertex</a>&gt; <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContextr9">NL3D::CPatchDLMContext::_Vertices</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bezier Patch Array information: Width*Height. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00180">180</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto0" doxytag="NL3D::CPatchDLMContext::CurPointLightCount" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto0">NL3D::CPatchDLMContext::CurPointLightCount</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00128">128</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06157.html#l02005">NL3D::CPatch::beginDLMLighting()</a>, <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>, and <a class="el" href="a06157.html#l02021">NL3D::CPatch::processDLMLight()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto1" doxytag="NL3D::CPatchDLMContext::DLMUBias" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto1">NL3D::CPatchDLMContext::DLMUBias</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Mapping to this rectangle from 0-1 basis. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00119">119</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06161.html#l01609">NL3D::CPatch::fillFar0DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l00946">NL3D::CPatch::fillFar0VertexVB()</a>, <a class="el" href="a06161.html#l01664">NL3D::CPatch::fillFar1DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01022">NL3D::CPatch::fillFar1VertexVB()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, and <a class="el" href="a06497.html#l00655">NL3D::CTessFace::initTileUvDLM()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto2" doxytag="NL3D::CPatchDLMContext::DLMUScale" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto2">NL3D::CPatchDLMContext::DLMUScale</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Mapping to this rectangle from 0-1 basis. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00119">119</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06161.html#l01609">NL3D::CPatch::fillFar0DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l00946">NL3D::CPatch::fillFar0VertexVB()</a>, <a class="el" href="a06161.html#l01664">NL3D::CPatch::fillFar1DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01022">NL3D::CPatch::fillFar1VertexVB()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, and <a class="el" href="a06497.html#l00655">NL3D::CTessFace::initTileUvDLM()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto3" doxytag="NL3D::CPatchDLMContext::DLMVBias" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto3">NL3D::CPatchDLMContext::DLMVBias</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Mapping to this rectangle from 0-1 basis. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00119">119</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06161.html#l01609">NL3D::CPatch::fillFar0DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l00946">NL3D::CPatch::fillFar0VertexVB()</a>, <a class="el" href="a06161.html#l01664">NL3D::CPatch::fillFar1DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01022">NL3D::CPatch::fillFar1VertexVB()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, and <a class="el" href="a06497.html#l00655">NL3D::CTessFace::initTileUvDLM()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto4" doxytag="NL3D::CPatchDLMContext::DLMVScale" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto4">NL3D::CPatchDLMContext::DLMVScale</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Mapping to this rectangle from 0-1 basis. 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00119">119</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06161.html#l01609">NL3D::CPatch::fillFar0DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l00946">NL3D::CPatch::fillFar0VertexVB()</a>, <a class="el" href="a06161.html#l01664">NL3D::CPatch::fillFar1DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01022">NL3D::CPatch::fillFar1VertexVB()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, and <a class="el" href="a06497.html#l00655">NL3D::CTessFace::initTileUvDLM()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto5" doxytag="NL3D::CPatchDLMContext::Height" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto5">NL3D::CPatchDLMContext::Height</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
DLM info The position and size of the DLM in the texture, in pixels. 
<p>
Definition at line <a class="el" href="a06164.html#l00117">117</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto6" doxytag="NL3D::CPatchDLMContext::MaxU8" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto6">NL3D::CPatchDLMContext::MaxU8</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00121">121</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto7" doxytag="NL3D::CPatchDLMContext::MaxV8" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto7">NL3D::CPatchDLMContext::MaxV8</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00122">122</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto8" doxytag="NL3D::CPatchDLMContext::MinU8" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto8">NL3D::CPatchDLMContext::MinU8</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping 
<p>

<p>
Definition at line <a class="el" href="a06164.html#l00121">121</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto9" doxytag="NL3D::CPatchDLMContext::MinV8" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto9">NL3D::CPatchDLMContext::MinV8</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06164.html#l00122">122</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableSortBlocko0" doxytag="NL3D::CPatchDLMContext::Next" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a02718.html">CTessNodeList</a>* <a class="el" href="a02718.html#NL3D_1_1CVegetableSortBlocko0">NL3D::CTessNodeList::Next</a><code> [inherited]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06496.html#l00044">44</a> of file <a class="el" href="a06496.html">tess_list.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a05862.html#l03489">NL3D::CLandscape::computeDynamicLighting()</a>, <a class="el" href="a06161.html#l01329">NL3D::CPatch::computeGeomorphAlphaFar1VertexListVB()</a>, <a class="el" href="a06161.html#l01311">NL3D::CPatch::computeGeomorphFar0VertexListVB()</a>, <a class="el" href="a06161.html#l01359">NL3D::CPatch::computeGeomorphTileVertexListVB()</a>, <a class="el" href="a06161.html#l01298">NL3D::CPatch::computeGeomorphVertexList()</a>, <a class="el" href="a06161.html#l00893">NL3D::CPatch::debugAllocationMarkIndicesFarList()</a>, <a class="el" href="a06161.html#l00904">NL3D::CPatch::debugAllocationMarkIndicesNearList()</a>, <a class="el" href="a06161.html#l01609">NL3D::CPatch::fillFar0DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01161">NL3D::CPatch::fillFar0VertexListVB()</a>, <a class="el" href="a06161.html#l01664">NL3D::CPatch::fillFar1DLMUvOnlyVertexListVB()</a>, <a class="el" href="a06161.html#l01173">NL3D::CPatch::fillFar1VertexListVB()</a>, <a class="el" href="a06161.html#l01185">NL3D::CPatch::fillTileVertexListVB()</a>, <a class="el" href="a05862.html#l03583">NL3D::CLandscape::getDynamicLightingMemoryLoad()</a>, <a class="el" href="a06491.html#l00177">NL3D::CTessBlock::refillFaceVectorFar0()</a>, <a class="el" href="a06491.html#l00223">NL3D::CTessBlock::refillFaceVectorFar1()</a>, <a class="el" href="a06491.html#l00267">NL3D::CTessBlock::refillFaceVectorTile()</a>, <a class="el" href="a05862.html#l00605">NL3D::CLandscape::refine()</a>, <a class="el" href="a06698.html#l01713">NL3D::CVegetableManager::render()</a>, <a class="el" href="a05862.html#l00939">NL3D::CLandscape::render()</a>, <a class="el" href="a06161.html#l00744">NL3D::CPatch::updateFar0VBAlloc()</a>, <a class="el" href="a06161.html#l00759">NL3D::CPatch::updateFar1VBAlloc()</a>, <a class="el" href="a06704.html#l00074">NL3D::CVegetableSortBlock::updateSortBlock()</a>, and <a class="el" href="a06161.html#l00774">NL3D::CPatch::updateTileVBAlloc()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto11" doxytag="NL3D::CPatchDLMContext::OldPointLightCount" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto11">NL3D::CPatchDLMContext::OldPointLightCount</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Lighting Process: number of light contribution to this patch in last rneder, and in cur Render. Modified by <a class="el" href="a03057.html">CPatch</a> and <a class="el" href="a02702.html">CLandscape</a>
<p>
Definition at line <a class="el" href="a06164.html#l00127">127</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06157.html#l02005">NL3D::CPatch::beginDLMLighting()</a>, <a class="el" href="a06163.html#l00171">CPatchDLMContext()</a>, and <a class="el" href="a06157.html#l02035">NL3D::CPatch::endDLMLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableSortBlocko1" doxytag="NL3D::CPatchDLMContext::Prec" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a02718.html">CTessNodeList</a>* <a class="el" href="a02718.html#NL3D_1_1CVegetableSortBlocko1">NL3D::CTessNodeList::Prec</a><code> [inherited]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06496.html#l00043">43</a> of file <a class="el" href="a06496.html">tess_list.h</a>.
<p>
Referenced by <a class="el" href="a06496.html#l00046">NL3D::CTessNodeList::CTessNodeList()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto13" doxytag="NL3D::CPatchDLMContext::TextPosX" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto13">NL3D::CPatchDLMContext::TextPosX</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
DLM info The position and size of the DLM in the texture, in pixels. 
<p>
Definition at line <a class="el" href="a06164.html#l00117">117</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00185">~CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto14" doxytag="NL3D::CPatchDLMContext::TextPosY" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto14">NL3D::CPatchDLMContext::TextPosY</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
DLM info The position and size of the DLM in the texture, in pixels. 
<p>
Definition at line <a class="el" href="a06164.html#l00117">117</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.
<p>
Referenced by <a class="el" href="a06163.html#l00888">compileLighting()</a>, <a class="el" href="a06163.html#l00214">generate()</a>, and <a class="el" href="a06163.html#l00185">~CPatchDLMContext()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CPatchDLMContexto15" doxytag="NL3D::CPatchDLMContext::Width" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03060.html#NL3D_1_1CPatchDLMContexto15">NL3D::CPatchDLMContext::Width</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
DLM info The position and size of the DLM in the texture, in pixels. 
<p>
Definition at line <a class="el" href="a06164.html#l00117">117</a> of file <a class="el" href="a06164.html">patchdlm_context.h</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06164.html">patchdlm_context.h</a><li><a class="el" href="a06163.html">patchdlm_context.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 07:00:53 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>