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
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>nevrax.org : docs</TITLE>
<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF='/'><b>Home</B></FONT></A> </TD>
<TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF='/'><b>nevrax.com</B></FONT></A> </TD>
</TR>
</TABLE>
<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
<TR><TD BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>
<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
<TR>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!------ Begin Box ------>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
<TABLE cellspacing=0 cellpadding=1 border=0>
<tr><td ALIGN=middle><a class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
</TABLE>
</TD></TR></TABLE></TD></TR></TABLE>
<!------ End Box ------>
</TD>
<TD WIDTH=15><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD ALIGN=left valign=top><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!-- title -->
<TABLE background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
<!-- block -->
<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
<TD><B>Documentation</B></TD>
<TD ALIGN=RIGHT> </td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> </center>
<hr><h1>tile_bank.cpp</h1><a href="tile__bank_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00008 <font class="comment"> *</font>
00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00013 <font class="comment"> * any later version.</font>
00014 <font class="comment"></font>
00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00018 <font class="comment"> * General Public License for more details.</font>
00019 <font class="comment"></font>
00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00023 <font class="comment"> * MA 02111-1307, USA.</font>
00024 <font class="comment"> */</font>
00025
00026 <font class="preprocessor">#include "<a class="code" href="std3d_8h.html">std3d.h</a>"</font>
00027
00028 <font class="preprocessor">#include "<a class="code" href="tile__bank_8h.html">3d/tile_bank.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="texture__file_8h.html">3d/texture_file.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="tile__noise__map_8h.html">3d/tile_noise_map.h</a>"</font>
00031
00032 <font class="preprocessor">#include "<a class="code" href="stream_8h.html">nel/misc/stream.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="common_8h.html">nel/misc/common.h</a>"</font>
00034 <font class="preprocessor">#include "<a class="code" href="path_8h.html">nel/misc/path.h</a>"</font>
00035 <font class="preprocessor">#include "<a class="code" href="file_8h.html">nel/misc/file.h</a>"</font>
00036 <font class="preprocessor">#include <string></font>
00037
00038 <font class="keyword">using</font> <font class="keyword">namespace </font>NLMISC;
00039 <font class="keyword">using</font> <font class="keyword">namespace </font>std;
00040
00041 <font class="keyword">namespace </font>NL3D
00042 {
00043
00044
00045 <font class="comment">// ***************************************************************************</font>
00046 <font class="comment">// ***************************************************************************</font>
00047 <font class="comment">// TileBankLand.</font>
00048 <font class="comment">// ***************************************************************************</font>
00049 <font class="comment">// ***************************************************************************</font>
00050
00051
00052 <font class="comment">// ***************************************************************************</font>
<a name="l00053"></a><a class="code" href="classNL3D_1_1CTileLand.html#r0">00053</a> <font class="keyword">const</font> sint CTileLand::_Version=0;
00054 <font class="comment">// ***************************************************************************</font>
<a name="l00055"></a><a class="code" href="classNL3D_1_1CTileLand.html#a5">00055</a> <font class="keywordtype">void</font> CTileLand::serial(IStream &f) <font class="keywordflow">throw</font>(EStream)
00056 {
00057 (void)f.serialVersion(_Version);
00058
00059 f.serial (_Name);
00060 f.serialCont (_TileSet);
00061 }
00062 <font class="comment">// ***************************************************************************</font>
<a name="l00063"></a><a class="code" href="classNL3D_1_1CTileLand.html#a2">00063</a> <font class="keywordtype">void</font> CTileLand::addTileSet (<font class="keyword">const</font> std::string& name)
00064 {
00065 <a class="code" href="classNL3D_1_1CTileLand.html#o1">_TileSet</a>.insert (name);
00066 }
00067 <font class="comment">// ***************************************************************************</font>
<a name="l00068"></a><a class="code" href="classNL3D_1_1CTileLand.html#a3">00068</a> <font class="keywordtype">void</font> CTileLand::removeTileSet (<font class="keyword">const</font> std::string& name)
00069 {
00070 <a class="code" href="classNL3D_1_1CTileLand.html#o1">_TileSet</a>.erase (name);
00071 }
00072 <font class="comment">// ***************************************************************************</font>
<a name="l00073"></a><a class="code" href="classNL3D_1_1CTileLand.html#a1">00073</a> <font class="keywordtype">void</font> CTileLand::setName (<font class="keyword">const</font> std::string& name)
00074 {
00075 <a class="code" href="classNL3D_1_1CTileLand.html#o0">_Name</a>=name;
00076 };
00077 <font class="comment">// ***************************************************************************</font>
00078
00079
00080 <font class="comment">// ***************************************************************************</font>
00081 <font class="comment">// ***************************************************************************</font>
00082 <font class="comment">// CTileBank.</font>
00083 <font class="comment">// ***************************************************************************</font>
00084 <font class="comment">// ***************************************************************************</font>
00085
00086
00087 <font class="comment">// ***************************************************************************</font>
<a name="l00088"></a><a class="code" href="classNL3D_1_1CTileBank.html#r0">00088</a> <font class="keyword">const</font> sint CTileBank::_Version=4;
00089 <font class="comment">// ***************************************************************************</font>
<a name="l00090"></a><a class="code" href="classNL3D_1_1CTileBank.html#a0">00090</a> CTileBank::CTileBank ()
00091 {
00092 <font class="comment">// Default _DisplacementMap</font>
00093 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.resize (1);
00094
00095 <font class="comment">// Fill it with 0</font>
00096 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[0].setEmpty ();
00097 }
00098 <font class="comment">// ***************************************************************************</font>
<a name="l00099"></a><a class="code" href="classNL3D_1_1CTileBank.html#a29">00099</a> <font class="keywordtype">void</font> CTileBank::serial(IStream &f) <font class="keywordflow">throw</font>(EStream)
00100 {
00101 f.serialCheck (std::string (<font class="stringliteral">"BANK"</font>));
00102
00103 sint streamver = f.serialVersion(_Version);
00104
00105 <font class="comment">// Version 1 not compatible</font>
00106 <font class="keywordflow">if</font> (f.isReading())
00107 {
00108 <font class="keywordflow">if</font> (streamver<2)
00109 <font class="keywordflow">throw</font> EOlderStream(f);
00110 }
00111
00112 <font class="keywordflow">switch</font> (streamver)
00113 {
00114 <font class="keywordflow">case</font> 4:
00115 <font class="comment">// Displacement map array</font>
00116 f.serialCont (_DisplacementMap);
00117 <font class="keywordflow">if</font> (f.isReading())
00118 {
00119 <font class="comment">// Checks</font>
00120 <a class="code" href="debug_8h.html#a6">nlassert</a> (_DisplacementMap.size()>0);
00121
00122 <font class="comment">// Set first empty</font>
00123 _DisplacementMap[0].setEmpty ();
00124 }
00125 <font class="keywordflow">case</font> 3:
00126 <font class="comment">// Absolute path</font>
00127 f.serial (_AbsPath);
00128 <font class="keywordflow">case</font> 2:
00129 <font class="comment">// Serial all containers</font>
00130 f.serialCont (_LandVector);
00131 f.serialCont (_TileSetVector);
00132 f.serialCont (_TileVector);
00133 }
00134
00135 <font class="comment">// Compute XRef in read mode</font>
00136 <font class="keywordflow">if</font> (f.isReading())
00137 computeXRef ();
00138
00139 <font class="comment">// If Version<=2, remove diffuse and alpha tiles in transitions</font>
00140 <font class="keywordflow">if</font> (streamver<=2)
00141 {
00142 <font class="comment">// Must be reading</font>
00143 <a class="code" href="debug_8h.html#a6">nlassert</a> (f.isReading());
00144
00145 <font class="comment">// Reset _AbsPath</font>
00146 _AbsPath=<font class="stringliteral">""</font>;
00147
00148 <font class="comment">// Remove diffuse and additive in transition</font>
00149 uint tileCount=(uint)getTileCount ();
00150 <font class="keywordflow">for</font> (uint i=0; i<tileCount; i++)
00151 {
00152 <font class="keywordtype">int</font> tileSet;
00153 <font class="keywordtype">int</font> number;
00154 TTileType <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>;
00155
00156 <font class="comment">// Get xref</font>
00157 getTileXRef (i, tileSet, number, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
00158
00159 <font class="comment">// Transition ?</font>
00160 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>==transition)
00161 {
00162 <font class="comment">// Remove diffuse bitmap</font>
00163 getTileSet(tileSet)->clearTransition ((CTileSet::TTransition)number, CTile::diffuse, *<font class="keyword">this</font>);
00164
00165 <font class="comment">// Remove alpha bitmap</font>
00166 getTileSet(tileSet)->clearTransition ((CTileSet::TTransition)number, CTile::alpha, *<font class="keyword">this</font>);
00167 }
00168 }
00169 }
00170 }
00171 <font class="comment">// ***************************************************************************</font>
<a name="l00172"></a><a class="code" href="classNL3D_1_1CTileBank.html#a10">00172</a> sint CTileBank::addLand (<font class="keyword">const</font> std::string& name)
00173 {
00174 sint last=<a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.size();
00175 <a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.push_back(CTileLand());
00176 <a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>[last].setName (name);
00177 <font class="keywordflow">return</font> last;
00178 }
00179 <font class="comment">// ***************************************************************************</font>
<a name="l00180"></a><a class="code" href="classNL3D_1_1CTileBank.html#a11">00180</a> <font class="keywordtype">void</font> CTileBank::removeLand (sint landIndex)
00181 {
00182 <font class="comment">// Check args</font>
00183 <a class="code" href="debug_8h.html#a6">nlassert</a> (landIndex>=0);
00184 <a class="code" href="debug_8h.html#a6">nlassert</a> (landIndex<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.size());
00185
00186 <a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.erase (<a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.begin ()+landIndex);
00187 }
00188 <font class="comment">// ***************************************************************************</font>
<a name="l00189"></a><a class="code" href="classNL3D_1_1CTileBank.html#a12">00189</a> sint CTileBank::addTileSet (<font class="keyword">const</font> std::string& name)
00190 {
00191 sint last=<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size();
00192 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.push_back(<a class="code" href="classNL3D_1_1CTileBank.html#l0">CTileSet</a>());
00193 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[last].setName (name);
00194 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i<CTileSet::count; i++)
00195 {
00196 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[last]._TileTransition[i]._Tile=<a class="code" href="classNL3D_1_1CTileBank.html#c0">createTile</a> ();
00197 }
00198 <font class="keywordflow">return</font> last;
00199 }
00200 <font class="comment">// ***************************************************************************</font>
<a name="l00201"></a><a class="code" href="classNL3D_1_1CTileBank.html#a13">00201</a> <font class="keywordtype">void</font> CTileBank::removeTileSet (sint setIndex)
00202 {
00203 <font class="comment">// Check args</font>
00204 <a class="code" href="debug_8h.html#a6">nlassert</a> (setIndex>=0);
00205 <a class="code" href="debug_8h.html#a6">nlassert</a> (setIndex<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size());
00206
00207 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i<CTileSet::count; i++)
00208 {
00209 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[setIndex]._TileTransition[i]._Tile;
00210 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>!=-1)
00211 <a class="code" href="classNL3D_1_1CTileBank.html#c1">freeTile</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00212 }
00213 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.erase (<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.begin ()+setIndex);
00214 }
00215 <font class="comment">// ***************************************************************************</font>
<a name="l00216"></a><a class="code" href="classNL3D_1_1CTileBank.html#a15">00216</a> <font class="keywordtype">void</font> CTileBank::clear ()
00217 {
00218 <a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.clear ();
00219 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.clear ();
00220 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.clear ();
00221 }
00222 <font class="comment">// ***************************************************************************</font>
<a name="l00223"></a><a class="code" href="classNL3D_1_1CTileBank.html#c0">00223</a> sint CTileBank::createTile ()
00224 {
00225 <font class="comment">// Look for a free tile</font>
00226 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size(); i++)
00227 {
00228 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].isFree())
00229 {
00230 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].setFileName (CTile::diffuse, <font class="stringliteral">""</font>);
00231 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].setFileName (CTile::additive, <font class="stringliteral">""</font>);
00232 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].setFileName (CTile::alpha, <font class="stringliteral">""</font>);
00233 <font class="keywordflow">return</font> i;
00234 }
00235 }
00236
00237 <font class="comment">// Nothing free, add a tile at the end</font>
00238 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.push_back (CTile());
00239 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1].setFileName (CTile::diffuse, <font class="stringliteral">""</font>);
00240 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1].setFileName (CTile::additive, <font class="stringliteral">""</font>);
00241 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1].setFileName (CTile::alpha, <font class="stringliteral">""</font>);
00242 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1;
00243 }
00244 <font class="comment">// ***************************************************************************</font>
<a name="l00245"></a><a class="code" href="classNL3D_1_1CTileBank.html#c1">00245</a> <font class="keywordtype">void</font> CTileBank::freeTile (<font class="keywordtype">int</font> tileIndex)
00246 {
00247 <font class="comment">// Check args</font>
00248 <a class="code" href="debug_8h.html#a6">nlassert</a> (tileIndex>=0);
00249 <a class="code" href="debug_8h.html#a6">nlassert</a> (tileIndex<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size());
00250
00251 <font class="comment">// Free</font>
00252 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[tileIndex].free();
00253
00254 <font class="comment">// Resize tile table</font>
00255 <font class="keywordtype">int</font> i;
00256 <font class="keywordflow">for</font> (i=(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1; i>=0; i--)
00257 {
00258 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].isFree ())
00259 <font class="keywordflow">break</font>;
00260 }
00261 <font class="keywordflow">if</font> (i<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size()-1)
00262 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.resize (i+1);
00263 }
00264 <font class="comment">// ***************************************************************************</font>
<a name="l00265"></a><a class="code" href="classNL3D_1_1CTileBank.html#a16">00265</a> sint CTileBank::getNumBitmap (CTile::TBitmap bitmap)<font class="keyword"> const</font>
00266 <font class="keyword"></font>{
00267 std::set<std::string> setString;
00268 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size(); i++)
00269 {
00270 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].isFree())
00271 {
00272 <font class="keyword">const</font> std::string &str=<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[i].getRelativeFileName (bitmap);
00273 <font class="keywordflow">if</font> (str!=<font class="stringliteral">""</font>)
00274 {
00275 std::vector<char> vect (str.length()+1);
00276 memcpy (&*vect.begin(), str.c_str(), str.length()+1);
00277 <a class="code" href="namespaceNLMISC.html#a229">NLMISC::strlwr</a> (&*vect.begin());
00278 setString.insert (std::string (&*vect.begin()));
00279 }
00280 }
00281 }
00282 <font class="keywordflow">return</font> setString.size();
00283 }
00284 <font class="comment">// ***************************************************************************</font>
<a name="l00285"></a><a class="code" href="classNL3D_1_1CTileBank.html#a17">00285</a> <font class="keywordtype">void</font> CTileBank::computeXRef ()
00286 {
00287 <font class="comment">// Resize</font>
00288 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>.resize (<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size());
00289
00290 <font class="comment">// Erase number of the tileset in xref</font>
00291 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> tile=0; tile<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size(); tile++)
00292 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[tile]._XRefTileSet=-1;
00293
00294 <font class="comment">// Erase number of the tileset in xref</font>
00295 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a><(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size(); <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>++)
00296 {
00297 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
00298 <a class="code" href="classNL3D_1_1CTileBank.html#l0">CTileSet</a> *tileSet=<a class="code" href="classNL3D_1_1CTileBank.html#a5">getTileSet</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>);
00299 <font class="keywordflow">for</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a><tileSet->getNumTile128(); <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>++)
00300 {
00301 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=tileSet->getTile128 (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>);
00302 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileSet=<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>;
00303 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileNumber=<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
00304 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileType=<a class="code" href="classNL3D_1_1CTileBank.html#s4s0">_128x128</a>;
00305 }
00306 <font class="keywordflow">for</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a><tileSet->getNumTile256(); <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>++)
00307 {
00308 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=tileSet->getTile256 (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>);
00309 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileSet=<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>;
00310 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileNumber=<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
00311 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileType=<a class="code" href="classNL3D_1_1CTileBank.html#s4s1">_256x256</a>;
00312 }
00313 <font class="keywordflow">for</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a><CTileSet::count; <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>++)
00314 {
00315 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=tileSet->getTransition (t)->getTile();
00316 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileSet=<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>;
00317 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileNumber=<a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
00318 <a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>]._XRefTileType=<a class="code" href="classNL3D_1_1CTileBank.html#s4s2">transition</a>;
00319 }
00320 }
00321 }
00322 <font class="comment">// ***************************************************************************</font>
<a name="l00323"></a><a class="code" href="classNL3D_1_1CTileBank.html#a14">00323</a> <font class="keywordtype">void</font> CTileBank::xchgTileset (sint firstTileSet, sint secondTileSet)
00324 {
00325 <font class="comment">// Some check</font>
00326 <a class="code" href="debug_8h.html#a6">nlassert</a> ((firstTileSet>=0)&&(firstTileSet<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size()));
00327 <a class="code" href="debug_8h.html#a6">nlassert</a> ((secondTileSet>=0)&&(secondTileSet<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size()));
00328
00329 <font class="comment">// Xchange the sets</font>
00330 <a class="code" href="classNL3D_1_1CTileBank.html#l0">CTileSet</a> tmp=<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[firstTileSet];
00331 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[firstTileSet]=<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[secondTileSet];
00332 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[secondTileSet]=tmp;
00333 }
00334 <font class="comment">// ***************************************************************************</font>
00335 <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a468">TroncFileName</a> (<font class="keywordtype">char</font>* sDest, <font class="keyword">const</font> <font class="keywordtype">char</font>* sSrc)
00336 {
00337 <font class="keywordtype">char</font>* ptr=strrchr (sSrc, <font class="charliteral">'\\'</font>);
00338 <font class="keywordflow">if</font> (ptr==NULL)
00339 ptr=strrchr (sSrc, <font class="charliteral">'/'</font>);
00340 <font class="keywordflow">if</font> (ptr)
00341 {
00342 ptr++;
00343 strcpy (sDest, ptr);
00344 }
00345 <font class="keywordflow">else</font>
00346 {
00347 strcpy (sDest, sSrc);
00348 }
00349 }
00350 <font class="comment">// ***************************************************************************</font>
00351 <font class="comment">// Je parie que ce patch reste jusqu'� la fin du jeu. (Hulud)</font>
<a name="l00352"></a><a class="code" href="classNL3D_1_1CTileBank.html#a25">00352</a> <font class="keywordtype">void</font> CTileBank::makeAllPathRelative ()
00353 {
00354 <font class="comment">// For all tiles</font>
00355 <font class="keywordflow">for</font> (sint nTile=0; nTile<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size(); nTile++)
00356 {
00357 <font class="comment">// Tronc filename</font>
00358 <font class="keywordtype">char</font> sTmpFileName[512];
00359
00360 <font class="comment">// Diffuse</font>
00361 <a class="code" href="namespaceNL3D.html#a468">TroncFileName</a> (sTmpFileName, <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::diffuse).c_str());
00362 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::diffuse, sTmpFileName);
00363
00364 <font class="comment">// Additive</font>
00365 <a class="code" href="namespaceNL3D.html#a468">TroncFileName</a> (sTmpFileName, <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::additive).c_str());
00366 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::additive, sTmpFileName);
00367
00368 <font class="comment">// Alpha</font>
00369 <a class="code" href="namespaceNL3D.html#a468">TroncFileName</a> (sTmpFileName, <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::alpha).c_str());
00370 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::alpha, sTmpFileName);
00371 }
00372
00373 <font class="comment">// For all displaces</font>
00374 <font class="keywordflow">for</font> (uint i=0; i<<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size(); i++)
00375 {
00376 <font class="comment">// Tronc filename</font>
00377 <font class="keywordtype">char</font> sTmpFileName[512];
00378
00379 <a class="code" href="namespaceNL3D.html#a468">TroncFileName</a> (sTmpFileName, <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[i]._FileName.c_str());
00380 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[i]._FileName = sTmpFileName;
00381 }
00382 }
00383
00384
00385 <font class="comment">// ***************************************************************************</font>
00386 <font class="comment">// Moi aussi je le parie (Yoyo).</font>
<a name="l00387"></a><a class="code" href="classNL3D_1_1CTileBank.html#a26">00387</a> <font class="keywordtype">void</font> CTileBank::makeAllExtensionDDS ()
00388 {
00389 <font class="comment">// For all tiles</font>
00390 <font class="keywordflow">for</font> (sint nTile=0; nTile<(sint)<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size(); nTile++)
00391 {
00392 string tmp;
00393 uint32 pos;
00394
00395 <font class="comment">// Diffuse</font>
00396 tmp= <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::diffuse);
00397 pos= tmp.rfind(<font class="stringliteral">".tga"</font>);
00398 <font class="keywordflow">if</font>(pos!= string::npos)
00399 {
00400 tmp.replace(pos, 4, <font class="stringliteral">".dds"</font>);
00401 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::diffuse, tmp);
00402 }
00403
00404 <font class="comment">// Additive.</font>
00405 tmp= <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::additive);
00406 pos= tmp.rfind(<font class="stringliteral">".tga"</font>);
00407 <font class="keywordflow">if</font>(pos!= string::npos)
00408 {
00409 tmp.replace(pos, 4, <font class="stringliteral">".dds"</font>);
00410 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::additive, tmp);
00411 }
00412
00413 <font class="comment">// Alpha.</font>
00414 tmp= <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].getRelativeFileName (CTile::alpha);
00415 pos= tmp.rfind(<font class="stringliteral">".tga"</font>);
00416 <font class="keywordflow">if</font>(pos!= string::npos)
00417 {
00418 tmp.replace(pos, 4, <font class="stringliteral">".dds"</font>);
00419 <a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>[nTile].setFileName (CTile::alpha, tmp);
00420 }
00421
00422 }
00423
00424 }
00425 <font class="comment">// ***************************************************************************</font>
<a name="l00426"></a><a class="code" href="classNL3D_1_1CTileBank.html#a18">00426</a> <font class="keywordtype">void</font> CTileBank::cleanUnusedData ()
00427 {
00428 <font class="comment">// Clean each tileset</font>
00429 <font class="keywordflow">for</font> (uint i=0; i<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size(); i++)
00430 {
00431 <font class="comment">// Clean the tileset</font>
00432 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[i].cleanUnusedData ();
00433 }
00434
00435 <font class="comment">// Clear the land vector</font>
00436 <a class="code" href="classNL3D_1_1CTileBank.html#o0">_LandVector</a>.clear();
00437 }
00438 <font class="comment">// ***************************************************************************</font>
<a name="l00439"></a><a class="code" href="classNL3D_1_1CTileBank.html#z833_0">00439</a> CTileNoiseMap *CTileBank::getTileNoiseMap (uint tileNumber, uint tileSubNoise)
00440 {
00441 <font class="comment">// Check tile number..</font>
00442 <font class="keywordflow">if</font> (tileNumber<<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size())
00443 {
00444 <font class="comment">// Get tileset number</font>
00445 uint tileSet=<a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[tileNumber]._XRefTileSet;
00446
00447 <font class="comment">// Checks</font>
00448 <font class="keywordflow">if</font> (tileSet<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size())
00449 {
00450 <a class="code" href="debug_8h.html#a6">nlassert</a> (tileSubNoise<CTileSet::CountDisplace);
00451 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet]._DisplacementBitmap[tileSubNoise]<<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size());
00452
00453 <font class="comment">// Return the tile noise map</font>
00454 CTileNoise &tileNoise=<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet]._DisplacementBitmap[tileSubNoise]];
00455
00456 <font class="comment">// Not loaded ?</font>
00457 <font class="keywordflow">if</font> (tileNoise._TileNoiseMap==NULL)
00458 {
00459 <font class="comment">// Load a bitmap</font>
00460 CTextureFile texture (<a class="code" href="classNL3D_1_1CTileBank.html#a28">getAbsPath</a>()+tileNoise._FileName);
00461 texture.loadGrayscaleAsAlpha (<font class="keyword">false</font>);
00462 texture.generate ();
00463 texture.convertToType (CBitmap::Luminance);
00464
00465 <font class="comment">// Alloc</font>
00466 tileNoise._TileNoiseMap=<font class="keyword">new</font> CTileNoiseMap;
00467
00468 <font class="comment">// Good size ?</font>
00469 <font class="keywordflow">if</font> ((texture.getWidth ()==<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>)&&(texture.getHeight()==<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>))
00470 {
00471 <font class="comment">// Copy</font>
00472 memcpy (tileNoise._TileNoiseMap->Pixels, &texture.getPixels()[0], <a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>*<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>);
00473
00474 <font class="comment">// Remap lumels</font>
00475 <font class="keywordflow">for</font> (uint i=0; i<<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>*<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>; i++)
00476 {
00477 tileNoise._TileNoiseMap->Pixels[i]=(sint8)((uint8)tileNoise._TileNoiseMap->Pixels[i]-128);
00478 <font class="keywordflow">if</font> (tileNoise._TileNoiseMap->Pixels[i]==-128)
00479 tileNoise._TileNoiseMap->Pixels[i]=-127;
00480 }
00481 }
00482 <font class="keywordflow">else</font>
00483 {
00484 <font class="comment">// This is not a normal behaviour.</font>
00485 string pathname= <a class="code" href="classNL3D_1_1CTileBank.html#a28">getAbsPath</a>()+tileNoise._FileName;
00486 <font class="keywordflow">if</font>( texture.getWidth ()==0 || texture.getHeight ()==0 )
00487 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"TileNoiseMap not found: %s."</font>, pathname.c_str());
00488 <font class="keywordflow">else</font>
00489 <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"Bad TileNoiseMap size: %s."</font>, pathname.c_str());
00490
00491 <font class="comment">// Not good size, copy a static map</font>
00492 sint8 notGoodSizeForm[<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>*<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>]=
00493 {
00494 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00495 00, 99, 99, 99, 99, 99, 99, 99, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00496 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00497 00, 99, 00, 99, 99, 99, 99, 99, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00498 00, 99, 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00499 00, 99, 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00500 00, 99, 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00501 00, 99, 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00502 00, 99, 00, 99, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00503 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00504 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00505 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00506 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00507 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00508 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00509 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00510 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00511 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00512 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00513 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00514 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00515 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00516 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00517 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00, 99, 00,
00518 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00, 99, 00,
00519 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00, 99, 00,
00520 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00, 99, 00,
00521 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00, 99, 00,
00522 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 99, 99, 99, 99, 99, 00, 99, 00,
00523 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 00,
00524 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 99, 99, 99, 99, 99, 99, 99, 99, 00,
00525 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00
00526 };
00527
00528 <font class="comment">// Copy</font>
00529 memcpy (tileNoise._TileNoiseMap->Pixels, notGoodSizeForm, <a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>*<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>);
00530 }
00531 }
00532
00533 <font class="comment">// Return the noise map</font>
00534 <font class="keywordflow">return</font> tileNoise._TileNoiseMap;
00535 }
00536 }
00537
00538 <font class="comment">// Checks</font>
00539 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[0]._TileNoiseMap);
00540 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[0]._TileNoiseMap;
00541 }
00542 <font class="comment">// ***************************************************************************</font>
<a name="l00543"></a><a class="code" href="classNL3D_1_1CTileBank.html#a24">00543</a> <font class="keywordtype">void</font> CTileBank::removeDisplacementMap (uint mapId)
00544 {
00545 <font class="comment">// Checks</font>
00546 <a class="code" href="debug_8h.html#a6">nlassert</a> (mapId<<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size());
00547
00548 <font class="keywordflow">if</font> (mapId!=0)
00549 {
00550 <font class="comment">// Check if another tileSet uses it</font>
00551 uint tileSet;
00552 <font class="keywordflow">for</font> (tileSet=0; tileSet<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size(); tileSet++)
00553 {
00554 <font class="comment">// It uses it ?</font>
00555 uint tile;
00556 <font class="keywordflow">for</font> (tile=0; tile<CTileSet::CountDisplace; tile++)
00557 {
00558 <font class="comment">// The same ?</font>
00559 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet]._DisplacementBitmap[tile]==mapId)
00560 <font class="comment">// Stop</font>
00561 <font class="keywordflow">break</font>;
00562 }
00563 <font class="keywordflow">if</font> (tile!=CTileSet::CountDisplace)
00564 <font class="keywordflow">break</font>;
00565 }
00566 <font class="keywordflow">if</font> (tileSet==<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size())
00567 {
00568 <font class="comment">// Remove it</font>
00569 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[mapId].reset();
00570
00571 <font class="comment">// Last element ?</font>
00572 <font class="keywordflow">if</font> (mapId==<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size()-1)
00573 {
00574 <font class="comment">// Resize the array ?</font>
00575 <font class="keywordflow">while</font> ((mapId>0)&&(<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[mapId]._FileName==<font class="stringliteral">""</font>))
00576 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.resize (mapId--);
00577 }
00578 }
00579 }
00580 }
00581 <font class="comment">// ***************************************************************************</font>
00582 uint CTileBank::getDisplacementMap (<font class="keyword">const</font> string &fileName)
00583 {
00584 <font class="comment">// Lower string</font>
00585 string lower=fileName;
00586 lower=strlwr (lower);
00587
00588 <font class="comment">// Look for this texture filename</font>
00589 uint noiseTile;
00590 <font class="keywordflow">for</font> (noiseTile=0; noiseTile<<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size(); noiseTile++)
00591 {
00592 <font class="comment">// Same name ?</font>
00593 <font class="keywordflow">if</font> (lower==<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[noiseTile]._FileName)
00594 <font class="keywordflow">return</font> noiseTile;
00595 }
00596
00597 <font class="comment">// Look for a free space</font>
00598 <font class="keywordflow">for</font> (noiseTile=0; noiseTile<<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size(); noiseTile++)
00599 {
00600 <font class="comment">// Same name ?</font>
00601 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[noiseTile]._FileName==<font class="stringliteral">""</font>)
00602 <font class="keywordflow">break</font>;
00603 }
00604 <font class="keywordflow">if</font> (noiseTile==<a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size())
00605 {
00606 <font class="comment">// Add a tile</font>
00607 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.resize (noiseTile+1);
00608 }
00609
00610 <font class="comment">// Set the file name</font>
00611 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[noiseTile]._FileName=lower;
00612
00613 <font class="keywordflow">return</font> noiseTile;
00614 }
00615 <font class="comment">// ***************************************************************************</font>
<a name="l00616"></a><a class="code" href="classNL3D_1_1CTileBank.html#a21">00616</a> <font class="keyword">const</font> <font class="keywordtype">char</font>* CTileBank::getDisplacementMap (uint noiseMap)
00617 {
00618 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[noiseMap]._FileName.c_str();
00619 }
00620 <font class="comment">// ***************************************************************************</font>
<a name="l00621"></a><a class="code" href="classNL3D_1_1CTileBank.html#a22">00621</a> <font class="keywordtype">void</font> CTileBank::setDisplacementMap (uint noiseMap, <font class="keyword">const</font> <font class="keywordtype">char</font> *newName)
00622 {
00623 <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>[noiseMap]._FileName=newName;
00624 }
00625 <font class="comment">// ***************************************************************************</font>
<a name="l00626"></a><a class="code" href="classNL3D_1_1CTileBank.html#a20">00626</a> uint CTileBank::getDisplacementMapCount ()<font class="keyword"> const</font>
00627 <font class="keyword"></font>{
00628 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileBank.html#o4">_DisplacementMap</a>.size();
00629 }
00630
00631
00632 <font class="comment">// ***************************************************************************</font>
<a name="l00633"></a><a class="code" href="classNL3D_1_1CTileBank.html#z833_1">00633</a> <font class="keyword">const</font> CTileVegetableDesc &CTileBank::getTileVegetableDesc(uint tileNumber)<font class="keyword"> const</font>
00634 <font class="keyword"></font>{
00635 <font class="comment">// Check tile number..</font>
00636 <font class="keywordflow">if</font> (tileNumber<<a class="code" href="classNL3D_1_1CTileBank.html#o2">_TileVector</a>.size())
00637 {
00638 <font class="comment">// Get tileset number</font>
00639 uint tileSet=<a class="code" href="classNL3D_1_1CTileBank.html#o3">_TileXRef</a>[tileNumber]._XRefTileSet;
00640
00641 <font class="comment">// Checks</font>
00642 <font class="keywordflow">if</font> (tileSet<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size())
00643 {
00644 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet].getTileVegetableDesc();
00645 }
00646
00647 }
00648
00649 <font class="comment">// if fails for any reason, return an empty tileVegetableDesc;</font>
00650 <font class="keyword">static</font> CTileVegetableDesc emptyTvd;
00651 <font class="keywordflow">return</font> emptyTvd;
00652 }
00653
00654
00655 <font class="comment">// ***************************************************************************</font>
<a name="l00656"></a><a class="code" href="classNL3D_1_1CTileBank.html#z833_2">00656</a> <font class="keywordtype">void</font> CTileBank::loadTileVegetableDescs()
00657 {
00658 <font class="comment">// For all tileSets.</font>
00659 uint tileSet;
00660
00661 <font class="keywordflow">for</font>(tileSet=0; tileSet<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size(); tileSet++)
00662 {
00663 <font class="comment">// load their fileName</font>
00664 <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet].loadTileVegetableDesc();
00665 }
00666 }
00667
00668
00669 <font class="comment">// ***************************************************************************</font>
<a name="l00670"></a><a class="code" href="classNL3D_1_1CTileBank.html#z833_3">00670</a> <font class="keywordtype">void</font> CTileBank::initTileVegetableDescs(CVegetableManager *vegetableManager)
00671 {
00672 <font class="comment">// For all tileSets.</font>
00673 uint tileSet;
00674
00675 <font class="keywordflow">for</font>(tileSet=0; tileSet<<a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>.size(); tileSet++)
00676 {
00677 CTileVegetableDesc &tvd= <a class="code" href="classNL3D_1_1CTileBank.html#o1">_TileSetVector</a>[tileSet].getTileVegetableDesc();
00678 tvd.registerToManager(vegetableManager);
00679 }
00680 }
00681
00682
00683 <font class="comment">// ***************************************************************************</font>
00684 <font class="comment">// ***************************************************************************</font>
00685 <font class="comment">// CTile.</font>
00686 <font class="comment">// ***************************************************************************</font>
00687 <font class="comment">// ***************************************************************************</font>
00688
00689
00690 <font class="comment">// ***************************************************************************</font>
<a name="l00691"></a><a class="code" href="classNL3D_1_1CTile.html#r0">00691</a> <font class="keyword">const</font> sint CTile::_Version=4;
00692 <font class="comment">// ***************************************************************************</font>
<a name="l00693"></a><a class="code" href="classNL3D_1_1CTile.html#a3">00693</a> <font class="keywordtype">void</font> CTile::serial(IStream &f) <font class="keywordflow">throw</font>(EStream)
00694 {
00695 sint streamver = f.serialVersion(_Version);
00696
00697 <font class="comment">// Tmp value</font>
00698 <font class="keywordtype">bool</font> tmp;
00699 string tmpStr;
00700
00701 <font class="keywordflow">switch</font> (streamver)
00702 {
00703 <font class="keywordflow">case</font> 4:
00704 <font class="keywordflow">case</font> 3:
00705 <font class="keywordflow">case</font> 2:
00706 f.serial (_Flags);
00707
00708 <font class="comment">// Version 2, flags are not the same</font>
00709 <font class="keywordflow">if</font> (streamver==2)
00710 _Flags=(_Flags&<a class="code" href="tile__bank_8h.html#a0">NL3D_CTILE_ROT_MASK</a>)|(_Flags&<a class="code" href="tile__bank_8h.html#a3">NL3D_CTILE_GROUP_MASK_V2</a>)|(((_Flags&<a class="code" href="tile__bank_8h.html#a7">NL3D_CTILE_FREE_FLAG_V2</a>)!=0)?<a class="code" href="tile__bank_8h.html#a6">NL3D_CTILE_FREE_FLAG</a>:0);
00711 <font class="keywordflow">if</font> (streamver==3)
00712 _Flags=(_Flags&<a class="code" href="tile__bank_8h.html#a0">NL3D_CTILE_ROT_MASK</a>)|(_Flags&<a class="code" href="tile__bank_8h.html#a4">NL3D_CTILE_GROUP_MASK_V3</a>)|(((_Flags&<a class="code" href="tile__bank_8h.html#a8">NL3D_CTILE_FREE_FLAG_V3</a>)!=0)?<a class="code" href="tile__bank_8h.html#a6">NL3D_CTILE_FREE_FLAG</a>:0);
00713
00714 f.serial (_BitmapName[diffuse]);
00715 f.serial (_BitmapName[additive]);
00716 f.serial (_BitmapName[<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>]);
00717 <font class="keywordflow">break</font>;
00718 <font class="keywordflow">case</font> 1:
00719 <font class="comment">// Don't need invert many more</font>
00720 f.serial (tmp);
00721 <font class="keywordflow">case</font> 0:
00722 <font class="comment">// Initialize flags</font>
00723 _Flags=0;
00724
00725 <font class="comment">// Initialize alpha name</font>
00726 _BitmapName[<a class="code" href="driver__opengl__extension__def_8h.html#a420">alpha</a>]=<font class="stringliteral">""</font>;
00727
00728 <font class="comment">// Read free flag</font>
00729 f.serial (tmp);
00730
00731 <font class="comment">// If free, set the flag</font>
00732 <font class="keywordflow">if</font> (tmp)
00733 _Flags|=<a class="code" href="tile__bank_8h.html#a6">NL3D_CTILE_FREE_FLAG</a>;
00734
00735 <font class="comment">// Read diffuse bitmap and additive</font>
00736 f.serial (_BitmapName[diffuse]);
00737 f.serial (_BitmapName[additive]);
00738
00739 <font class="comment">// Don't need bump name</font>
00740 f.serial (tmpStr);
00741
00742 <font class="keywordflow">break</font>;
00743 }
00744 }
00745 <font class="comment">// ***************************************************************************</font>
<a name="l00746"></a><a class="code" href="classNL3D_1_1CTile.html#c0">00746</a> <font class="keywordtype">void</font> CTile::clearTile (CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)
00747 {
00748 <a class="code" href="classNL3D_1_1CTile.html#o1">_BitmapName</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>]=<font class="stringliteral">""</font>;
00749 }
00750
00751
00752 <font class="comment">// ***************************************************************************</font>
00753 <font class="comment">// ***************************************************************************</font>
00754 <font class="comment">// CTileSet.</font>
00755 <font class="comment">// ***************************************************************************</font>
00756 <font class="comment">// ***************************************************************************</font>
00757
00758
00759 <font class="comment">// ***************************************************************************</font>
<a name="l00760"></a><a class="code" href="classNL3D_1_1CTileSet.html#r0">00760</a> <font class="keyword">const</font> sint CTileSet::_Version=5;
00761 <font class="comment">// ***************************************************************************</font>
<a name="l00762"></a><a class="code" href="classNL3D_1_1CTileSet.html#r1">00762</a> <font class="keyword">const</font> <font class="keywordtype">char</font>* CTileSet::_ErrorMessage[CTileSet::errorCount]=
00763 {
00764 <font class="stringliteral">"No error."</font>, <font class="comment">// ok</font>
00765 <font class="stringliteral">"Top interface is incompatible."</font>, <font class="comment">// topInterfaceProblem</font>
00766 <font class="stringliteral">"Bottom interface is incompatible."</font>, <font class="comment">// bottomInterfaceProblem</font>
00767 <font class="stringliteral">"Left interface is incompatible."</font>, <font class="comment">// leftInterfaceProblem</font>
00768 <font class="stringliteral">"Right interface is incompatible."</font>, <font class="comment">// rightInterfaceProblem</font>
00769 <font class="stringliteral">"Add first a 128x128 tile."</font>, <font class="comment">// addFirstA128128</font>
00770 <font class="stringliteral">"Top and bottom interface not the same."</font>, <font class="comment">// topBottomNotTheSame, </font>
00771 <font class="stringliteral">"Right and left interface not the same."</font>, <font class="comment">// rightLeftNotTheSame</font>
00772 <font class="stringliteral">"Invalide bitmap size."</font>, <font class="comment">// sizeInvalide</font>
00773 };
00774 <font class="comment">// ***************************************************************************</font>
<a name="l00775"></a><a class="code" href="classNL3D_1_1CTileSet.html#r2">00775</a> <font class="keyword">const</font> CTileSet::TFlagBorder CTileSet::_TransitionFlags[CTileSet::count][4]=
00776 {
00777 {_0000,_1111,_0111,_0111}, <font class="comment">// tile 0</font>
00778 {_0111,_1111,_0111,_1111}, <font class="comment">// tile 1</font>
00779 {_0000,_0111,_0000,_0111}, <font class="comment">// tile 2</font>
00780 {_1110,_1110,_1111,_0000}, <font class="comment">// tile 3</font>
00781 {_1110,_1111,_1111,_0111}, <font class="comment">// tile 4</font>
00782 {_0000,_1110,_0111,_0000}, <font class="comment">// tile 5</font>
00783
00784 {_0000,_1111,_0001,_0001}, <font class="comment">// tile 6</font>
00785 {_0000,_1000,_0001,_0000}, <font class="comment">// tile 7</font>
00786 {_1111,_1000,_1111,_1000}, <font class="comment">// tile 8</font>
00787 {_1000,_1000,_1111,_0000}, <font class="comment">// tile 9</font>
00788 {_1000,_0000,_1000,_0000}, <font class="comment">// tile 10</font>
00789 {_1111,_0001,_1000,_1111}, <font class="comment">// tile 11</font>
00790
00791 {_0000,_1111,_0111,_0001}, <font class="comment">// tile 12</font>
00792 {_0000,_1111,_0001,_0111}, <font class="comment">// tile 13</font>
00793 {_0111,_1111,_0001,_1111}, <font class="comment">// tile 14</font>
00794 {_1110,_1000,_1111,_0000}, <font class="comment">// tile 15</font>
00795 {_1000,_1110,_1111,_0000}, <font class="comment">// tile 16</font>
00796 {_1111,_0001,_1110,_1111}, <font class="comment">// tile 17</font>
00797
00798 {_1000,_0000,_1110,_0000}, <font class="comment">// tile 18</font>
00799 {_0000,_0111,_0000,_0001}, <font class="comment">// tile 19</font>
00800 {_1111,_1000,_1111,_1110}, <font class="comment">// tile 21</font>
00801 {_0111,_0000,_0000,_1000}, <font class="comment">// tile 21</font>
00802 {_0000,_1000,_0111,_0000}, <font class="comment">// tile 22</font>
00803 {_1111,_0111,_1000,_1111}, <font class="comment">// tile 23</font>
00804
00805 {_1111,_0000,_1110,_1110}, <font class="comment">// tile 24</font>
00806 {_1111,_1110,_1111,_1110}, <font class="comment">// tile 25</font>
00807 {_1110,_0000,_1110,_0000}, <font class="comment">// tile 26</font>
00808 {_0111,_0111,_0000,_1111}, <font class="comment">// tile 27</font>
00809 {_1111,_0111,_1110,_1111}, <font class="comment">// tile 28</font>
00810 {_0111,_0000,_0000,_1110}, <font class="comment">// tile 29</font>
00811
00812 {_1111,_0000,_1000,_1000}, <font class="comment">// tile 30</font>
00813 {_0001,_0000,_0000,_1000}, <font class="comment">// tile 31</font>
00814 {_0001,_1111,_0001,_1111}, <font class="comment">// tile 32</font>
00815 {_0001,_0001,_0000,_1111}, <font class="comment">// tile 33</font>
00816 {_0000,_0001,_0000,_0001}, <font class="comment">// tile 34</font>
00817 {_1000,_1111,_1111,_0001}, <font class="comment">// tile 35</font>
00818
00819 {_1111,_0000,_1000,_1110}, <font class="comment">// tile 36</font>
00820 {_1111,_0000,_1110,_1000}, <font class="comment">// tile 37</font>
00821 {_1000,_1111,_1111,_0111}, <font class="comment">// tile 38</font>
00822 {_0001,_0111,_0000,_1111}, <font class="comment">// tile 39</font>
00823 {_0111,_0001,_0000,_1111}, <font class="comment">// tile 40</font>
00824 {_1111,_1110,_1111,_1000}, <font class="comment">// tile 41</font>
00825
00826 {_0000,_0001,_0000,_0111}, <font class="comment">// tile 42</font>
00827 {_1110,_0000,_1000,_0000}, <font class="comment">// tile 43</font>
00828 {_0001,_1111,_0111,_1111}, <font class="comment">// tile 44</font>
00829 {_0000,_1110,_0001,_0000}, <font class="comment">// tile 45</font>
00830 {_0001,_0000,_0000,_1110}, <font class="comment">// tile 46</font>
00831 {_1110,_1111,_1111,_0001} <font class="comment">// tile 47</font>
00832 };
00833 <font class="comment">// ***************************************************************************</font>
<a name="l00834"></a><a class="code" href="classNL3D_1_1CTileSet.html#a0">00834</a> CTileSet::CTileSet ()
00835 {
00836 <font class="comment">// Default, tileset 0</font>
00837 <a class="code" href="classNL3D_1_1CTileSet.html#o1">_Oriented</a> = <font class="keyword">false</font>;
00838 uint displace;
00839 <font class="keywordflow">for</font> (displace=<a class="code" href="classNL3D_1_1CTileSet.html#s31s14">FirstDisplace</a>; displace<<a class="code" href="classNL3D_1_1CTileSet.html#s31s16">CountDisplace</a>; displace++)
00840 <a class="code" href="classNL3D_1_1CTileSet.html#o9">_DisplacementBitmap</a>[displace]=0;
00841
00842 <font class="comment">// Default user surface data</font>
00843 <a class="code" href="classNL3D_1_1CTileSet.html#m0">SurfaceData</a> = 0;
00844 }
00845 <font class="comment">// ***************************************************************************</font>
<a name="l00846"></a><a class="code" href="classNL3D_1_1CTileSet.html#a9">00846</a> <font class="keywordtype">void</font> CTileSet::setName (<font class="keyword">const</font> std::string& name)
00847 {
00848 <a class="code" href="classNL3D_1_1CTileSet.html#o0">_Name</a>=name;
00849 }
00850 <font class="comment">// ***************************************************************************</font>
<a name="l00851"></a><a class="code" href="classNL3D_1_1CTileSet.html#a23">00851</a> <font class="keyword">const</font> std::string& <a class="code" href="zone__lighter_8cpp.html#a11">CTileSet::getName</a> ()<font class="keyword"> const</font>
00852 <font class="keyword"></font>{
00853 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#o0">_Name</a>;
00854 }
00855 <font class="comment">// ***************************************************************************</font>
<a name="l00856"></a><a class="code" href="classNL3D_1_1CTileSet.html#a42">00856</a> <font class="keywordtype">void</font> CTileSet::serial(IStream &f) <font class="keywordflow">throw</font>(EStream)
00857 {
00858 sint streamver = f.serialVersion(_Version);
00859
00860 CTileBorder tmp;
00861
00862 <font class="comment">// serial the user surface data</font>
00863 <font class="keywordflow">if</font> (streamver>=5)
00864 {
00865 f.serial (SurfaceData);
00866 }
00867
00868 <font class="comment">// serial the oriented info which tell if the tile has a special orientation</font>
00869 <font class="keywordflow">if</font> (streamver>=4)
00870 {
00871 f.serial (_Oriented);
00872 }
00873
00874 <font class="comment">// serial vegetable info.</font>
00875 <font class="keywordflow">if</font> (streamver>=3)
00876 {
00877 <font class="comment">// serialisze only the FileName, not the descrpitor</font>
00878 f.serial(_TileVegetableDescFileName);
00879 }
00880
00881 <font class="comment">// New version</font>
00882 <font class="keywordflow">if</font> (streamver>=2)
00883 {
00884 uint displace;
00885 <font class="keywordflow">for</font> (displace=FirstDisplace; displace<CountDisplace; displace++)
00886 f.serial (_DisplacementBitmap[displace]);
00887 }
00888
00889 <font class="comment">// Serial displacement map filename, obsolete</font>
00890 <font class="keywordflow">if</font> (streamver==1)
00891 {
00892 <font class="comment">// Remove obsolete data</font>
00893 string tmp;
00894 <font class="keywordflow">for</font> (uint displace=FirstDisplace; displace<CountDisplace; displace++)
00895 f.serial (tmp);
00896 }
00897
00898 <font class="keywordtype">int</font> i;
00899 f.serial (_Name);
00900 f.serialCont (_Tile128);
00901 f.serialCont (_Tile256);
00902 <font class="keywordflow">for</font> (i=0; i<count; i++)
00903 f.serial (_TileTransition[i]);
00904 f.serialCont (_ChildName);
00905 f.serial (_Border128[CTile::diffuse]);
00906 f.serial (_Border128[CTile::additive]);
00907
00908 <font class="comment">// old field, border bump 128</font>
00909 <font class="keywordflow">if</font> (streamver==0)
00910 f.serial (tmp);
00911
00912 f.serial (_Border256[CTile::diffuse]);
00913 f.serial (_Border256[CTile::additive]);
00914
00915 <font class="comment">// old field, border bump 256</font>
00916 <font class="keywordflow">if</font> (streamver==0)
00917 f.serial (tmp);
00918
00919 <font class="keywordflow">for</font> (i=0; i<count; i++)
00920 {
00921 f.serial (_BorderTransition[i][CTile::diffuse]);
00922 f.serial (_BorderTransition[i][CTile::additive]);
00923 f.serial (_BorderTransition[i][CTile::alpha]);
00924
00925 <font class="comment">// Reset the diffuse and alpha border if old version</font>
00926 <font class="keywordflow">if</font> (streamver==0)
00927 {
00928 _BorderTransition[i][CTile::diffuse].reset();
00929 _BorderTransition[i][CTile::alpha].reset();
00930 }
00931 }
00932 }
00933 <font class="comment">// ***************************************************************************</font>
<a name="l00934"></a><a class="code" href="classNL3D_1_1CTileSet.html#a1">00934</a> <font class="keywordtype">void</font> CTileSet::addTile128 (<font class="keywordtype">int</font>& indexInTileSet, CTileBank& bank)
00935 {
00936 <font class="comment">// Create a tile</font>
00937 sint <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=bank.createTile ();
00938
00939 <font class="comment">// Index of the new tile</font>
00940 indexInTileSet=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.size();
00941
00942 <font class="comment">// Add to the end of the list</font>
00943 <a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.push_back (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00944 }
00945 <font class="comment">// ***************************************************************************</font>
<a name="l00946"></a><a class="code" href="classNL3D_1_1CTileSet.html#a15">00946</a> <font class="keywordtype">void</font> CTileSet::setBorder (CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
00947 {
00948 <font class="comment">// This is our new border desc</font>
00949 <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>;
00950 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>;
00951 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].doubleSize ();
00952 }
00953 <font class="comment">// ***************************************************************************</font>
<a name="l00954"></a><a class="code" href="classNL3D_1_1CTileSet.html#a11">00954</a> <font class="keywordtype">void</font> CTileSet::setTile128 (<font class="keywordtype">int</font> indexInTileSet, <font class="keyword">const</font> std::string& name, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank)
00955 {
00956 <font class="comment">// Edit a tile</font>
00957 CTile *tile=bank.getTile (<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>[indexInTileSet]);
00958 tile->setFileName (<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, name);
00959 tile->setRotAlpha (0);
00960 }
00961 <font class="comment">// ***************************************************************************</font>
<a name="l00962"></a><a class="code" href="classNL3D_1_1CTileSet.html#a20">00962</a> CTileSet::TError CTileSet::checkTile128 (CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <font class="keywordtype">int</font>& pixel, <font class="keywordtype">int</font>& composante)
00963 {
00964 <font class="comment">// Self check</font>
00965 <font class="keywordflow">if</font> ((<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>.getWidth()!=128)||(<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>.getHeight()!=128))
00966 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s8">sizeInvalide</a>;
00967 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::top, CTileBorder::bottom, pixel, composante))
00968 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s6">topBottomNotTheSame</a>;
00969 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::left, CTileBorder::right, pixel, composante))
00970 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s7">rightLeftNotTheSame</a>;
00971
00972 <font class="comment">// Check</font>
00973 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].isSet())
00974 {
00975 <font class="comment">// Other check</font>
00976 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::top, CTileBorder::top, pixel, composante))
00977 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s1">topInterfaceProblem</a>;
00978 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::bottom, CTileBorder::bottom, pixel, composante))
00979 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s2">bottomInterfaceProblem</a>;
00980 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::left, CTileBorder::left, pixel, composante))
00981 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s3">leftInterfaceProblem</a>;
00982 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::right, CTileBorder::right, pixel, composante))
00983 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s4">rightInterfaceProblem</a>;
00984 }
00985 <font class="keywordflow">else</font>
00986 {
00987 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s5">addFirstA128128</a>;
00988 }
00989
00990 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s0">ok</a>;
00991 }
00992 <font class="comment">// ***************************************************************************</font>
<a name="l00993"></a><a class="code" href="classNL3D_1_1CTileSet.html#a2">00993</a> <font class="keywordtype">void</font> CTileSet::addTile256 (<font class="keywordtype">int</font>& indexInTileSet, CTileBank& bank)
00994 {
00995 <font class="comment">// Create a tile</font>
00996 sint <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=bank.createTile ();
00997
00998 <font class="comment">// Index of the new tile</font>
00999 indexInTileSet=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.size();
01000
01001 <font class="comment">// Add to the end of the list</font>
01002 <a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.push_back (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
01003 }
01004 <font class="comment">// ***************************************************************************</font>
<a name="l01005"></a><a class="code" href="classNL3D_1_1CTileSet.html#a21">01005</a> CTileSet::TError CTileSet::checkTile256 (CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <font class="keywordtype">int</font>& pixel, <font class="keywordtype">int</font>& composante)
01006 {
01007 <font class="comment">// Self check</font>
01008 <font class="keywordflow">if</font> ((<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>.getWidth()!=256)||(<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>.getHeight()!=256))
01009 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s8">sizeInvalide</a>;
01010 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::top, CTileBorder::bottom, pixel, composante))
01011 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s6">topBottomNotTheSame</a>;
01012 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::left, CTileBorder::right, pixel, composante))
01013 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s7">rightLeftNotTheSame</a>;
01014
01015 <font class="comment">// Check if prb</font>
01016 <font class="keywordflow">if</font> ((!<a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].isSet())&&(<a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].isSet()))
01017 {
01018 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>]=<a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>];
01019 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].doubleSize ();
01020 }
01021
01022 <font class="comment">// Check</font>
01023 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].isSet())
01024 {
01025
01026 <font class="comment">// Other check</font>
01027 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::top, CTileBorder::top, pixel, composante))
01028 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s1">topInterfaceProblem</a>;
01029 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::bottom, CTileBorder::bottom, pixel, composante))
01030 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s2">bottomInterfaceProblem</a>;
01031 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::left, CTileBorder::left, pixel, composante))
01032 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s3">leftInterfaceProblem</a>;
01033 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::right, CTileBorder::right, pixel, composante))
01034 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s4">rightInterfaceProblem</a>;
01035 }
01036 <font class="keywordflow">else</font>
01037 {
01038 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s5">addFirstA128128</a>;
01039 }
01040
01041 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s0">ok</a>;
01042 }
01043 <font class="comment">// ***************************************************************************</font>
<a name="l01044"></a><a class="code" href="classNL3D_1_1CTileSet.html#a12">01044</a> <font class="keywordtype">void</font> CTileSet::setTile256 (<font class="keywordtype">int</font> indexInTileSet, <font class="keyword">const</font> std::string& name, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank)
01045 {
01046 <font class="comment">// Edit a tile</font>
01047 CTile *tile=bank.getTile (<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>[indexInTileSet]);
01048 tile->setFileName (<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, name);
01049 tile->setRotAlpha (0);
01050 }
01051 <font class="comment">// ***************************************************************************</font>
<a name="l01052"></a><a class="code" href="classNL3D_1_1CTileSet.html#a13">01052</a> <font class="keywordtype">void</font> CTileSet::setTileTransition (TTransition transition, <font class="keyword">const</font> std::string& name, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank,
01053 <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
01054 {
01055 <font class="comment">// Check is not an alpha channel</font>
01056 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>!=CTile::alpha); <font class="comment">// use setTileTransitionAlpha</font>
01057
01058 <font class="comment">// Create a tile</font>
01059 <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[transition][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>;
01060
01061 <font class="comment">// Set the tile file name</font>
01062 CTile *tile=bank.getTile (<a class="code" href="classNL3D_1_1CTileSet.html#o4">_TileTransition</a>[transition]._Tile);
01063 tile->setFileName (<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, name);
01064 }
01065 <font class="comment">// ***************************************************************************</font>
<a name="l01066"></a><a class="code" href="classNL3D_1_1CTileSet.html#a14">01066</a> <font class="keywordtype">void</font> CTileSet::setTileTransitionAlpha (TTransition transition, <font class="keyword">const</font> std::string& name, CTileBank& bank,
01067 <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, uint8 rot)
01068 {
01069 <font class="comment">// Check some args</font>
01070 <a class="code" href="debug_8h.html#a6">nlassert</a> (rot<4);
01071
01072 <font class="comment">// Create a tile</font>
01073 <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[transition][CTile::alpha]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>;
01074
01075 <font class="comment">// Set the tile file name</font>
01076 CTile *tile=bank.getTile (<a class="code" href="classNL3D_1_1CTileSet.html#o4">_TileTransition</a>[transition]._Tile);
01077 tile->setFileName (CTile::alpha, name);
01078 tile->setRotAlpha (rot);
01079 }
01080 <font class="comment">// ***************************************************************************</font>
<a name="l01081"></a><a class="code" href="classNL3D_1_1CTileSet.html#a22">01081</a> CTileSet::TError CTileSet::checkTileTransition (TTransition transition, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, <font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <font class="keywordtype">int</font>& indexError,
01082 <font class="keywordtype">int</font>& pixel, <font class="keywordtype">int</font>& composante)
01083 {
01084 <a class="code" href="debug_8h.html#a6">nlassert</a> (transition>=0);
01085 <a class="code" href="debug_8h.html#a6">nlassert</a> (transition<<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>);
01086
01087 <font class="comment">// Check</font>
01088 indexError=-1;
01089
01090 <font class="comment">// Top</font>
01091 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> ((<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01092 <font class="keywordflow">if</font> (indexError!=-1)
01093 {
01094 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::top, CTileBorder::top, pixel, composante))
01095 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s1">topInterfaceProblem</a>;
01096 }
01097 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01098 <font class="keywordflow">if</font> (indexError!=-1)
01099 {
01100 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::top, CTileBorder::bottom, pixel, composante))
01101 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s1">topInterfaceProblem</a>;
01102 }
01103 indexError=-1;
01104 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>]==<a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>)
01105 {
01106 <font class="keywordflow">if</font> (!CTileBorder::allAlphaSet (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::top, pixel, composante))
01107 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s1">topInterfaceProblem</a>;
01108 }
01109
01110 <font class="comment">// Bottom</font>
01111 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01112 <font class="keywordflow">if</font> (indexError!=-1)
01113 {
01114 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::bottom, CTileBorder::bottom, pixel, composante))
01115 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s2">bottomInterfaceProblem</a>;
01116 }
01117 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> ((<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01118 <font class="keywordflow">if</font> (indexError!=-1)
01119 {
01120 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::bottom, CTileBorder::top, pixel, composante))
01121 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s2">bottomInterfaceProblem</a>;
01122 }
01123 indexError=-1;
01124 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>]==<a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>)
01125 {
01126 <font class="keywordflow">if</font> (!CTileBorder::allAlphaSet (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::bottom, pixel, composante))
01127 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s2">bottomInterfaceProblem</a>;
01128 }
01129
01130 <font class="comment">// Left</font>
01131 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01132 <font class="keywordflow">if</font> (indexError!=-1)
01133 {
01134 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::left, CTileBorder::left, pixel, composante))
01135 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s3">leftInterfaceProblem</a>;
01136 }
01137 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>], transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01138 <font class="keywordflow">if</font> (indexError!=-1)
01139 {
01140 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::left, CTileBorder::right, pixel, composante))
01141 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s3">leftInterfaceProblem</a>;
01142 }
01143 indexError=-1;
01144 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>]==<a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>)
01145 {
01146 <font class="keywordflow">if</font> (!CTileBorder::allAlphaSet (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::left, pixel, composante))
01147 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s3">leftInterfaceProblem</a>;
01148 }
01149
01150 <font class="comment">// Right</font>
01151 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>], transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01152 <font class="keywordflow">if</font> (indexError!=-1)
01153 {
01154 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::right, CTileBorder::right, pixel, composante))
01155 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s4">rightInterfaceProblem</a>;
01156 }
01157 indexError=<a class="code" href="classNL3D_1_1CTileSet.html#a37">getExistingTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, (<a class="code" href="classNL3D_1_1CTileSet.html#s33">TFlagBorder</a>)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>], <a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>, transition, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01158 <font class="keywordflow">if</font> (indexError!=-1)
01159 {
01160 <font class="keywordflow">if</font> (!CTileBorder::compare (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[indexError][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>], CTileBorder::right, CTileBorder::left, pixel, composante))
01161 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s4">rightInterfaceProblem</a>;
01162 }
01163 indexError=-1;
01164 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>]==<a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>)
01165 {
01166 <font class="keywordflow">if</font> (!CTileBorder::allAlphaSet (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, CTileBorder::right, pixel, composante))
01167 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s4">rightInterfaceProblem</a>;
01168 }
01169 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s29s0">ok</a>;
01170 }
01171 <font class="comment">// ***************************************************************************</font>
<a name="l01172"></a><a class="code" href="classNL3D_1_1CTileSet.html#a3">01172</a> <font class="keywordtype">void</font> CTileSet::removeTile128 (<font class="keywordtype">int</font> indexInTileSet, CTileBank& bank)
01173 {
01174 <font class="comment">// Check args</font>
01175 <a class="code" href="debug_8h.html#a6">nlassert</a> (indexInTileSet>=0);
01176 <a class="code" href="debug_8h.html#a6">nlassert</a> (indexInTileSet<(sint)<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.size());
01177
01178 <font class="comment">// Old index</font>
01179 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>[indexInTileSet];
01180
01181 <font class="comment">// Erase</font>
01182 <a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.erase (<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.begin()+indexInTileSet);
01183 bank.freeTile (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
01184
01185 <font class="comment">// Erase border if it is the last texture</font>
01186 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::diffuse);
01187 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::additive);
01188 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::alpha);
01189 }
01190 <font class="comment">// ***************************************************************************</font>
<a name="l01191"></a><a class="code" href="classNL3D_1_1CTileSet.html#a4">01191</a> <font class="keywordtype">void</font> CTileSet::removeTile256 (<font class="keywordtype">int</font> indexInTileSet, CTileBank& bank)
01192 {
01193 <font class="comment">// Check args</font>
01194 <a class="code" href="debug_8h.html#a6">nlassert</a> (indexInTileSet>=0);
01195 <a class="code" href="debug_8h.html#a6">nlassert</a> (indexInTileSet<(sint)<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.size());
01196
01197 <font class="comment">// Old index</font>
01198 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>[indexInTileSet];
01199
01200 <font class="comment">// Erase</font>
01201 <a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.erase (<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.begin()+indexInTileSet);
01202 bank.freeTile (<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
01203
01204 <font class="comment">// Erase border if it is the last texture</font>
01205 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::diffuse);
01206 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::additive);
01207 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, CTile::alpha);
01208 }
01209 <font class="comment">// ***************************************************************************</font>
<a name="l01210"></a><a class="code" href="classNL3D_1_1CTileSet.html#d1">01210</a> CTileSet::TTransition CTileSet::getTransitionTile (TFlagBorder _top, TFlagBorder _bottom, TFlagBorder _left, TFlagBorder _right)
01211 {
01212 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> n=<a class="code" href="classNL3D_1_1CTileSet.html#s30s10">first</a>; n<<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>; n++)
01213 {
01214 <font class="keywordflow">if</font> (((_top==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_top==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>]))&&
01215 ((_bottom==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_bottom==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>]))&&
01216 ((_left==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_left==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>]))&&
01217 ((_right==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_right==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>])))
01218 {
01219 <font class="keywordflow">return</font> (TTransition)n;
01220 }
01221 }
01222 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s30s13">notfound</a>;
01223 }
01224 <font class="comment">// ***************************************************************************</font>
<a name="l01225"></a><a class="code" href="classNL3D_1_1CTileSet.html#a37">01225</a> CTileSet::TTransition CTileSet::getExistingTransitionTile (TFlagBorder _top, TFlagBorder _bottom, TFlagBorder _left, TFlagBorder _right, <font class="keywordtype">int</font> reject, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)
01226 {
01227 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> n=<a class="code" href="classNL3D_1_1CTileSet.html#s30s10">first</a>; n<<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>; n++)
01228 {
01229 <font class="keywordflow">if</font> ((n!=reject)&&
01230 (<a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[n][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].isSet ())&&
01231 ((_top==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_top==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>]))&&
01232 ((_bottom==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_bottom==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>]))&&
01233 ((_left==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_left==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>]))&&
01234 ((_right==<a class="code" href="classNL3D_1_1CTileSet.html#s33s28">dontcare</a>)||(_right==(TFlagBorder)<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[n][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>])))
01235 {
01236 <font class="keywordflow">return</font> (TTransition)n;
01237 }
01238 }
01239 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s30s13">notfound</a>;
01240 }
01241 <font class="comment">// ***************************************************************************</font>
<a name="l01242"></a><a class="code" href="classNL3D_1_1CTileSet.html#a39">01242</a> <font class="keywordtype">void</font> CTileSet::addChild (<font class="keyword">const</font> std::string& name)
01243 {
01244 <a class="code" href="classNL3D_1_1CTileSet.html#o5">_ChildName</a>.insert (name);
01245 }
01246 <font class="comment">// ***************************************************************************</font>
<a name="l01247"></a><a class="code" href="classNL3D_1_1CTileSet.html#a40">01247</a> <font class="keywordtype">void</font> CTileSet::removeChild (<font class="keyword">const</font> std::string& name)
01248 {
01249 <a class="code" href="classNL3D_1_1CTileSet.html#o5">_ChildName</a>.erase (name);
01250 }
01251 <font class="comment">// ***************************************************************************</font>
<a name="l01252"></a><a class="code" href="classNL3D_1_1CTileSet.html#d2">01252</a> CTileSet::TTransition CTileSet::getComplementaryTransition (TTransition transition)
01253 {
01254 <a class="code" href="debug_8h.html#a6">nlassert</a> ((transition>=<a class="code" href="classNL3D_1_1CTileSet.html#s30s10">first</a>)&&(transition<=<a class="code" href="classNL3D_1_1CTileSet.html#s30s11">last</a>));
01255 <a class="code" href="classNL3D_1_1CTileSet.html#s30">TTransition</a> trans=<a class="code" href="classNL3D_1_1CTileSet.html#d1">getTransitionTile</a> (<a class="code" href="classNL3D_1_1CTileSet.html#f0">getComplementaryBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>]),
01256 <a class="code" href="classNL3D_1_1CTileSet.html#f0">getComplementaryBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>]),
01257 <a class="code" href="classNL3D_1_1CTileSet.html#f0">getComplementaryBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>]),
01258 <a class="code" href="classNL3D_1_1CTileSet.html#f0">getComplementaryBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>]));
01259
01260 <a class="code" href="debug_8h.html#a6">nlassert</a> (trans!=<a class="code" href="classNL3D_1_1CTileSet.html#s30s13">notfound</a>);
01261
01262 <font class="keywordflow">return</font> trans;
01263 }
01264 <font class="comment">// ***************************************************************************</font>
<a name="l01265"></a><a class="code" href="classNL3D_1_1CTileSet.html#f0">01265</a> CTileSet::TFlagBorder CTileSet::getComplementaryBorder (TFlagBorder <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
01266 {
01267 <font class="keywordflow">switch</font> (border)
01268 {
01269 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>:
01270 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>;
01271 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s25">_0001</a>:
01272 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s24">_1110</a>;
01273 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s23">_0111</a>:
01274 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s26">_1000</a>;
01275 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s26">_1000</a>:
01276 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s23">_0111</a>;
01277 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s24">_1110</a>:
01278 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s25">_0001</a>;
01279 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>:
01280 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>;
01281 <font class="keywordflow">default</font>:
01282 <a class="code" href="debug_8h.html#a6">nlassert</a> (0); <font class="comment">// no</font>
01283 }
01284 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>;
01285 }
01286 <font class="comment">// ***************************************************************************</font>
<a name="l01287"></a><a class="code" href="classNL3D_1_1CTileSet.html#d3">01287</a> CTileSet::TFlagBorder CTileSet::getInvertBorder (TFlagBorder <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
01288 {
01289 <font class="keywordflow">switch</font> (border)
01290 {
01291 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>:
01292 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>;
01293 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s25">_0001</a>:
01294 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s26">_1000</a>;
01295 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s23">_0111</a>:
01296 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s24">_1110</a>;
01297 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s26">_1000</a>:
01298 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s25">_0001</a>;
01299 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s24">_1110</a>:
01300 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s23">_0111</a>;
01301 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>:
01302 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s22">_1111</a>;
01303 <font class="keywordflow">default</font>:
01304 <a class="code" href="debug_8h.html#a6">nlassert</a> (0); <font class="comment">// no</font>
01305 }
01306 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>;
01307 }
01308 <font class="comment">// ***************************************************************************</font>
<a name="l01309"></a><a class="code" href="classNL3D_1_1CTileSet.html#d4">01309</a> CTileSet::TFlagBorder CTileSet::getOrientedBorder (TBorder where, TFlagBorder <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
01310 {
01311 <font class="keywordflow">switch</font> (where)
01312 {
01313 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>:
01314 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>:
01315 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>;
01316 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>:
01317 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>:
01318 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#d3">getInvertBorder</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>);
01319 <font class="keywordflow">default</font>:
01320 <a class="code" href="debug_8h.html#a6">nlassert</a> (0); <font class="comment">// no</font>
01321 }
01322 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#s33s27">_0000</a>;
01323 }
01324 <font class="comment">// ***************************************************************************</font>
<a name="l01325"></a><a class="code" href="classNL3D_1_1CTileSet.html#d6">01325</a> CTileSet::TTransition CTileSet::rotateTransition (TTransition transition)
01326 {
01327 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#d1">getTransitionTile</a> (
01328 <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>, <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>, <a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>])), <font class="comment">// top</font>
01329 <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>, <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>, <a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>])), <font class="comment">// bottom</font>
01330 <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s19">left</a>, <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>, <a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s17">top</a>])), <font class="comment">// left</font>
01331 <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s20">right</a>, <a class="code" href="classNL3D_1_1CTileSet.html#d4">getOrientedBorder</a> (<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>, <a class="code" href="classNL3D_1_1CTileSet.html#r2">_TransitionFlags</a>[transition][<a class="code" href="classNL3D_1_1CTileSet.html#s32s18">bottom</a>])) <font class="comment">// right</font>
01332 );
01333 }
01334 <font class="comment">// ***************************************************************************</font>
<a name="l01335"></a><a class="code" href="classNL3D_1_1CTileSet.html#a5">01335</a> <font class="keywordtype">void</font> CTileSet::clearTile128 (<font class="keywordtype">int</font> indexInTileSet, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank)
01336 {
01337 <font class="keywordtype">int</font> nTile=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>[indexInTileSet];
01338 bank.getTile (nTile)->clearTile(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01339
01340 <font class="comment">// Erase border if it is the last texture</font>
01341 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01342 }
01343 <font class="comment">// ***************************************************************************</font>
<a name="l01344"></a><a class="code" href="classNL3D_1_1CTileSet.html#a6">01344</a> <font class="keywordtype">void</font> CTileSet::clearTile256 (<font class="keywordtype">int</font> indexInTileSet, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank)
01345 {
01346 <font class="keywordtype">int</font> nTile=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>[indexInTileSet];
01347 bank.getTile (nTile)->clearTile(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01348
01349 <font class="comment">// Erase border if it is the last texture</font>
01350 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01351 }
01352 <font class="comment">// ***************************************************************************</font>
<a name="l01353"></a><a class="code" href="classNL3D_1_1CTileSet.html#a7">01353</a> <font class="keywordtype">void</font> CTileSet::clearTransition (TTransition transition, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>, CTileBank& bank)
01354 {
01355 <font class="keywordtype">int</font> nTile=<a class="code" href="classNL3D_1_1CTileSet.html#o4">_TileTransition</a>[transition]._Tile;
01356 <font class="keywordflow">if</font> (nTile!=-1)
01357 bank.getTile (nTile)->clearTile(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01358 <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[transition][<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].reset();
01359
01360 <font class="comment">// Erase border if it is the last texture</font>
01361 <a class="code" href="classNL3D_1_1CTileSet.html#c0">deleteBordersIfLast</a> (bank, <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>);
01362 }
01363 <font class="comment">// ***************************************************************************</font>
01364 <font class="comment">// Delete 128 and 256 borders if no more valid texture file name for each bitmap type.</font>
<a name="l01365"></a><a class="code" href="classNL3D_1_1CTileSet.html#c0">01365</a> <font class="keywordtype">void</font> CTileSet::deleteBordersIfLast (<font class="keyword">const</font> CTileBank& bank, CTile::TBitmap <a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)
01366 {
01367 <font class="comment">// delete is true</font>
01368 <font class="keywordtype">bool</font> bDelete=<font class="keyword">true</font>;
01369
01370 <font class="comment">// iterator..</font>
01371 std::vector<sint32>::iterator ite=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.begin();
01372
01373 <font class="comment">// Check all the 128x128 tiles</font>
01374 <font class="keywordflow">while</font> (ite!=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.end())
01375 {
01376 <font class="comment">// If the file name is valid</font>
01377 <font class="keywordflow">if</font> (bank.getTile (*ite)->getRelativeFileName(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)!=<font class="stringliteral">""</font>)
01378 {
01379 <font class="comment">// Don't delete, </font>
01380 bDelete=<font class="keyword">false</font>;
01381 <font class="keywordflow">break</font>;
01382 }
01383 ite++;
01384 }
01385 <font class="comment">// If break, not empty, return</font>
01386 <font class="keywordflow">if</font> (ite!=<a class="code" href="classNL3D_1_1CTileSet.html#o2">_Tile128</a>.end())
01387 <font class="keywordflow">return</font>;
01388
01389 <font class="comment">// Check all the 256x256 tiles</font>
01390 ite=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.begin();
01391 <font class="keywordflow">while</font> (ite!=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.end())
01392 {
01393 <font class="comment">// If the file name is valid</font>
01394 <font class="keywordflow">if</font> (bank.getTile (*ite)->getRelativeFileName(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)!=<font class="stringliteral">""</font>)
01395 {
01396 <font class="comment">// Don't delete, </font>
01397 bDelete=<font class="keyword">false</font>;
01398 <font class="keywordflow">break</font>;
01399 }
01400 ite++;
01401 }
01402 <font class="comment">// If break, not empty, return</font>
01403 <font class="keywordflow">if</font> (ite!=<a class="code" href="classNL3D_1_1CTileSet.html#o3">_Tile256</a>.end())
01404 <font class="keywordflow">return</font>;
01405
01406
01407 <font class="comment">// Check all the transitions tiles</font>
01408 sint trans;
01409 <font class="keywordflow">for</font> (trans=0; trans<<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>; trans++)
01410 {
01411 <font class="comment">// Get the tile associed with the transition</font>
01412 <font class="keywordtype">int</font> nTile=<a class="code" href="classNL3D_1_1CTileSet.html#o4">_TileTransition</a>[trans]._Tile;
01413
01414 <font class="comment">// If it is not NULL..</font>
01415 <font class="keywordflow">if</font> (nTile!=-1)
01416 {
01417 <font class="comment">// If the file name is valid</font>
01418 <font class="keywordflow">if</font> (bank.getTile (nTile)->getRelativeFileName(<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>)!=<font class="stringliteral">""</font>)
01419 {
01420 <font class="comment">// Don't delete, </font>
01421 bDelete=<font class="keyword">false</font>;
01422 <font class="keywordflow">break</font>;
01423 }
01424 }
01425 }
01426 <font class="keywordflow">if</font> (trans!=<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>)
01427 <font class="keywordflow">return</font>;
01428
01429 <font class="comment">// Ok, erase borders because no tile use it anymore</font>
01430 <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].reset();
01431 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[<a class="code" href="driver__opengl__extension__def_8h.html#a373">type</a>].reset();
01432 }
01433 <font class="comment">// ***************************************************************************</font>
<a name="l01434"></a><a class="code" href="classNL3D_1_1CTileSet.html#a8">01434</a> <font class="keywordtype">void</font> CTileSet::clearDisplacement (TDisplacement displacement, CTileBank& bank)
01435 {
01436 <font class="comment">// checks</font>
01437 <a class="code" href="debug_8h.html#a6">nlassert</a> (displacement>=<a class="code" href="classNL3D_1_1CTileSet.html#s31s14">FirstDisplace</a>);
01438 <a class="code" href="debug_8h.html#a6">nlassert</a> (displacement<=<a class="code" href="classNL3D_1_1CTileSet.html#s31s15">LastDisplace</a>);
01439
01440 <font class="comment">// Backup the id</font>
01441 <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a356">id</a>=<a class="code" href="classNL3D_1_1CTileSet.html#o9">_DisplacementBitmap</a>[displacement];
01442
01443 <font class="comment">// Clear map id</font>
01444 <a class="code" href="classNL3D_1_1CTileSet.html#o9">_DisplacementBitmap</a>[displacement]=0;
01445
01446 <font class="comment">// Tell the bank we remove it</font>
01447 bank.removeDisplacementMap (<a class="code" href="driver__opengl__extension__def_8h.html#a356">id</a>);
01448 }
01449 <font class="comment">// ***************************************************************************</font>
<a name="l01450"></a><a class="code" href="classNL3D_1_1CTileSet.html#a16">01450</a> <font class="keywordtype">void</font> CTileSet::setDisplacement (TDisplacement displacement, <font class="keyword">const</font> std::string& fileName, CTileBank& bank)
01451 {
01452 <font class="comment">// checks</font>
01453 <a class="code" href="debug_8h.html#a6">nlassert</a> (displacement>=<a class="code" href="classNL3D_1_1CTileSet.html#s31s14">FirstDisplace</a>);
01454 <a class="code" href="debug_8h.html#a6">nlassert</a> (displacement<=<a class="code" href="classNL3D_1_1CTileSet.html#s31s15">LastDisplace</a>);
01455
01456 <font class="comment">// Clear it</font>
01457 bank.removeDisplacementMap (<a class="code" href="classNL3D_1_1CTileSet.html#o9">_DisplacementBitmap</a>[displacement]);
01458
01459 <font class="comment">// Get displacement map</font>
01460 <a class="code" href="classNL3D_1_1CTileSet.html#o9">_DisplacementBitmap</a>[displacement]=bank.getDisplacementMap (fileName);
01461 }
01462 <font class="comment">// ***************************************************************************</font>
<a name="l01463"></a><a class="code" href="classNL3D_1_1CTileSet.html#a38">01463</a> <font class="keywordtype">void</font> CTileSet::cleanUnusedData ()
01464 {
01465 <a class="code" href="classNL3D_1_1CTileSet.html#o0">_Name</a>=<font class="stringliteral">""</font>;
01466 <a class="code" href="classNL3D_1_1CTileSet.html#o5">_ChildName</a>.clear();
01467 <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[0].reset ();
01468 <a class="code" href="classNL3D_1_1CTileSet.html#o6">_Border128</a>[1].reset ();
01469 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[0].reset ();
01470 <a class="code" href="classNL3D_1_1CTileSet.html#o7">_Border256</a>[1].reset ();
01471 <font class="keywordflow">for</font> (uint i=0; i<<a class="code" href="classNL3D_1_1CTileSet.html#s30s12">count</a>; i++)
01472 <font class="keywordflow">for</font> (uint j=0; j<CTile::bitmapCount; j++)
01473 <a class="code" href="classNL3D_1_1CTileSet.html#o8">_BorderTransition</a>[i][j].reset();
01474 }
01475
01476
01477 <font class="comment">// ***************************************************************************</font>
<a name="l01478"></a><a class="code" href="classNL3D_1_1CTileSet.html#a17">01478</a> <font class="keywordtype">void</font> CTileSet::setTileVegetableDescFileName (<font class="keyword">const</font> std::string &fileName)
01479 {
01480 <a class="code" href="classNL3D_1_1CTileSet.html#o11">_TileVegetableDescFileName</a>= fileName;
01481 }
01482 <font class="comment">// ***************************************************************************</font>
<a name="l01483"></a><a class="code" href="classNL3D_1_1CTileSet.html#a33">01483</a> <font class="keyword">const</font> std::string& CTileSet::getTileVegetableDescFileName ()<font class="keyword"> const</font>
01484 <font class="keyword"></font>{
01485 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#o11">_TileVegetableDescFileName</a>;
01486 }
01487 <font class="comment">// ***************************************************************************</font>
<a name="l01488"></a><a class="code" href="classNL3D_1_1CTileSet.html#a18">01488</a> <font class="keywordtype">void</font> CTileSet::setTileVegetableDesc (<font class="keyword">const</font> CTileVegetableDesc &tvd)
01489 {
01490 <a class="code" href="classNL3D_1_1CTileSet.html#o10">_TileVegetableDesc</a>= tvd;
01491 }
01492
01493 <font class="comment">// ***************************************************************************</font>
<a name="l01494"></a><a class="code" href="classNL3D_1_1CTileSet.html#a35">01494</a> CTileVegetableDesc &CTileSet::getTileVegetableDesc()
01495 {
01496 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#o10">_TileVegetableDesc</a>;
01497 }
01498
01499 <font class="comment">// ***************************************************************************</font>
<a name="l01500"></a><a class="code" href="classNL3D_1_1CTileSet.html#a36">01500</a> <font class="keyword">const</font> CTileVegetableDesc &CTileSet::getTileVegetableDesc()<font class="keyword"> const</font>
01501 <font class="keyword"></font>{
01502 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CTileSet.html#o10">_TileVegetableDesc</a>;
01503 }
01504
01505 <font class="comment">// ***************************************************************************</font>
<a name="l01506"></a><a class="code" href="classNL3D_1_1CTileSet.html#a19">01506</a> <font class="keywordtype">void</font> CTileSet::loadTileVegetableDesc()
01507 {
01508 <font class="keywordflow">if</font>(<a class="code" href="classNL3D_1_1CTileSet.html#o11">_TileVegetableDescFileName</a>!=<font class="stringliteral">""</font>)
01509 {
01510 <font class="keywordflow">try</font>
01511 {
01512 string fname= CPath::lookup(<a class="code" href="classNL3D_1_1CTileSet.html#o11">_TileVegetableDescFileName</a>);
01513 CIFile f(fname);
01514 <font class="comment">// load the TileVegetableDesc</font>
01515 f.serial(<a class="code" href="classNL3D_1_1CTileSet.html#o10">_TileVegetableDesc</a>);
01516 }
01517 <font class="keywordflow">catch</font>(Exception &e)
01518 {
01519 <a class="code" href="debug_8h.html#a1">nlinfo</a>(<font class="stringliteral">"Error loading TileVegetableDesc: %s"</font>, e.what());
01520 }
01521 }
01522 }
01523
01524
01525 <font class="comment">// ***************************************************************************</font>
01526 <font class="comment">// ***************************************************************************</font>
01527 <font class="comment">// CTileBorder.</font>
01528 <font class="comment">// ***************************************************************************</font>
01529 <font class="comment">// ***************************************************************************</font>
01530
01531
01532 <font class="comment">// ***************************************************************************</font>
<a name="l01533"></a><a class="code" href="classNL3D_1_1CTileBorder.html#r0">01533</a> <font class="keyword">const</font> sint CTileBorder::_Version=0;
01534 <font class="comment">// ***************************************************************************</font>
<a name="l01535"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a6">01535</a> <font class="keywordtype">void</font> CTileBorder::serial(IStream &f) <font class="keywordflow">throw</font>(EStream)
01536 {
01537 (void)f.serialVersion(_Version);
01538
01539 f.serial (_Set);
01540 f.serial (_Width);
01541 f.serial (_Height);
01542 f.serialCont (_Borders[top]);
01543 f.serialCont (_Borders[bottom]);
01544 f.serialCont (_Borders[left]);
01545 f.serialCont (_Borders[right]);
01546 }
01547 <font class="comment">// ***************************************************************************</font>
<a name="l01548"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a1">01548</a> <font class="keywordtype">void</font> CTileBorder::set (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>, <font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>, <font class="keyword">const</font> std::vector<CBGRA>& array)
01549 {
01550 <font class="comment">// Check array size</font>
01551 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>>0);
01552 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>>0);
01553 <a class="code" href="debug_8h.html#a6">nlassert</a> ((sint)array.size()==<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>*<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>);
01554
01555 <font class="comment">// Copy size</font>
01556 <a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
01557 <a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>;
01558
01559 <font class="comment">// Last line</font>
01560 <font class="keywordtype">int</font> lastLine=(<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>-1)*<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>;
01561 <font class="keywordtype">int</font> lastCol=(<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>-1);
01562 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>);
01563 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>);
01564 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>);
01565 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>);
01566
01567 <font class="comment">// Copy top/bottom border</font>
01568 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a><<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>++)
01569 {
01570 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>]=array[<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>];
01571 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>]=array[<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+lastLine];
01572 }
01573
01574 <font class="comment">// Copy left/right border</font>
01575 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> h=0; h<<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>; h++)
01576 {
01577 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>][h]=array[h*<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>];
01578 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>][h]=array[h*<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>+lastCol];
01579 }
01580
01581 <font class="comment">// Set</font>
01582 <a class="code" href="classNL3D_1_1CTileBorder.html#o0">_Set</a>=<font class="keyword">true</font>;
01583 }
01584 <font class="comment">// ***************************************************************************</font>
01585 <font class="keywordtype">void</font> CTileBorder::get (<font class="keywordtype">int</font> &<a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>, <font class="keywordtype">int</font> &<a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>, std::vector<CBGRA>& array)<font class="keyword"> const</font>
01586 <font class="keyword"></font>{
01587 <font class="comment">// Go</font>
01588 <font class="keywordflow">if</font> (_Set)
01589 {
01590 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>=<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>;
01591 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>=<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>;
01592 array.resize (0);
01593 array.resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>*<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>);
01594 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()==(uint)<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>);
01595 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()==(uint)<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>);
01596 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()==(uint)<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>);
01597 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>].<a class="code" href="cf__lexical_8cpp.html#a94">size</a>()==(uint)<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>);
01598
01599 <font class="comment">// Fill</font>
01600 CBGRA black(0,0,0);
01601 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> p=0; p<<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>*<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>; p++)
01602 {
01603 array[p]=black;
01604 }
01605
01606 <font class="comment">// Last line</font>
01607 <font class="keywordtype">int</font> lastLine=(<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>-1)*<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>;
01608 <font class="keywordtype">int</font> lastCol=(<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>-1);
01609
01610 <font class="comment">// Copy top/bottom border</font>
01611 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a><<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>++)
01612 {
01613 array[<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>];
01614 array[<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+lastLine]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>];
01615 }
01616
01617 <font class="comment">// Copy left/right border</font>
01618 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> h=0; h<<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>; h++)
01619 {
01620 array[h*<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>][h];
01621 array[h*<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>+lastCol]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>][h];
01622 }
01623 }
01624 <font class="keywordflow">else</font>
01625 {
01626 <a class="code" href="driver__opengl__extension__def_8h.html#a389">width</a>=0;
01627 <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a>=0;
01628 array.resize (0);
01629 }
01630 }
01631 <font class="comment">// ***************************************************************************</font>
<a name="l01632"></a><a class="code" href="classNL3D_1_1CTileBorder.html#d1">01632</a> <font class="keywordtype">bool</font> CTileBorder::compare (<font class="keyword">const</font> CTileBorder& border1, <font class="keyword">const</font> CTileBorder& border2, TBorder where1, TBorder where2, <font class="keywordtype">int</font>& pixel, <font class="keywordtype">int</font>& composante)
01633 {
01634 <font class="comment">// Check border is initialized</font>
01635 <a class="code" href="debug_8h.html#a6">nlassert</a> (border1.isSet());
01636 <a class="code" href="debug_8h.html#a6">nlassert</a> (border2.isSet());
01637
01638 <font class="keywordflow">if</font> (border1._Borders[where1].size()!=border2._Borders[where2].size())
01639 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01640 <font class="keywordflow">for</font> (pixel=0; pixel<(int)border1._Borders[where1].size(); pixel++)
01641 {
01642 <font class="keywordflow">if</font> (border1._Borders[where1][pixel].R!=border2._Borders[where2][pixel].R)
01643 {
01644 composante=0;
01645 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01646 }
01647 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (border1._Borders[where1][pixel].G!=border2._Borders[where2][pixel].G)
01648 {
01649 composante=1;
01650 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01651 }
01652 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (border1._Borders[where1][pixel].B!=border2._Borders[where2][pixel].B)
01653 {
01654 composante=2;
01655 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01656 }
01657 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (border1._Borders[where1][pixel].A!=border2._Borders[where2][pixel].A)
01658 {
01659 composante=3;
01660 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01661 }
01662 }
01663
01664 <font class="keywordflow">return</font> <font class="keyword">true</font>;
01665 }
01666 <font class="comment">// ***************************************************************************</font>
<a name="l01667"></a><a class="code" href="classNL3D_1_1CTileBorder.html#d0">01667</a> <font class="keywordtype">bool</font> CTileBorder::allAlphaSet (<font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>, TBorder where, <font class="keywordtype">int</font>& pixel, <font class="keywordtype">int</font>& composante)
01668 {
01669 <font class="comment">// Check border is initialized</font>
01670 <a class="code" href="debug_8h.html#a6">nlassert</a> (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>.isSet());
01671
01672 <font class="comment">// always Alpha</font>
01673 composante=3;
01674
01675 <font class="keywordflow">for</font> (pixel=0; pixel<(int)<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[where].size(); pixel++)
01676 {
01677 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[where][pixel].A!=0xff)
01678 <font class="keywordflow">return</font> <font class="keyword">false</font>;
01679 }
01680
01681 <font class="keywordflow">return</font> <font class="keyword">true</font>;
01682 }
01683 <font class="comment">// ***************************************************************************</font>
<a name="l01684"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a4">01684</a> <font class="keywordtype">bool</font> CTileBorder::operator== (<font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)<font class="keyword"> const</font>
01685 <font class="keyword"></font>{
01686 <font class="keywordflow">return</font> (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>==<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Width) && (<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>==<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Height) && (<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>==<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders);
01687 }
01688 <font class="comment">// ***************************************************************************</font>
<a name="l01689"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a5">01689</a> <font class="keywordtype">void</font> CTileBorder::operator= (<font class="keyword">const</font> CTileBorder& <a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>)
01690 {
01691 <a class="code" href="classNL3D_1_1CTileBorder.html#o0">_Set</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Set;
01692 <a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Width;
01693 <a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Width;
01694 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>];
01695 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>];
01696 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>];
01697 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>]=<a class="code" href="driver__opengl__extension__def_8h.html#a392">border</a>._Borders[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>];
01698 }
01699
01700 <font class="comment">// ***************************************************************************</font>
<a name="l01701"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a3">01701</a> <font class="keywordtype">void</font> CTileBorder::doubleSize ()
01702 {
01703 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>*2);
01704 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>*2);
01705 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>*2);
01706 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>].resize (<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>*2);
01707
01708 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>=0; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a><<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>; <a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>++)
01709 {
01710 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>];
01711 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>+<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>][<a class="code" href="driver__opengl__extension__def_8h.html#a367">w</a>];
01712 }
01713 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> h=0; h<<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>; h++)
01714 {
01715 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>][h+<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>][h];
01716 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>][h+<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>][h];
01717 }
01718 }
01719 <font class="comment">// ***************************************************************************</font>
<a name="l01720"></a><a class="code" href="classNL3D_1_1CTileBorder.html#a11">01720</a> <font class="keywordtype">void</font> CTileBorder::rotate()
01721 {
01722 <font class="comment">// Copy the right</font>
01723 std::vector<NLMISC::CBGRA> tmpLeft=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>];
01724
01725 <font class="comment">// Top inverted becomes left</font>
01726 uint i, size;
01727 size=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>].size();
01728 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>].resize (size);
01729
01730 <font class="comment">// copy inverted</font>
01731 <font class="keywordflow">for</font> (i=0; i<size; i++)
01732 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s2">left</a>][i]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>][size-i-1];
01733
01734 <font class="comment">// Right become top</font>
01735 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s0">top</a>]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>];
01736
01737 <font class="comment">// bottom inverted becomes right</font>
01738 size=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>].size();
01739 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>].resize (size);
01740
01741 <font class="comment">// copy inverted</font>
01742 <font class="keywordflow">for</font> (i=0; i<size; i++)
01743 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s3">right</a>][i]=<a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>][size-i-1];
01744
01745 <font class="comment">// Left become bottom</font>
01746 <a class="code" href="classNL3D_1_1CTileBorder.html#o3">_Borders</a>[<a class="code" href="classNL3D_1_1CTileBorder.html#s5s1">bottom</a>]=tmpLeft;
01747
01748 <font class="comment">// Invert size</font>
01749 sint32 tmpSize=<a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>;
01750 <a class="code" href="classNL3D_1_1CTileBorder.html#o1">_Width</a>=<a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>;
01751 <a class="code" href="classNL3D_1_1CTileBorder.html#o2">_Height</a>=tmpSize;
01752 }
01753
01754 <font class="comment">// ***************************************************************************</font>
01755 <font class="comment">// ***************************************************************************</font>
01756 <font class="comment">// CTileSetTransition.</font>
01757 <font class="comment">// ***************************************************************************</font>
01758 <font class="comment">// ***************************************************************************</font>
01759
01760
01761 <font class="comment">// ***************************************************************************</font>
<a name="l01762"></a><a class="code" href="classNL3D_1_1CTileSetTransition.html#r0">01762</a> <font class="keyword">const</font> sint CTileSetTransition::_Version=1;
01763 <font class="comment">// ***************************************************************************</font>
<a name="l01764"></a><a class="code" href="classNL3D_1_1CTileSetTransition.html#a2">01764</a> <font class="keywordtype">void</font> CTileSetTransition::serial(<font class="keyword">class</font> <a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &f) <font class="keywordflow">throw</font>(EStream)
01765 {
01766 sint streamver = f.serialVersion(_Version);
01767
01768 <font class="keywordflow">switch</font> (streamver)
01769 {
01770 <font class="keywordflow">case</font> 0:
01771 {
01772 <font class="keywordtype">bool</font> doomy;
01773 f.serial (_Tile);
01774 f.serial (doomy); <font class="comment">// skip the old argu</font>
01775 }
01776 <font class="keywordflow">break</font>;
01777 <font class="keywordflow">case</font> 1:
01778 f.serial (_Tile);
01779 <font class="keywordflow">break</font>;
01780 }
01781 }
01782 <font class="comment">// ***************************************************************************</font>
01783
01784
01785 <font class="comment">// ***************************************************************************</font>
01786 <font class="comment">// ***************************************************************************</font>
01787 <font class="comment">// CTileNoise.</font>
01788 <font class="comment">// ***************************************************************************</font>
01789 <font class="comment">// ***************************************************************************</font>
01790
01791
01792 <font class="comment">// ***************************************************************************</font>
<a name="l01793"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a0">01793</a> CTileNoise::CTileNoise ()
01794 {
01795 <font class="comment">// Not loaded</font>
01796 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=NULL;
01797 <a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>=<font class="stringliteral">""</font>;
01798 }
01799 <font class="comment">// ***************************************************************************</font>
<a name="l01800"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a1">01800</a> CTileNoise::CTileNoise (<font class="keyword">const</font> CTileNoise &<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>)
01801 {
01802 <font class="comment">// Default ctor</font>
01803 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=NULL;
01804 <a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>=<font class="stringliteral">""</font>;
01805
01806 <font class="comment">// Copy</font>
01807 *<font class="keyword">this</font>=<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>;
01808 }
01809 <font class="comment">// ***************************************************************************</font>
<a name="l01810"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a2">01810</a> CTileNoise::~CTileNoise ()
01811 {
01812 <font class="keywordflow">if</font> (_TileNoiseMap)
01813 {
01814 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>;
01815 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=NULL;
01816 }
01817 }
01818 <font class="comment">// ***************************************************************************</font>
<a name="l01819"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a3">01819</a> CTileNoise& CTileNoise::operator= (<font class="keyword">const</font> CTileNoise &<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>)
01820 {
01821 <font class="comment">// Copy the filename</font>
01822 <a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>=<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._FileName;
01823
01824 <font class="comment">// Tile noise map ?</font>
01825 <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._TileNoiseMap)
01826 {
01827 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>==NULL)
01828 {
01829 <font class="comment">// Allocate it</font>
01830 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=<font class="keyword">new</font> CTileNoiseMap;
01831 }
01832
01833 <font class="comment">// Copy the noise map</font>
01834 *<a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=*<a class="code" href="driver__opengl__extension__def_8h.html#a409">src</a>._TileNoiseMap;
01835 }
01836 <font class="keywordflow">else</font>
01837 {
01838 <font class="comment">// Erase the map</font>
01839 <font class="keywordflow">if</font> (_TileNoiseMap)
01840 {
01841 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>;
01842 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=NULL;
01843 }
01844 }
01845 <font class="keywordflow">return</font> *<font class="keyword">this</font>;
01846 }
01847 <font class="comment">// ***************************************************************************</font>
<a name="l01848"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a4">01848</a> <font class="keywordtype">void</font> CTileNoise::serial (IStream& f)
01849 {
01850 <font class="comment">// Version</font>
01851 f.serialVersion (0);
01852
01853 <font class="comment">// Serial the file name</font>
01854 f.serial (<a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>);
01855 }
01856 <font class="comment">// ***************************************************************************</font>
<a name="l01857"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a5">01857</a> <font class="keywordtype">void</font> CTileNoise::setEmpty ()
01858 {
01859 <font class="comment">// Reset it</font>
01860 <a class="code" href="classNL3D_1_1CTileNoise.html#a6">reset</a>();
01861 <a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>=<font class="stringliteral">"EmptyDisplacementMap"</font>;
01862 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=<font class="keyword">new</font> CTileNoiseMap();
01863 memset (<a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>->Pixels, 0, <a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>*<a class="code" href="tile__noise__map_8h.html#a1">NL3D_TILE_NOISE_MAP_SIZE</a>);
01864 }
01865 <font class="comment">// ***************************************************************************</font>
<a name="l01866"></a><a class="code" href="classNL3D_1_1CTileNoise.html#a6">01866</a> <font class="keywordtype">void</font> CTileNoise::reset()
01867 {
01868 <font class="comment">// Erase the map</font>
01869 <font class="keywordflow">if</font> (_TileNoiseMap)
01870 {
01871 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>;
01872 <a class="code" href="classNL3D_1_1CTileNoise.html#o0">_TileNoiseMap</a>=NULL;
01873 }
01874
01875 <font class="comment">// Erase filename</font>
01876 <a class="code" href="classNL3D_1_1CTileNoise.html#o1">_FileName</a>=<font class="stringliteral">""</font>;
01877 }
01878 <font class="comment">// ***************************************************************************</font>
01879
01880 } <font class="comment">// NL3D</font>
</pre></div>
<!-- footer -->
<BR><FONT Size=+5> </FONT>
</TD>
<TD WIDTH=15><IMG SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|