Compare commits
2501 Commits
release-20
...
playtest-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5fcb297af | ||
|
|
dce04c9d11 | ||
|
|
0854cd33fa | ||
|
|
607e5c1a6e | ||
|
|
10f8bcf980 | ||
|
|
7d8d5dc30d | ||
|
|
b41718876c | ||
|
|
4ab5cd8e05 | ||
|
|
f2150fc403 | ||
|
|
9d5986c03f | ||
|
|
ebd8adae5e | ||
|
|
b2d37ba754 | ||
|
|
615ac2504a | ||
|
|
ac6227b4d1 | ||
|
|
d8b0c0d440 | ||
|
|
46691cdb31 | ||
|
|
52d9a7a31b | ||
|
|
60b3601ffa | ||
|
|
fea8dc11cf | ||
|
|
f485ef2ecf | ||
|
|
35370afa19 | ||
|
|
1c7cc60205 | ||
|
|
acb7534dde | ||
|
|
37208a608c | ||
|
|
5237c9149e | ||
|
|
87d2d607e6 | ||
|
|
abf772bd64 | ||
|
|
1edac09ea7 | ||
|
|
64ecd26152 | ||
|
|
6e13cb7f3b | ||
|
|
bc5c11e44f | ||
|
|
8fd4243861 | ||
|
|
9bbeb63989 | ||
|
|
1e53434e45 | ||
|
|
e5e9ff95d0 | ||
|
|
e4d66b3d7a | ||
|
|
3e0dd12db6 | ||
|
|
dac4d26841 | ||
|
|
dff60c3792 | ||
|
|
f39371d249 | ||
|
|
bdb0b249b0 | ||
|
|
d167eaea04 | ||
|
|
cadf689406 | ||
|
|
6f1f5e0ca0 | ||
|
|
e542290e95 | ||
|
|
4ec1edac06 | ||
|
|
4b629eced4 | ||
|
|
de9321a17e | ||
|
|
b5a9a480ff | ||
|
|
099aed6e14 | ||
|
|
d8ae966d64 | ||
|
|
d272377d66 | ||
|
|
bd0e29d274 | ||
|
|
2e4ded8f7a | ||
|
|
e0a30b2405 | ||
|
|
ba2cb14c5c | ||
|
|
33ffb41384 | ||
|
|
d0188e5728 | ||
|
|
f840d6b66c | ||
|
|
247ea6e2bd | ||
|
|
8fec285ea5 | ||
|
|
72285b2d36 | ||
|
|
ce1f4c3eec | ||
|
|
3285e2ac71 | ||
|
|
d88e092fc0 | ||
|
|
9721339067 | ||
|
|
674e9f3c86 | ||
|
|
6a8e820fd5 | ||
|
|
96bbd46fc2 | ||
|
|
e942c3a2a7 | ||
|
|
1e2bccbc59 | ||
|
|
72141aa916 | ||
|
|
0466cac3ab | ||
|
|
7f67b567f9 | ||
|
|
bf521518af | ||
|
|
009f6a3f70 | ||
|
|
34ec588392 | ||
|
|
1c04c6608f | ||
|
|
018ceb8d82 | ||
|
|
8c6074a081 | ||
|
|
32c3563a04 | ||
|
|
bad57b6ab7 | ||
|
|
eabe16b1ff | ||
|
|
72d2ebd3a8 | ||
|
|
cb2dd333a7 | ||
|
|
0a84ddc8fb | ||
|
|
40438e7fa6 | ||
|
|
c551cfca0f | ||
|
|
0dd73a1289 | ||
|
|
f480679ab1 | ||
|
|
1a9c762115 | ||
|
|
3457255fa9 | ||
|
|
67c1eaf919 | ||
|
|
3db98b6554 | ||
|
|
8a1e825946 | ||
|
|
d4364694ab | ||
|
|
c71e081afc | ||
|
|
51be8ef6bd | ||
|
|
93622ebeb2 | ||
|
|
9950706cb1 | ||
|
|
c6e9b00c8c | ||
|
|
d1f3ad81a6 | ||
|
|
b014a3d09c | ||
|
|
6e26173f0f | ||
|
|
3025e3cf62 | ||
|
|
e28bbf1f90 | ||
|
|
a831b8984a | ||
|
|
efb55d4cb9 | ||
|
|
376a6c7a5d | ||
|
|
b73ca27a8f | ||
|
|
8718a9cb44 | ||
|
|
d0d2c7a49b | ||
|
|
bed3fc2498 | ||
|
|
341522232e | ||
|
|
03eaf76cd8 | ||
|
|
a7504b5dd9 | ||
|
|
0dbee935e7 | ||
|
|
81f577dcbe | ||
|
|
d5203f703f | ||
|
|
e77286c0a7 | ||
|
|
d565413e4d | ||
|
|
bfd8739e2b | ||
|
|
924e1e0061 | ||
|
|
9536de03e7 | ||
|
|
7b42888064 | ||
|
|
2a7318b69f | ||
|
|
503fdc463f | ||
|
|
5cb79283be | ||
|
|
115a447b2f | ||
|
|
fbc02957a2 | ||
|
|
271ce5275c | ||
|
|
3fd64dfe52 | ||
|
|
ce41eb2361 | ||
|
|
059c88ca1b | ||
|
|
d76a8c2950 | ||
|
|
ca90b2e6f1 | ||
|
|
608ca31f6d | ||
|
|
b6a033eef5 | ||
|
|
7278739e45 | ||
|
|
f83ad88d2a | ||
|
|
179fbc06ea | ||
|
|
2bd655b3a7 | ||
|
|
f6d0ea4b0f | ||
|
|
18759e01cf | ||
|
|
70580b27b9 | ||
|
|
5bea8fd4cc | ||
|
|
387ac04d9f | ||
|
|
e1f4a9d5b5 | ||
|
|
b4146dea86 | ||
|
|
0393f75729 | ||
|
|
25152a31db | ||
|
|
c07dc9d120 | ||
|
|
f7abeddaad | ||
|
|
265106d760 | ||
|
|
a1dd7cff7b | ||
|
|
2b6b212d02 | ||
|
|
d3edaaae4d | ||
|
|
94c3090528 | ||
|
|
aaf1904257 | ||
|
|
c0be16cde3 | ||
|
|
004d3669c2 | ||
|
|
9dbbd32686 | ||
|
|
6cfca021bc | ||
|
|
d7b7c18489 | ||
|
|
6b5747f017 | ||
|
|
ec83c34281 | ||
|
|
cb4e4d7bd9 | ||
|
|
ef968a0caf | ||
|
|
42d998a5ea | ||
|
|
3fdf9ddbc9 | ||
|
|
f975e7b414 | ||
|
|
0a2455a0bb | ||
|
|
171c52b4a6 | ||
|
|
aca9e9ec9b | ||
|
|
9a9494c01b | ||
|
|
4b51b0c205 | ||
|
|
1040d7f3ef | ||
|
|
63eb1b8a03 | ||
|
|
587fac377e | ||
|
|
a88b5e98d7 | ||
|
|
2aed55f5f6 | ||
|
|
ebd0c210d9 | ||
|
|
80870dcca8 | ||
|
|
aab63e6f2d | ||
|
|
f2ecea4731 | ||
|
|
d27d5f449e | ||
|
|
9c5b526a3d | ||
|
|
53287ba2c8 | ||
|
|
3e605b1ee9 | ||
|
|
40a9caddc7 | ||
|
|
c0cb52a5ca | ||
|
|
eef941fd42 | ||
|
|
08ea277891 | ||
|
|
c3bcca2ff7 | ||
|
|
0a9d920eb6 | ||
|
|
e4d1c654ed | ||
|
|
4f3c9aa0af | ||
|
|
fa517b8787 | ||
|
|
ff98fb0cdf | ||
|
|
6b1b8d9ed4 | ||
|
|
9ccf2014b0 | ||
|
|
bbff99d958 | ||
|
|
5dcf1c755c | ||
|
|
c98dfd0439 | ||
|
|
d2e4c2904f | ||
|
|
771c32255c | ||
|
|
59d821b8ef | ||
|
|
119f9b9ff0 | ||
|
|
f4371f886c | ||
|
|
c25fbc7d28 | ||
|
|
0b1ce8097f | ||
|
|
1b6d79888f | ||
|
|
18ae6aed28 | ||
|
|
cc44139eb1 | ||
|
|
190ce0fc90 | ||
|
|
69130fea95 | ||
|
|
3b3e6edc90 | ||
|
|
a6ee4daf58 | ||
|
|
4754cbb768 | ||
|
|
b02fd0d002 | ||
|
|
810a52af36 | ||
|
|
614d57ac08 | ||
|
|
7d1931cd80 | ||
|
|
b18e1aa8ca | ||
|
|
4a7a50dac9 | ||
|
|
5e03b503be | ||
|
|
be7fc57cdd | ||
|
|
2b99c8a4d9 | ||
|
|
751836ad68 | ||
|
|
8fcbe7bb9e | ||
|
|
c034715f69 | ||
|
|
8271e5ed63 | ||
|
|
53d098d96f | ||
|
|
9ea2f50634 | ||
|
|
1279b23f62 | ||
|
|
af5321b51c | ||
|
|
a57b43fb45 | ||
|
|
69275d9e2a | ||
|
|
cf725d3442 | ||
|
|
6803414b22 | ||
|
|
03a0640f65 | ||
|
|
f55ed62ebf | ||
|
|
be2fd7b9df | ||
|
|
f8a2290cb7 | ||
|
|
d47912a58f | ||
|
|
b56b0075e4 | ||
|
|
e80785b59b | ||
|
|
3e5fcface2 | ||
|
|
2dbc4f4786 | ||
|
|
685073fedd | ||
|
|
51e4d6d4c5 | ||
|
|
7f77e5a5f3 | ||
|
|
669a95479a | ||
|
|
fb042056b0 | ||
|
|
9d40b430dc | ||
|
|
feb7f80a39 | ||
|
|
781c680ad3 | ||
|
|
3ae173394b | ||
|
|
00839cb77b | ||
|
|
57f7f71c8d | ||
|
|
05f165357d | ||
|
|
452342f289 | ||
|
|
2653f95853 | ||
|
|
32cbe4620f | ||
|
|
47044fc696 | ||
|
|
6436ccd431 | ||
|
|
0cfe7e2a06 | ||
|
|
e6368b2b44 | ||
|
|
5957627fb6 | ||
|
|
4603f0bbf6 | ||
|
|
59b700fcde | ||
|
|
d278bc84d1 | ||
|
|
bcce9ea7f0 | ||
|
|
c49ddefbe0 | ||
|
|
c2d80d21f3 | ||
|
|
040e8eccd9 | ||
|
|
1cd3a97772 | ||
|
|
79355bbb32 | ||
|
|
7415b0ce23 | ||
|
|
f02bfbf0c2 | ||
|
|
fb2e85e6d3 | ||
|
|
2d45346c27 | ||
|
|
56ae309b3b | ||
|
|
9848668fe7 | ||
|
|
d815348230 | ||
|
|
791a77ab5d | ||
|
|
7cf94e4f1e | ||
|
|
a1ac1973a7 | ||
|
|
ebfb9fed9b | ||
|
|
a582efcca0 | ||
|
|
6da236d47f | ||
|
|
3dc73d286d | ||
|
|
78b4f17baf | ||
|
|
f10e4a562e | ||
|
|
b3d1496ddb | ||
|
|
8bd8e896d9 | ||
|
|
6fc2e11ad4 | ||
|
|
ceb6f17afc | ||
|
|
49f03e49a5 | ||
|
|
e2f51a3424 | ||
|
|
04e5edc811 | ||
|
|
c7350b704e | ||
|
|
c980d97027 | ||
|
|
87b32fd0b9 | ||
|
|
c08f602661 | ||
|
|
d867e8200f | ||
|
|
40533918f3 | ||
|
|
8fb7ed4913 | ||
|
|
5617b2a550 | ||
|
|
136ddf1697 | ||
|
|
cc5390c289 | ||
|
|
2cd3829ad4 | ||
|
|
431adcf3a7 | ||
|
|
9c35fc7cba | ||
|
|
b7c349b1a5 | ||
|
|
74c136b7e3 | ||
|
|
a0cea99825 | ||
|
|
8f24f93330 | ||
|
|
755fa6eaf4 | ||
|
|
03e09e25bb | ||
|
|
deb03e7a02 | ||
|
|
079fc7cc04 | ||
|
|
a545259454 | ||
|
|
805b4b6258 | ||
|
|
d2a310e879 | ||
|
|
01fb04049e | ||
|
|
3788d4f185 | ||
|
|
ad95f48711 | ||
|
|
06233a76a8 | ||
|
|
fa84f1906f | ||
|
|
41af9d7993 | ||
|
|
927180fb00 | ||
|
|
b62d9b7517 | ||
|
|
d51aec5fde | ||
|
|
4009edfa96 | ||
|
|
cdef41adb4 | ||
|
|
130fd0bf0c | ||
|
|
1ae2e55448 | ||
|
|
3d1b7d6d53 | ||
|
|
b50ba0bfb9 | ||
|
|
e08445f762 | ||
|
|
3fd01cfac2 | ||
|
|
4a425e0fa0 | ||
|
|
f198d7f204 | ||
|
|
bf9c737a11 | ||
|
|
b374816fa1 | ||
|
|
285ecb8c03 | ||
|
|
da5c85dbac | ||
|
|
547fcdfa4d | ||
|
|
df46ffeb84 | ||
|
|
6d52af4553 | ||
|
|
46a384d1ca | ||
|
|
332759a5f5 | ||
|
|
8f5a1333d2 | ||
|
|
06d65305df | ||
|
|
d62c6ab20f | ||
|
|
206fc0ea1d | ||
|
|
0e37c99521 | ||
|
|
389aa6c929 | ||
|
|
2d050cb2cc | ||
|
|
af103f185b | ||
|
|
74ac720086 | ||
|
|
0ecabe0e49 | ||
|
|
9be6f3f29d | ||
|
|
0cdc4d6f01 | ||
|
|
6722db20e3 | ||
|
|
40c6264aca | ||
|
|
106fa4da0d | ||
|
|
7c91d6976d | ||
|
|
eb57e2dd4e | ||
|
|
858b3888b2 | ||
|
|
616472140d | ||
|
|
3e44ac7d00 | ||
|
|
c7018e438c | ||
|
|
e01b2a9ffc | ||
|
|
ea36d05fc5 | ||
|
|
0657abd51b | ||
|
|
4a146d140d | ||
|
|
bdded2f14c | ||
|
|
c836374ae2 | ||
|
|
126fc79eed | ||
|
|
67388d2ba9 | ||
|
|
7405921621 | ||
|
|
b24427a9c1 | ||
|
|
7cb70d3aab | ||
|
|
bc4061aabd | ||
|
|
a09bcbd47a | ||
|
|
ff4a600d94 | ||
|
|
e1a7a55f2a | ||
|
|
bfaf5446cb | ||
|
|
ac7b93d39d | ||
|
|
b54ffdbabd | ||
|
|
b75ad65493 | ||
|
|
ea5f4d9029 | ||
|
|
501bf6b4fd | ||
|
|
d59a1af272 | ||
|
|
f95c19e5b2 | ||
|
|
f88c62e363 | ||
|
|
f685f08789 | ||
|
|
9d3f2f8b84 | ||
|
|
7754357760 | ||
|
|
dc84acc300 | ||
|
|
80ebd3aae1 | ||
|
|
4eece4326c | ||
|
|
79b7fb9eb1 | ||
|
|
47502dbb8b | ||
|
|
cc00c5bc18 | ||
|
|
cff5b8bfb0 | ||
|
|
0594822078 | ||
|
|
57adaf46b0 | ||
|
|
c3f04cc32e | ||
|
|
29009fe3a4 | ||
|
|
e23c1ad33e | ||
|
|
6a435752fd | ||
|
|
19165d259d | ||
|
|
3e9bc63d4e | ||
|
|
0676116d77 | ||
|
|
abdfac6e85 | ||
|
|
048bed0a5e | ||
|
|
ac4b07bf7b | ||
|
|
ecc119cb29 | ||
|
|
36a45d1a3f | ||
|
|
ac3f63b59c | ||
|
|
200fde77b1 | ||
|
|
8a988e5e02 | ||
|
|
031c17ab9c | ||
|
|
179f97a598 | ||
|
|
712e13b1e7 | ||
|
|
b92aa760d2 | ||
|
|
a070629571 | ||
|
|
f18994f800 | ||
|
|
56da57bc09 | ||
|
|
0f42fa5460 | ||
|
|
897f6cd69e | ||
|
|
002df7b24e | ||
|
|
ddd1314613 | ||
|
|
0c35e49239 | ||
|
|
27f04c1b78 | ||
|
|
37c02fea79 | ||
|
|
800acdbdf2 | ||
|
|
e6865c5996 | ||
|
|
39d2095e54 | ||
|
|
c1a0836640 | ||
|
|
6201d7bfe2 | ||
|
|
1dfc4837d4 | ||
|
|
8751d29a9a | ||
|
|
c21db5dbbd | ||
|
|
7abab1449c | ||
|
|
7853c2127e | ||
|
|
1b4e387ecc | ||
|
|
61cb279c1d | ||
|
|
52fcba1607 | ||
|
|
77ff985dcd | ||
|
|
b519c915ca | ||
|
|
acbd692de8 | ||
|
|
e8d7624867 | ||
|
|
da4a2f548b | ||
|
|
506790e09c | ||
|
|
667aee095f | ||
|
|
60d97ef5fb | ||
|
|
3da3726ded | ||
|
|
f2c931b059 | ||
|
|
adea353e2b | ||
|
|
847f93246c | ||
|
|
a642b8298e | ||
|
|
dcbef51ba0 | ||
|
|
9a47c6a303 | ||
|
|
15688eed13 | ||
|
|
d3e760659a | ||
|
|
01f72f4f44 | ||
|
|
a1f05fd017 | ||
|
|
aa56c6339b | ||
|
|
8bec40eb9b | ||
|
|
fc458d191d | ||
|
|
b314b37d67 | ||
|
|
cdab89ce74 | ||
|
|
e1dab71600 | ||
|
|
5debc253a1 | ||
|
|
c7c9b8710e | ||
|
|
57a27eb948 | ||
|
|
330978aeea | ||
|
|
8f5abf7983 | ||
|
|
d930aee65d | ||
|
|
ef703d61af | ||
|
|
2faeaca83f | ||
|
|
c579f885c3 | ||
|
|
cafb5ffdf3 | ||
|
|
a802c5cb01 | ||
|
|
7ead562349 | ||
|
|
bd38f1255f | ||
|
|
4e86eea57c | ||
|
|
bb2de697ee | ||
|
|
567b1967cf | ||
|
|
0fa258b950 | ||
|
|
5a06d9dfec | ||
|
|
80593ef27f | ||
|
|
a678337d14 | ||
|
|
55653c3f1f | ||
|
|
db22f3568d | ||
|
|
d3110bd114 | ||
|
|
7376cccf4d | ||
|
|
2091a386fb | ||
|
|
6bf783e674 | ||
|
|
06b06a5dad | ||
|
|
8287c5c872 | ||
|
|
8c3769c99f | ||
|
|
259e121307 | ||
|
|
3fed98fcb1 | ||
|
|
ba885907ba | ||
|
|
6fb01c7ab8 | ||
|
|
d4cead2187 | ||
|
|
b639179f31 | ||
|
|
ed54b34c8a | ||
|
|
e4e92ec900 | ||
|
|
1fe2418e22 | ||
|
|
3b6ab58940 | ||
|
|
086b0a62e9 | ||
|
|
a676c4f311 | ||
|
|
dc2c16130b | ||
|
|
d38a17ddf8 | ||
|
|
1740e95716 | ||
|
|
7867277321 | ||
|
|
cc15320963 | ||
|
|
6b5f40bd79 | ||
|
|
504dfff769 | ||
|
|
861be8f157 | ||
|
|
be38038782 | ||
|
|
016292fca4 | ||
|
|
f638bf4156 | ||
|
|
4d7f1462ef | ||
|
|
0cf63d9899 | ||
|
|
9a6e7f749b | ||
|
|
a35a046ede | ||
|
|
95d8c17d71 | ||
|
|
9746b53cb6 | ||
|
|
54bdaa1037 | ||
|
|
a23998819e | ||
|
|
571a1e6fd1 | ||
|
|
823a502873 | ||
|
|
93ee46ba52 | ||
|
|
6a37808dae | ||
|
|
a783321c03 | ||
|
|
045eb12388 | ||
|
|
a49cc78c57 | ||
|
|
60f49b39d4 | ||
|
|
11cebddaa9 | ||
|
|
a263fd879d | ||
|
|
b10a5d27a0 | ||
|
|
0326d2bbd0 | ||
|
|
ee188ededd | ||
|
|
91698678a2 | ||
|
|
ae987b3c10 | ||
|
|
935b829532 | ||
|
|
bed2745c61 | ||
|
|
9b9952dcdf | ||
|
|
401ffaff17 | ||
|
|
4cebe6b9dc | ||
|
|
93d1241a72 | ||
|
|
827352aa4e | ||
|
|
2d1a4404bc | ||
|
|
e0a7819c54 | ||
|
|
71a4ebe8b7 | ||
|
|
6a7f8c9416 | ||
|
|
f93aa9511b | ||
|
|
3cff9cc392 | ||
|
|
e7708e7b4a | ||
|
|
8fedf1f0f4 | ||
|
|
7b3c322b13 | ||
|
|
10e0f367a8 | ||
|
|
46eb82c5af | ||
|
|
bd4434d8db | ||
|
|
8bb5b5700b | ||
|
|
a90b3a9cd3 | ||
|
|
f0f64010ec | ||
|
|
5b07a3147b | ||
|
|
2cff2d8bbe | ||
|
|
4fbed810dc | ||
|
|
5976913c73 | ||
|
|
1e7f1ab225 | ||
|
|
01de84e9fc | ||
|
|
8fe0eb73e2 | ||
|
|
87361df043 | ||
|
|
4b1323ada5 | ||
|
|
89fd889cf4 | ||
|
|
d0bed06765 | ||
|
|
7883b1bd7f | ||
|
|
0fdffd7b6a | ||
|
|
7f25573cfa | ||
|
|
9eaeeffae9 | ||
|
|
e741e83fd4 | ||
|
|
2a0eff2ed0 | ||
|
|
f9ec5fd9b7 | ||
|
|
561cb6cfe0 | ||
|
|
82b7854ed7 | ||
|
|
34df1ab705 | ||
|
|
39e699d119 | ||
|
|
ec15aa5ee4 | ||
|
|
edb08d6fec | ||
|
|
631baeafd2 | ||
|
|
d631f1b06b | ||
|
|
ec9054ceb1 | ||
|
|
4a471eff8b | ||
|
|
07f9575bb7 | ||
|
|
3a0f6dda08 | ||
|
|
6f67602d57 | ||
|
|
399aac7e0f | ||
|
|
eec986d93d | ||
|
|
e765fb6439 | ||
|
|
f05bd319c5 | ||
|
|
f81d086673 | ||
|
|
18cecf8a67 | ||
|
|
3a356782fc | ||
|
|
5626088042 | ||
|
|
af2218b0ed | ||
|
|
db1a0dd9c7 | ||
|
|
3e1a0e2458 | ||
|
|
948eaa03c5 | ||
|
|
15b09d8938 | ||
|
|
f8313672ff | ||
|
|
db9582f799 | ||
|
|
6fa4e54022 | ||
|
|
4f099348b2 | ||
|
|
e18e09361d | ||
|
|
595603daf0 | ||
|
|
166e26db5b | ||
|
|
71656b609a | ||
|
|
53f960ebd2 | ||
|
|
fd454d86fc | ||
|
|
4d3f7b366b | ||
|
|
4c0e61bca6 | ||
|
|
daf445366c | ||
|
|
7b5d20e81f | ||
|
|
5f3dc49e50 | ||
|
|
526c6331ab | ||
|
|
c98338b639 | ||
|
|
cff1c1375f | ||
|
|
631726641b | ||
|
|
a515f0b7b0 | ||
|
|
507c9ceabf | ||
|
|
e0ffc205b1 | ||
|
|
dfe3d7bfaa | ||
|
|
7c9b53c8d8 | ||
|
|
e00041c2bc | ||
|
|
b3ba7cb8d0 | ||
|
|
53312694d4 | ||
|
|
fc49950fd4 | ||
|
|
c4190167ee | ||
|
|
47406d8765 | ||
|
|
09dd36d31b | ||
|
|
a49bf40413 | ||
|
|
0ad9e65577 | ||
|
|
0477a2eb05 | ||
|
|
e0395fe903 | ||
|
|
62b193254b | ||
|
|
cfd5a73b92 | ||
|
|
9d256d93a5 | ||
|
|
85c146caf2 | ||
|
|
5e3f19ea52 | ||
|
|
09ce64ee04 | ||
|
|
b3cddbba41 | ||
|
|
046d6be402 | ||
|
|
cb6b4c3b93 | ||
|
|
04ae39caa5 | ||
|
|
63a1377aca | ||
|
|
450fbded3f | ||
|
|
e805dff16f | ||
|
|
8f087878be | ||
|
|
716b470911 | ||
|
|
05030e6b98 | ||
|
|
e6eac5a6c0 | ||
|
|
ec7bbd6c18 | ||
|
|
528198977a | ||
|
|
fd660c7fa0 | ||
|
|
fe6c6a3017 | ||
|
|
f4d37857aa | ||
|
|
3e2f7b41d8 | ||
|
|
d7a580584d | ||
|
|
f7f8740745 | ||
|
|
7eb579cb6c | ||
|
|
8307014de9 | ||
|
|
daf94e61e0 | ||
|
|
07689efc6e | ||
|
|
14a952169b | ||
|
|
646f7c1362 | ||
|
|
faa745e566 | ||
|
|
3485a5e855 | ||
|
|
79779d69ba | ||
|
|
a6e5a0b53f | ||
|
|
6cd69f5c05 | ||
|
|
251c316120 | ||
|
|
8856a1444c | ||
|
|
791cdeba4d | ||
|
|
39e97ee767 | ||
|
|
7e7d48444b | ||
|
|
bd7e8da81d | ||
|
|
1fce900801 | ||
|
|
859af00f1c | ||
|
|
6e4cf37e44 | ||
|
|
1cd3adef5e | ||
|
|
557492cc72 | ||
|
|
c0e0efd0ef | ||
|
|
185e9b3f08 | ||
|
|
c886253738 | ||
|
|
f52a1c1521 | ||
|
|
fc6a38182d | ||
|
|
5dca3742f1 | ||
|
|
9f1d9e153a | ||
|
|
836a0ffe4b | ||
|
|
c7ccdfde2d | ||
|
|
d18289d5bc | ||
|
|
fcf987a4dd | ||
|
|
52069c6788 | ||
|
|
c20df5874d | ||
|
|
e6bdacce9c | ||
|
|
2b84dbfccf | ||
|
|
efc494b859 | ||
|
|
6a50c760ae | ||
|
|
c18b5e424e | ||
|
|
8ddc840370 | ||
|
|
dab3d99890 | ||
|
|
b93e9a5945 | ||
|
|
c9e46ee0f6 | ||
|
|
c94e80d682 | ||
|
|
2e2e95ef57 | ||
|
|
0029cb8aec | ||
|
|
0424b56af1 | ||
|
|
80c3cf479d | ||
|
|
6d24eb14d7 | ||
|
|
76efea72d9 | ||
|
|
37bc3766a5 | ||
|
|
9adfb56f65 | ||
|
|
b95cd0c91f | ||
|
|
7bce2017c3 | ||
|
|
23d9d611c1 | ||
|
|
13fbcc56ee | ||
|
|
e9b2bcc579 | ||
|
|
65088ea2d5 | ||
|
|
897cb13626 | ||
|
|
574ab7281b | ||
|
|
a13ce8cd40 | ||
|
|
ed8f6d9691 | ||
|
|
29c93182f1 | ||
|
|
c5a8af9885 | ||
|
|
c40fd80ae1 | ||
|
|
90d7f230ed | ||
|
|
88fd5ba094 | ||
|
|
3095c6ea5f | ||
|
|
fc33c56d61 | ||
|
|
5084b30f3f | ||
|
|
5ee9b5cab4 | ||
|
|
1a3a4bd7ba | ||
|
|
ac0094176a | ||
|
|
5734131310 | ||
|
|
e99d0a0b43 | ||
|
|
f376eb9b2a | ||
|
|
98039abf1b | ||
|
|
9a6b5e21dc | ||
|
|
979ac4f91f | ||
|
|
425aa46476 | ||
|
|
5a0bd24a4e | ||
|
|
d60b33b159 | ||
|
|
74ddb432aa | ||
|
|
a0e224ec71 | ||
|
|
b7f1711497 | ||
|
|
66383a57d1 | ||
|
|
d7bafdf0c8 | ||
|
|
698efb4995 | ||
|
|
321ed4ea3d | ||
|
|
6c1d4efb07 | ||
|
|
708e91145c | ||
|
|
6b261534d8 | ||
|
|
627a892097 | ||
|
|
c862ba6e03 | ||
|
|
7e39b2546b | ||
|
|
659600db23 | ||
|
|
875ac468d3 | ||
|
|
b01d55f1f6 | ||
|
|
734f12bbc6 | ||
|
|
6f3cd5dff2 | ||
|
|
787fde31ed | ||
|
|
c273a02b94 | ||
|
|
6735fd593b | ||
|
|
154cdc8709 | ||
|
|
cec62bd356 | ||
|
|
b34a31b5be | ||
|
|
5d733b8e45 | ||
|
|
2deef04095 | ||
|
|
e03734f2b4 | ||
|
|
ce01eca4d7 | ||
|
|
ae8c556187 | ||
|
|
11755798cc | ||
|
|
e229194b62 | ||
|
|
82059dca6d | ||
|
|
1eb04a70a5 | ||
|
|
886099a948 | ||
|
|
71616201ff | ||
|
|
2eeabfe668 | ||
|
|
0c4df26ed0 | ||
|
|
cdeea80037 | ||
|
|
9fb98f04d4 | ||
|
|
85da51ca09 | ||
|
|
d98a766362 | ||
|
|
659e56f0fa | ||
|
|
924aba49ea | ||
|
|
0e21107694 | ||
|
|
f918d1d0b2 | ||
|
|
52de4e1796 | ||
|
|
52335a37bf | ||
|
|
4c22193446 | ||
|
|
c5337cdcf3 | ||
|
|
2215f74959 | ||
|
|
7a71f87d9f | ||
|
|
18311be3ae | ||
|
|
7d09e78655 | ||
|
|
7beef85a64 | ||
|
|
e5bcb88b0e | ||
|
|
9b576d3fdd | ||
|
|
4152f61999 | ||
|
|
5f0ab1f62d | ||
|
|
37770a4e47 | ||
|
|
013ad0617e | ||
|
|
22e6966c8e | ||
|
|
4c8c010506 | ||
|
|
0e1c12131a | ||
|
|
cd268c11ee | ||
|
|
da8202a15e | ||
|
|
ef95faa9b9 | ||
|
|
b2201a0463 | ||
|
|
ebe0b0323e | ||
|
|
2b8319090e | ||
|
|
bad3bd5fbb | ||
|
|
06b797fd14 | ||
|
|
5d37438561 | ||
|
|
1593c94d90 | ||
|
|
c2e450986f | ||
|
|
6b44d232e7 | ||
|
|
01a625691a | ||
|
|
5334589922 | ||
|
|
17a3c0773b | ||
|
|
06375fe1a3 | ||
|
|
e3bde3ccfe | ||
|
|
6a5f1b0f63 | ||
|
|
10e5558812 | ||
|
|
2301c11309 | ||
|
|
db0829e6a0 | ||
|
|
c5f491dfc4 | ||
|
|
3513e6538a | ||
|
|
6ca4f0797a | ||
|
|
18a64cb0e5 | ||
|
|
ec9345b051 | ||
|
|
0a8e47c357 | ||
|
|
59d10cfc5d | ||
|
|
ae809ce39f | ||
|
|
5bc47f4834 | ||
|
|
a9b6a94ade | ||
|
|
1258a6186c | ||
|
|
b91c8f0b6a | ||
|
|
1b4521fd51 | ||
|
|
f871998a35 | ||
|
|
0554ef35b7 | ||
|
|
1ea322ff9b | ||
|
|
5ea2598ea9 | ||
|
|
6a1b37b5b7 | ||
|
|
801f293948 | ||
|
|
c9466f995b | ||
|
|
d898899de7 | ||
|
|
54439f8af8 | ||
|
|
eb159afb64 | ||
|
|
e7fcb758e3 | ||
|
|
22a8af34ea | ||
|
|
5184cee3ca | ||
|
|
fd3f48b359 | ||
|
|
d040153017 | ||
|
|
77f66fa8b8 | ||
|
|
20058b137e | ||
|
|
11d8b4e747 | ||
|
|
82128be9e2 | ||
|
|
51fcb8d679 | ||
|
|
0acfb77be9 | ||
|
|
e4cd7220cc | ||
|
|
cdb74fd547 | ||
|
|
aecc3624ba | ||
|
|
fdfd2eacea | ||
|
|
9383e0572d | ||
|
|
18f1683968 | ||
|
|
980c44bf62 | ||
|
|
1043f58cc4 | ||
|
|
7fb643f962 | ||
|
|
5cfde95358 | ||
|
|
235042ea65 | ||
|
|
82faf7e929 | ||
|
|
a00696ec3b | ||
|
|
6cef4290df | ||
|
|
af6791d942 | ||
|
|
992db08f71 | ||
|
|
656a529249 | ||
|
|
f6264eeba4 | ||
|
|
1b34c7d6b9 | ||
|
|
9566385aac | ||
|
|
064938378f | ||
|
|
fb3e776cb9 | ||
|
|
eff46cf40d | ||
|
|
9ed7d05ca7 | ||
|
|
1456cd6254 | ||
|
|
8c9fb382e3 | ||
|
|
06d11c4fa9 | ||
|
|
50dff05675 | ||
|
|
5692b95ad2 | ||
|
|
130300074e | ||
|
|
0cccfa4f8c | ||
|
|
ee058e72a9 | ||
|
|
10acb115da | ||
|
|
61c5b99dc5 | ||
|
|
edf604e080 | ||
|
|
6d8df80664 | ||
|
|
dd23e9598a | ||
|
|
6edde6c4ac | ||
|
|
93b606da2c | ||
|
|
a3729a11c7 | ||
|
|
646b94e7cb | ||
|
|
bd72179cb2 | ||
|
|
4552bbf19f | ||
|
|
8123a383b6 | ||
|
|
81991ffae0 | ||
|
|
02a8b05aff | ||
|
|
5f3563d83e | ||
|
|
733f29d184 | ||
|
|
92d72cc725 | ||
|
|
cc9a45daff | ||
|
|
ec36279ecb | ||
|
|
403f3745d9 | ||
|
|
bf3d337913 | ||
|
|
c149898592 | ||
|
|
53aa698491 | ||
|
|
e7aa6ce998 | ||
|
|
07f3c0171d | ||
|
|
1d5f67cb6a | ||
|
|
13f8d944d2 | ||
|
|
e029347355 | ||
|
|
0d6f02abcc | ||
|
|
cae9bef807 | ||
|
|
1a307b45e4 | ||
|
|
e885e428ae | ||
|
|
f22216aeb5 | ||
|
|
7a4d06efb7 | ||
|
|
d4b21ce206 | ||
|
|
592c76eb6e | ||
|
|
5ef3a49485 | ||
|
|
f31912aa42 | ||
|
|
84ab4ec854 | ||
|
|
beb73befa3 | ||
|
|
a0fa99037b | ||
|
|
1c6a98ba93 | ||
|
|
2958c80e51 | ||
|
|
33376b52bd | ||
|
|
5af277d20e | ||
|
|
a863f556a6 | ||
|
|
629fe95ebd | ||
|
|
547e64724f | ||
|
|
afb67f8595 | ||
|
|
413b476c01 | ||
|
|
113968aaa7 | ||
|
|
770477f7a5 | ||
|
|
90dc755ad4 | ||
|
|
c74fa90305 | ||
|
|
93c89a6ef5 | ||
|
|
9d074c6721 | ||
|
|
835dfd0780 | ||
|
|
bd360dab54 | ||
|
|
81563ee5d6 | ||
|
|
0dd8d7f7b6 | ||
|
|
a11e403084 | ||
|
|
d048d083c4 | ||
|
|
437de8e884 | ||
|
|
25dd8d9fa7 | ||
|
|
debfdfbad2 | ||
|
|
923df5eafe | ||
|
|
38fcfe9a83 | ||
|
|
f85fce2ed1 | ||
|
|
e1669ecd70 | ||
|
|
3cc3a7dd65 | ||
|
|
2abb6421fe | ||
|
|
579bafd439 | ||
|
|
0719b89cdf | ||
|
|
e3391d1535 | ||
|
|
04fd2e6d0f | ||
|
|
fbe06df9e6 | ||
|
|
4e7f04da5f | ||
|
|
4e3da1c081 | ||
|
|
d9fab238d5 | ||
|
|
de3d4da000 | ||
|
|
9067c2c842 | ||
|
|
69ae57b246 | ||
|
|
6d3cf83052 | ||
|
|
e6745f80ce | ||
|
|
f7aca32e0e | ||
|
|
ac430bd3bc | ||
|
|
be3b18057a | ||
|
|
9772f9b770 | ||
|
|
4d85605cca | ||
|
|
96ecb7c232 | ||
|
|
112034a41d | ||
|
|
9dc3f4bf2d | ||
|
|
974e9b3325 | ||
|
|
47f078ec3a | ||
|
|
8817fd2cc5 | ||
|
|
50b87b580a | ||
|
|
170e14546a | ||
|
|
4b4c1b71df | ||
|
|
e122797a68 | ||
|
|
4d8dd2db7d | ||
|
|
3e1c1096c2 | ||
|
|
c6e6977bf6 | ||
|
|
85056e1c6c | ||
|
|
57142fbb8d | ||
|
|
e382dc9b71 | ||
|
|
e1290dca47 | ||
|
|
ca5f2c3785 | ||
|
|
9b7aaebcbc | ||
|
|
462478afdf | ||
|
|
d7e6125dd7 | ||
|
|
79cbb7f729 | ||
|
|
fe716e76a7 | ||
|
|
fb17654ea0 | ||
|
|
d878c96343 | ||
|
|
d103a187f6 | ||
|
|
7719ad1f2d | ||
|
|
cfcccb590d | ||
|
|
8b4814e399 | ||
|
|
3f1805c1ea | ||
|
|
56067e4d4f | ||
|
|
7e3f90ee1d | ||
|
|
c71bdf32e1 | ||
|
|
6e5d58379f | ||
|
|
a2a3def685 | ||
|
|
01e6c14025 | ||
|
|
2d1bc7bac8 | ||
|
|
6262aa846f | ||
|
|
8f822f6cad | ||
|
|
f14441d2f4 | ||
|
|
2762c245ee | ||
|
|
0c1b6f21b9 | ||
|
|
7f40f59d85 | ||
|
|
6a6776754b | ||
|
|
4a1ebb69c3 | ||
|
|
3ae61c5f8c | ||
|
|
881fcf1191 | ||
|
|
ce021a4f62 | ||
|
|
2207c391d6 | ||
|
|
e97638ce86 | ||
|
|
f5d59fab22 | ||
|
|
4ebe547a05 | ||
|
|
28d4df355d | ||
|
|
891158ca44 | ||
|
|
c13c989fe8 | ||
|
|
7d543abb92 | ||
|
|
6dd62d7806 | ||
|
|
d70a5aff6a | ||
|
|
ccbfacec62 | ||
|
|
cca784752b | ||
|
|
c91f0dfd2f | ||
|
|
b7ea36b858 | ||
|
|
484b726373 | ||
|
|
44336b1ea5 | ||
|
|
63c71bf3f5 | ||
|
|
3500f4b3e3 | ||
|
|
942946f1b1 | ||
|
|
e8db3c2e77 | ||
|
|
c14dbb29c9 | ||
|
|
f05760b986 | ||
|
|
0576937fd6 | ||
|
|
2c250ed700 | ||
|
|
95ec993134 | ||
|
|
f4a4afbb69 | ||
|
|
05d187d327 | ||
|
|
904c6b76b5 | ||
|
|
a4c69f0a74 | ||
|
|
b301bc1d79 | ||
|
|
c9255a2873 | ||
|
|
ca4e99993d | ||
|
|
37fe6009ee | ||
|
|
37069652c0 | ||
|
|
0c12dcb3c3 | ||
|
|
a606ea4a80 | ||
|
|
792d61ad8c | ||
|
|
84d595bcde | ||
|
|
426467a38f | ||
|
|
6aae5d2ad6 | ||
|
|
e38aea276c | ||
|
|
99d4d07cd5 | ||
|
|
c75f758f8d | ||
|
|
21775df1b8 | ||
|
|
0a49153dbf | ||
|
|
e10a5e591e | ||
|
|
022aeec41a | ||
|
|
a396d1e170 | ||
|
|
f7668f3b9d | ||
|
|
37f5b471fc | ||
|
|
956d68a84b | ||
|
|
7d0b7d9617 | ||
|
|
87986af197 | ||
|
|
38f749ee47 | ||
|
|
41873d7cc5 | ||
|
|
d42f45825a | ||
|
|
90dc6d3298 | ||
|
|
16decbf02b | ||
|
|
c2d0799595 | ||
|
|
48010197f4 | ||
|
|
8fe7f3f874 | ||
|
|
57d66ed60d | ||
|
|
198d6b2e9e | ||
|
|
90ac648ff1 | ||
|
|
818876a451 | ||
|
|
500c24fbaf | ||
|
|
4a1698804f | ||
|
|
729088adda | ||
|
|
9a58d26321 | ||
|
|
656476991f | ||
|
|
f74b5ea0d4 | ||
|
|
cb8b0898d6 | ||
|
|
0e624ad12f | ||
|
|
c3c5321e1d | ||
|
|
8dab49fb95 | ||
|
|
7ac87dfdf8 | ||
|
|
abcc30f0b7 | ||
|
|
7bbaab2e4a | ||
|
|
5e5818c34a | ||
|
|
89933b358f | ||
|
|
7fb85e7abb | ||
|
|
490230027c | ||
|
|
c23dedbcb2 | ||
|
|
c438534a4a | ||
|
|
8e9ee2654b | ||
|
|
a1f12e9a2f | ||
|
|
30e953646d | ||
|
|
24bb086c7f | ||
|
|
ef81d429f7 | ||
|
|
357f974e49 | ||
|
|
e1db583775 | ||
|
|
a79d422d96 | ||
|
|
bd3f7f7ded | ||
|
|
1dc838beca | ||
|
|
b94c20b2f5 | ||
|
|
d41d6a73b7 | ||
|
|
2d685ab07d | ||
|
|
67cb3c5cf7 | ||
|
|
f0e6ff8545 | ||
|
|
04674c5c01 | ||
|
|
d091789206 | ||
|
|
c0d50c2ac1 | ||
|
|
d7eac12d64 | ||
|
|
cba13bb535 | ||
|
|
8bff53b6d6 | ||
|
|
c2722ebd5f | ||
|
|
6caadfcd8a | ||
|
|
7e6f6aa842 | ||
|
|
53ff1ca723 | ||
|
|
e542c2abcc | ||
|
|
79ca7b4e9f | ||
|
|
94d9238ff9 | ||
|
|
a2382ce9b2 | ||
|
|
5ce9755071 | ||
|
|
bfb8c30779 | ||
|
|
1b0ebb3f94 | ||
|
|
776131d1ca | ||
|
|
34e60b3223 | ||
|
|
0f1ebeba23 | ||
|
|
c0a08fd7f9 | ||
|
|
f0205c738d | ||
|
|
919cf76110 | ||
|
|
88fb927fc4 | ||
|
|
df9c4043a9 | ||
|
|
d4b95ff40e | ||
|
|
fb3ec2ff83 | ||
|
|
0f75679e0b | ||
|
|
24bb0fd922 | ||
|
|
55d5db0f02 | ||
|
|
0747b331d1 | ||
|
|
7c9fe3eda7 | ||
|
|
038cc6fc2f | ||
|
|
da0b4ecd3b | ||
|
|
5877f72345 | ||
|
|
9a9dc7eab1 | ||
|
|
5af983a409 | ||
|
|
23025df697 | ||
|
|
d4cd05c2ea | ||
|
|
c18df57af9 | ||
|
|
d36caebecc | ||
|
|
7e1c3a5f20 | ||
|
|
53502742a8 | ||
|
|
9c97623257 | ||
|
|
0fcef9b18c | ||
|
|
5461d2d4aa | ||
|
|
cfe55033d5 | ||
|
|
f9d5ea06f7 | ||
|
|
0c9c932435 | ||
|
|
87dd54c3c0 | ||
|
|
3c349da93b | ||
|
|
cfc8d6422f | ||
|
|
7a89740ad6 | ||
|
|
d76d53bee2 | ||
|
|
b595c7f435 | ||
|
|
51ce32a8bb | ||
|
|
9971bdfb66 | ||
|
|
cb7cc8b293 | ||
|
|
52797e8b79 | ||
|
|
6da0db0035 | ||
|
|
3c4a68bfbc | ||
|
|
7f37080a87 | ||
|
|
b846b0b5d3 | ||
|
|
46f2dd67d4 | ||
|
|
0f3f77c52a | ||
|
|
893eab0fb1 | ||
|
|
36a7d070a8 | ||
|
|
461cc347fc | ||
|
|
1177402856 | ||
|
|
de8f96abe3 | ||
|
|
950b77bfdf | ||
|
|
07916c422e | ||
|
|
48cea2bd96 | ||
|
|
b5e8b5426e | ||
|
|
7bd253d56b | ||
|
|
08ad22923a | ||
|
|
70f705bdc7 | ||
|
|
e240b9ca3d | ||
|
|
2c0b7d2111 | ||
|
|
90ac642aa9 | ||
|
|
5d4fa5eea9 | ||
|
|
e332571102 | ||
|
|
cf9fcdee60 | ||
|
|
4470d67617 | ||
|
|
3ce68d2f7d | ||
|
|
ca80ac2d1f | ||
|
|
7ec4bcad0e | ||
|
|
508f6d4ae3 | ||
|
|
45ff0645ba | ||
|
|
91115d5ba3 | ||
|
|
d21875d353 | ||
|
|
fd58461d43 | ||
|
|
a1d2229a58 | ||
|
|
ba2704291a | ||
|
|
c7900b2cc0 | ||
|
|
e09a7f57f3 | ||
|
|
a309511f9b | ||
|
|
cded77c176 | ||
|
|
0c7b552471 | ||
|
|
cc4559cae6 | ||
|
|
ed9d8fb7f7 | ||
|
|
9069d98365 | ||
|
|
9f4b323287 | ||
|
|
b52a8b27ff | ||
|
|
8fe21b4608 | ||
|
|
0b7c70ef3c | ||
|
|
ed68aef0e4 | ||
|
|
1f1b31008d | ||
|
|
3b8957a65e | ||
|
|
d2c1c8a629 | ||
|
|
d08d3d6e23 | ||
|
|
406b210958 | ||
|
|
4872330dce | ||
|
|
b4f14d2ba6 | ||
|
|
a6ee60c352 | ||
|
|
7f34f8da7a | ||
|
|
322d010076 | ||
|
|
2bc38fd751 | ||
|
|
11852880e9 | ||
|
|
992d1723f8 | ||
|
|
a13f9ea3eb | ||
|
|
f40fbaf35e | ||
|
|
d0fe25e022 | ||
|
|
dbc8019365 | ||
|
|
2f2d79fd97 | ||
|
|
8cac132e9e | ||
|
|
ab4990299a | ||
|
|
c3000e90ef | ||
|
|
5cead96550 | ||
|
|
ecae967386 | ||
|
|
40f73a9289 | ||
|
|
c86a17c170 | ||
|
|
8750f04f4c | ||
|
|
b818f85b38 | ||
|
|
a9cacbc16b | ||
|
|
3649342317 | ||
|
|
6125f4f9d3 | ||
|
|
f6908e45d3 | ||
|
|
7508b3f6e3 | ||
|
|
411a0ce8df | ||
|
|
0c169bcfd3 | ||
|
|
53172d2aa3 | ||
|
|
43997fda19 | ||
|
|
32916ee8c5 | ||
|
|
478c54c187 | ||
|
|
6f681dfe37 | ||
|
|
dc7b2c0f5d | ||
|
|
9a65399fed | ||
|
|
9b677107ec | ||
|
|
c02791eb2e | ||
|
|
2d77a46aec | ||
|
|
df6dd52832 | ||
|
|
6a78ade36b | ||
|
|
2b8efd9949 | ||
|
|
24bb08f8a8 | ||
|
|
58411bbaf7 | ||
|
|
884eb3bf89 | ||
|
|
735e437912 | ||
|
|
00550afd98 | ||
|
|
b2b3959d95 | ||
|
|
ffe6b88986 | ||
|
|
adc36d13d9 | ||
|
|
b6de3b3991 | ||
|
|
5aacb1b95f | ||
|
|
eac2b42fd3 | ||
|
|
540dda980b | ||
|
|
f6e092acb5 | ||
|
|
d12566928d | ||
|
|
88de950afb | ||
|
|
cce71551fd | ||
|
|
dec5c7dfe2 | ||
|
|
81d5c89e6c | ||
|
|
f35ff421d2 | ||
|
|
51b485dd2e | ||
|
|
f41b03cdfa | ||
|
|
4d2ccb811a | ||
|
|
88b59d5033 | ||
|
|
95b5e1856e | ||
|
|
77d17ce761 | ||
|
|
371888b886 | ||
|
|
520bb19e44 | ||
|
|
713260a49f | ||
|
|
2c66e5352e | ||
|
|
d735242cd0 | ||
|
|
2c4c7aa4c0 | ||
|
|
3ba5bc255e | ||
|
|
c640daba85 | ||
|
|
62962d1039 | ||
|
|
7231586e94 | ||
|
|
78b123deb4 | ||
|
|
fa76526d42 | ||
|
|
75b86269cf | ||
|
|
8178894234 | ||
|
|
05e6581a4a | ||
|
|
ef20009310 | ||
|
|
f87375422b | ||
|
|
0f519cf747 | ||
|
|
d2a6781e7e | ||
|
|
f8e44b792f | ||
|
|
7f835cf438 | ||
|
|
493811c0d0 | ||
|
|
fafe723841 | ||
|
|
e24608ff31 | ||
|
|
ebe9805e5b | ||
|
|
1db4cb1867 | ||
|
|
47cef088c2 | ||
|
|
fc6918a67b | ||
|
|
9c331d1be5 | ||
|
|
28299d28dc | ||
|
|
0b6d207810 | ||
|
|
12eff5141d | ||
|
|
8fcef92537 | ||
|
|
8611a48396 | ||
|
|
22b5217c9b | ||
|
|
b406b1d2e0 | ||
|
|
396a82987e | ||
|
|
e604ac44b2 | ||
|
|
8417d1d54a | ||
|
|
7e2faa89af | ||
|
|
a27e14b984 | ||
|
|
1c5d2a4a52 | ||
|
|
43601cfb7e | ||
|
|
c35e27e841 | ||
|
|
2682dc8d83 | ||
|
|
282268c2a0 | ||
|
|
12814371b1 | ||
|
|
6fb1c4879a | ||
|
|
a23a1718f5 | ||
|
|
17478c858a | ||
|
|
e17ca5a27c | ||
|
|
3b8f31f992 | ||
|
|
456b225c42 | ||
|
|
b688b268a0 | ||
|
|
faa04e9788 | ||
|
|
ab5082a9cb | ||
|
|
a66bcad133 | ||
|
|
810d995661 | ||
|
|
f3e867c5c7 | ||
|
|
19d1211705 | ||
|
|
d4d627263a | ||
|
|
ac5378e41a | ||
|
|
2304f3e6cc | ||
|
|
617d66a5f7 | ||
|
|
53e0f52763 | ||
|
|
7157cbdf49 | ||
|
|
939cd8a942 | ||
|
|
28c1075334 | ||
|
|
4b4a1a8b86 | ||
|
|
255ea6249a | ||
|
|
b0f16b0de6 | ||
|
|
7f9b22a17f | ||
|
|
66a3cae31c | ||
|
|
086df23140 | ||
|
|
30e07e027d | ||
|
|
5f07988e97 | ||
|
|
e25f3b7504 | ||
|
|
7b79ad92a3 | ||
|
|
2b9cc149f9 | ||
|
|
d0f261c6b9 | ||
|
|
e59a61a747 | ||
|
|
7d81a1d814 | ||
|
|
745078945e | ||
|
|
df6d9a17f3 | ||
|
|
8199cf275e | ||
|
|
40376234a7 | ||
|
|
b23a889a95 | ||
|
|
9010bbacfb | ||
|
|
5235004633 | ||
|
|
01b8579e59 | ||
|
|
ae5e5b6309 | ||
|
|
6bfda746e9 | ||
|
|
bc1bd9b10d | ||
|
|
b1b7e6b20f | ||
|
|
ddbd25d8cc | ||
|
|
8b79910749 | ||
|
|
e46498d77f | ||
|
|
bc93081b98 | ||
|
|
20fb4353f5 | ||
|
|
25b731cb50 | ||
|
|
3bb1a27d6f | ||
|
|
5804e3908a | ||
|
|
2bd9e23650 | ||
|
|
49d4c2e66f | ||
|
|
e8c4e913a3 | ||
|
|
9ec49d8a2b | ||
|
|
6a2ce922b0 | ||
|
|
6baf7dbf24 | ||
|
|
2c561b220c | ||
|
|
c776f8a1e2 | ||
|
|
79278c59a8 | ||
|
|
1a816e73c3 | ||
|
|
f8771d8300 | ||
|
|
57d812c78d | ||
|
|
03861d3fbe | ||
|
|
494481c7e5 | ||
|
|
de683ea9a2 | ||
|
|
655038fa2c | ||
|
|
91e5a8ba04 | ||
|
|
ec50df79f7 | ||
|
|
bffdec2252 | ||
|
|
6e0ab1f955 | ||
|
|
8488a7980f | ||
|
|
a6238b2da0 | ||
|
|
8b498d93b6 | ||
|
|
4a26ad7c30 | ||
|
|
a2097b7640 | ||
|
|
1819be392d | ||
|
|
cec2033274 | ||
|
|
5b199ce7ea | ||
|
|
58d9a2839a | ||
|
|
e6507b6acf | ||
|
|
bd1995e89d | ||
|
|
86fc743862 | ||
|
|
6d0d7ca764 | ||
|
|
8839d1f441 | ||
|
|
f6955eabc1 | ||
|
|
eee36c90b5 | ||
|
|
72553ae388 | ||
|
|
b7b8177b99 | ||
|
|
ce26750051 | ||
|
|
d47d541bba | ||
|
|
d08af21df2 | ||
|
|
4e7807d6d4 | ||
|
|
96da2fbf9e | ||
|
|
8579f83e63 | ||
|
|
921c7b4fb1 | ||
|
|
59afc46ab5 | ||
|
|
194f8b0dfc | ||
|
|
f71dbca8e7 | ||
|
|
4a2473a1a5 | ||
|
|
f80180509c | ||
|
|
18b457af37 | ||
|
|
a7ace54ecb | ||
|
|
8fa1fc2345 | ||
|
|
08cf941fef | ||
|
|
115da5c770 | ||
|
|
d3959d21ca | ||
|
|
4ca777597f | ||
|
|
7470189be1 | ||
|
|
89fc587731 | ||
|
|
8b0cfaaeb1 | ||
|
|
b4db72702c | ||
|
|
357b6a8e77 | ||
|
|
2e31f9318c | ||
|
|
234f32860e | ||
|
|
b8e96b1957 | ||
|
|
ee43227fcf | ||
|
|
ad9aef635b | ||
|
|
953bda65de | ||
|
|
9728992997 | ||
|
|
881e8f705a | ||
|
|
306fc98917 | ||
|
|
264ffcba32 | ||
|
|
d1796a17d4 | ||
|
|
dc5d7747df | ||
|
|
a3458735fc | ||
|
|
24a09b1eb7 | ||
|
|
43dc5bbf70 | ||
|
|
e545865599 | ||
|
|
e76c746b61 | ||
|
|
8676562d47 | ||
|
|
a1313b518d | ||
|
|
ff282eafa2 | ||
|
|
3855c84e89 | ||
|
|
e0697771a5 | ||
|
|
a35be26feb | ||
|
|
53a75ac794 | ||
|
|
03504c28f9 | ||
|
|
7babb1b96c | ||
|
|
10ead15023 | ||
|
|
3df51ed601 | ||
|
|
4c4acde590 | ||
|
|
711aa60562 | ||
|
|
50a6ed7d0e | ||
|
|
7c062a7f45 | ||
|
|
22cf0c7de6 | ||
|
|
40ac4d52a2 | ||
|
|
7921bed1d7 | ||
|
|
fbfa209de9 | ||
|
|
f7f4170ba9 | ||
|
|
e66ea6060f | ||
|
|
c9d5f42dce | ||
|
|
51fa777018 | ||
|
|
cbd8032acf | ||
|
|
1e5e092aec | ||
|
|
73483877af | ||
|
|
405975bd6e | ||
|
|
3eed67c61b | ||
|
|
27aae11d9f | ||
|
|
a29d4759b6 | ||
|
|
4804b9d460 | ||
|
|
eae10973c2 | ||
|
|
c9180aaf86 | ||
|
|
0dc6f33752 | ||
|
|
2cdeb112fe | ||
|
|
43492b920d | ||
|
|
1069a89332 | ||
|
|
2a9cfc6203 | ||
|
|
5eff33cc65 | ||
|
|
b6d6757690 | ||
|
|
829af80c95 | ||
|
|
54a76070d5 | ||
|
|
b649b4b7bb | ||
|
|
4e33f26859 | ||
|
|
50b9d68c12 | ||
|
|
e83f80d6be | ||
|
|
25e33be52e | ||
|
|
e8ad630e9d | ||
|
|
f931706664 | ||
|
|
b292acfedb | ||
|
|
82d99b4e98 | ||
|
|
777cc626ce | ||
|
|
a5e899999c | ||
|
|
b21e0f97d0 | ||
|
|
d8312c73a4 | ||
|
|
400ad49de0 | ||
|
|
2c680a1831 | ||
|
|
c3ec29a14c | ||
|
|
821fe02fde | ||
|
|
99ec55d793 | ||
|
|
23ca044515 | ||
|
|
707c86fbbb | ||
|
|
9b7bb53287 | ||
|
|
248e815d99 | ||
|
|
ca8dbce0ef | ||
|
|
c428cad70c | ||
|
|
6fb6aba9fc | ||
|
|
9377a02a6a | ||
|
|
aae6394300 | ||
|
|
e2b3d68d8a | ||
|
|
eee09319b6 | ||
|
|
4bd9770126 | ||
|
|
3abe58c4ae | ||
|
|
1603485b33 | ||
|
|
654697dc03 | ||
|
|
5ff317a6b1 | ||
|
|
7436fd1613 | ||
|
|
92efc64602 | ||
|
|
5c3923c4f5 | ||
|
|
455dd98eec | ||
|
|
30ae1186d8 | ||
|
|
cd9a264f01 | ||
|
|
a897c256c8 | ||
|
|
1e45a9899b | ||
|
|
3a66cd75b4 | ||
|
|
66eff85aa4 | ||
|
|
8f7819fb24 | ||
|
|
58524a712d | ||
|
|
e7e74aac3c | ||
|
|
5ba899088c | ||
|
|
505e3de0c4 | ||
|
|
5911208553 | ||
|
|
c173cfa771 | ||
|
|
1bbc74c910 | ||
|
|
05b7596bfa | ||
|
|
f16edfcf98 | ||
|
|
67fcdb5b91 | ||
|
|
3ad2689e38 | ||
|
|
3cc6874da0 | ||
|
|
c810d0083a | ||
|
|
09efeed105 | ||
|
|
f368556b23 | ||
|
|
eddc1fc0cf | ||
|
|
71999bdc52 | ||
|
|
415df59e20 | ||
|
|
21833f34b0 | ||
|
|
29ca520d89 | ||
|
|
f0e88b55f6 | ||
|
|
a98cfd8445 | ||
|
|
fbf74a0758 | ||
|
|
c421399e45 | ||
|
|
c52bd4bf82 | ||
|
|
87c107c825 | ||
|
|
5580ad4663 | ||
|
|
70b40a54be | ||
|
|
0cf4c7ccb9 | ||
|
|
a694d10d2f | ||
|
|
6b164672eb | ||
|
|
273a9869bf | ||
|
|
2fb12f755a | ||
|
|
bed26c3dee | ||
|
|
3968609a1e | ||
|
|
76b206670a | ||
|
|
a5ec473a59 | ||
|
|
096d95f391 | ||
|
|
3272b6725e | ||
|
|
f2668b8831 | ||
|
|
b9ecfa1e9a | ||
|
|
ada26b9d12 | ||
|
|
6675903eb9 | ||
|
|
3b95708811 | ||
|
|
ece611e5c8 | ||
|
|
ea512b30fb | ||
|
|
aa3b460724 | ||
|
|
9c4c619bed | ||
|
|
dbc9ae4fe0 | ||
|
|
b395e9ba7d | ||
|
|
b2d885d268 | ||
|
|
0488903a15 | ||
|
|
cf4ed16cf6 | ||
|
|
263c5486c2 | ||
|
|
92c0a67255 | ||
|
|
f546d867a6 | ||
|
|
bb8922cc1a | ||
|
|
f7a1e0edce | ||
|
|
d16d736489 | ||
|
|
ab72262d25 | ||
|
|
7a1ce8441c | ||
|
|
f741085b61 | ||
|
|
dead3308e4 | ||
|
|
c5d00c785e | ||
|
|
c7e5c9a849 | ||
|
|
f6ce9a3f02 | ||
|
|
8319a4d569 | ||
|
|
d4348b0ff0 | ||
|
|
29135b1b65 | ||
|
|
1ddc1eb64b | ||
|
|
c4a24dc536 | ||
|
|
6236fb5531 | ||
|
|
aeb784628d | ||
|
|
5b0856f655 | ||
|
|
84746c97b8 | ||
|
|
b25e29173a | ||
|
|
da127f24d3 | ||
|
|
5041642f2e | ||
|
|
acc8cd1e5e | ||
|
|
6c6f5601d8 | ||
|
|
aa97bbbea8 | ||
|
|
fe091487cc | ||
|
|
58c1fba595 | ||
|
|
2cb634b8f5 | ||
|
|
99516fd2b9 | ||
|
|
819e48334e | ||
|
|
0fb8878273 | ||
|
|
d739b747de | ||
|
|
995b4c73d9 | ||
|
|
4bc5d06c19 | ||
|
|
5e2e284cbf | ||
|
|
9d74734ec5 | ||
|
|
8f7940f969 | ||
|
|
792405d789 | ||
|
|
5423c400f7 | ||
|
|
c2cc4c2256 | ||
|
|
01248de66b | ||
|
|
4907ea1f0c | ||
|
|
083d59613a | ||
|
|
989c23e632 | ||
|
|
8f5fcc6e54 | ||
|
|
994e7dc3dd | ||
|
|
d03143dc0e | ||
|
|
b22b7208ec | ||
|
|
9996db7382 | ||
|
|
0ce8e85af4 | ||
|
|
11c5aeec6a | ||
|
|
8d0a7b46ac | ||
|
|
9c40fcec27 | ||
|
|
8ab817f466 | ||
|
|
770e1bbaac | ||
|
|
514126cc41 | ||
|
|
9147b73b1f | ||
|
|
7848702042 | ||
|
|
2f4e2679eb | ||
|
|
d49c344463 | ||
|
|
f7bbc7a23a | ||
|
|
1745f5a100 | ||
|
|
f4abe08863 | ||
|
|
4a580c3780 | ||
|
|
3511667609 | ||
|
|
2fe20b13f1 | ||
|
|
380c849d91 | ||
|
|
a879d6c033 | ||
|
|
cb05244814 | ||
|
|
d22764d3d3 | ||
|
|
74ae8e0b09 | ||
|
|
e8c43eae92 | ||
|
|
270296f64b | ||
|
|
c1427c1eaa | ||
|
|
99c89e5378 | ||
|
|
0cff898954 | ||
|
|
7bbac5659d | ||
|
|
ffc241d170 | ||
|
|
dca73b2c7d | ||
|
|
2982002397 | ||
|
|
5ecd0edeb8 | ||
|
|
03d203e64a | ||
|
|
38578c7f99 | ||
|
|
75395de526 | ||
|
|
3a3503201b | ||
|
|
82b3126417 | ||
|
|
63893e97e7 | ||
|
|
58bdfb90e3 | ||
|
|
3dfce53bf8 | ||
|
|
7a143d94f9 | ||
|
|
c2a8da086f | ||
|
|
8c294022f4 | ||
|
|
a55a902ba5 | ||
|
|
48f77f7117 | ||
|
|
6a466bde38 | ||
|
|
864ae11233 | ||
|
|
c0fd62e410 | ||
|
|
26a510401a | ||
|
|
c62a7572a7 | ||
|
|
e82dd025f6 | ||
|
|
772efb98d4 | ||
|
|
21bdc6afa5 | ||
|
|
2593bc0a72 | ||
|
|
f556be975c | ||
|
|
9ec47034ec | ||
|
|
32bafa1560 | ||
|
|
a3998f6f12 | ||
|
|
d3c1831bc0 | ||
|
|
a765a1330a | ||
|
|
57012b9a6e | ||
|
|
7f752519bb | ||
|
|
3123bebe33 | ||
|
|
c0e3861891 | ||
|
|
c68d939e4f | ||
|
|
c97e9c197f | ||
|
|
08f213a952 | ||
|
|
de988e45a5 | ||
|
|
43e6512049 | ||
|
|
819d315d56 | ||
|
|
be250bca76 | ||
|
|
0976901326 | ||
|
|
c390a4325a | ||
|
|
0695307730 | ||
|
|
171c88cea9 | ||
|
|
91b633a126 | ||
|
|
138c965a85 | ||
|
|
af2ed64c5c | ||
|
|
b2772c1443 | ||
|
|
2be1d68088 | ||
|
|
7414c00d63 | ||
|
|
7b54bbf0b2 | ||
|
|
e6c962cc6b | ||
|
|
8ae723fec6 | ||
|
|
b6a4f2f9c1 | ||
|
|
b7d6fa8a18 | ||
|
|
3c03474fb6 | ||
|
|
800a9ff0c4 | ||
|
|
41dcb11030 | ||
|
|
34a9675744 | ||
|
|
afa28dbc24 | ||
|
|
2f80cd5f92 | ||
|
|
7c21459b48 | ||
|
|
01bf635e26 | ||
|
|
c9fdb39854 | ||
|
|
70c7522c98 | ||
|
|
eb3933f071 | ||
|
|
48da405a39 | ||
|
|
971ff431e0 | ||
|
|
9127d0dcf4 | ||
|
|
65d80cfa08 | ||
|
|
4dc5c4a871 | ||
|
|
395df45a5a | ||
|
|
85c0f7fcbf | ||
|
|
855d65d9af | ||
|
|
c49aae1eba | ||
|
|
fa8efba1b9 | ||
|
|
1bea6465c1 | ||
|
|
1ccd1cd1ac | ||
|
|
66d8bbb9b5 | ||
|
|
2fe75b322d | ||
|
|
091bdac830 | ||
|
|
260dd5e1fb | ||
|
|
02898e8bbc | ||
|
|
42b606ca3c | ||
|
|
9405f47711 | ||
|
|
904b80076d | ||
|
|
63fe7ef540 | ||
|
|
722fd9b59a | ||
|
|
f090941427 | ||
|
|
918f27575d | ||
|
|
51880db3c5 | ||
|
|
f89650c61c | ||
|
|
221279dc18 | ||
|
|
42f0dadd27 | ||
|
|
30dd2e3d2d | ||
|
|
5e74d3c54e | ||
|
|
491468b84f | ||
|
|
7c816f75d2 | ||
|
|
2f839f6b58 | ||
|
|
4ebaaf716d | ||
|
|
0289fd543e | ||
|
|
b9793635c8 | ||
|
|
008b0cbab5 | ||
|
|
67df893fc3 | ||
|
|
6a4caab023 | ||
|
|
79d51f0ce2 | ||
|
|
0cff8b5b12 | ||
|
|
5bd34bda22 | ||
|
|
bb6a1ed6e0 | ||
|
|
27d852a425 | ||
|
|
9e4bab07e5 | ||
|
|
724ea88c3b | ||
|
|
61959aa45b | ||
|
|
d9efe82b5a | ||
|
|
153d29a00f | ||
|
|
0c78d59d88 | ||
|
|
54a59afde0 | ||
|
|
1eb7c62c62 | ||
|
|
b4a2489874 | ||
|
|
1a768c99ff | ||
|
|
7eeac660b8 | ||
|
|
5c095a7fe8 | ||
|
|
8d9f91a844 | ||
|
|
10ba7ae1c3 | ||
|
|
db4f880d61 | ||
|
|
467002a88b | ||
|
|
37e0a189fb | ||
|
|
8fd02a4ce5 | ||
|
|
4c1f671767 | ||
|
|
7720e20f81 | ||
|
|
ebb3c4d938 | ||
|
|
10c38d1339 | ||
|
|
81dac5521f | ||
|
|
8a13bc68ef | ||
|
|
ba7310d0a0 | ||
|
|
0bf79635ec | ||
|
|
9ca391c814 | ||
|
|
0a82bfe552 | ||
|
|
a682670b97 | ||
|
|
fc1a3f9916 | ||
|
|
5927bce7b5 | ||
|
|
d153f3f74f | ||
|
|
039589c739 | ||
|
|
3f20415aff | ||
|
|
e795ab9174 | ||
|
|
0ab57c9abc | ||
|
|
c993140fe7 | ||
|
|
715e7a010f | ||
|
|
328c81e07b | ||
|
|
8509505c01 | ||
|
|
28f24cd03a | ||
|
|
ead0da4161 | ||
|
|
a3c0b1b9f6 | ||
|
|
ca2f48a439 | ||
|
|
04a1b56e03 | ||
|
|
a0bd6f0d46 | ||
|
|
813faee4aa | ||
|
|
851512a84e | ||
|
|
ba12aafd78 | ||
|
|
41d0860db4 | ||
|
|
227a7a61eb | ||
|
|
baacad8432 | ||
|
|
eb4f7a046f | ||
|
|
14468b4895 | ||
|
|
91442a0414 | ||
|
|
0167bbfbaa | ||
|
|
3e63751960 | ||
|
|
10ec82d1bb | ||
|
|
1005c0bc08 | ||
|
|
586723926a | ||
|
|
7f6eaf8d5e | ||
|
|
7e9c20df71 | ||
|
|
c00eee835f | ||
|
|
0880c1241d | ||
|
|
6307e51991 | ||
|
|
43bb75c135 | ||
|
|
6cedc424ed | ||
|
|
15324b1f1a | ||
|
|
2d6200792d | ||
|
|
28d740dfc3 | ||
|
|
aa6f12f0a1 | ||
|
|
a25aa23805 | ||
|
|
9b1555d3a1 | ||
|
|
594e3c14e6 | ||
|
|
942cbb2fe2 | ||
|
|
38f0d722c6 | ||
|
|
d53dcc859f | ||
|
|
65c9d4295b | ||
|
|
c731a7960e | ||
|
|
ed0e0a8a41 | ||
|
|
89228cd484 | ||
|
|
35f4230984 | ||
|
|
8226fd21f9 | ||
|
|
d0cf627b23 | ||
|
|
57d85e2c97 | ||
|
|
e9602ca4e9 | ||
|
|
f0876828f4 | ||
|
|
99c3272a81 | ||
|
|
7c31a8f28e | ||
|
|
989dd7eef4 | ||
|
|
8c811ed21d | ||
|
|
e562f8d2cc | ||
|
|
c41ad3d600 | ||
|
|
021e1116b8 | ||
|
|
b6d09b8829 | ||
|
|
78f961f653 | ||
|
|
3e787315d2 | ||
|
|
770d79da0b | ||
|
|
0172c5e5ce | ||
|
|
1fb2796ada | ||
|
|
46465da483 | ||
|
|
751b6594a8 | ||
|
|
ff04d0fa8f | ||
|
|
ff983157a6 | ||
|
|
604854f22d | ||
|
|
5381b1fbac | ||
|
|
2722fc5434 | ||
|
|
5ac47b49ce | ||
|
|
acf779ace3 | ||
|
|
451c453442 | ||
|
|
b8b258c6f9 | ||
|
|
9fe429aeb8 | ||
|
|
86b55a6444 | ||
|
|
5d564e2378 | ||
|
|
d54282be14 | ||
|
|
bb31654289 | ||
|
|
0680b06383 | ||
|
|
2dd8426dec | ||
|
|
b1eef4ec55 | ||
|
|
b36d83b7cd | ||
|
|
75a1115685 | ||
|
|
36e820308f | ||
|
|
431961401f | ||
|
|
d6953b88ea | ||
|
|
6bbef8d33f | ||
|
|
e4806e4d39 | ||
|
|
6d6664d930 | ||
|
|
7676ef6a14 | ||
|
|
712b29d233 | ||
|
|
65455ee1ca | ||
|
|
0d86595ba8 | ||
|
|
4ab2fa21eb | ||
|
|
1f3710b90e | ||
|
|
c8a457bdce | ||
|
|
67ca37326e | ||
|
|
2dd53e6d99 | ||
|
|
623fce3cdf | ||
|
|
97d850e481 | ||
|
|
7cbc4a29bf | ||
|
|
9db06ca222 | ||
|
|
63e5ce2bc5 | ||
|
|
8bb1d83fb7 | ||
|
|
947c9d73ce | ||
|
|
66855072de | ||
|
|
c145dc2379 | ||
|
|
f2b7c2c2ad | ||
|
|
6bfeb12d33 | ||
|
|
09bef2d4c2 | ||
|
|
53fec13183 | ||
|
|
6427ad1cf9 | ||
|
|
c5d97fea69 | ||
|
|
7a41b10618 | ||
|
|
2032a7efa4 | ||
|
|
bd292b56cf | ||
|
|
7af91f1747 | ||
|
|
17d032b190 | ||
|
|
9d6c8453fd | ||
|
|
6bbe5f633c | ||
|
|
ba8c9bb1b1 | ||
|
|
8c46b421de | ||
|
|
1a6a7da9c1 | ||
|
|
d8c752ecb9 | ||
|
|
7e913c4bb7 | ||
|
|
2abde381a7 | ||
|
|
493eb10b96 | ||
|
|
7d0de5645f | ||
|
|
290310fbe8 | ||
|
|
19e6a588b8 | ||
|
|
b39f540e4b | ||
|
|
e45fc0079c | ||
|
|
25971bf98f | ||
|
|
3f273674f7 | ||
|
|
da566f3648 | ||
|
|
70e823f526 | ||
|
|
0411b34bbd | ||
|
|
49cfa21ddb | ||
|
|
7675a69cec | ||
|
|
ca6cc3fbe1 | ||
|
|
455c66e2eb | ||
|
|
de30f0a917 | ||
|
|
b16b171b1e | ||
|
|
804729deac | ||
|
|
f3e0ff8758 | ||
|
|
e3fbd40278 | ||
|
|
f2703dd65d | ||
|
|
2f917982fd | ||
|
|
f29238df6e | ||
|
|
71b1cf9cb2 | ||
|
|
20737415fa | ||
|
|
6e9ac71168 | ||
|
|
15032e3a40 | ||
|
|
eed8cf2cf0 | ||
|
|
27235df950 | ||
|
|
0902dcb7f3 | ||
|
|
8bdcbe727f | ||
|
|
e4a7e9716e | ||
|
|
7052b72f48 | ||
|
|
3e5ee4dc1b | ||
|
|
190342a2c8 | ||
|
|
82568376a0 | ||
|
|
e47cc68ee2 | ||
|
|
d56bf2ee34 | ||
|
|
07f0fcde33 | ||
|
|
de3814dcd2 | ||
|
|
cc2440d0a2 | ||
|
|
3123f6672b | ||
|
|
382997086d | ||
|
|
43995ebb28 | ||
|
|
1725fdcf8a | ||
|
|
e0362f3c36 | ||
|
|
53fefa7c10 | ||
|
|
1d0ae1a39b | ||
|
|
b6a3d1c2ae | ||
|
|
11dcabae73 | ||
|
|
d61cc913c0 | ||
|
|
527790f962 | ||
|
|
ecd4ff68a4 | ||
|
|
d4ea8aad8d | ||
|
|
f44a14c81e | ||
|
|
7caf2956d7 | ||
|
|
7398914af9 | ||
|
|
fb82d554fa | ||
|
|
8a53819f50 | ||
|
|
58c3b52a1a | ||
|
|
4a26d3f36e | ||
|
|
21e8e3a78d | ||
|
|
7bf00a766f | ||
|
|
8f69ea9da6 | ||
|
|
60923e3413 | ||
|
|
72841a51e6 | ||
|
|
5d441d2591 | ||
|
|
b001c83bd5 | ||
|
|
b1afeb4408 | ||
|
|
f6d4b860ee | ||
|
|
5d2b704608 | ||
|
|
d0f61faf4a | ||
|
|
0e1229e8d1 | ||
|
|
d785430db5 | ||
|
|
59d0cff410 | ||
|
|
e0b7242f1b | ||
|
|
3f56e00173 | ||
|
|
f8fd6681c8 | ||
|
|
a02fddd1a0 | ||
|
|
786c3b1f1a | ||
|
|
01cb3a40d7 | ||
|
|
8931a1f4c1 | ||
|
|
daa8e087f3 | ||
|
|
29e917ae88 | ||
|
|
ef36c446bd | ||
|
|
76644537e2 | ||
|
|
db521dad74 | ||
|
|
8b504bc4b1 | ||
|
|
7503de33a5 | ||
|
|
9df613ee27 | ||
|
|
2f3def3f86 | ||
|
|
5426e2c831 | ||
|
|
38b2b6cb4e | ||
|
|
94415d9cfb | ||
|
|
2fb822e1c1 | ||
|
|
0978d21439 | ||
|
|
775b0409c4 | ||
|
|
1083f8cf55 | ||
|
|
4cf8f9a434 | ||
|
|
6152fa2890 | ||
|
|
c0a702a386 | ||
|
|
a332f3189b | ||
|
|
e042ec5f3f | ||
|
|
336076c248 | ||
|
|
c21b60f555 | ||
|
|
efd0d81dca | ||
|
|
63467cd000 | ||
|
|
46f4685eec | ||
|
|
af3a5cf939 | ||
|
|
fb0ce8c06a | ||
|
|
8358597fd2 | ||
|
|
b31f830cb1 | ||
|
|
561d47a6a1 | ||
|
|
b8b0111aa2 | ||
|
|
f204f25474 | ||
|
|
47075e1cd0 | ||
|
|
793dfa5748 | ||
|
|
0b493bcb09 | ||
|
|
dd476bbf5c | ||
|
|
fc5350c9f8 | ||
|
|
b2c867bf2b | ||
|
|
3d8d116106 | ||
|
|
4b2f08f21f | ||
|
|
233088077b | ||
|
|
a59621910e | ||
|
|
05b6b59dad | ||
|
|
2bc7570674 | ||
|
|
0085ac130b | ||
|
|
7e1ee0e2e5 | ||
|
|
6bd3de8ec8 | ||
|
|
fab7f2c4b6 | ||
|
|
ea799e5735 | ||
|
|
3ab4112631 | ||
|
|
817e6f1ec1 | ||
|
|
81c8f0360f | ||
|
|
bec29d81c5 | ||
|
|
3a11aeb434 | ||
|
|
dddec1ec61 | ||
|
|
82426e0e45 | ||
|
|
3033eb8be0 | ||
|
|
e9665cf9f3 | ||
|
|
9bc743068a | ||
|
|
72a9954491 | ||
|
|
f2fe30a7bb | ||
|
|
ce39c79477 | ||
|
|
6fc4807a10 | ||
|
|
f890ea010e | ||
|
|
5b360a7fe2 | ||
|
|
55efd53ef7 | ||
|
|
fa5cf96f40 | ||
|
|
e33c783fc1 | ||
|
|
1438030e82 | ||
|
|
09e4d64f99 | ||
|
|
b5bd6191c2 | ||
|
|
e57de0ebce | ||
|
|
3bc9e7d2e4 | ||
|
|
6b636b166c | ||
|
|
026a86ba75 | ||
|
|
5a4bd14835 | ||
|
|
43159a0e05 | ||
|
|
3380817865 | ||
|
|
d6fcaafd78 | ||
|
|
0703f3f164 | ||
|
|
a083554218 | ||
|
|
c34c62ad42 | ||
|
|
fc3c091a48 | ||
|
|
000a5eaa56 | ||
|
|
48d713aafd | ||
|
|
885eec7444 | ||
|
|
95871e6cc1 | ||
|
|
f0ba0ce2e8 | ||
|
|
a166815348 | ||
|
|
35a149ea87 | ||
|
|
0287993c31 | ||
|
|
2d10f6b739 | ||
|
|
db7887687b | ||
|
|
f593807617 | ||
|
|
6da02b7b92 | ||
|
|
86c99c47c9 | ||
|
|
3b3e39b375 | ||
|
|
4b3feed324 | ||
|
|
57dd8bb91e | ||
|
|
34b1f90200 | ||
|
|
128e2c9e1f | ||
|
|
d0669823a2 | ||
|
|
1f99b1ec8e | ||
|
|
2c5eeb551e | ||
|
|
54906702bd | ||
|
|
ec56311a3d | ||
|
|
cdd09ea24f | ||
|
|
1ecdbc1d90 | ||
|
|
b1a5195c51 | ||
|
|
03f03ff501 | ||
|
|
3c5967a623 | ||
|
|
9013e8376c | ||
|
|
9b5b054297 | ||
|
|
4e161f0c91 | ||
|
|
6bbd54ab93 | ||
|
|
87190762d1 | ||
|
|
f4da36065f | ||
|
|
e71135b511 | ||
|
|
dfc880807e | ||
|
|
d12853ddf7 | ||
|
|
f1019ab332 | ||
|
|
96d1f8d83b | ||
|
|
c4fc0e57b3 | ||
|
|
6403c5e6af | ||
|
|
b3fbafad59 | ||
|
|
7594c4eab2 | ||
|
|
4163f1d6b0 | ||
|
|
ea716200a7 | ||
|
|
2bd9b7a640 | ||
|
|
4f670d516d | ||
|
|
f5835244c7 | ||
|
|
b00b1c36bc | ||
|
|
b2ddc6cfd8 | ||
|
|
0d6dbdc58b | ||
|
|
78baf76ae1 | ||
|
|
43c43e25c4 | ||
|
|
32daf025ab | ||
|
|
750bdb7bba | ||
|
|
8a796416a4 | ||
|
|
691e6cf9e8 | ||
|
|
de208e7a2f | ||
|
|
63a72c5d28 | ||
|
|
b6b4b89008 | ||
|
|
0b65735d86 | ||
|
|
44215ae6f1 | ||
|
|
fba5b80980 | ||
|
|
3f6af59612 | ||
|
|
693a622322 | ||
|
|
60e9d3f660 | ||
|
|
1d40858f70 | ||
|
|
5188529ff6 | ||
|
|
2079db79f7 | ||
|
|
d73eec068f | ||
|
|
8a32e5761c | ||
|
|
12e1a531fe | ||
|
|
32830da3c2 | ||
|
|
9f47e75492 | ||
|
|
e975681c16 | ||
|
|
a968d296bb | ||
|
|
031240ffc1 | ||
|
|
dfc4b07b1a | ||
|
|
63241dbf69 | ||
|
|
5b7523b9e0 | ||
|
|
4b228a71ef | ||
|
|
0f864c3192 | ||
|
|
e475d0d0b9 | ||
|
|
1635ace182 | ||
|
|
b4e3ce5de6 | ||
|
|
50ceb7c4dd | ||
|
|
4395a04d57 | ||
|
|
c5313375f0 | ||
|
|
2503ddfde4 | ||
|
|
b356cca528 | ||
|
|
d52394bb47 | ||
|
|
1da2d89ced | ||
|
|
a88a7d9834 | ||
|
|
9507fde91d | ||
|
|
742a27158a | ||
|
|
5ed383e3e2 | ||
|
|
1679837e46 | ||
|
|
eb3685fe67 | ||
|
|
50f8465d1e | ||
|
|
5502864a1f | ||
|
|
d572e59d2e | ||
|
|
e313bbfb31 | ||
|
|
a51c5fd9ca | ||
|
|
0c104cfc3a | ||
|
|
3a77082c66 | ||
|
|
975e4db452 | ||
|
|
d92f184bc9 | ||
|
|
2eea5cc3b2 | ||
|
|
0e8cb14099 | ||
|
|
1ec3b2ffe2 | ||
|
|
c836d69385 | ||
|
|
11c45e4388 | ||
|
|
3b9fac9c84 | ||
|
|
185558985e | ||
|
|
e3d25f6fed | ||
|
|
200071e713 | ||
|
|
bdb7bb97cd | ||
|
|
82809f27f7 | ||
|
|
c8e84b3a11 | ||
|
|
9581f07242 | ||
|
|
411aedafa0 | ||
|
|
f7f307c3bf | ||
|
|
c10df031bd | ||
|
|
a56228aba1 | ||
|
|
1b09544314 | ||
|
|
2dc18594a2 | ||
|
|
baa7a58a10 | ||
|
|
bb5212d2bb | ||
|
|
38db7d1e50 | ||
|
|
3371085da0 | ||
|
|
5c688370ed | ||
|
|
ab01722d96 | ||
|
|
ae5cb9864a | ||
|
|
43e5838555 | ||
|
|
cf8b02de26 | ||
|
|
d3ede583c2 | ||
|
|
cda871d2eb | ||
|
|
2ea3b77b7a | ||
|
|
3ab04e4c30 | ||
|
|
3b2190d720 | ||
|
|
b3691dcce9 | ||
|
|
722bc00c9b | ||
|
|
fe07da8634 | ||
|
|
54feab66e0 | ||
|
|
fda897c69e | ||
|
|
31d3616b8d | ||
|
|
eb6bab36a0 | ||
|
|
81f9798307 | ||
|
|
d1dafd5782 | ||
|
|
799a2ea541 | ||
|
|
4b2e45bbae | ||
|
|
32721ac8cb | ||
|
|
6871d2ed37 | ||
|
|
bdfa6f6ecc | ||
|
|
c59fbd5f9d | ||
|
|
54916cc548 | ||
|
|
3ff3ed39fb | ||
|
|
a8dbedd486 | ||
|
|
988a68dae5 | ||
|
|
9a9c5911a6 | ||
|
|
bfb07e9948 | ||
|
|
dda4e2c33a | ||
|
|
05e143662d | ||
|
|
9e2f15bde4 | ||
|
|
8f90423793 | ||
|
|
eecc002236 | ||
|
|
4167d3291a | ||
|
|
3be6229cf2 | ||
|
|
5f693945f0 | ||
|
|
82f478716c | ||
|
|
6544069aa2 | ||
|
|
8486a4fbae | ||
|
|
edd1138556 | ||
|
|
14ed3ae816 | ||
|
|
d5db9e88d4 | ||
|
|
f0a4fa7712 | ||
|
|
1f92768193 | ||
|
|
ccfcf0a1ee | ||
|
|
51626bf0db | ||
|
|
be6da2452a | ||
|
|
ec423db4e5 | ||
|
|
4c7f215559 | ||
|
|
0f9da06309 | ||
|
|
4ce6cabc46 | ||
|
|
b2b13b98b7 | ||
|
|
4c729ca5ed | ||
|
|
a78f8865b8 | ||
|
|
d5b37d4343 | ||
|
|
e424883857 | ||
|
|
b6e8c9c9ea | ||
|
|
ed9bb72dbe | ||
|
|
9753808936 | ||
|
|
82fdbc4bc6 | ||
|
|
d7f3b81e4c | ||
|
|
36f349ecba | ||
|
|
30a374b9e9 | ||
|
|
2a0b9a8596 | ||
|
|
9a9324946f | ||
|
|
babf1556e3 | ||
|
|
bb1c87b084 | ||
|
|
1c584fb158 | ||
|
|
83e1855919 | ||
|
|
4bc04769ec | ||
|
|
178358c29a | ||
|
|
42b16f74a1 | ||
|
|
9b493ad9e7 | ||
|
|
d7d5baae0e | ||
|
|
a8e434b74d | ||
|
|
07d5ba8405 | ||
|
|
a5141f9908 | ||
|
|
d15fb82b08 | ||
|
|
947b27a227 | ||
|
|
b49110bf5c | ||
|
|
8578958e40 | ||
|
|
65e78ca8b0 | ||
|
|
608bf9ada1 | ||
|
|
4373831317 | ||
|
|
aa78d63d72 | ||
|
|
400d94caba | ||
|
|
1660c4fe7c | ||
|
|
e643f12371 | ||
|
|
339c0bc520 | ||
|
|
e15c240a8f | ||
|
|
7bd66c2560 | ||
|
|
1f8fd404e5 | ||
|
|
93e951eb75 | ||
|
|
c52cd77c4c | ||
|
|
0da911c9f8 | ||
|
|
395aa0fc10 | ||
|
|
e10920d4ea | ||
|
|
914afa2dee | ||
|
|
ca1e0b4c48 | ||
|
|
70cf48dcaf | ||
|
|
68130c85f3 | ||
|
|
d0aea18b3e | ||
|
|
ac301b22e2 | ||
|
|
b56125fa39 | ||
|
|
b362ddac15 | ||
|
|
5f2aa810b1 | ||
|
|
189a6c337e | ||
|
|
9c552839ea | ||
|
|
79aa7901cf | ||
|
|
ad2dbffe75 | ||
|
|
3b77b04b95 | ||
|
|
88959b2e6c | ||
|
|
f256742a0d | ||
|
|
22e2d3d0f4 | ||
|
|
3eed137117 | ||
|
|
e28be10dd4 | ||
|
|
90361cb631 | ||
|
|
c3b959846c | ||
|
|
39884e16fa | ||
|
|
f107f8a87b | ||
|
|
8246b2f35f | ||
|
|
f13d12acec | ||
|
|
4090be72d4 | ||
|
|
90d30005f6 | ||
|
|
7c968a8f88 | ||
|
|
e4ab86e6f9 | ||
|
|
f41fb32d60 | ||
|
|
5249a17d48 | ||
|
|
99256bcad0 | ||
|
|
f402c37b14 | ||
|
|
494ab2db4d | ||
|
|
5d4160bc82 | ||
|
|
b9194e4305 | ||
|
|
8ab1fbe83a | ||
|
|
96a088f998 | ||
|
|
7d4399d7cc | ||
|
|
107c37f33d | ||
|
|
88949024e6 | ||
|
|
aad0b3d2d8 | ||
|
|
4e0e53c714 | ||
|
|
87a2817234 | ||
|
|
f3e796e972 | ||
|
|
7d5a843684 | ||
|
|
f914929eb7 | ||
|
|
8f7b776556 | ||
|
|
aeaa58a01b | ||
|
|
4dacd3be26 | ||
|
|
05929bdfe9 | ||
|
|
0690041347 | ||
|
|
842fd8b4e5 | ||
|
|
7a89e3d67a | ||
|
|
5ecc6224b0 | ||
|
|
f5c592291c | ||
|
|
7f229a3fde | ||
|
|
c859fb1186 | ||
|
|
6dceb30632 | ||
|
|
f3dc31be40 | ||
|
|
a2f5ffd59e | ||
|
|
a2c66a32b0 | ||
|
|
72139675ac | ||
|
|
2b57f04dc0 | ||
|
|
15e09fa83b | ||
|
|
55ee1d41f3 | ||
|
|
2e7908366a | ||
|
|
6ab4fda9a6 | ||
|
|
a5ba41cae8 | ||
|
|
5e9cdad044 | ||
|
|
c14de26c07 | ||
|
|
e5f506c81d | ||
|
|
4160f08c6c | ||
|
|
4ad0d1682e | ||
|
|
8fb4fc9a14 | ||
|
|
5a0187e1db | ||
|
|
7f5141c338 | ||
|
|
354cabf8d1 | ||
|
|
fd734c8553 | ||
|
|
9238de6a47 | ||
|
|
b2c5f488a7 | ||
|
|
c634867cdd | ||
|
|
d7f2273788 | ||
|
|
5c1a982fdd | ||
|
|
0300a67da8 | ||
|
|
862dfb3275 | ||
|
|
03121ed826 | ||
|
|
0cdff00cb6 | ||
|
|
787facec65 | ||
|
|
44d63b9103 | ||
|
|
49571fc78a | ||
|
|
60569bc97c | ||
|
|
b37510c30e | ||
|
|
343b7bf3e1 | ||
|
|
7a2423a742 | ||
|
|
57dfc739c6 | ||
|
|
f3d4b6541c | ||
|
|
d1c20d6c72 | ||
|
|
e4beb8236e | ||
|
|
99a8aa6868 | ||
|
|
983fc1a7b6 |
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
; Top-most http://editorconfig.org/ file
|
||||
root = true
|
||||
|
||||
; Unix-style newlines
|
||||
[*]
|
||||
end_of_line = LF
|
||||
|
||||
; 4-column tab indentation
|
||||
[*.cs]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
; 4-column tab indentation
|
||||
[*.yaml]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
10
.gitattributes
vendored
Normal file
10
.gitattributes
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Enforce LF normalization on Windows
|
||||
* text=lf
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
*.sln merge=union
|
||||
*.csproj merge=union
|
||||
*.vbproj merge=union
|
||||
*.fsproj merge=union
|
||||
*.dbproj merge=union
|
||||
18
.gitignore
vendored
18
.gitignore
vendored
@@ -13,11 +13,9 @@ mods/*/*.dll
|
||||
# ReSharper crap
|
||||
_ReSharper.*/
|
||||
|
||||
# Red Alert binary files
|
||||
mods/*/packages/*.[mM][iI][xX]
|
||||
|
||||
#binary stuff
|
||||
/*.dll
|
||||
/*.dll.config
|
||||
*.pdb
|
||||
*.mdb
|
||||
*.exe
|
||||
@@ -27,9 +25,13 @@ mods/*/packages/*.[mM][iI][xX]
|
||||
*.orig
|
||||
\#*
|
||||
.*.sw?
|
||||
|
||||
# dependency DLLs (different for every platform!)
|
||||
cg.dll
|
||||
cgGL.dll
|
||||
freetype6.dll
|
||||
zlib1.dll
|
||||
SDL.dll
|
||||
|
||||
/OpenRa.Gl.dll
|
||||
|
||||
@@ -52,9 +54,15 @@ OpenRA.Launcher.Mac/build/
|
||||
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.pbxuser
|
||||
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.perspectivev3
|
||||
OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
|
||||
*.config
|
||||
*.resources
|
||||
|
||||
# KDE crap
|
||||
*.kate-swp
|
||||
*.directory
|
||||
*.directory
|
||||
|
||||
# auto-generated documentation
|
||||
DOCUMENTATION.md
|
||||
*.html
|
||||
|
||||
# StyleCop
|
||||
*.Cache
|
||||
23
.travis.yml
Normal file
23
.travis.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
# Travis-CI Build for OpenRA
|
||||
# see travis-ci.org for details
|
||||
|
||||
# Mono/.NET are not officially supported. The following is a workaround.
|
||||
language: c
|
||||
|
||||
# Make sure build dependencies are installed.
|
||||
install:
|
||||
- sudo apt-get update && sudo apt-get install mono-gmcs cli-common-dev libgl1-mesa-dev libsdl1.2-dev libopenal-dev
|
||||
|
||||
# Run the build script which will automatically call RALint and ensure that the IDE project files are still valid.
|
||||
script:
|
||||
- make all
|
||||
- xbuild
|
||||
|
||||
# Only watch the development branch.
|
||||
branches:
|
||||
only:
|
||||
- bleed
|
||||
|
||||
# Notify developers when build passed/failed.
|
||||
notifications:
|
||||
irc: "irc.freenode.net#openra"
|
||||
108
AUTHORS
108
AUTHORS
@@ -1,40 +1,78 @@
|
||||
AUTHORS
|
||||
OpenRA wouldn't be where it is today without the
|
||||
hard work of many contributors.
|
||||
|
||||
The OpenRA developers are:
|
||||
* Alli Witheford (alzeih)
|
||||
* Caleb Anderson (RobotCaleb)
|
||||
* Chris Forbes (chrisf)
|
||||
* Curtis Shmyr (hamb)
|
||||
* Daniel Hernandez (Mancano)
|
||||
* Matthew Bowra-Dean (beedee)
|
||||
* Mike Bundy (kehaar)
|
||||
* Chris Forbes (chrisf)
|
||||
* Curtis Shmyr (hamb)
|
||||
* Matthias Mailänder (Mailaender)
|
||||
* Paul Chote (pchote)
|
||||
* ScottNZ
|
||||
|
||||
Previous developers included:
|
||||
* Alli Witheford (alzeih)
|
||||
* Caleb Anderson (RobotCaleb)
|
||||
* Daniel Hernandez (Mancano)
|
||||
* Megan Bowra-Dean (beedee)
|
||||
* Mike Bundy (kehaar)
|
||||
* Robert Pepperell (ytinasni)
|
||||
|
||||
Also thanks to:
|
||||
* Akseli Virtanen (RAGEQUIT)
|
||||
* Andrew Riedi
|
||||
* Barnaby Smith (mvi)
|
||||
* Bellator
|
||||
* Christer Ulfsparre (Holloweye)
|
||||
* Erasmus Schroder (rasco)
|
||||
* Igor Popov (ihptru)
|
||||
* James Dunne (jsd)
|
||||
* Jeff Harris (jeff_1amstudios)
|
||||
* Joakim Lindberg (booom3)
|
||||
* Kenny Hoxworth (hoxworth)
|
||||
* Kyrre Soerensen (zypres)
|
||||
* Lawrence Wang
|
||||
* Mark Olson (markolson)
|
||||
* Matthew Gatland (mgatland)
|
||||
* Matthias Mailänder (Mailaender)
|
||||
* Max Ugrumov (katzsmile)
|
||||
* Max621
|
||||
* Nukem
|
||||
* Paolo Chiodi (paolochiodi)
|
||||
* Paul Dovydaitis (pdovy)
|
||||
* Raymond Martineau (mart0258)
|
||||
* Riderr3
|
||||
* Tim Mylemans (gecko)
|
||||
* Akseli Virtanen (RAGEQUIT)
|
||||
* Andrew Aldridge (i80and)
|
||||
* Andrew Perkins
|
||||
* Andrew Riedi
|
||||
* Andreas Beck (baxtor)
|
||||
* Barnaby Smith (mvi)
|
||||
* Bellator
|
||||
* Bugra Cuhadaroglu (BugraC)
|
||||
* Christer Ulfsparre (Holloweye)
|
||||
* Cody Brittain (Generalcamo)
|
||||
* D2k Sardaukar
|
||||
* Daniel Derejvanik (Harisson)
|
||||
* Danny Keary (Dan9550)
|
||||
* Erasmus Schroder (rasco)
|
||||
* Fahrradkette
|
||||
* Frank Razenberg (zzattack)
|
||||
* Igor Popov (ihptru)
|
||||
* Iran
|
||||
* James Dunne (jsd)
|
||||
* Jeff Harris (jeff_1amstudios)
|
||||
* Jes
|
||||
* Joakim Lindberg (booom3)
|
||||
* JOo
|
||||
* Kenny Hoxworth (hoxworth)
|
||||
* Krishnakanth Mallik
|
||||
* Kyrre Soerensen (zypres)
|
||||
* Lawrence Wang
|
||||
* Lesueur Benjamin (Valkirie)
|
||||
* Maarten Meuris (Nyerguds)
|
||||
* Mark Olson (markolson)
|
||||
* Matthew Gatland (mgatland)
|
||||
* Max621
|
||||
* Max Ugrumov (katzsmile)
|
||||
* Nukem
|
||||
* Olaf van der Spek
|
||||
* Paolo Chiodi (paolochiodi)
|
||||
* Paul Dovydaitis (pdovy)
|
||||
* Psydev
|
||||
* Raymond Martineau (mart0258)
|
||||
* Reaperrr
|
||||
* Riderr3
|
||||
* Sascha Biedermann (bidifx)
|
||||
* Tim Mylemans (gecko)
|
||||
* Tirili
|
||||
* Tristan Keating (Kilkakon)
|
||||
* Vladimir Komarov (VrKomarov)
|
||||
* Wuschel
|
||||
|
||||
Using GeoLite data created by MaxMind and
|
||||
distributed under the CC BY-SA 3.0 license.
|
||||
|
||||
Finally, special thanks goes to the original teams
|
||||
at Westwood Studios and EA for creating the classic
|
||||
games that inspired the creation of OpenRA.
|
||||
|
||||
Red Alert, Command and Conquer, and related
|
||||
trademarks belong to Electronic Arts Inc. and are
|
||||
used without permission.
|
||||
|
||||
Past developers included:
|
||||
* Paul Chote (pchote)
|
||||
* Robert Pepperell (ytinasni)
|
||||
|
||||
19
CONTRIBUTING.md
Normal file
19
CONTRIBUTING.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# OpenRA Contributing Guidelines
|
||||
|
||||
## Bug reports
|
||||
|
||||
* Have you read the [FAQ](https://github.com/OpenRA/OpenRA/wiki/FAQ)?
|
||||
* Add the appropriate log files on crashes.
|
||||
* Please be specific on how to reproduce the problem.
|
||||
|
||||
## Patches
|
||||
|
||||
* [Coding standard](https://github.com/OpenRA/OpenRA/wiki/Coding-Standard)
|
||||
* [Branches and Releases](https://github.com/OpenRA/OpenRA/wiki/Branches-and-Releases)
|
||||
* [Licensing](http://www.gnu.org/licenses/quick-guide-gplv3.html)
|
||||
|
||||
Please `git rebase` to the latest revision of the bleed branch.
|
||||
|
||||
Don't forget to add youself to [AUTHORS](https://github.com/OpenRA/OpenRA/blob/bleed/AUTHORS).
|
||||
|
||||
While your pull-request is in review it will be helpful if you join [IRC](irc://chat.freenode.net/openra) to discuss the changes.
|
||||
BIN
Dune2k.ttf
Normal file
BIN
Dune2k.ttf
Normal file
Binary file not shown.
165
GeoIP/COPYING
Normal file
165
GeoIP/COPYING
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
63
GeoIP/Country.cs
Normal file
63
GeoIP/Country.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace GeoIP
|
||||
{
|
||||
public class Country
|
||||
{
|
||||
String code;
|
||||
String name;
|
||||
|
||||
/*
|
||||
* Creates a new Country.
|
||||
*
|
||||
* @param code the country code.
|
||||
* @param name the country name.
|
||||
*/
|
||||
public Country(String code, String name)
|
||||
{
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the ISO two-letter country code of this country.
|
||||
*
|
||||
* @return the country code.
|
||||
*/
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the name of this country.
|
||||
*
|
||||
* @return the country name.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
106
GeoIP/DatabaseInfo.cs
Normal file
106
GeoIP/DatabaseInfo.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace GeoIP
|
||||
{
|
||||
public class DatabaseInfo
|
||||
{
|
||||
public static int COUNTRY_EDITION = 1;
|
||||
public static int REGION_EDITION_REV0 = 7;
|
||||
public static int REGION_EDITION_REV1 = 3;
|
||||
public static int CITY_EDITION_REV0 = 6;
|
||||
public static int CITY_EDITION_REV1 = 2;
|
||||
public static int ORG_EDITION = 5;
|
||||
public static int ISP_EDITION = 4;
|
||||
public static int PROXY_EDITION = 8;
|
||||
public static int ASNUM_EDITION = 9;
|
||||
public static int NETSPEED_EDITION = 10;
|
||||
public static int DOMAIN_EDITION = 11;
|
||||
public static int COUNTRY_EDITION_V6 = 12;
|
||||
public static int ASNUM_EDITION_V6 = 21;
|
||||
public static int ISP_EDITION_V6 = 22;
|
||||
public static int ORG_EDITION_V6 = 23;
|
||||
public static int DOMAIN_EDITION_V6 = 24;
|
||||
public static int CITY_EDITION_REV1_V6 = 30;
|
||||
public static int CITY_EDITION_REV0_V6 = 31;
|
||||
public static int NETSPEED_EDITION_REV1 = 32;
|
||||
public static int NETSPEED_EDITION_REV1_V6 = 33;
|
||||
|
||||
private String info;
|
||||
/**
|
||||
* Creates a new DatabaseInfo object given the database info String.
|
||||
* @param info
|
||||
*/
|
||||
|
||||
public DatabaseInfo(String info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public int getType()
|
||||
{
|
||||
if ((info == null) | (info == ""))
|
||||
{
|
||||
return COUNTRY_EDITION;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the type code from the database info string and then
|
||||
// subtract 105 from the value to preserve compatability with
|
||||
// databases from April 2003 and earlier.
|
||||
return Convert.ToInt32(info.Substring(4, 3)) - 105;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date of the database.
|
||||
*
|
||||
* @return the date of the database.
|
||||
*/
|
||||
public DateTime getDate()
|
||||
{
|
||||
for (int i=0; i<info.Length-9; i++)
|
||||
{
|
||||
if (Char.IsWhiteSpace(info[i]) == true)
|
||||
{
|
||||
var dateString = info.Substring(i+1, 8);
|
||||
try
|
||||
{
|
||||
return DateTime.ParseExact(dateString,"yyyyMMdd",null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.Write(e.Message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return DateTime.Now;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
GeoIP/GeoIP.csproj
Normal file
44
GeoIP/GeoIP.csproj
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{021DDD6A-A608-424C-9A9A-252D8A9989E0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GeoIP</RootNamespace>
|
||||
<AssemblyName>GeoIP</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Country.cs" />
|
||||
<Compile Include="DatabaseInfo.cs" />
|
||||
<Compile Include="Location.cs" />
|
||||
<Compile Include="LookupService.cs" />
|
||||
<Compile Include="Region.cs" />
|
||||
<Compile Include="RegionName.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
67
GeoIP/Location.cs
Normal file
67
GeoIP/Location.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace GeoIP
|
||||
{
|
||||
public class Location
|
||||
{
|
||||
public String countryCode;
|
||||
public String countryName;
|
||||
public String region;
|
||||
public String city;
|
||||
public String postalCode;
|
||||
public double latitude;
|
||||
public double longitude;
|
||||
public int dma_code;
|
||||
public int area_code;
|
||||
public String regionName;
|
||||
public int metro_code;
|
||||
|
||||
private static double EARTH_DIAMETER = 2 * 6378.2;
|
||||
private static double PI = 3.14159265;
|
||||
private static double RAD_CONVERT = PI / 180;
|
||||
|
||||
public double distance (Location loc)
|
||||
{
|
||||
double delta_lat, delta_lon;
|
||||
double temp;
|
||||
|
||||
double lat1 = latitude;
|
||||
double lon1 = longitude;
|
||||
double lat2 = loc.latitude;
|
||||
double lon2 = loc.longitude;
|
||||
|
||||
// convert degrees to radians
|
||||
lat1 *= RAD_CONVERT;
|
||||
lat2 *= RAD_CONVERT;
|
||||
|
||||
// find the deltas
|
||||
delta_lat = lat2 - lat1;
|
||||
delta_lon = (lon2 - lon1) * RAD_CONVERT;
|
||||
|
||||
// Find the great circle distance
|
||||
temp = Math.Pow(Math.Sin(delta_lat/2), 2) + Math.Cos(lat1) * Math.Cos(lat2) * Math.Pow(Math.Sin(delta_lon/2), 2);
|
||||
return EARTH_DIAMETER * Math.Atan2(Math.Sqrt(temp), Math.Sqrt(1-temp));
|
||||
}
|
||||
}
|
||||
}
|
||||
999
GeoIP/LookupService.cs
Normal file
999
GeoIP/LookupService.cs
Normal file
@@ -0,0 +1,999 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace GeoIP
|
||||
{
|
||||
public class LookupService
|
||||
{
|
||||
private FileStream file = null;
|
||||
private DatabaseInfo databaseInfo = null;
|
||||
private Object ioLock = new Object();
|
||||
byte databaseType = Convert.ToByte(DatabaseInfo.COUNTRY_EDITION);
|
||||
int[] databaseSegments;
|
||||
int recordLength;
|
||||
int dboptions;
|
||||
byte[] dbbuffer;
|
||||
|
||||
private static Country UNKNOWN_COUNTRY = new Country("--", "Unknown Location");
|
||||
private static int COUNTRY_BEGIN = 16776960;
|
||||
private static int STRUCTURE_INFO_MAX_SIZE = 20;
|
||||
private static int DATABASE_INFO_MAX_SIZE = 100;
|
||||
private static int FULL_RECORD_LENGTH = 100;//???
|
||||
private static int SEGMENT_RECORD_LENGTH = 3;
|
||||
private static int STANDARD_RECORD_LENGTH = 3;
|
||||
private static int ORG_RECORD_LENGTH = 4;
|
||||
private static int MAX_RECORD_LENGTH = 4;
|
||||
private static int MAX_ORG_RECORD_LENGTH = 1000;//???
|
||||
private static int FIPS_RANGE = 360;
|
||||
private static int STATE_BEGIN_REV0 = 16700000;
|
||||
private static int STATE_BEGIN_REV1 = 16000000;
|
||||
private static int US_OFFSET = 1;
|
||||
private static int CANADA_OFFSET = 677;
|
||||
private static int WORLD_OFFSET = 1353;
|
||||
public static int GEOIP_STANDARD = 0;
|
||||
public static int GEOIP_MEMORY_CACHE = 1;
|
||||
public static int GEOIP_UNKNOWN_SPEED = 0;
|
||||
public static int GEOIP_DIALUP_SPEED = 1;
|
||||
public static int GEOIP_CABLEDSL_SPEED = 2;
|
||||
public static int GEOIP_CORPORATE_SPEED = 3;
|
||||
|
||||
private static String[] countryCode = {
|
||||
"--",
|
||||
"AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "CW",
|
||||
"AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB",
|
||||
"BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO",
|
||||
"BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD",
|
||||
"CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR",
|
||||
"CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO",
|
||||
"DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ",
|
||||
"FK", "FM", "FO", "FR", "SX", "GA", "GB", "GD", "GE", "GF",
|
||||
"GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT",
|
||||
"GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID",
|
||||
"IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO",
|
||||
"JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW",
|
||||
"KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT",
|
||||
"LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML",
|
||||
"MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV",
|
||||
"MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI",
|
||||
"NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF",
|
||||
"PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW",
|
||||
"PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD",
|
||||
"SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO",
|
||||
"SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH",
|
||||
"TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW",
|
||||
"TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE",
|
||||
"VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "RS", "ZA",
|
||||
"ZM", "ME", "ZW", "A1", "A2", "O1", "AX", "GG", "IM", "JE",
|
||||
"BL", "MF", "BQ", "SS", "O1" };
|
||||
|
||||
private static String[] countryName = {
|
||||
"Unknown Location",
|
||||
"Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Curacao",
|
||||
"Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", "Barbados",
|
||||
"Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia",
|
||||
"Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the",
|
||||
"Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica",
|
||||
"Cuba", "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic",
|
||||
"Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji",
|
||||
"Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", "France", "Sint Maarten (Dutch part)", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana",
|
||||
"Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala",
|
||||
"Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia",
|
||||
"Ireland", "Israel", "India", "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", "Iceland", "Italy", "Jamaica", "Jordan",
|
||||
"Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait",
|
||||
"Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania",
|
||||
"Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova, Republic of", "Madagascar", "Marshall Islands", "Macedonia", "Mali",
|
||||
"Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives",
|
||||
"Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua",
|
||||
"Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia",
|
||||
"Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory", "Portugal", "Palau",
|
||||
"Paraguay", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan",
|
||||
"Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname",
|
||||
"Sao Tome and Principe", "El Salvador", "Syrian Arab Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand",
|
||||
"Tajikistan", "Tokelau", "Turkmenistan", "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan",
|
||||
"Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", "Venezuela",
|
||||
"Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Serbia", "South Africa",
|
||||
"Zambia", "Montenegro", "Zimbabwe", "Anonymous Proxy", "Satellite Provider", "Other", "Aland Islands", "Guernsey", "Isle of Man", "Jersey",
|
||||
"Saint Barthelemy", "Saint Martin", "Bonaire, Saint Eustatius and Saba", "South Sudan", "Other" };
|
||||
|
||||
public LookupService(String databaseFile, int options)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (ioLock)
|
||||
this.file = new FileStream(databaseFile, FileMode.Open, FileAccess.Read);
|
||||
dboptions = options;
|
||||
init();
|
||||
}
|
||||
catch(System.SystemException)
|
||||
{
|
||||
Console.WriteLine("cannot open file " + databaseFile);
|
||||
}
|
||||
}
|
||||
|
||||
public LookupService(String databaseFile):this(databaseFile, GEOIP_STANDARD) { }
|
||||
|
||||
private void init()
|
||||
{
|
||||
int i, j;
|
||||
byte[] delim = new byte[3];
|
||||
byte[] buf = new byte[SEGMENT_RECORD_LENGTH];
|
||||
databaseType = (byte)DatabaseInfo.COUNTRY_EDITION;
|
||||
recordLength = STANDARD_RECORD_LENGTH;
|
||||
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(-3,SeekOrigin.End);
|
||||
for (i = 0; i < STRUCTURE_INFO_MAX_SIZE; i++)
|
||||
{
|
||||
file.Read(delim,0,3);
|
||||
if (delim[0] == 255 && delim[1] == 255 && delim[2] == 255)
|
||||
{
|
||||
databaseType = Convert.ToByte(file.ReadByte());
|
||||
if (databaseType >= 106)
|
||||
{
|
||||
// Backward compatibility with databases from April 2003 and earlier
|
||||
databaseType -= 105;
|
||||
}
|
||||
// Determine the database type.
|
||||
if (databaseType == DatabaseInfo.REGION_EDITION_REV0)
|
||||
{
|
||||
databaseSegments = new int[1];
|
||||
databaseSegments[0] = STATE_BEGIN_REV0;
|
||||
recordLength = STANDARD_RECORD_LENGTH;
|
||||
}
|
||||
else if (databaseType == DatabaseInfo.REGION_EDITION_REV1)
|
||||
{
|
||||
databaseSegments = new int[1];
|
||||
databaseSegments[0] = STATE_BEGIN_REV1;
|
||||
recordLength = STANDARD_RECORD_LENGTH;
|
||||
}
|
||||
else if (databaseType == DatabaseInfo.CITY_EDITION_REV0 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV1 ||
|
||||
databaseType == DatabaseInfo.ORG_EDITION ||
|
||||
databaseType == DatabaseInfo.ORG_EDITION_V6 ||
|
||||
databaseType == DatabaseInfo.ISP_EDITION ||
|
||||
databaseType == DatabaseInfo.ISP_EDITION_V6 ||
|
||||
databaseType == DatabaseInfo.ASNUM_EDITION ||
|
||||
databaseType == DatabaseInfo.ASNUM_EDITION_V6 ||
|
||||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1 ||
|
||||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1_V6 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV0_V6 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV1_V6)
|
||||
{
|
||||
databaseSegments = new int[1];
|
||||
databaseSegments[0] = 0;
|
||||
if (databaseType == DatabaseInfo.CITY_EDITION_REV0 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV1 ||
|
||||
databaseType == DatabaseInfo.ASNUM_EDITION_V6 ||
|
||||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1 ||
|
||||
databaseType == DatabaseInfo.NETSPEED_EDITION_REV1_V6 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV0_V6 ||
|
||||
databaseType == DatabaseInfo.CITY_EDITION_REV1_V6 ||
|
||||
databaseType == DatabaseInfo.ASNUM_EDITION)
|
||||
{
|
||||
recordLength = STANDARD_RECORD_LENGTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
recordLength = ORG_RECORD_LENGTH;
|
||||
}
|
||||
file.Read(buf,0,SEGMENT_RECORD_LENGTH);
|
||||
for (j = 0; j < SEGMENT_RECORD_LENGTH; j++)
|
||||
databaseSegments[0] += (unsignedByteToInt(buf[j]) << (j * 8));
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
file.Seek(-4,SeekOrigin.Current);
|
||||
}
|
||||
}
|
||||
if ((databaseType == DatabaseInfo.COUNTRY_EDITION) ||
|
||||
(databaseType == DatabaseInfo.COUNTRY_EDITION_V6) ||
|
||||
(databaseType == DatabaseInfo.PROXY_EDITION) ||
|
||||
(databaseType == DatabaseInfo.NETSPEED_EDITION))
|
||||
{
|
||||
databaseSegments = new int[1];
|
||||
databaseSegments[0] = COUNTRY_BEGIN;
|
||||
recordLength = STANDARD_RECORD_LENGTH;
|
||||
}
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
{
|
||||
int l = (int) file.Length;
|
||||
dbbuffer = new byte[l];
|
||||
file.Seek(0,SeekOrigin.Begin);
|
||||
file.Read(dbbuffer,0,l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void close()
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (ioLock) { file.Close(); }
|
||||
file = null;
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public Country getCountry(IPAddress ipAddress)
|
||||
{
|
||||
return getCountry(bytestoLong(ipAddress.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public Country getCountryV6(String ipAddress)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(ipAddress);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return UNKNOWN_COUNTRY;
|
||||
}
|
||||
return getCountryV6(addr);
|
||||
}
|
||||
|
||||
public Country getCountry(String ipAddress)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(ipAddress);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return UNKNOWN_COUNTRY;
|
||||
}
|
||||
return getCountry(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public Country getCountryV6(IPAddress ipAddress)
|
||||
{
|
||||
if (file == null)
|
||||
{
|
||||
throw new Exception("Database has been closed.");
|
||||
}
|
||||
if ((databaseType == DatabaseInfo.CITY_EDITION_REV1) |
|
||||
(databaseType == DatabaseInfo.CITY_EDITION_REV0))
|
||||
{
|
||||
var l = getLocation(ipAddress);
|
||||
if (l == null)
|
||||
return UNKNOWN_COUNTRY;
|
||||
else
|
||||
return new Country(l.countryCode, l.countryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
int ret = SeekCountryV6(ipAddress) - COUNTRY_BEGIN;
|
||||
if (ret == 0)
|
||||
return UNKNOWN_COUNTRY;
|
||||
else
|
||||
return new Country(countryCode[ret], countryName[ret]);
|
||||
}
|
||||
}
|
||||
|
||||
public Country getCountry(long ipAddress)
|
||||
{
|
||||
if (file == null)
|
||||
throw new Exception("Database has been closed.");
|
||||
if ((databaseType == DatabaseInfo.CITY_EDITION_REV1) |
|
||||
(databaseType == DatabaseInfo.CITY_EDITION_REV0))
|
||||
{
|
||||
var l = getLocation(ipAddress);
|
||||
if (l == null)
|
||||
return UNKNOWN_COUNTRY;
|
||||
else
|
||||
return new Country(l.countryCode, l.countryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var ret = SeekCountry(ipAddress) - COUNTRY_BEGIN;
|
||||
if (ret == 0)
|
||||
return UNKNOWN_COUNTRY;
|
||||
else
|
||||
return new Country(countryCode[ret], countryName[ret]);
|
||||
}
|
||||
}
|
||||
|
||||
public int getID(String ipAddress)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(ipAddress);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return 0;
|
||||
}
|
||||
return getID(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public int getID(IPAddress ipAddress)
|
||||
{
|
||||
|
||||
return getID(bytestoLong(ipAddress.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public int getID(long ipAddress)
|
||||
{
|
||||
if (file == null)
|
||||
throw new Exception("Database has been closed.");
|
||||
int ret = SeekCountry(ipAddress) - databaseSegments[0];
|
||||
return ret;
|
||||
}
|
||||
|
||||
public DatabaseInfo getDatabaseInfo()
|
||||
{
|
||||
if (databaseInfo != null)
|
||||
return databaseInfo;
|
||||
try
|
||||
{
|
||||
// Synchronize since we're accessing the database file.
|
||||
lock (ioLock)
|
||||
{
|
||||
bool hasStructureInfo = false;
|
||||
byte [] delim = new byte[3];
|
||||
// Advance to part of file where database info is stored.
|
||||
file.Seek(-3,SeekOrigin.End);
|
||||
for (int i=0; i<STRUCTURE_INFO_MAX_SIZE; i++)
|
||||
{
|
||||
file.Read(delim,0,3);
|
||||
if (delim[0] == 255 && delim[1] == 255 && delim[2] == 255)
|
||||
{
|
||||
hasStructureInfo = true;
|
||||
break;
|
||||
}
|
||||
file.Seek(-4,SeekOrigin.Current);
|
||||
}
|
||||
if (hasStructureInfo)
|
||||
file.Seek(-6,SeekOrigin.Current);
|
||||
else
|
||||
{
|
||||
// No structure info, must be pre Sep 2002 database, go back to end.
|
||||
file.Seek(-3,SeekOrigin.End);
|
||||
}
|
||||
// Find the database info string.
|
||||
for (int i=0; i<DATABASE_INFO_MAX_SIZE; i++)
|
||||
{
|
||||
file.Read(delim,0,3);
|
||||
if (delim[0]==0 && delim[1]==0 && delim[2]==0)
|
||||
{
|
||||
byte[] dbInfo = new byte[i];
|
||||
char[] dbInfo2 = new char[i];
|
||||
file.Read(dbInfo,0,i);
|
||||
for (int a0 = 0;a0 < i;a0++)
|
||||
dbInfo2[a0] = Convert.ToChar(dbInfo[a0]);
|
||||
// Create the database info object using the string.
|
||||
this.databaseInfo = new DatabaseInfo(new String(dbInfo2));
|
||||
return databaseInfo;
|
||||
}
|
||||
file.Seek(-4,SeekOrigin.Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
return new DatabaseInfo("");
|
||||
}
|
||||
|
||||
public Region getRegion(IPAddress ipAddress)
|
||||
{
|
||||
return getRegion(bytestoLong(ipAddress.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public Region getRegion(String str)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(str);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
return getRegion(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public Region getRegion(long ipnum)
|
||||
{
|
||||
Region record = new Region();
|
||||
int seek_region = 0;
|
||||
if (databaseType == DatabaseInfo.REGION_EDITION_REV0)
|
||||
{
|
||||
seek_region = SeekCountry(ipnum) - STATE_BEGIN_REV0;
|
||||
char [] ch = new char[2];
|
||||
if (seek_region >= 1000)
|
||||
{
|
||||
record.countryCode = "US";
|
||||
record.countryName = "United States";
|
||||
ch[0] = (char)(((seek_region - 1000)/26) + 65);
|
||||
ch[1] = (char)(((seek_region - 1000)%26) + 65);
|
||||
record.region = new String(ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
record.countryCode = countryCode[seek_region];
|
||||
record.countryName = countryName[seek_region];
|
||||
record.region = "";
|
||||
}
|
||||
}
|
||||
else if (databaseType == DatabaseInfo.REGION_EDITION_REV1)
|
||||
{
|
||||
seek_region = SeekCountry(ipnum) - STATE_BEGIN_REV1;
|
||||
char [] ch = new char[2];
|
||||
if (seek_region < US_OFFSET)
|
||||
{
|
||||
record.countryCode = "";
|
||||
record.countryName = "";
|
||||
record.region = "";
|
||||
} else if (seek_region < CANADA_OFFSET)
|
||||
{
|
||||
record.countryCode = "US";
|
||||
record.countryName = "United States";
|
||||
ch[0] = (char)(((seek_region - US_OFFSET)/26) + 65);
|
||||
ch[1] = (char)(((seek_region - US_OFFSET)%26) + 65);
|
||||
record.region = new String(ch);
|
||||
} else if (seek_region < WORLD_OFFSET)
|
||||
{
|
||||
record.countryCode = "CA";
|
||||
record.countryName = "Canada";
|
||||
ch[0] = (char)(((seek_region - CANADA_OFFSET)/26) + 65);
|
||||
ch[1] = (char)(((seek_region - CANADA_OFFSET)%26) + 65);
|
||||
record.region = new String(ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
record.countryCode = countryCode[(seek_region - WORLD_OFFSET) / FIPS_RANGE];
|
||||
record.countryName = countryName[(seek_region - WORLD_OFFSET) / FIPS_RANGE];
|
||||
record.region = "";
|
||||
}
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
public Location getLocation(IPAddress addr)
|
||||
{
|
||||
return getLocation(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public Location getLocationV6(String str)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(str);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
|
||||
return getLocationV6(addr);
|
||||
}
|
||||
|
||||
public Location getLocation(String str)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(str);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
|
||||
return getLocation(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public Location getLocationV6(IPAddress addr)
|
||||
{
|
||||
int record_pointer;
|
||||
byte[] record_buf = new byte[FULL_RECORD_LENGTH];
|
||||
char[] record_buf2 = new char[FULL_RECORD_LENGTH];
|
||||
int record_buf_offset = 0;
|
||||
Location record = new Location();
|
||||
int str_length = 0;
|
||||
int j, Seek_country;
|
||||
double latitude = 0, longitude = 0;
|
||||
|
||||
try
|
||||
{
|
||||
Seek_country = SeekCountryV6(addr);
|
||||
if (Seek_country == databaseSegments[0])
|
||||
return null;
|
||||
|
||||
record_pointer = Seek_country + ((2 * recordLength - 1) * databaseSegments[0]);
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
Array.Copy(dbbuffer, record_pointer, record_buf, 0, Math.Min(dbbuffer.Length - record_pointer, FULL_RECORD_LENGTH));
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(record_pointer,SeekOrigin.Begin);
|
||||
file.Read(record_buf,0,FULL_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
for (int a0 = 0;a0 < FULL_RECORD_LENGTH;a0++)
|
||||
record_buf2[a0] = Convert.ToChar(record_buf[a0]);
|
||||
|
||||
// get country
|
||||
record.countryCode = countryCode[unsignedByteToInt(record_buf[0])];
|
||||
record.countryName = countryName[unsignedByteToInt(record_buf[0])];
|
||||
record_buf_offset++;
|
||||
|
||||
// get region
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.region = new String(record_buf2, record_buf_offset, str_length);
|
||||
record_buf_offset += str_length + 1;
|
||||
str_length = 0;
|
||||
|
||||
// get region_name
|
||||
record.regionName = RegionName.getRegionName( record.countryCode, record.region );
|
||||
|
||||
// get city
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.city = new String(record_buf2, record_buf_offset, str_length);
|
||||
record_buf_offset += (str_length + 1);
|
||||
str_length = 0;
|
||||
|
||||
// get postal code
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.postalCode = new String(record_buf2, record_buf_offset, str_length);
|
||||
record_buf_offset += (str_length + 1);
|
||||
|
||||
// get latitude
|
||||
for (j = 0; j < 3; j++)
|
||||
latitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.latitude = (float)latitude/10000 - 180;
|
||||
record_buf_offset += 3;
|
||||
|
||||
// get longitude
|
||||
for (j = 0; j < 3; j++)
|
||||
longitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.longitude = (float)longitude/10000 - 180;
|
||||
|
||||
record.metro_code = record.dma_code = 0;
|
||||
record.area_code = 0;
|
||||
if (databaseType == DatabaseInfo.CITY_EDITION_REV1
|
||||
||databaseType == DatabaseInfo.CITY_EDITION_REV1_V6)
|
||||
{
|
||||
// get metro_code
|
||||
int metroarea_combo = 0;
|
||||
if (record.countryCode == "US")
|
||||
{
|
||||
record_buf_offset += 3;
|
||||
for (j = 0; j < 3; j++)
|
||||
metroarea_combo += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.metro_code = record.dma_code = metroarea_combo/1000;
|
||||
record.area_code = metroarea_combo % 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception while seting up segments");
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public Location getLocation(long ipnum)
|
||||
{
|
||||
int record_pointer;
|
||||
byte[] record_buf = new byte[FULL_RECORD_LENGTH];
|
||||
char[] record_buf2 = new char[FULL_RECORD_LENGTH];
|
||||
int record_buf_offset = 0;
|
||||
Location record = new Location();
|
||||
int str_length = 0;
|
||||
int j, Seek_country;
|
||||
double latitude = 0, longitude = 0;
|
||||
|
||||
try
|
||||
{
|
||||
Seek_country = SeekCountry(ipnum);
|
||||
if (Seek_country == databaseSegments[0])
|
||||
return null;
|
||||
|
||||
record_pointer = Seek_country + ((2 * recordLength - 1) * databaseSegments[0]);
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
Array.Copy(dbbuffer, record_pointer, record_buf, 0, Math.Min(dbbuffer.Length - record_pointer, FULL_RECORD_LENGTH));
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(record_pointer,SeekOrigin.Begin);
|
||||
file.Read(record_buf,0,FULL_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
for (int a0 = 0;a0 < FULL_RECORD_LENGTH;a0++)
|
||||
record_buf2[a0] = Convert.ToChar(record_buf[a0]);
|
||||
|
||||
// get country
|
||||
record.countryCode = countryCode[unsignedByteToInt(record_buf[0])];
|
||||
record.countryName = countryName[unsignedByteToInt(record_buf[0])];
|
||||
record_buf_offset++;
|
||||
|
||||
// get region
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.region = new String(record_buf2, record_buf_offset, str_length);
|
||||
record_buf_offset += str_length + 1;
|
||||
str_length = 0;
|
||||
|
||||
// get region_name
|
||||
record.regionName = RegionName.getRegionName(record.countryCode, record.region);
|
||||
|
||||
// get city
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.city = new String(record_buf2, record_buf_offset, str_length);
|
||||
|
||||
record_buf_offset += (str_length + 1);
|
||||
str_length = 0;
|
||||
|
||||
// get postal code
|
||||
while (record_buf[record_buf_offset + str_length] != '\0')
|
||||
str_length++;
|
||||
if (str_length > 0)
|
||||
record.postalCode = new String(record_buf2, record_buf_offset, str_length);
|
||||
record_buf_offset += (str_length + 1);
|
||||
|
||||
// get latitude
|
||||
for (j = 0; j < 3; j++)
|
||||
latitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.latitude = (float) latitude/10000 - 180;
|
||||
record_buf_offset += 3;
|
||||
|
||||
// get longitude
|
||||
for (j = 0; j < 3; j++)
|
||||
longitude += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.longitude = (float) longitude/10000 - 180;
|
||||
|
||||
record.metro_code = record.dma_code = 0;
|
||||
record.area_code = 0;
|
||||
if (databaseType == DatabaseInfo.CITY_EDITION_REV1)
|
||||
{
|
||||
// get metro_code
|
||||
int metroarea_combo = 0;
|
||||
if (record.countryCode == "US"){
|
||||
record_buf_offset += 3;
|
||||
for (j = 0; j < 3; j++)
|
||||
metroarea_combo += (unsignedByteToInt(record_buf[record_buf_offset + j]) << (j * 8));
|
||||
record.metro_code = record.dma_code = metroarea_combo/1000;
|
||||
record.area_code = metroarea_combo % 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception while seting up segments");
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
public String getOrg(IPAddress addr)
|
||||
{
|
||||
return getOrg(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
public String getOrgV6(String str)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(str);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
return getOrgV6(addr);
|
||||
}
|
||||
|
||||
public String getOrg(String str)
|
||||
{
|
||||
IPAddress addr;
|
||||
try
|
||||
{
|
||||
addr = IPAddress.Parse(str);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
return getOrg(bytestoLong(addr.GetAddressBytes()));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public String getOrgV6( IPAddress addr)
|
||||
{
|
||||
int Seek_org;
|
||||
int record_pointer;
|
||||
int str_length = 0;
|
||||
byte[] buf = new byte[MAX_ORG_RECORD_LENGTH];
|
||||
char[] buf2 = new char[MAX_ORG_RECORD_LENGTH];
|
||||
String org_buf;
|
||||
|
||||
try
|
||||
{
|
||||
Seek_org = SeekCountryV6(addr);
|
||||
if (Seek_org == databaseSegments[0])
|
||||
return null;
|
||||
|
||||
record_pointer = Seek_org + (2 * recordLength - 1) * databaseSegments[0];
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
Array.Copy(dbbuffer, record_pointer, buf, 0, Math.Min(dbbuffer.Length - record_pointer, MAX_ORG_RECORD_LENGTH));
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(record_pointer,SeekOrigin.Begin);
|
||||
file.Read(buf,0,MAX_ORG_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
while (buf[str_length] != 0)
|
||||
{
|
||||
buf2[str_length] = Convert.ToChar(buf[str_length]);
|
||||
str_length++;
|
||||
}
|
||||
buf2[str_length] = '\0';
|
||||
org_buf = new String(buf2,0,str_length);
|
||||
return org_buf;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public String getOrg(long ipnum)
|
||||
{
|
||||
int Seek_org;
|
||||
int record_pointer;
|
||||
int str_length = 0;
|
||||
byte [] buf = new byte[MAX_ORG_RECORD_LENGTH];
|
||||
char [] buf2 = new char[MAX_ORG_RECORD_LENGTH];
|
||||
String org_buf;
|
||||
|
||||
try
|
||||
{
|
||||
Seek_org = SeekCountry(ipnum);
|
||||
if (Seek_org == databaseSegments[0])
|
||||
return null;
|
||||
|
||||
record_pointer = Seek_org + (2 * recordLength - 1) * databaseSegments[0];
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
Array.Copy(dbbuffer, record_pointer, buf, 0, Math.Min(dbbuffer.Length - record_pointer, MAX_ORG_RECORD_LENGTH));
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(record_pointer,SeekOrigin.Begin);
|
||||
file.Read(buf,0,MAX_ORG_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
while (buf[str_length] != 0)
|
||||
{
|
||||
buf2[str_length] = Convert.ToChar(buf[str_length]);
|
||||
str_length++;
|
||||
}
|
||||
buf2[str_length] = '\0';
|
||||
org_buf = new String(buf2, 0, str_length);
|
||||
return org_buf;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
int SeekCountryV6(IPAddress ipAddress)
|
||||
{
|
||||
byte [] v6vec = ipAddress.GetAddressBytes();
|
||||
byte [] buf = new byte[2 * MAX_RECORD_LENGTH];
|
||||
int [] x = new int[2];
|
||||
int offset = 0;
|
||||
|
||||
for (int depth = 127; depth >= 0; depth--)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
{
|
||||
for (int i = 0;i < (2 * MAX_RECORD_LENGTH);i++)
|
||||
buf[i] = dbbuffer[i+(2 * recordLength * offset)];
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(2 * recordLength * offset,SeekOrigin.Begin);
|
||||
file.Read(buf,0,2 * MAX_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception");
|
||||
}
|
||||
for (int i = 0; i<2; i++)
|
||||
{
|
||||
x[i] = 0;
|
||||
for (int j = 0; j<recordLength; j++)
|
||||
{
|
||||
int y = buf[(i*recordLength)+j];
|
||||
if (y < 0)
|
||||
{
|
||||
y+= 256;
|
||||
}
|
||||
x[i] += (y << (j * 8));
|
||||
}
|
||||
}
|
||||
|
||||
int bnum = 127 - depth;
|
||||
int idx = bnum >> 3;
|
||||
int b_mask = 1 << ( bnum & 7 ^ 7 );
|
||||
if ((v6vec[idx] & b_mask) > 0)
|
||||
{
|
||||
if (x[1] >= databaseSegments[0])
|
||||
{
|
||||
return x[1];
|
||||
}
|
||||
offset = x[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x[0] >= databaseSegments[0])
|
||||
{
|
||||
return x[0];
|
||||
}
|
||||
offset = x[0];
|
||||
}
|
||||
}
|
||||
|
||||
// shouldn't reach here
|
||||
Console.WriteLine("Error Seeking country while Seeking " + ipAddress);
|
||||
return 0;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.Synchronized)]
|
||||
int SeekCountry(long ipAddress)
|
||||
{
|
||||
byte [] buf = new byte[2 * MAX_RECORD_LENGTH];
|
||||
int [] x = new int[2];
|
||||
int offset = 0;
|
||||
for (int depth = 31; depth >= 0; depth--)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((dboptions & GEOIP_MEMORY_CACHE) == 1)
|
||||
{
|
||||
for (int i = 0;i < (2 * MAX_RECORD_LENGTH);i++)
|
||||
{
|
||||
buf[i] = dbbuffer[i+(2 * recordLength * offset)];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (ioLock)
|
||||
{
|
||||
file.Seek(2 * recordLength * offset,SeekOrigin.Begin);
|
||||
file.Read(buf, 0, 2 * MAX_RECORD_LENGTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
Console.WriteLine("IO Exception");
|
||||
}
|
||||
for (int i = 0; i<2; i++)
|
||||
{
|
||||
x[i] = 0;
|
||||
for (int j = 0; j<recordLength; j++)
|
||||
{
|
||||
int y = buf[(i*recordLength)+j];
|
||||
if (y < 0)
|
||||
y+= 256;
|
||||
x[i] += (y << (j * 8));
|
||||
}
|
||||
}
|
||||
|
||||
if ((ipAddress & (1 << depth)) > 0)
|
||||
{
|
||||
if (x[1] >= databaseSegments[0])
|
||||
return x[1];
|
||||
offset = x[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x[0] >= databaseSegments[0])
|
||||
return x[0];
|
||||
offset = x[0];
|
||||
}
|
||||
}
|
||||
|
||||
// shouldn't reach here
|
||||
Console.WriteLine("Error Seeking country while Seeking " + ipAddress);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long swapbytes(long ipAddress)
|
||||
{
|
||||
return (((ipAddress>>0) & 255) << 24) | (((ipAddress>>8) & 255) << 16)
|
||||
| (((ipAddress>>16) & 255) << 8) | (((ipAddress>>24) & 255) << 0);
|
||||
}
|
||||
|
||||
static long bytestoLong(byte [] address)
|
||||
{
|
||||
long ipnum = 0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
long y = address[i];
|
||||
if (y < 0)
|
||||
y += 256;
|
||||
ipnum += y << ((3-i)*8);
|
||||
}
|
||||
return ipnum;
|
||||
}
|
||||
|
||||
static int unsignedByteToInt(byte b)
|
||||
{
|
||||
return (int) b & 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
53
GeoIP/Region.cs
Normal file
53
GeoIP/Region.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright (C) 2008 MaxMind Inc. All Rights Reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public class Region
|
||||
{
|
||||
public String countryCode;
|
||||
public String countryName;
|
||||
public String region;
|
||||
|
||||
public Region() { }
|
||||
|
||||
public Region(String countryCode,String countryName,String region)
|
||||
{
|
||||
this.countryCode = countryCode;
|
||||
this.countryName = countryName;
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getcountryCode()
|
||||
{
|
||||
return countryCode;
|
||||
}
|
||||
|
||||
public String getcountryName()
|
||||
{
|
||||
return countryName;
|
||||
}
|
||||
|
||||
public String getregion()
|
||||
{
|
||||
return region;
|
||||
}
|
||||
}
|
||||
4489
GeoIP/RegionName.cs
Normal file
4489
GeoIP/RegionName.cs
Normal file
File diff suppressed because it is too large
Load Diff
323
Makefile
323
Makefile
@@ -1,22 +1,69 @@
|
||||
############################# INSTRUCTIONS #############################
|
||||
#
|
||||
# to compile, run:
|
||||
# make
|
||||
#
|
||||
# to compile with development tools, run:
|
||||
# make all
|
||||
#
|
||||
# to install, run:
|
||||
# make [prefix=/foo] [bindir=/bar/bin] install
|
||||
#
|
||||
# to install with development tools, run:
|
||||
# make [prefix=/foo] [bindir=/bar/bin] install-all
|
||||
#
|
||||
# to uninstall, run:
|
||||
# make uninstall
|
||||
#
|
||||
# for help, run:
|
||||
# make help
|
||||
#
|
||||
# to start the game, run:
|
||||
# openra
|
||||
|
||||
|
||||
|
||||
############################## TOOLCHAIN ###############################
|
||||
#
|
||||
CSC = gmcs
|
||||
CSFLAGS = -nologo -warn:4 -debug:+ -debug:full -optimize- -codepage:utf8 -unsafe
|
||||
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
|
||||
DEFINE = DEBUG;TRACE
|
||||
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll
|
||||
PHONY = core tools package all mods clean distclean
|
||||
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll
|
||||
|
||||
.SUFFIXES:
|
||||
core: game renderers mods utility tsbuild
|
||||
tools: editor ralint tsbuild
|
||||
package: core editor
|
||||
mods: mod_ra mod_cnc mod_d2k
|
||||
all: core tools
|
||||
clean:
|
||||
@-rm -f *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
|
||||
distclean: clean
|
||||
|
||||
|
||||
######################### UTILITIES/SETTINGS ###########################
|
||||
#
|
||||
# install locations
|
||||
prefix ?= /usr/local
|
||||
datarootdir ?= $(prefix)/share
|
||||
datadir ?= $(datarootdir)
|
||||
bindir ?= $(prefix)/bin
|
||||
BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
|
||||
DATA_INSTALL_DIR = $(DESTDIR)$(datadir)/openra
|
||||
|
||||
# install tools
|
||||
RM = rm
|
||||
RM_R = $(RM) -r
|
||||
RM_F = $(RM) -f
|
||||
CP = cp
|
||||
CP_R = $(CP) -r
|
||||
INSTALL = install
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_PROGRAM = $(INSTALL) -m755
|
||||
INSTALL_DATA = $(INSTALL) -m644
|
||||
|
||||
# program targets
|
||||
CORE = fileformats rcg rgl rsdl rnull game utility
|
||||
TOOLS = editor tsbuild ralint
|
||||
|
||||
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
|
||||
|
||||
|
||||
|
||||
######################## PROGRAM TARGET RULES ##########################
|
||||
#
|
||||
# Core binaries
|
||||
#
|
||||
fileformats_SRCS := $(shell find OpenRA.FileFormats/ -iname '*.cs')
|
||||
fileformats_TARGET = OpenRA.FileFormats.dll
|
||||
fileformats_KIND = library
|
||||
@@ -24,19 +71,24 @@ fileformats_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Sdl.dll System.Windows.Form
|
||||
PROGRAMS = fileformats
|
||||
fileformats: $(fileformats_TARGET)
|
||||
|
||||
geoip_SRCS := $(shell find GeoIP/ -iname '*.cs')
|
||||
geoip_TARGET = GeoIP.dll
|
||||
geoip_KIND = library
|
||||
geoip_LIBS = $(COMMON_LIBS)
|
||||
PROGRAMS += geoip
|
||||
geoip: $(geoip_TARGET)
|
||||
|
||||
game_SRCS := $(shell find OpenRA.Game/ -iname '*.cs')
|
||||
game_TARGET = OpenRA.Game.exe
|
||||
game_KIND = winexe
|
||||
game_DEPS = $(fileformats_TARGET)
|
||||
game_DEPS = $(fileformats_TARGET)
|
||||
game_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll $(game_DEPS) \
|
||||
thirdparty/Tao/Tao.OpenAl.dll thirdparty/Tao/Tao.FreeType.dll
|
||||
thirdparty/Tao/Tao.OpenAl.dll thirdparty/SharpFont.dll
|
||||
game_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico
|
||||
PROGRAMS += game
|
||||
game: $(game_TARGET)
|
||||
|
||||
#
|
||||
# Renderer dlls
|
||||
#
|
||||
rsdl_SRCS := $(shell find OpenRA.Renderer.SdlCommon/ -iname '*.cs')
|
||||
rsdl_TARGET = OpenRA.Renderer.SdlCommon.dll
|
||||
rsdl_KIND = library
|
||||
@@ -70,19 +122,18 @@ rnull_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll \
|
||||
PROGRAMS += rcg rgl rnull rsdl
|
||||
renderers: $(rcg_TARGET) $(rgl_TARGET) $(rnull_TARGET) $(rsdl_TARGET)
|
||||
|
||||
#
|
||||
# Official Mods
|
||||
#
|
||||
# Red Alert
|
||||
|
||||
##### Official Mods #####
|
||||
|
||||
STD_MOD_LIBS = $(fileformats_TARGET) $(game_TARGET)
|
||||
STD_MOD_DEPS = $(STD_MOD_LIBS) $(ralint_TARGET)
|
||||
|
||||
# Red Alert
|
||||
mod_ra_SRCS := $(shell find OpenRA.Mods.RA/ -iname '*.cs')
|
||||
mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll
|
||||
mod_ra_KIND = library
|
||||
mod_ra_DEPS = $(STD_MOD_DEPS)
|
||||
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS)
|
||||
mod_ra_DEPS = $(STD_MOD_DEPS) $(utility_TARGET) $(geoip_TARGET)
|
||||
mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(utility_TARGET) $(geoip_TARGET)
|
||||
mod_ra_EXTRA_CMDS = mono --debug RALint.exe ra
|
||||
PROGRAMS += mod_ra
|
||||
mod_ra: $(mod_ra_TARGET)
|
||||
@@ -101,15 +152,24 @@ mod_cnc: $(mod_cnc_TARGET)
|
||||
mod_d2k_SRCS := $(shell find OpenRA.Mods.D2k/ -iname '*.cs')
|
||||
mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll
|
||||
mod_d2k_KIND = library
|
||||
mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(mod_cnc_TARGET) $(utility_TARGET)
|
||||
mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) $(utility_TARGET)
|
||||
mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(mod_cnc_TARGET)
|
||||
mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
|
||||
mod_d2k_EXTRA_CMDS = mono --debug RALint.exe d2k
|
||||
PROGRAMS += mod_d2k
|
||||
mod_d2k: $(mod_d2k_TARGET)
|
||||
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
# Tiberian Sun
|
||||
mod_ts_SRCS := $(shell find OpenRA.Mods.TS/ -iname '*.cs')
|
||||
mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll
|
||||
mod_ts_KIND = library
|
||||
mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET)
|
||||
mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET)
|
||||
mod_ts_EXTRA_CMDS = mono --debug RALint.exe ts
|
||||
PROGRAMS += mod_ts
|
||||
mod_ts: $(mod_ts_TARGET)
|
||||
|
||||
##### Tools #####
|
||||
|
||||
# Map Editor
|
||||
editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs')
|
||||
editor_TARGET = OpenRA.Editor.exe
|
||||
@@ -141,23 +201,18 @@ tsbuild_TARGET = OpenRA.TilesetBuilder.exe
|
||||
tsbuild_KIND = winexe
|
||||
tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET)
|
||||
tsbuild_LIBS = $(COMMON_LIBS) $(tsbuild_DEPS) System.Windows.Forms.dll
|
||||
tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.frmBuilder.resources -resource:OpenRA.TilesetBuilder.frmNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources
|
||||
tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.FormBuilder.resources -resource:OpenRA.TilesetBuilder.FormNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources
|
||||
PROGRAMS += tsbuild
|
||||
OpenRA.TilesetBuilder.frmBuilder.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/frmBuilder.resx OpenRA.TilesetBuilder.frmBuilder.resources 1> /dev/null
|
||||
OpenRA.TilesetBuilder.frmNew.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.frmNew.resources 1> /dev/null
|
||||
OpenRA.TilesetBuilder.FormBuilder.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/FormBuilder.resx OpenRA.TilesetBuilder.FormBuilder.resources 1> /dev/null
|
||||
OpenRA.TilesetBuilder.FormNew.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.FormNew.resources 1> /dev/null
|
||||
OpenRA.TilesetBuilder.Surface.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/Surface.resx OpenRA.TilesetBuilder.Surface.resources 1> /dev/null
|
||||
tsbuild: OpenRA.TilesetBuilder.frmBuilder.resources OpenRA.TilesetBuilder.frmNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET)
|
||||
tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET)
|
||||
|
||||
#
|
||||
# Launchers / Utilities
|
||||
#
|
||||
# Patches binary headers to work around a mono bug
|
||||
fixheader.exe: packaging/fixheader.cs
|
||||
@echo CSC fixheader.exe
|
||||
@$(CSC) packaging/fixheader.cs $(CSFLAGS) -out:fixheader.exe -t:exe $(COMMON_LIBS:%=-r:%)
|
||||
|
||||
##### Launchers / Utilities #####
|
||||
|
||||
# Backend for the launcher apps - queries game/mod info and applies actions to an install
|
||||
utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs')
|
||||
@@ -168,11 +223,13 @@ utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.Shar
|
||||
PROGRAMS += utility
|
||||
utility: $(utility_TARGET)
|
||||
|
||||
.PHONY: $(PHONY) $(PROGRAMS)
|
||||
|
||||
#
|
||||
# Patches binary headers to work around a mono bug
|
||||
fixheader.exe: packaging/fixheader.cs
|
||||
@echo CSC fixheader.exe
|
||||
@$(CSC) packaging/fixheader.cs $(CSFLAGS) -out:fixheader.exe -t:exe $(COMMON_LIBS:%=-r:%)
|
||||
|
||||
# Generate build rules for each target defined above in PROGRAMS
|
||||
#
|
||||
define BUILD_ASSEMBLY
|
||||
|
||||
$$($(1)_TARGET): $$($(1)_SRCS) Makefile $$($(1)_DEPS) fixheader.exe
|
||||
@@ -191,74 +248,130 @@ endef
|
||||
$(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
|
||||
|
||||
|
||||
|
||||
########################## MAKE/INSTALL RULES ##########################
|
||||
#
|
||||
# Install / Uninstall for *nix
|
||||
#
|
||||
prefix ?= /usr/local
|
||||
datarootdir ?= $(prefix)/share
|
||||
datadir ?= $(datarootdir)
|
||||
bindir ?= $(prefix)/bin
|
||||
BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
|
||||
INSTALL_DIR = $(DESTDIR)$(datadir)/openra
|
||||
INSTALL = install
|
||||
INSTALL_PROGRAM = $(INSTALL)
|
||||
CORE = fileformats rcg rgl rsdl rnull game editor utility tsbuild
|
||||
default: dependencies core
|
||||
|
||||
install: all
|
||||
@-echo "Installing OpenRA to $(INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)
|
||||
@$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) $(INSTALL_DIR)
|
||||
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/cnc
|
||||
@$(INSTALL_PROGRAM) $(mod_cnc_TARGET) $(INSTALL_DIR)/mods/cnc
|
||||
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/ra
|
||||
@$(INSTALL_PROGRAM) $(mod_ra_TARGET) $(INSTALL_DIR)/mods/ra
|
||||
@$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/d2k
|
||||
@$(INSTALL_PROGRAM) $(mod_d2k_TARGET) $(INSTALL_DIR)/mods/d2k
|
||||
core: game renderers mods utility tsbuild
|
||||
|
||||
@-cp $(foreach f,$(shell ls mods/cnc --hide=*.dll),mods/cnc/$(f)) $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/maps $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/chrome $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/bits $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/rules $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/sequences $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/tilesets $(INSTALL_DIR)/mods/cnc
|
||||
@cp -r mods/cnc/uibits $(INSTALL_DIR)/mods/cnc
|
||||
tools: editor tsbuild ralint
|
||||
|
||||
@-cp $(foreach f,$(shell ls mods/ra --hide=*.dll),mods/ra/$(f)) $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/maps $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/bits $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/chrome $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/rules $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/tilesets $(INSTALL_DIR)/mods/ra
|
||||
@cp -r mods/ra/uibits $(INSTALL_DIR)/mods/ra
|
||||
|
||||
@-cp $(foreach f,$(shell ls mods/d2k --hide=*.dll),mods/d2k/$(f)) $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/maps $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/bits $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/chrome $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/rules $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/tilesets $(INSTALL_DIR)/mods/d2k
|
||||
@cp -r mods/d2k/uibits $(INSTALL_DIR)/mods/d2k
|
||||
package: dependencies core editor docs version
|
||||
|
||||
@cp -r glsl $(INSTALL_DIR)
|
||||
@cp -r cg $(INSTALL_DIR)
|
||||
@cp *.ttf $(INSTALL_DIR)
|
||||
@cp thirdparty/Tao/* $(INSTALL_DIR)
|
||||
@$(INSTALL_PROGRAM) thirdparty/ICSharpCode.SharpZipLib.dll $(INSTALL_DIR)
|
||||
mods: mod_ra mod_cnc mod_d2k mod_ts
|
||||
|
||||
@echo "#!/bin/sh" > openra
|
||||
@echo "cd "$(datadir)"/openra" >> openra
|
||||
@echo "exec mono "$(datadir)"/openra/OpenRA.Game.exe \"$$""@\"" >> openra
|
||||
all: dependencies core tools
|
||||
|
||||
@echo "#!/bin/sh" > openra-editor
|
||||
@echo "cd "$(datadir)"/openra" >> openra-editor
|
||||
@echo "exec mono "$(datadir)"/openra/OpenRA.Editor.exe \"$$""@\"" >> openra-editor
|
||||
clean:
|
||||
@-$(RM_F) *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources
|
||||
|
||||
@$(INSTALL_PROGRAM) -d $(BIN_INSTALL_DIR)
|
||||
@$(INSTALL_PROGRAM) -m +rx openra $(BIN_INSTALL_DIR)
|
||||
@$(INSTALL_PROGRAM) -m +rx openra-editor $(BIN_INSTALL_DIR)
|
||||
distclean: clean
|
||||
|
||||
dependencies:
|
||||
@ $(CP_R) thirdparty/*.dl* .
|
||||
@ $(CP_R) thirdparty/Tao/* .
|
||||
|
||||
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml
|
||||
@for i in $? ; do \
|
||||
awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $${i} > $${i}.tmp && \
|
||||
mv -f $${i}.tmp $${i} ; \
|
||||
done
|
||||
|
||||
# Documentation (d2k depends on all mod libraries)
|
||||
docs: utility
|
||||
@mono --debug OpenRA.Utility.exe --docs d2k > DOCUMENTATION.md
|
||||
|
||||
install: install-core
|
||||
|
||||
install-all: install-core install-tools
|
||||
|
||||
install-core: default
|
||||
@-echo "Installing OpenRA to $(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)/mods"
|
||||
@$(CP_R) mods/cnc "$(DATA_INSTALL_DIR)/mods/"
|
||||
@$(INSTALL_PROGRAM) $(mod_cnc_TARGET) "$(DATA_INSTALL_DIR)/mods/cnc"
|
||||
@$(CP_R) mods/ra "$(DATA_INSTALL_DIR)/mods/"
|
||||
@$(INSTALL_PROGRAM) $(mod_ra_TARGET) "$(DATA_INSTALL_DIR)/mods/ra"
|
||||
@$(CP_R) mods/d2k "$(DATA_INSTALL_DIR)/mods/"
|
||||
@$(INSTALL_PROGRAM) $(mod_d2k_TARGET) "$(DATA_INSTALL_DIR)/mods/d2k"
|
||||
|
||||
@$(INSTALL_DATA) "global mix database.dat" "$(DATA_INSTALL_DIR)/global mix database.dat"
|
||||
@$(INSTALL_DATA) "GeoIP.dat" "$(DATA_INSTALL_DIR)/GeoIP.dat"
|
||||
@$(INSTALL_DATA) AUTHORS "$(DATA_INSTALL_DIR)/AUTHORS"
|
||||
|
||||
@$(CP_R) glsl "$(DATA_INSTALL_DIR)"
|
||||
@$(CP_R) cg "$(DATA_INSTALL_DIR)"
|
||||
@$(CP) *.ttf "$(DATA_INSTALL_DIR)"
|
||||
@$(CP) thirdparty/Tao/* "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) thirdparty/ICSharpCode.SharpZipLib.dll "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) thirdparty/FuzzyLogicLibrary.dll "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) thirdparty/SharpFont.dll "$(DATA_INSTALL_DIR)"
|
||||
@$(CP) thirdparty/SharpFont.dll.config "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) thirdparty/Mono.Nat.dll "$(DATA_INSTALL_DIR)"
|
||||
|
||||
@echo "#!/bin/sh" > openra
|
||||
@echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra
|
||||
@echo 'ROOTDIR="$${BINDIR%'"$(bindir)"'}"' >> openra
|
||||
@echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra
|
||||
@echo 'cd "$${DATADIR}/openra"' >> openra
|
||||
@echo 'exec mono OpenRA.Game.exe "$$@"' >> openra
|
||||
|
||||
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)"
|
||||
|
||||
@-$(RM) openra
|
||||
|
||||
install-tools: tools
|
||||
@-echo "Installing OpenRA tools to $(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_DIR) "$(DATA_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) $(foreach prog,$(TOOLS),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)"
|
||||
|
||||
@echo "#!/bin/sh" > openra-editor
|
||||
@echo 'BINDIR=$$(dirname $$(readlink -f $$0))' >> openra-editor
|
||||
@echo 'ROOTDIR="$${BINDIR%'"$(bindir)"'}"' >> openra-editor
|
||||
@echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra-editor
|
||||
@echo 'cd "$${DATADIR}/openra"' >> openra-editor
|
||||
@echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor
|
||||
|
||||
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)"
|
||||
|
||||
@-$(RM) openra-editor
|
||||
|
||||
uninstall:
|
||||
@-rm -r $(INSTALL_DIR)
|
||||
@-rm $(DESTDIR)$(bindir)/openra
|
||||
@-rm $(DESTDIR)$(bindir)/openra-editor
|
||||
@-$(RM_R) "$(DATA_INSTALL_DIR)"
|
||||
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra"
|
||||
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra-editor"
|
||||
|
||||
help:
|
||||
@echo to compile, run:
|
||||
@echo \ \ make
|
||||
@echo
|
||||
@echo to compile with development tools, run:
|
||||
@echo \ \ make all
|
||||
@echo
|
||||
@echo to install, run:
|
||||
@echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install
|
||||
@echo
|
||||
@echo to install with development tools, run:
|
||||
@echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install-all
|
||||
@echo
|
||||
@echo to uninstall, run:
|
||||
@echo \ \ make uninstall
|
||||
@echo
|
||||
@echo to start the game, run:
|
||||
@echo \ \ openra
|
||||
|
||||
|
||||
|
||||
|
||||
########################### MAKEFILE SETTINGS ##########################
|
||||
#
|
||||
.DEFAULT_GOAL := default
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
.PHONY: core tools package all mods clean distclean dependencies version $(PROGRAMS)
|
||||
|
||||
2
OpenRA.Editor/ActorPropertiesDialog.Designer.cs
generated
2
OpenRA.Editor/ActorPropertiesDialog.Designer.cs
generated
@@ -14,9 +14,7 @@
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
var r = new TextBox();
|
||||
r.Text = FieldSaver.FormatValue(getter(), t);
|
||||
r.LostFocus += (e,_) => setter(FieldLoader.GetValue("<editor internals>", t, r.Text));
|
||||
r.LostFocus += (e, _) => setter(FieldLoader.GetValue("<editor internals>", t, r.Text));
|
||||
r.Enabled = false;
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace OpenRA.Editor
|
||||
{
|
||||
class ActorTool : ITool
|
||||
{
|
||||
ActorTemplate Actor;
|
||||
public ActorTool(ActorTemplate actor) { this.Actor = actor; }
|
||||
ActorTemplate actorTemplate;
|
||||
public ActorTool(ActorTemplate actor) { this.actorTemplate = actor; }
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
surface.DrawActor(g, surface.GetBrushLocation(), Actor,
|
||||
surface.DrawActor(g, surface.GetBrushLocation(), actorTemplate,
|
||||
surface.GetPaletteForPlayer(surface.NewActorOwner));
|
||||
}
|
||||
|
||||
@@ -33,17 +33,17 @@ namespace OpenRA.Editor
|
||||
|
||||
var owner = surface.NewActorOwner;
|
||||
var id = NextActorName(surface);
|
||||
surface.Map.Actors.Value[id] = new ActorReference(Actor.Info.Name.ToLowerInvariant())
|
||||
surface.Map.Actors.Value[id] = new ActorReference(actorTemplate.Info.Name.ToLowerInvariant())
|
||||
{
|
||||
new LocationInit( surface.GetBrushLocation() ),
|
||||
new OwnerInit( owner)
|
||||
new LocationInit(surface.GetBrushLocation()),
|
||||
new OwnerInit(owner)
|
||||
};
|
||||
}
|
||||
|
||||
string NextActorName(Surface surface)
|
||||
{
|
||||
var id = 0;
|
||||
for (; ; )
|
||||
for (;;)
|
||||
{
|
||||
var possible = "Actor{0}".F(id++);
|
||||
if (!surface.Map.Actors.Value.ContainsKey(possible)) return possible;
|
||||
|
||||
@@ -19,15 +19,15 @@ namespace OpenRA.Editor
|
||||
{
|
||||
class BrushTool : ITool
|
||||
{
|
||||
BrushTemplate Brush;
|
||||
BrushTemplate brushTemplate;
|
||||
|
||||
public BrushTool(BrushTemplate brush) { this.Brush = brush; }
|
||||
public BrushTool(BrushTemplate brush) { this.brushTemplate = brush; }
|
||||
|
||||
public void Apply(Surface surface)
|
||||
{
|
||||
// change the bits in the map
|
||||
var template = surface.TileSet.Templates[Brush.N];
|
||||
var tile = template.Data;
|
||||
var template = surface.TileSet.Templates[brushTemplate.N];
|
||||
var tile = surface.TileSetRenderer.Data(brushTemplate.N);
|
||||
var pos = surface.GetBrushLocation();
|
||||
|
||||
if (surface.GetModifiers() == Keys.Shift)
|
||||
@@ -42,11 +42,11 @@ namespace OpenRA.Editor
|
||||
if (surface.Map.IsInMap(new CVec(u, v) + pos))
|
||||
{
|
||||
var z = u + v * template.Size.X;
|
||||
if (tile.TileBitmapBytes[z] != null)
|
||||
if (tile[z] != null)
|
||||
surface.Map.MapTiles.Value[u + pos.X, v + pos.Y] =
|
||||
new TileReference<ushort, byte>
|
||||
{
|
||||
type = Brush.N,
|
||||
type = brushTemplate.N,
|
||||
index = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4) * 4) : (byte)z,
|
||||
};
|
||||
|
||||
@@ -62,11 +62,11 @@ namespace OpenRA.Editor
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
g.DrawImage(Brush.Bitmap,
|
||||
surface.TileSet.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
|
||||
surface.TileSet.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
|
||||
Brush.Bitmap.Width * surface.Zoom,
|
||||
Brush.Bitmap.Height * surface.Zoom);
|
||||
g.DrawImage(brushTemplate.Bitmap,
|
||||
surface.TileSetRenderer.TileSize.Width * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
|
||||
surface.TileSetRenderer.TileSize.Height * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
|
||||
brushTemplate.Bitmap.Width * surface.Zoom,
|
||||
brushTemplate.Bitmap.Height * surface.Zoom);
|
||||
}
|
||||
|
||||
void FloodFillWithBrush(Surface s, CPos pos)
|
||||
@@ -96,7 +96,7 @@ namespace OpenRA.Editor
|
||||
|
||||
for (var x = a.X; x <= b.X; x++)
|
||||
{
|
||||
s.Map.MapTiles.Value[x, p.Y] = new TileReference<ushort, byte> { type = Brush.N, index = (byte)0 };
|
||||
s.Map.MapTiles.Value[x, p.Y] = new TileReference<ushort, byte> { type = brushTemplate.N, index = (byte)0 };
|
||||
if (s.Map.MapTiles.Value[x, p.Y - 1].Equals(replace))
|
||||
maybeEnqueue(x, p.Y - 1);
|
||||
if (s.Map.MapTiles.Value[x, p.Y + 1].Equals(replace))
|
||||
@@ -104,14 +104,14 @@ namespace OpenRA.Editor
|
||||
}
|
||||
}
|
||||
|
||||
/* todo: optimize */
|
||||
/* TODO: optimize */
|
||||
foreach (var ch in s.Chunks.Values) ch.Dispose();
|
||||
s.Chunks.Clear();
|
||||
}
|
||||
|
||||
CPos FindEdge(Surface s, CPos p, CVec d, TileReference<ushort, byte> replace)
|
||||
{
|
||||
for (; ; )
|
||||
for (;;)
|
||||
{
|
||||
var q = p + d;
|
||||
if (!s.Map.IsInMap(q)) return p;
|
||||
|
||||
2
OpenRA.Editor/ErrorListDialog.Designer.cs
generated
2
OpenRA.Editor/ErrorListDialog.Designer.cs
generated
@@ -24,9 +24,7 @@ namespace OpenRA.Editor
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
public partial class ErrorListDialog : Form
|
||||
{
|
||||
public ErrorListDialog( IEnumerable<string> errors )
|
||||
public ErrorListDialog(IEnumerable<string> errors)
|
||||
{
|
||||
InitializeComponent();
|
||||
foreach (var e in errors)
|
||||
|
||||
765
OpenRA.Editor/Form1.Designer.cs
generated
765
OpenRA.Editor/Form1.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -42,14 +42,17 @@ namespace OpenRA.Editor
|
||||
tilePalette.ResumeLayout();
|
||||
actorPalette.ResumeLayout();
|
||||
resourcePalette.ResumeLayout();
|
||||
surface1.Bind(null, null, null);
|
||||
pmMiniMap.Image = null;
|
||||
surface1.Bind(null, null, null, null, null);
|
||||
miniMapBox.Image = null;
|
||||
currentMod = toolStripComboBox1.SelectedItem as string;
|
||||
|
||||
Text = "OpenRA Editor (mod:{0})".F(currentMod);
|
||||
Game.modData = new ModData(currentMod);
|
||||
FileSystem.LoadFromManifest(Game.modData.Manifest);
|
||||
Rules.LoadRules(Game.modData.Manifest, new Map());
|
||||
|
||||
var mod = Game.modData.Manifest.Mods[0];
|
||||
Text = "{0} Mod Version: {1} - OpenRA Editor".F(Mod.AllMods[mod].Title, Mod.AllMods[mod].Version);
|
||||
|
||||
loadedMapName = null;
|
||||
};
|
||||
|
||||
@@ -66,12 +69,13 @@ namespace OpenRA.Editor
|
||||
void OnMapChanged()
|
||||
{
|
||||
MakeDirty();
|
||||
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
|
||||
miniMapBox.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
|
||||
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
|
||||
}
|
||||
|
||||
void ActorDoubleClicked(KeyValuePair<string,ActorReference> kv)
|
||||
void ActorDoubleClicked(KeyValuePair<string, ActorReference> kv)
|
||||
{
|
||||
using( var apd = new ActorPropertiesDialog() )
|
||||
using (var apd = new ActorPropertiesDialog())
|
||||
{
|
||||
var name = kv.Key;
|
||||
apd.AddRow("(Name)", apd.MakeEditorControl(typeof(string), () => name, v => name = (string)v));
|
||||
@@ -80,11 +84,11 @@ namespace OpenRA.Editor
|
||||
var objSaved = kv.Value.Save();
|
||||
|
||||
// TODO: make this work properly
|
||||
foreach( var init in Rules.Info[kv.Value.Type].GetInitKeys() )
|
||||
foreach (var init in Rules.Info[kv.Value.Type].GetInitKeys())
|
||||
apd.AddRow(init.First,
|
||||
apd.MakeEditorControl(init.Second,
|
||||
() => objSaved.NodesDict.ContainsKey( init.First ) ? objSaved.NodesDict[init.First].Value : null,
|
||||
_ => {}));
|
||||
() => objSaved.NodesDict.ContainsKey(init.First) ? objSaved.NodesDict[init.First].Value : null,
|
||||
_ => { }));
|
||||
|
||||
apd.ShowDialog();
|
||||
|
||||
@@ -97,6 +101,7 @@ namespace OpenRA.Editor
|
||||
string loadedMapName;
|
||||
string currentMod = "ra";
|
||||
TileSet tileset;
|
||||
TileSetRenderer tilesetRenderer;
|
||||
bool dirty = false;
|
||||
|
||||
void LoadMap(string mapname)
|
||||
@@ -117,6 +122,9 @@ namespace OpenRA.Editor
|
||||
|
||||
PrepareMapResources(Game.modData.Manifest, map);
|
||||
|
||||
// Calculate total net worth of resources in cash
|
||||
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
|
||||
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
@@ -137,16 +145,22 @@ namespace OpenRA.Editor
|
||||
{
|
||||
Rules.LoadRules(manifest, map);
|
||||
tileset = Rules.TileSets[map.Tileset];
|
||||
tileset.LoadTiles();
|
||||
int[] ShadowIndex = { 3, 4 };
|
||||
var palette = new Palette(FileSystem.Open(tileset.Palette), ShadowIndex);
|
||||
tilesetRenderer = new TileSetRenderer(tileset, new Size(manifest.TileSize, manifest.TileSize));
|
||||
var shadowIndex = new int[] { 3, 4 };
|
||||
var palette = new Palette(FileSystem.Open(tileset.Palette), shadowIndex);
|
||||
|
||||
// required for desert terrain in RA
|
||||
var playerPalette = tileset.PlayerPalette ?? tileset.Palette;
|
||||
var shadowedPalette = new Palette(FileSystem.Open(playerPalette), shadowIndex);
|
||||
|
||||
surface1.Bind(map, tileset, tilesetRenderer, palette, shadowedPalette);
|
||||
|
||||
surface1.Bind(map, tileset, palette);
|
||||
// construct the palette of tiles
|
||||
var palettes = new[] { tilePalette, actorPalette, resourcePalette };
|
||||
foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); }
|
||||
|
||||
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category))
|
||||
var templateOrder = tileset.EditorTemplateOrder ?? new string[] { };
|
||||
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category).OrderBy(t => templateOrder.ToList().IndexOf(t.Key)))
|
||||
{
|
||||
var category = tc.Key ?? "(Uncategorized)";
|
||||
var categoryHeader = new Label
|
||||
@@ -159,19 +173,20 @@ namespace OpenRA.Editor
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
Width = tilePalette.ClientSize.Width,
|
||||
};
|
||||
|
||||
// hook this manually, anchoring inside FlowLayoutPanel is flaky.
|
||||
tilePalette.Resize += (_,e) => categoryHeader.Width = tilePalette.ClientSize.Width;
|
||||
tilePalette.Resize += (_, e) => categoryHeader.Width = tilePalette.ClientSize.Width;
|
||||
|
||||
if (tilePalette.Controls.Count > 0)
|
||||
tilePalette.SetFlowBreak(
|
||||
tilePalette.Controls[tilePalette.Controls.Count - 1], true);
|
||||
tilePalette.Controls.Add(categoryHeader);
|
||||
|
||||
foreach( var t in tc )
|
||||
foreach (var t in tc)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bitmap = tileset.RenderTemplate((ushort)t.Key, palette);
|
||||
var bitmap = tilesetRenderer.RenderTemplate((ushort)t.Key, palette);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = bitmap,
|
||||
@@ -185,12 +200,7 @@ namespace OpenRA.Editor
|
||||
|
||||
var template = t.Value;
|
||||
tilePalette.Controls.Add(ibox);
|
||||
tt.SetToolTip(ibox,
|
||||
"{1}:{0} ({2}x{3})".F(
|
||||
template.Image,
|
||||
template.Id,
|
||||
template.Size.X,
|
||||
template.Size.Y));
|
||||
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Image, template.Id, template.Size.X, template.Size.Y));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
@@ -211,7 +221,14 @@ namespace OpenRA.Editor
|
||||
if (etf != null && etf.RequireTilesets != null
|
||||
&& !etf.RequireTilesets.Contains(tileset.Id)) continue;
|
||||
|
||||
var template = RenderUtils.RenderActor(info, tileset, palette);
|
||||
var templatePalette = shadowedPalette;
|
||||
var rsi = info.Traits.GetOrDefault<RenderSimpleInfo>();
|
||||
|
||||
// exception for desert buildings
|
||||
if (rsi != null && rsi.Palette != null && rsi.Palette.Contains("terrain"))
|
||||
templatePalette = palette;
|
||||
|
||||
var template = RenderUtils.RenderActor(info, tileset, templatePalette);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = template.Bitmap,
|
||||
@@ -225,9 +242,7 @@ namespace OpenRA.Editor
|
||||
|
||||
actorPalette.Controls.Add(ibox);
|
||||
|
||||
tt.SetToolTip(ibox,
|
||||
"{0}".F(
|
||||
info.Name));
|
||||
tt.SetToolTip(ibox, "{0}".F(info.Name));
|
||||
|
||||
actorTemplates.Add(template);
|
||||
}
|
||||
@@ -242,7 +257,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
try
|
||||
{
|
||||
var template = RenderUtils.RenderResourceType(a, tileset.Extensions, palette);
|
||||
var template = RenderUtils.RenderResourceType(a, tileset.Extensions, shadowedPalette);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = template.Bitmap,
|
||||
@@ -252,16 +267,11 @@ namespace OpenRA.Editor
|
||||
BorderStyle = BorderStyle.FixedSingle
|
||||
};
|
||||
|
||||
|
||||
|
||||
ibox.Click += (_, e) => surface1.SetTool(new ResourceTool(template));
|
||||
|
||||
resourcePalette.Controls.Add(ibox);
|
||||
|
||||
tt.SetToolTip(ibox,
|
||||
"{0}:{1}cr".F(
|
||||
template.Info.Name,
|
||||
template.Info.ValuePerUnit));
|
||||
tt.SetToolTip(ibox, "{0}:{1}cr".F(template.Info.Name, template.Info.ValuePerUnit));
|
||||
|
||||
resourceTemplates.Add(template);
|
||||
}
|
||||
@@ -276,13 +286,16 @@ namespace OpenRA.Editor
|
||||
p.ResumeLayout();
|
||||
}
|
||||
|
||||
pmMiniMap.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
|
||||
miniMapBox.Image = Minimap.AddStaticResources(surface1.Map, Minimap.TerrainBitmap(surface1.Map, true));
|
||||
|
||||
propertiesToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemProperties.Enabled = true;
|
||||
resizeToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemResize.Enabled = true;
|
||||
saveToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemSave.Enabled = true;
|
||||
saveAsToolStripMenuItem.Enabled = true;
|
||||
mnuMinimapToPNG.Enabled = true; // todo: what is this VB naming bullshit doing here?
|
||||
miniMapToPng.Enabled = true;
|
||||
|
||||
PopulateActorOwnerChooser();
|
||||
}
|
||||
@@ -299,25 +312,25 @@ namespace OpenRA.Editor
|
||||
{
|
||||
using (var rd = new ResizeDialog())
|
||||
{
|
||||
rd.width.Value = surface1.Map.MapSize.X;
|
||||
rd.height.Value = surface1.Map.MapSize.Y;
|
||||
rd.cordonLeft.Value = surface1.Map.Bounds.Left;
|
||||
rd.cordonTop.Value = surface1.Map.Bounds.Top;
|
||||
rd.cordonRight.Value = surface1.Map.Bounds.Right;
|
||||
rd.cordonBottom.Value = surface1.Map.Bounds.Bottom;
|
||||
rd.MapWidth.Value = surface1.Map.MapSize.X;
|
||||
rd.MapHeight.Value = surface1.Map.MapSize.Y;
|
||||
rd.CordonLeft.Value = surface1.Map.Bounds.Left;
|
||||
rd.CordonTop.Value = surface1.Map.Bounds.Top;
|
||||
rd.CordonRight.Value = surface1.Map.Bounds.Right;
|
||||
rd.CordonBottom.Value = surface1.Map.Bounds.Bottom;
|
||||
|
||||
if (DialogResult.OK != rd.ShowDialog())
|
||||
return;
|
||||
|
||||
surface1.Map.ResizeCordon((int)rd.cordonLeft.Value,
|
||||
(int)rd.cordonTop.Value,
|
||||
(int)rd.cordonRight.Value,
|
||||
(int)rd.cordonBottom.Value);
|
||||
surface1.Map.ResizeCordon((int)rd.CordonLeft.Value,
|
||||
(int)rd.CordonTop.Value,
|
||||
(int)rd.CordonRight.Value,
|
||||
(int)rd.CordonBottom.Value);
|
||||
|
||||
if ((int)rd.width.Value != surface1.Map.MapSize.X || (int)rd.height.Value != surface1.Map.MapSize.Y)
|
||||
if ((int)rd.MapWidth.Value != surface1.Map.MapSize.X || (int)rd.MapHeight.Value != surface1.Map.MapSize.Y)
|
||||
{
|
||||
surface1.Map.Resize((int)rd.width.Value, (int)rd.height.Value);
|
||||
surface1.Bind(surface1.Map, surface1.TileSet, surface1.Palette); // rebind it to invalidate all caches
|
||||
surface1.Map.Resize((int)rd.MapWidth.Value, (int)rd.MapHeight.Value);
|
||||
surface1.Bind(surface1.Map, surface1.TileSet, surface1.TileSetRenderer, surface1.Palette, surface1.PlayerPalette); // rebind it to invalidate all caches
|
||||
}
|
||||
|
||||
surface1.Invalidate();
|
||||
@@ -333,25 +346,24 @@ namespace OpenRA.Editor
|
||||
surface1.Map.Save(loadedMapName);
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SaveAsClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var nms = new MapSelect(currentMod))
|
||||
{
|
||||
nms.txtNew.ReadOnly = false;
|
||||
nms.btnOk.Text = "Save";
|
||||
nms.txtNew.Text = "unnamed";
|
||||
nms.txtPathOut.ReadOnly = false;
|
||||
nms.NewText.ReadOnly = false;
|
||||
nms.ButtonOkay.Text = "Save";
|
||||
nms.NewText.Text = "unnamed";
|
||||
nms.PathOutText.ReadOnly = false;
|
||||
|
||||
if (DialogResult.OK == nms.ShowDialog())
|
||||
{
|
||||
if (nms.txtNew.Text == "")
|
||||
nms.txtNew.Text = "unnamed";
|
||||
if (nms.NewText.Text == "")
|
||||
nms.NewText.Text = "unnamed";
|
||||
|
||||
// TODO: Allow the user to choose map format (directory vs oramap)
|
||||
loadedMapName = Path.Combine(nms.MapFolderPath, nms.txtNew.Text + ".oramap");
|
||||
loadedMapName = Path.Combine(nms.MapFolderPath, nms.NewText.Text + ".oramap");
|
||||
SaveClicked(sender, e);
|
||||
}
|
||||
}
|
||||
@@ -361,12 +373,12 @@ namespace OpenRA.Editor
|
||||
{
|
||||
using (var nms = new MapSelect(currentMod))
|
||||
{
|
||||
nms.txtNew.ReadOnly = true;
|
||||
nms.txtPathOut.ReadOnly = true;
|
||||
nms.btnOk.Text = "Open";
|
||||
nms.NewText.ReadOnly = true;
|
||||
nms.PathOutText.ReadOnly = true;
|
||||
nms.ButtonOkay.Text = "Open";
|
||||
|
||||
if (DialogResult.OK == nms.ShowDialog())
|
||||
LoadMap(nms.txtNew.Tag as string);
|
||||
LoadMap(nms.NewText.Tag as string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,18 +386,19 @@ namespace OpenRA.Editor
|
||||
{
|
||||
using (var nmd = new NewMapDialog())
|
||||
{
|
||||
nmd.theater.Items.Clear();
|
||||
nmd.theater.Items.AddRange(Rules.TileSets.Select(a => a.Value.Id).ToArray());
|
||||
nmd.theater.SelectedIndex = 0;
|
||||
nmd.TheaterBox.Items.Clear();
|
||||
nmd.TheaterBox.Items.AddRange(Rules.TileSets.Select(a => a.Value.Id).ToArray());
|
||||
nmd.TheaterBox.SelectedIndex = 0;
|
||||
|
||||
if (DialogResult.OK == nmd.ShowDialog())
|
||||
{
|
||||
var map = Map.FromTileset(nmd.theater.SelectedItem as string);
|
||||
var map = Map.FromTileset(nmd.TheaterBox.SelectedItem as string);
|
||||
|
||||
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
|
||||
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
|
||||
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
|
||||
map.Resize((int)nmd.MapWidth.Value, (int)nmd.MapHeight.Value);
|
||||
map.ResizeCordon((int)nmd.CordonLeft.Value, (int)nmd.CordonTop.Value,
|
||||
(int)nmd.CordonRight.Value, (int)nmd.CordonBottom.Value);
|
||||
|
||||
map.Players.Clear();
|
||||
map.MakeDefaultPlayers();
|
||||
|
||||
NewMap(map);
|
||||
@@ -397,20 +410,20 @@ namespace OpenRA.Editor
|
||||
{
|
||||
using (var pd = new PropertiesDialog())
|
||||
{
|
||||
pd.title.Text = surface1.Map.Title;
|
||||
pd.desc.Text = surface1.Map.Description;
|
||||
pd.author.Text = surface1.Map.Author;
|
||||
pd.selectable.Checked = surface1.Map.Selectable;
|
||||
pd.useAsShellmap.Checked = surface1.Map.UseAsShellmap;
|
||||
pd.TitleBox.Text = surface1.Map.Title;
|
||||
pd.DescBox.Text = surface1.Map.Description;
|
||||
pd.AuthorBox.Text = surface1.Map.Author;
|
||||
pd.SelectableCheckBox.Checked = surface1.Map.Selectable;
|
||||
pd.ShellmapCheckBox.Checked = surface1.Map.UseAsShellmap;
|
||||
|
||||
if (DialogResult.OK != pd.ShowDialog())
|
||||
return;
|
||||
|
||||
surface1.Map.Title = pd.title.Text;
|
||||
surface1.Map.Description = pd.desc.Text;
|
||||
surface1.Map.Author = pd.author.Text;
|
||||
surface1.Map.Selectable = pd.selectable.Checked;
|
||||
surface1.Map.UseAsShellmap = pd.useAsShellmap.Checked;
|
||||
surface1.Map.Title = pd.TitleBox.Text;
|
||||
surface1.Map.Description = pd.DescBox.Text;
|
||||
surface1.Map.Author = pd.AuthorBox.Text;
|
||||
surface1.Map.Selectable = pd.SelectableCheckBox.Checked;
|
||||
surface1.Map.UseAsShellmap = pd.ShellmapCheckBox.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,26 +481,31 @@ namespace OpenRA.Editor
|
||||
|
||||
void ExportMinimap(object sender, EventArgs e)
|
||||
{
|
||||
using( var sfd = new SaveFileDialog() {
|
||||
using (var sfd = new SaveFileDialog()
|
||||
{
|
||||
InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps"),
|
||||
DefaultExt = "*.png",
|
||||
Filter = "PNG Image (*.png)|*.png",
|
||||
Title = "Export Minimap to PNG",
|
||||
FileName = Path.ChangeExtension(loadedMapName, ".png"),
|
||||
RestoreDirectory = true } )
|
||||
if (DialogResult.OK == sfd.ShowDialog())
|
||||
pmMiniMap.Image.Save(sfd.FileName);
|
||||
RestoreDirectory = true
|
||||
})
|
||||
|
||||
if (DialogResult.OK == sfd.ShowDialog())
|
||||
miniMapBox.Image.Save(sfd.FileName);
|
||||
}
|
||||
|
||||
void ShowActorNamesClicked(object sender, EventArgs e)
|
||||
{
|
||||
showActorNamesToolStripMenuItem.Checked ^= true;
|
||||
toolStripMenuItemShowActorNames.Checked ^= true;
|
||||
surface1.ShowActorNames = showActorNamesToolStripMenuItem.Checked;
|
||||
}
|
||||
|
||||
void ShowGridClicked(object sender, EventArgs e)
|
||||
{
|
||||
showGridToolStripMenuItem.Checked ^= true;
|
||||
toolStripMenuItemShowGrid.Checked ^= true;
|
||||
surface1.ShowGrid = showGridToolStripMenuItem.Checked;
|
||||
surface1.Chunks.Clear();
|
||||
}
|
||||
@@ -502,8 +520,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
var tr = surface1.Map.MapTiles.Value[i, j];
|
||||
if (tr.type == 0xff || tr.type == 0xffff || tr.type == 1 || tr.type == 2)
|
||||
tr.index = (byte)r.Next(0,
|
||||
Rules.TileSets[surface1.Map.Tileset].Templates[tr.type].Data.TileBitmapBytes.Count);
|
||||
tr.index = (byte)r.Next(0, surface1.TileSetRenderer.Data(tr.type).Count);
|
||||
|
||||
surface1.Map.MapTiles.Value[i, j] = tr;
|
||||
}
|
||||
@@ -515,6 +532,7 @@ namespace OpenRA.Editor
|
||||
void SetupDefaultPlayers(object sender, EventArgs e)
|
||||
{
|
||||
dirty = true;
|
||||
surface1.Map.Players.Clear();
|
||||
surface1.Map.MakeDefaultPlayers();
|
||||
|
||||
surface1.Chunks.Clear();
|
||||
@@ -534,11 +552,11 @@ namespace OpenRA.Editor
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
var color = player.ColorRamp.GetColor(0);
|
||||
using( var brush = new SolidBrush(color) )
|
||||
e.Graphics.FillRectangle( brush, e.Bounds.Left + 2, e.Bounds.Top + 2, e.Bounds.Height + 6, e.Bounds.Height - 4 );
|
||||
using( var foreBrush = new SolidBrush(e.ForeColor) )
|
||||
e.Graphics.DrawString( player.Name, e.Font, foreBrush, e.Bounds.Left + e.Bounds.Height + 12, e.Bounds.Top );
|
||||
var color = player.Color.RGB;
|
||||
using (var brush = new SolidBrush(color))
|
||||
e.Graphics.FillRectangle(brush, e.Bounds.Left + 2, e.Bounds.Top + 2, e.Bounds.Height + 6, e.Bounds.Height - 4);
|
||||
using (var foreBrush = new SolidBrush(e.ForeColor))
|
||||
e.Graphics.DrawString(player.Name, e.Font, foreBrush, e.Bounds.Left + e.Bounds.Height + 12, e.Bounds.Top);
|
||||
}
|
||||
|
||||
void OnSelectedPlayerChanged(object sender, EventArgs e)
|
||||
@@ -547,9 +565,192 @@ namespace OpenRA.Editor
|
||||
surface1.NewActorOwner = player.Name;
|
||||
}
|
||||
|
||||
private void copySelectionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
void CopySelectionToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
surface1.CopySelection();
|
||||
}
|
||||
|
||||
void OpenRAWebsiteToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.open-ra.org");
|
||||
}
|
||||
|
||||
void OpenRAResourcesToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://content.open-ra.org");
|
||||
}
|
||||
|
||||
void WikiDocumentationToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/wiki");
|
||||
}
|
||||
|
||||
void DiscussionForumsToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.sleipnirstuff.com/forum/viewforum.php?f=80");
|
||||
}
|
||||
|
||||
void IssueTrackerToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/issues");
|
||||
}
|
||||
|
||||
void DeveloperBountiesToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://www.bountysource.com/#repos/OpenRA/OpenRA");
|
||||
}
|
||||
|
||||
void SourceCodeToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA");
|
||||
}
|
||||
|
||||
void AboutToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("OpenRA and OpenRA Editor are Free/Libre Open Source Software released under the GNU General Public License version 3. See AUTHORS and COPYING for details.",
|
||||
"About",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Asterisk);
|
||||
}
|
||||
|
||||
void HelpToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA/wiki/Mapping");
|
||||
}
|
||||
|
||||
void ToolStripMenuItemNewClick(object sender, EventArgs e)
|
||||
{
|
||||
NewClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemOpenClick(object sender, EventArgs e)
|
||||
{
|
||||
OpenClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemPropertiesClick(object sender, EventArgs e)
|
||||
{
|
||||
PropertiesClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemResizeClick(object sender, EventArgs e)
|
||||
{
|
||||
ResizeClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemShowActorNamesClick(object sender, EventArgs e)
|
||||
{
|
||||
ShowActorNamesClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemFixOpenAreasClick(object sender, EventArgs e)
|
||||
{
|
||||
FixOpenAreas(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemSetupDefaultPlayersClick(object sender, EventArgs e)
|
||||
{
|
||||
SetupDefaultPlayers(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemCopySelectionClick(object sender, EventArgs e)
|
||||
{
|
||||
CopySelectionToolStripMenuItemClick(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemShowGridClick(object sender, EventArgs e)
|
||||
{
|
||||
ShowGridClicked(sender, e);
|
||||
}
|
||||
|
||||
public int CalculateTotalResource()
|
||||
{
|
||||
int totalResource = 0;
|
||||
for (int i = 0; i < surface1.Map.MapSize.X; i++)
|
||||
for (int j = 0; j < surface1.Map.MapSize.Y; j++)
|
||||
{
|
||||
if (surface1.Map.MapResources.Value[i, j].type != 0)
|
||||
totalResource += GetResourceValue(i, j);
|
||||
}
|
||||
|
||||
return totalResource;
|
||||
}
|
||||
|
||||
int GetAdjecentCellsWith(int resourceType, int x, int y)
|
||||
{
|
||||
int sum = 0;
|
||||
for (var u = -1; u < 2; u++)
|
||||
for (var v = -1; v < 2; v++)
|
||||
{
|
||||
if (!surface1.Map.IsInMap(new CPos(x + u, y + v)))
|
||||
continue;
|
||||
if (surface1.Map.MapResources.Value[x + u, y + v].type == resourceType)
|
||||
++sum;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
int GetResourceValue(int x, int y)
|
||||
{
|
||||
int imageLength = 0;
|
||||
int type = surface1.Map.MapResources.Value[x, y].type;
|
||||
var template = surface1.ResourceTemplates.Where(a => a.Value.Info.ResourceType == type).FirstOrDefault().Value;
|
||||
if (type == 1)
|
||||
imageLength = 12;
|
||||
else if (type == 2)
|
||||
imageLength = 3;
|
||||
int density = (GetAdjecentCellsWith(type, x, y) * imageLength - 1) / 9;
|
||||
int value = template.Info.ValuePerUnit;
|
||||
return density * value;
|
||||
}
|
||||
|
||||
void ZoomInToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
if (surface1.Map == null) return;
|
||||
|
||||
surface1.Zoom /= .75f;
|
||||
|
||||
surface1.Invalidate();
|
||||
}
|
||||
|
||||
void ZoomOutToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
if (surface1.Map == null) return;
|
||||
|
||||
surface1.Zoom *= .75f;
|
||||
|
||||
surface1.Invalidate();
|
||||
}
|
||||
|
||||
void PanToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
panToolStripButton.Checked ^= true;
|
||||
surface1.IsPanning = panToolStripButton.Checked;
|
||||
}
|
||||
|
||||
void ShowRulerToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
showRulerToolStripMenuItem.Checked ^= true;
|
||||
showRulerToolStripItem.Checked ^= true;
|
||||
surface1.ShowRuler = showRulerToolStripMenuItem.Checked;
|
||||
surface1.Chunks.Clear();
|
||||
}
|
||||
|
||||
void ShowRulerToolStripItemClick(object sender, System.EventArgs e)
|
||||
{
|
||||
ShowRulerToolStripMenuItemClick(sender, e);
|
||||
}
|
||||
|
||||
void EraserToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
eraserToolStripButton.Checked ^= true;
|
||||
surface1.IsErasing = eraserToolStripButton.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@@ -120,90 +120,292 @@
|
||||
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>429, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="toolStripMenuItemNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHPSURBVDhPpZFNTxNRFIb7W1y4NZpI4k/QrRs3rjSu/QMk
|
||||
NjHGYCFgYYIWsaJidAKoUWqEgFiwGjE2ERREKEOZZtpa23H6OWX6OHN7CQaxNfFNTm5Oct7nnvten6fN
|
||||
6AV+rPixM/2sTRzGNgKYGz0kF/2IgXayNIXNF8fADJB8fcY9e0lMHqGw3v1vAO9mLAXqMSx9zD2jot/6
|
||||
cg3l3qSogbvPWViMHwxcVQ+hzZ6maEzgUKCcfSZ6faqDXV0PP6Xj1PmDIWIDMwjVWQHxNhF94ba0Q8/Q
|
||||
OC8XlgRk/v0+iLU1SCJyFCfdSerNWdcYFBnUjLC0Q9fgQ2HeLWltSotdbP5C6gr6zAkSKzcoa32k435p
|
||||
B6fR4NbYPENq9E/A7+odfiwte3K9VGp1cmaZ8VerHD957u+AwE1V2vZUtXfIWxW2Mz9Rp5dbA64OPJC2
|
||||
puz6DmaxRuq7xddkjtHIx9aAy30j0up+huNglWoYuSLftvPE19LcefK2NeBS97AwO06DUsUmky+RSBX4
|
||||
tJ4ltqQTejTXGtDZFXJDa1CpNkPTDJPPG1neLevMfNBQ7k+3B3iheWl7gXlvDrtrh9Q5lNEpgiOR9k/w
|
||||
BtqVHP9f+Xy/AI/l932QyhfPAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACeUlE
|
||||
QVQ4T6WSWUiUURiG/4suurJIjUIwskQsEAMjqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
|
||||
sEIoFInQcqHE1CwoKsXUUMnt6XfEye0munjgnO+c9+HjO0cA/osNi2tJLdA6SXN13MwoI12lJ06uiV8+
|
||||
W3d5IwIjVXiGKvwX11djSs2TRFlUito7ILIAoVab7SvCWhqrZYq1omXC4gpPe4Ur8AjNMQjo69IwPVZj
|
||||
4PeojtlhNfoyBXXalKSNBJ5hSjxCcnELzkeoKVcyNVq5Kjz/rZDZnggqSzOoKEpDXZBEcU4id+Sx5Mui
|
||||
RcdfmVClyWLqh8YYXhDD9MVCT/CGrBPcK5Hx62uxMdxUm2XgiT6Tep2MhxVp6NXJ6IqllKlucTc3niJl
|
||||
LKqsGINMqChOY+JTnqHtwRYJdZVK5gelMJSymo9ibSAOeiPhXTid1T5cD3IvF9SqZMb7M+CznEdVCtqe
|
||||
ypcurWz9bQC0ezHX6sr0M0c+lNtx5cKJcVGwXyjJlfDzvZSh1gTqdHIWBiTQHbIU7AwSg+eYa3Nnuvk4
|
||||
E41HGak9gDTUmvPOZjmGGRQqExjpiuG+NouOl2InvRGi4BJ0+LPw6gwzL04x2XSM0ToHvlfZ0p66FT9X
|
||||
KxxsTGwMAlVmLN3NiTzQZkJ/IrwR233tzUyLG5PPHRmrP8Sw3o4vmr30yE2RBO/Bfp9Fg/EV8tKjqSnL
|
||||
oOdxGO3ZgpE2+SaaZZtpSNpCdbw56mgLbt/YhZ/L7oVD9pYuRkF2ShTZksukxwQSd813cbJc9HHm7MnD
|
||||
OB2x46CdNbZWFljuNGP7NhN2mJqIuRX/YOXm30H4A70P0TsBWkcYAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACPklE
|
||||
QVQ4T6WS70uTURTH9y/03jdBL3prU2O4FqvBU66hLB2GFtKvJ9Isfy3TJEXLVHT5A7QVLp20Wk3CiUb+
|
||||
AH8gJmIsJSs1l7TEoabYRDD4ds99dI9Le1MHzvPi3OfzufeeexQA/iv5p7MjAEp32xpaXat45lhGc5Mf
|
||||
j6zzqKv9BkuVF/dLZ1BU+Bn5eR+Qkz2OG9c9DN0SENjbA9TWbFDxr7G+sQl9Yi/OJL7iyUISuF6ucEF5
|
||||
2Q8q7hkE+5fXcdT4GkqlCFOCk8qSwPF0iQuKCr9TcVdsw198K4gwuJF3axanjS20JAlsjQtccNM8TcWQ
|
||||
2Am/n/LjoOBCZsYk4mJttCwJGup9XJB+bZyKwfgTHvL4EKZ1QBRHYTBY6RdJUFM9xwXi5VEq8tgL7hn5
|
||||
in3RTUg+24+YmDr6TRJUlM+iuwvsKYGUC29hOjfIu00NozvTsWlnCe5DvOkNBMEiC0qKp9DuBpsBoMX+
|
||||
i737T5TeW+RNpYbRndNSPUH4VFwbdLoyWXA7fxLO58AT2yYbnAD0SRkhaTxvRtLVAgmOZfBJJ7TaYllg
|
||||
zplgMFD9IMB3JkjBliLUAsY+LWBiZhFi9l0c17dyWH3MDo2mQBbQWFofInhsEhB8JbcSH71L8M6vIuuO
|
||||
BZFaO4ObEXnkMdTRubIgLfUdu/cahw/onNh/SMCL9gG4u4bQ3TeCweExnDCYoNQ0IorB4aoGqFSZIYL4
|
||||
SxcH+HjShNGQ0DvTU1G3qWF0Z9qVkuDDUemy4N8Tit/kKu4LI/ykxwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemProperties.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAAB/klE
|
||||
QVQ4T6WQ30tTUQDHz39QD0UQRlAPIkgPxh6yhCRCykGBL0WZjOytLKdl7KGHJmFYtAjH7uUWy3XvMswf
|
||||
d3Ou8MdWils1ggZCRQ43lbbAwYpB4vbtnDMzrrsMw4cvB87h8/l+OQTAlqJ7ydL/7MEhGvQ9vQdZ6oLT
|
||||
boVouwV7t4XFIvkFKMGB0nB23rqeX187kPl0CR/VJi5hsBh9VBo2nzuqgdPh0/gxeRhJXwWs8g3cDDSC
|
||||
uH0fwKKMvIMyNI6/8DVTPT/bzh7RwAtqOWZdZWjpacZlbwOIMvIe+XweqdSCBo5HLLhqMnK4tfE4YmoV
|
||||
QsIeeLp240rDXpzpPIXmfiOI7AlzAYMXo3c4PO4fpOdJzAVNXMImHyzfierK7TBU7ELlvh0Pj7XXwOSu
|
||||
B+kdnsFqLo9kMo7O6xeQSMSQpZ8RDr3hktm+A6gz7IfgGoThxEX6UvgrKjAbb9eCOIemObAx6ZUcpqeC
|
||||
MJ+vRWQug0B0WSNgoZJt5MnA22L4dw6LmRV8/p6l8E8Oq6FUkYCFSC8CHJKUUThcPg7bJA/uCyq6HcPr
|
||||
kSeW9AXC84l/zXQ2a/7CmwuzWbNCYdGb0Bc4lLHCAtkPR6+Pw7bHdIGoXWB7GdMX2OXXtHkVS6w5WWie
|
||||
XGtms0VvnMN33d/0BT2uV/xhsykSbLz4v4D8ATko6xzt+1ySAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemResize.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAH3SURBVDhPrZJfSFNxFMf3rBk+iIH2oOCTIAlZSGCQPqgIqQ/5tHQpPiikBpIpCnuxYkWCokQg
|
||||
qDcoNYZETZAhbII0dh92DdPNvJuj4f7epWa2vOvrzg/u8uqQkA4cztPn8/uee4/mv5RxgQfN2Xkbm9zc
|
||||
EpujUyY2+w0TbJ5ZBL/9sAyCx2cWMcqZYHj5Dv3PJsF/FjE8aUZrH4eWXg7Njzjoeqb+ShU4/iee7MO4
|
||||
jIB0gPsDI9B2PIYkScmORCK4Vt2iTkUvH4djhzI2fbsJeBC88EUl8Hg8aoESW1bg3zKiP2JY2/qO27pe
|
||||
VGu7k3A4HIbL5TqdYIybZ/DPXzLCuwcQt/exIkZR0dAF3rHKYhMcDAbhcDjUAoKfvzJC2ovhayL2+tYO
|
||||
hM0o+PUIbta349adDgYGAgH4/X7Y7fbTCfQvOHTqx9DY9QS19/oSL3eirK4NlwrKMD1nZqDX62UpLBaL
|
||||
WqAfeo3VjW9oevAUn/gV1Nx9iGW7wCQEp2cXsSmKIhOkTNBjMLI9lV1DoVAysvG9GWlZheCmPyIzrzy1
|
||||
gI6EvrIiIQHt7fP54Ha78WbWhAvZV5CRW5paQBd2/Fed7Mz8CmTkXMfFyzdSC+g86WU6EqfTCUEQYLPZ
|
||||
YLVaGXCyr1bq1AK6bbL+SxeXa1FS1awWnK80miNVQhp+0k4xYAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemShowActorNames.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAGOSURBVDhPY/j//z9FGKsgKRirIAiHFm92CyjctB+bHDLGKgjCGa37/gcWbvzftvBaCDZ5GMYq
|
||||
6Je/XtQ3d81/35x1/23j5r7FpgaGsQq6Zaya7Zi8fLZFzML/xgH9QNznj00dCGMVdExa9sUqdqGoWdi0
|
||||
00b+ff8N/LpvYFMHwhgCrmlLE+1iF54AsU3DZ7mZhE79r+fT+U/Pp8MFXS0IYwg4Ji68ahk1WwvGNw6d
|
||||
/ApowH9dz9ZdyOpgGIXjEDdX2Sp61n/DgP4Let7tVw38+67q+fV+0fFs/a9knfNX0SpLBVk9CKNwbGNm
|
||||
bwT6e5+6fZGJik2ulaZThZWmW6OWpmvDfxWbApAhG5HVgzCcYRczg9s4ZNoXTecKUWQFIKzuWDEFaPt/
|
||||
BYsMjCgFExbh06SMgiZt13St+eoQUvoSWYGyXUmEvFnSf2WgC1RsC/4rWqR/UDBL44bJgwl9v25RoGYt
|
||||
JatMLXmTBHgAgrCSTYGoLFBMUjtQS1zTV0tSJ0hL1jgB1QBKMFZB4vF/BgBJP5kepjxMJgAAAABJRU5E
|
||||
rkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemShowGrid.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAFYSURBVDhPY6AqyJt9/z+UyZA1/TacHd93Cc4OaTwJZ2MAZAPSJt+Es2M6z8PZAbVHMQ0AaQTh
|
||||
7Bn3/mcAbU6fcuN/ysSr/xOBNsd2nfsf0Xr6P8hmkGafyoP/PUr3/ncp3I5pUNZUhLNBmqFMhpDm43C2
|
||||
R+luTI0wALIZykRxdmDtETjbpXAnpgEgZ2cgORukOaId5OzjQGcfBjvbDeTsgu3/7XK3/rfJ3PjfMm0d
|
||||
pkEozgZqhjJRnA3SDGViAlCAQZnA0D4MZzshOdsifS2mAfE9VyDOBoc2wtkgm0F+dsje+t86c9N/89R1
|
||||
/02TVv03jF/x3yB6KaZByKEN8jOUieJskGYoExMEITkbObSRA0wvBpvNcGfvBycSkJ8doKFtDtRskrQa
|
||||
7Gy96GX/daIW/9eKWAjGUO0IgBLa2QhnG8Uvh7OxaoQBZGdbpCJCG9nZeA0gHTAwAACOffGU2o3WzAAA
|
||||
AABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="zoomIntoolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIiSURBVDhPpY/ta5JRGIct+hP61Oe+RR+KWBBB4cAg02ea
|
||||
ewmKIEzWinIu2yDqUamslrS114qZ01m0Wol7oWXlxFVrmq5yzUk5lmyG6Zz6qKiLXz5qH3KjUbvgPodz
|
||||
c37XOTeDhiTNG6a/+NhDI7Y77boB69X23mnxpc65843aVxqDi5u79DeGLU5Zm8Yw8fTZWNJk+wyTy4tO
|
||||
oxXnmvTgC8lg+Snl4cLV5VSdvLapSW1499Ji/xmgEphPpOCNJuAIUDC65iBTD4JVUZ9mCWo3FyJ/YrI6
|
||||
1PcMwzHfj0VQ6QwiqQyybUyF4jDPRNBjm0f1ZTV2888o8okiWjXGyaFRJwLxFGLpJVCZpZzAE0rA4l3E
|
||||
Q2cQF7Qj2MkTh/OJImrlHRj1+OCNJHPB4tKP+6G4b8cegYQ+L0d2s/trz4v3sH+nMLWQgCecF73+FkX/
|
||||
ZBBdVh8krYMoYdc48okiSJVO29Dcl3w+E4VlNpataE5gdIegs/mh7PuEyrpb4B0VUflEESLy9kaeUBFp
|
||||
fGRB74cgnnxcwIPs3Oq3flw3unFM3g1mhQT6FuHKI9AcPHGFxTkijx+Xd+Gi1px9dQJ1bQM4JG3BXsFp
|
||||
NMsIhN3KVSTVym0Nqsd3meXSsRK2OFZaVY/Kmhuz+w/skzJ3bMWbji2rS1ZgHb1wyjh8oozz35Ica5KQ
|
||||
JGM9vf+W9Ku246yo9N9/QUMQxC6C4IxzuWxeobUWGIxfeWNbk9TvsLwAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="zoomOutToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIpSURBVDhPpY/da5JhGMYt+hM66riz6KCIBREUDgwyfedy
|
||||
H0ERhMlaUc5lG0S9KpXVkrb2WTFzOotWK3EftKycuGpN07Vcc1KOJZthfsyvV9TF1et4OxBHo/aD+3m4
|
||||
H+7reu6LlYckLZtmv/q5w6P2ex36Qdv1jr5ZyZWuhYtNujdao5u/MvQ3RqwuebvWOPn8xXjabP8Cs9uH
|
||||
LpMNF5oNKBeRoYozqqPMaDHVp29sadYYP7y2On4FkxQWqQx8cQrOYBIm9wLkmiFwKhuyHGHdVkZSiNnm
|
||||
1DwwjiT8P5eQzOYQy+QQTGUxE07BMhdDr30RNVc12Ft+TslICmnTmqaHx1y0KINEdhnJ3DIiVA7eMAWr
|
||||
bwmPXSFc0o1it0ASZSSF1Ck6Meb1wxdLg26LyjARgPKhA/uE0nxfjPx2z7feVx/h+JHETISCN5rGFJ3/
|
||||
7fc4BqZD6Lb5IW0bQgm31slICiHVel1jS3/65Vwc1vkEXXGY6dVNnjD09gBU/Z9RVX8HguPiJCMpREze
|
||||
3SwQKWNNT6zo+xTCs6kIHtG5Ne8DuGny4ISiB+xKKQytotUj5Dl86hqHd0yROqnoxmWdhf51EvXtgzgi
|
||||
a8V+4Vm0yAlEPao1TGpUOxrVT++zK2TjJVxJorS6AVW1t+YPHjogY+/ajned29Y2WYUN+YNXxisnynj/
|
||||
bbLCukxIkrUxf/8xGVDvxHlx6b9vkYcgiD0EwZvg87kC5mk9sFi/AU2lZoSWJFHPAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="panToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEQSURBVDhPpZE/DoJgDMWBydHR0SMY7sARSBg5AiO34Agc
|
||||
g4mZkZGRxYQ4KCRGiSz1tRTiHxSMv6Sh9Ot7XynGF1amadZ4XhBrqcxhWdZeRSxukiShPM8JeYwaIT6b
|
||||
sbBtWyqKgmB0QIkGhlzNziJ4BQenKIqITfDaIUTEvOY8meu6nLuIkRWiq6qK2Ai5St4NHMcRk6lpKAiC
|
||||
cQrVPOWDuCxLqbPoadvIG+2dhA2YOI55goa/fdy2mkjDHL7vS8jy6rqWopqM435DL9sanudRmqZaXgb/
|
||||
aohviB7btmmYYglhGEqoXNj8YoJ+3v5WlA/slphkWcYG117yzqwJln5EX9i3TyMmn8A5376Rzv8xjDs1
|
||||
5wrrvlLxhgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="showRulerToolStripItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAEiSURBVDhPvVO7TgJBFN2fovAHNDb+gLGywsbCxoTOxF/wgaLGRPGJNUEeglBaaKExWhF8E1kh
|
||||
Cwsyxzl3d83Gip3Ck5zMvTtzz97cOWPtnFVBbmcusXVaEaZOytg8vsDGUUmYPCxi/aCAtXReuLp/jpW9
|
||||
HCyCxWHML6X8yEP/G2i7wEcHqH8C96/AdQOITc56AvxzAMdxMD696GfAYAgeQlMXN1rAw5uX5+9CAmyZ
|
||||
YDE5NhWXnAffW11Zb1+GstYeve/ZvwILy7uYmEno4jnZGJUiwIGF8bsxKjjtADqNLsBrCmDbjrmADs06
|
||||
oEmUUuj19T033egCdJg7UPjqGc6A1gycdvOkzAToNB2adcCH8WwDV3WI0yIL8FWxKEx/6z9gWT/PHGlW
|
||||
lc2EywAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemFixOpenAreas.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAE/SURBVDhPY0ACokCsBaVhAJsYVsBvbGzsD6T/Q2l+HGI4gTwQ/wcBEA3lYxMDGQKjUQAxLpDH
|
||||
ogYFIJsOY8MwjI/uIjAABRBMEQjg8jt2cSAnC00Qp01AAJOHGQoG6IpxugCIMTRjcwEIoCvGZSgYoIcB
|
||||
NiBv6q79v3Rmwv+0Pv//EU32Xzwr9GqgcnCAbisIgMViGzz6G1cn/t9yZer/C892/e/fnfU/vF/3v3m2
|
||||
ZA9EGVAhFifCxWLanH9uvDzh/8Zrk8Dh1bMn9X//nnSQAd+B8mAAshksCaKhfLiYT7Xh/21X5oDZMLDp
|
||||
0lSQASC1YIDXBRbZ0j+7dyX9b9+VANbcvjMB7AKzLIkfQHk4wBkGJqni3cE9Gv97d6WAbQbRIL5xivhU
|
||||
iDIiANC5HUD8CeRsoM1fjJPFJzEwMDAAAD8wxIeEhxEyAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemSetupDefaultPlayers.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAD0SURBVDhPY0AD/9FoogEuDaQZdCzROe5YsvOJwwnODw7EO1S7KomLQaXwArAtIM33WrNef1ra
|
||||
/f9NT/7/U/H2X9f6mXeCVRDjEpDNIM0/N876/3FS8f9byTb/Fzhp34ZK4wVg00HOBtkM0vyiKvT/1WDN
|
||||
/z3G8q/AKohxAcjPIGeDbAZpXmch9mteYfb/Gct2EhWQ/0EBBvIzyNkgm8t8A/9X10/6DwLEGoICXCKK
|
||||
/vfP2fr/2p1nJBkCUwSmHUMLwIZcv/ucJENQAMyQG3coMMQprBBsyO17T8k3xNgj+b9rZBF1DAFhqBDp
|
||||
AGQIlEkNwMAAAP7JtzLCVbRNAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="eraserToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD2SURBVDhPY6ApmLlqNz+Irmqd/H/aqpP/S3s2/W+etuM/
|
||||
SKy8YxVYDidA1gwDv37/+X/i4sP/xR1rwYbgBNg0//z15/+9px/+3370HmxI7cQN2A3Bpfn1+29wA0Ag
|
||||
o2YmpgHEam6buvm/V1wVqgGkaMYwgCLNMECqZpe0crClYACKYxggWTMIzFx7+v/zN1/+P3z+8f+7j99J
|
||||
0wwCzTN2/992+Ob/tXuv/j9w5j5Q8zu45saJy/FrhoGs+nn/SzsW/58FdM3s9Wf+L9l8/P+MZTuxBxg6
|
||||
SCufCTc5Jq/tf0r5hP9xhZ0gjcRgBAhN68DtRNoABgYAAoqNFseCkuMAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItemCopySelection.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAJVSURBVDhPpZPdS5NhGMZ3LKJ/gzsrHg3sIFsm5A46cC3ImmnWOy0/lrMtpdbct5tbH5Op6eZH
|
||||
6lrvtOYqTTdxrUyCTgoKlSwiAjHICAOro7VdPe+7aRSyhC64eeDhvn73/b4Xj+BvRcc8WRPDphKnUYG2
|
||||
iwxam07AY6sqsTVXZKVa0itypyeHQrD63LhZ1MxVTqolvSZZF5ke7dwKQFIt6RUYvJLD9tm3AmxvA2rO
|
||||
uO+1iv0ey6a52yIX0zMj1fJvsb02srEFB7Coy7a3/obYXjsPSLzVQlt3GNp6aXrAk4nBzEf3+oWRQA8J
|
||||
+ztIcOiq1N/rQGKpCecZMTrN9VK2x0R8XQbi7dAJh10tmSmrQPD4bl/2s7CXmR0fBI0Q4ZEOTPraMe67
|
||||
huCAA4EbbRj1tIJ1m0EBoADc6tIzbrs6CaFTc7ncvy3PAGtzfCW+zCL+OYqfn2YQ+xhCfDWyeb8yH8B1
|
||||
ayOc+hohD5hiXYVc7rx5qRnxhUboa/OhO50HrXwnWqoJjA17EV9UIfayHu8eHIW+4QgMytLkfxkbsBfe
|
||||
9lgRW5nC+sMSrE0dwPe5UhgUeyhoN3RnduHHUxnWoxJ8DRXjVX8+lBVFUJ0sTgL8bksul/nyCx/mhwqw
|
||||
eHM/PkSq8H66EsrjO/AmKMHrETEWvCLeHGrLg0ImwtmyfclP8HWbsv1uU3W7vg4ODcOXjT4gmj2/qqb2
|
||||
EJrkB3GuspifzJnV5QWM4pjodxKdZmWmU1cjvHypitgvnCIUQMwqGaEAoqmREAogFEAayosIN/kP8/9J
|
||||
IPgFAlSB3U6URz4AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="QuickhelpToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPtVJNaxNRFM1PyE+Yn1AUXLjK0uWgDWQZwUUX
|
||||
KsGFBEEcCkIwqBEpGiydsSo2kupsasdo7Yi2toh0sFZjG5JpiZo20/TpVOmH5njvm8BYahEXHji8+968
|
||||
c+55l4n8F0zM+rhVWkHmdg29A/PoK1Yw8uIjOp/3xpvqBgrjLeilZbjNLXxZ34bwt6jexMVCGRndQenl
|
||||
0p+NWHzPXoP3rQ3bAbQhQM0E5Np2BKprbZzrm8TIs8puE+68+r0NwwZiacCwALEBCVcAqet8JlAjk1PZ
|
||||
JzsNJt6u4+FMS3ZmMV9mmFNAMhesbBZLC6oFdOsd8oVXocmdx018Ej9k1FgqiJ0zgS6qlR6BVI4iEFRN
|
||||
IJlxMF/1cfTMcGiQvbskB6ZqgairJ6BCTJKYu9tlAUW1oSRsNDwfB+JXQ4PzN6s07W0ZPxDS5aSgJEFn
|
||||
06Y9CaOqSauJRvMr9qmXQ4P8/RoWvU16eyBUEq5kbigwiKoOMTBQ0zbKlTq6TxihwejkZ1iOJwfEwmiC
|
||||
BQ49yaW50J7Fh0xJw3IxbM3hwo2x0ICRHZzFgveTunYERK5lgo5YMxx8WPFw5Li+U8wYm66jNz+Naov+
|
||||
Beqiao58N5NrPluoryJO0QeKU7sNGKPPazh9aRzGo/eYmVvEMk270fTlmzl2N3XW9xL/jv7iaxw7+wAH
|
||||
E9ew//AVxE8OItv/9O/Cf0ck8gud2vKswuxNZgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>198, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="propertiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACCklE
|
||||
QVQ4T6WT30tTUQDHz39QD0UQSpAPIkgPyR60AiUiyoGBL4qZjOyt0tZP9tBDk1AsXIhj93ILdd27DPPH
|
||||
3VwrUrdK2ioJHAgVOdoPaQsarBg43L6ec+akuRsEPnw5D4fP5/vlXg4BQHaSf8LjjwdqaTA2cg+y1Ith
|
||||
qxmi5Tas/SYWk+QRoPgmtNsLcPq7GYX8+XoTqaUL+KR2cAmDxeBgqeBv2NhWzwUFOBk4g5/zRxB3V8Es
|
||||
38AtbzuIw/0RLMrMeyhTs2CzGdRtaOTn1dajvLkAR9VKLNvLcHmoExddzSDKzAfkcjkkEtEiOLxoQpdB
|
||||
z+Er7ScQUg/DL5TD2bsfl5oPoKWnCZ3jehDZGeAC1hwL3uXNs55Jep7Gis/AJWxyTeVe1FXvhq5qH6oP
|
||||
7nlw/NoxGByNIKPT77CezSEeD6Pn+jlEIiGk6X8N+F9zyfLYIZzUVUCwT0J36jy9yX83KjDq7zSADE8t
|
||||
cGB7kpksFt76YDzbgMWVFLzBX0WCTcku8mjiTSm8lkUslcHnH2kK/+aw6k+UCJiESE+9XCApz2Gzu5Gk
|
||||
sEVy4r6got82vRV5blVbIDyZ21rAZrPmL7w5P5s1KxQWXRFtgU15lV8ge2AbdXPY8pAuEIsXWJ6FtAVW
|
||||
+SWSmXWssuZ4vnl+s5nNFl1hMLjP8U1bMGR/wS/+N9tf7o6eMpNtADko6xybtEXLAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="resizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAADLklE
|
||||
QVQ4T3WS60/ScRjFf39CL3rR1ovurduWbbU2t7ZqdlkXt7Lrym6O1VoXcdYqQ54wKlGxABE1CzWF0nIm
|
||||
lZcoTbyUNJFIzDJSJK+E0qy8wInvz+i2erazfd+cz3m+zw4nTS+FLOeZNim3Vp6UU5sqvf5MSZqnyjhV
|
||||
pfKUvEx54kqp8rCkWHVQVKSJPHtbs+tUgSYiOicVAMfEqfR1dVFCGSqrX94cHQeN/aXhbyD3Zz91uf3U
|
||||
9tFHTQ4fzVtH9BOQVdKcW2F6/eKkWA1zcxu6vUAQMmCzk/3AErLtDyFrrY035z16T3PXin8B5LfqZE6P
|
||||
HyZzKw5FX+Yh4XtjwZKZGV3lNPIkhhojplON3Uc3S9/Q7LDfADKtKYklMsgTkwV7joixKHQr2Nq2fSET
|
||||
5uQwqtsyjcot45R510ozV8f/2iAhsyolCNh9WIyFoRGYHbIGfYN+SVd7Nznzk8ll0FLzKxdZO3xkaOjG
|
||||
GYUxcIIfRxSlPU4N/rn1fS8JJVlU1WCT3npggVLfAIWuHjJtNRIyjIhTPEKM7D6OSop4RcXpwZ2Wl11l
|
||||
gHanmze/c36ioc8jyRlFjSzljxl2daI9Pwuv1Cnw9PRjZeQ1cCcSS68Fza6+IXL2fCG7w0ssmc3o2IR8
|
||||
gbc1PQU9NUp48sNRcUyAkPBL4AIlUbLk3gEvS6YXrW6p0dx9UZ5n4gHjzBmYAAPPYwRwazeiMXYWqjcs
|
||||
wLSVInAHRYWq0TEf9Q+NUEsg+fr9t2nF1U71leyqn+u3vPuIl2298HZ2wnxkO5q2LYOtxoKpK86D23tW
|
||||
r+7zfCVzywAVGT/QVV2LvNDo0Eo0j3mAtbUTiRnFOJ94Axp9LfIKK5Ctq0RDmw9TQuPAsW7bHYNUYLCQ
|
||||
JL2GRAqjtMDYwV+8wzUAWeY9eIfHYW0fxNodxyGWZeOSPBvzl27C5OXnwG0T5irmr79wgdWTNYyVJFL8
|
||||
kAeo8wyBA/rx2jGErBIH0nXPsWmPEHcM9YgURGPS0jMTZfiXGKDfM4Y0fVOgA/UgRQWECTpExaqxUyDF
|
||||
wuUbJjb4H0AQfxtrDqiweLMUc8LEmLEqnv9zUMzM9B1/cM83lepxTAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="newToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHNSURBVDhPjZNdTxNREIb5LV54azSRxJ8gt95445XGa/8A
|
||||
CU0MMVgIWNmgRSioGN0AapQaISAWrEaITQTkQyhL2WbbWtt1+7ll+7h7SDdBocskk3Mm58xzZt7JaWmx
|
||||
bTdyk9/rPsz0fbYmz2JqfvSdHhJLPpxzTzMUid13F0D3k/h41V57iU+dI7/dfTqA8zKGBLUohjpurxER
|
||||
7/24i/RkSnj/47csLsWOB27IZ1DmrlDQJrHIU8q8EbE63UrD7oVe09p243iIqEAPQGVOQJxKRJwfdgE9
|
||||
gxO8X1wRkIWv/1Ri7A0QD5/HSrWT/HTNTgwIDapayAV0DTwXyQ0/IqwSvXU4hWQn6uwl4usPKCl9pGI+
|
||||
F2DV6zwaX2BQjgjIiZPpHXrpJjU2di7lao2sXmLiwwYXL18/GeB/KP8HqJgH5Iwy++k/yDOrzQF3+p8d
|
||||
AZi1A/RCleQvg81ElrHwt+aA232jLqBmWRjFKlq2wM/9HLGtFCOvPjcHdHQPCYBl1SmWTdK5IvFknu/b
|
||||
GaIrKsEX880B7V1B6rZq5cqhaIqms7aT4cuqyuyygvR0xhvgiOao7Qjm9Byyyw7K80hj0wRGw94tOGPy
|
||||
cs8fetoLfwGP5fd9L1vD4gAAAABJRU5ErkJggg==
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHPSURBVDhPpZFNTxNRFIb7W1y4NZpI4k/QrRs3rjSu/QMk
|
||||
NjHGYCFgYYIWsaJidAKoUWqEgFiwGjE2ERREKEOZZtpa23H6OWX6OHN7CQaxNfFNTm5Oct7nnvten6fN
|
||||
6AV+rPixM/2sTRzGNgKYGz0kF/2IgXayNIXNF8fADJB8fcY9e0lMHqGw3v1vAO9mLAXqMSx9zD2jot/6
|
||||
cg3l3qSogbvPWViMHwxcVQ+hzZ6maEzgUKCcfSZ6faqDXV0PP6Xj1PmDIWIDMwjVWQHxNhF94ba0Q8/Q
|
||||
OC8XlgRk/v0+iLU1SCJyFCfdSerNWdcYFBnUjLC0Q9fgQ2HeLWltSotdbP5C6gr6zAkSKzcoa32k435p
|
||||
B6fR4NbYPENq9E/A7+odfiwte3K9VGp1cmaZ8VerHD957u+AwE1V2vZUtXfIWxW2Mz9Rp5dbA64OPJC2
|
||||
puz6DmaxRuq7xddkjtHIx9aAy30j0up+huNglWoYuSLftvPE19LcefK2NeBS97AwO06DUsUmky+RSBX4
|
||||
tJ4ltqQTejTXGtDZFXJDa1CpNkPTDJPPG1neLevMfNBQ7k+3B3iheWl7gXlvDrtrh9Q5lNEpgiOR9k/w
|
||||
BtqVHP9f+Xy/AI/l932QyhfPAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACeklE
|
||||
QVQ4T6WTWUiUURiG/4suurJIjUIwskQsEANDqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
|
||||
sEIoFInQcqHE1CwoKsXUUMnt6Z+RLMtA8OK5OZz3Oe/5OEcAhPWwpnBaodZZmqfjWmY5GSo98XJNwq9D
|
||||
1yQIilLhFaYIMIQuxZaZJ4uy6FS1T2BUIUKdNsdPhL9pqpEp/ne18PiiE94RCjzDco0C+rs1zIzXGvkx
|
||||
pmNuRI2+XEG9NjV5NYlXuBLP0DzcQwoQaiuUTI9VrQgvfC5irjeSqrJMKovTURcmU5KbxE15HAWyGNH5
|
||||
e/BCtSab6a+a5ZMXxTD9cdAbsir/CG6Xyvj+qcRY2xBurss28lCfRYNOxr3KdPTqFHQlUspV17mVl0Cx
|
||||
Mg5VdqyxjVBZks7k+3wMtYdaJdRXKVkYksJw6kreiWuD8dAXBa8j6Krx5UqwR4WgVqUwMZAJH+Tcr1bQ
|
||||
/ki+tOnPK7wKhA5v5tvcmHnsxNsKOy6ePTohCvYKpXkSvr2RMtyWSL1OzuKgBHpClwRdwWLwNPPtHsy0
|
||||
HGGy6RCjdfuQhllzxsUs1zBMoUiZyGh3LHe02XQ+E5v0RYqC89AZwOLzk8w+Pc5U82HG6h34Um1LR9pm
|
||||
/N2scLAxsTEKVFlx9LQkcVebBQNJ8FKs+8KH2VZ3pp44Md7gyIjejo+a3fTKTZGE7MJ+j0Xj8lPOz4ih
|
||||
tjyT3gfhdOQIy7TLN9Ai20hj8iZqEsxRx1hw4+oO/F13LjraW7ouC3JSo8mRXCAjNoj4y36GyXLO14VT
|
||||
xw7gfNCO/XbW2FpZYLndjK1bTNhmarLyIa3nKxuyPwG9D9E7Fbto+QAAAABJRU5ErkJggg==
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACeUlE
|
||||
QVQ4T6WSWUiUURiG/4suurJIjUIwskQsEAMjqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
|
||||
sEIoFInQcqHE1CwoKsXUUMnt6XfEye0munjgnO+c9+HjO0cA/osNi2tJLdA6SXN13MwoI12lJ06uiV8+
|
||||
W3d5IwIjVXiGKvwX11djSs2TRFlUito7ILIAoVab7SvCWhqrZYq1omXC4gpPe4Ur8AjNMQjo69IwPVZj
|
||||
4PeojtlhNfoyBXXalKSNBJ5hSjxCcnELzkeoKVcyNVq5Kjz/rZDZnggqSzOoKEpDXZBEcU4id+Sx5Mui
|
||||
RcdfmVClyWLqh8YYXhDD9MVCT/CGrBPcK5Hx62uxMdxUm2XgiT6Tep2MhxVp6NXJ6IqllKlucTc3niJl
|
||||
LKqsGINMqChOY+JTnqHtwRYJdZVK5gelMJSymo9ibSAOeiPhXTid1T5cD3IvF9SqZMb7M+CznEdVCtqe
|
||||
ypcurWz9bQC0ezHX6sr0M0c+lNtx5cKJcVGwXyjJlfDzvZSh1gTqdHIWBiTQHbIU7AwSg+eYa3Nnuvk4
|
||||
E41HGak9gDTUmvPOZjmGGRQqExjpiuG+NouOl2InvRGi4BJ0+LPw6gwzL04x2XSM0ToHvlfZ0p66FT9X
|
||||
KxxsTGwMAlVmLN3NiTzQZkJ/IrwR233tzUyLG5PPHRmrP8Sw3o4vmr30yE2RBO/Bfp9Fg/EV8tKjqSnL
|
||||
oOdxGO3ZgpE2+SaaZZtpSNpCdbw56mgLbt/YhZ/L7oVD9pYuRkF2ShTZksukxwQSd813cbJc9HHm7MnD
|
||||
OB2x46CdNbZWFljuNGP7NhN2mJqIuRX/YOXm30H4A70P0TsBWkcYAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACMklE
|
||||
QVQ4T6WT3UuTcRTH9y90303QRbc1NYZrMRs86hzKsmFoIb09kqZpunxJUqxMxZYvkK1w6sTlahJOKvIF
|
||||
TJEUMZaSlZkrWuJQU3QiGHz7nZ+wn0vrQh84Nw98Puc553wfBQDFXorDL18EQOXuXEGHaxlPHItoafbj
|
||||
kXUW9XU/YLnnxd3yaZSWfEZR4Qfk5Y7japaHoVBwAYF9vUBd7Tq9/Oeztr4BfVIfTic95xUUuJ4tcUFl
|
||||
xa//wv7FNRw3voJSKcN0yikEjrYFLigt+bmjgDoT/NW3hDCDG4UFMzhpbBUCW+McF1w3f9km2Aq/n/Lj
|
||||
kORCTvYkEuJtQtDwwMcFmVfGQwR/w0MeH/ZrHZDlURgMViGorfnOBfKl0aBgJ7h35Bv2RTYj5cwbxMbW
|
||||
C0FV5Qx6usFOCaSeH4bp7CDfNi2MZqbPps6bcD8STa8hSRYhuFU2hS43WAaAVvtvdvdVlN+Z50ulhdHM
|
||||
GemeIByX0AmdrkIIbhRNwtkONNk2WHAC0Cdnh5TxnBnJl4t557h4Bsc4odWWCYE5b4LBQM39AO9MAgXL
|
||||
WJhawtinOUxMz0POvY0T+g4Oq6Ps0GiKhYBiaX2I4GeTgOC0/Gp89C7AO7uMazctCNfaGdyC8GOPoY7M
|
||||
F4KM9Hds7hU+80GdEweOSHjaNQB39xB6+kcw+HYM0QYTlJpGRDD4sKoBKlVOiCDx4oUBHk9KGIWE7kyn
|
||||
om3Twmhm6kpF8NGITCGgn2K39QfkKu4LIHJHnwAAAABJRU5ErkJggg==
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACPklE
|
||||
QVQ4T6WS70uTURTH9y/03jdBL3prU2O4FqvBU66hLB2GFtKvJ9Isfy3TJEXLVHT5A7QVLp20Wk3CiUb+
|
||||
AH8gJmIsJSs1l7TEoabYRDD4ds99dI9Le1MHzvPi3OfzufeeexQA/iv5p7MjAEp32xpaXat45lhGc5Mf
|
||||
j6zzqKv9BkuVF/dLZ1BU+Bn5eR+Qkz2OG9c9DN0SENjbA9TWbFDxr7G+sQl9Yi/OJL7iyUISuF6ucEF5
|
||||
2Q8q7hkE+5fXcdT4GkqlCFOCk8qSwPF0iQuKCr9TcVdsw198K4gwuJF3axanjS20JAlsjQtccNM8TcWQ
|
||||
2Am/n/LjoOBCZsYk4mJttCwJGup9XJB+bZyKwfgTHvL4EKZ1QBRHYTBY6RdJUFM9xwXi5VEq8tgL7hn5
|
||||
in3RTUg+24+YmDr6TRJUlM+iuwvsKYGUC29hOjfIu00NozvTsWlnCe5DvOkNBMEiC0qKp9DuBpsBoMX+
|
||||
i737T5TeW+RNpYbRndNSPUH4VFwbdLoyWXA7fxLO58AT2yYbnAD0SRkhaTxvRtLVAgmOZfBJJ7TaYllg
|
||||
zplgMFD9IMB3JkjBliLUAsY+LWBiZhFi9l0c17dyWH3MDo2mQBbQWFofInhsEhB8JbcSH71L8M6vIuuO
|
||||
BZFaO4ObEXnkMdTRubIgLfUdu/cahw/onNh/SMCL9gG4u4bQ3TeCweExnDCYoNQ0IorB4aoGqFSZIYL4
|
||||
SxcH+HjShNGQ0DvTU1G3qWF0Z9qVkuDDUemy4N8Tit/kKu4LI/ykxwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="saveAsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABh0RVh0U29m
|
||||
dHdhcmUAUGFpbnQuTkVUIHYyLjY0giIQKQAAAuxJREFUOE+Vk2lIlFEUho/1x6XUSiVBgqQQosgy0VRy
|
||||
NxlcskSlQsUkcpd0bFxScy3Lbai0UMfGHJdRc5/QwEpaQFBrSEz9kUtqbqWmlYRv1+v8KPpTLxw4fPc+
|
||||
z+Xcy0f/Eze3gwQMkDgxjRCfAAQFqVb+Id7exrS6GkNpWQepIE/447m4EIiKmueLivYVamtdpZbmZWpv
|
||||
X6SmxgWqrZmlCuk0lZVOUGGBkmSyDjIzUyOFwguACPniTFSlpmdxmBXaWlfQ+GgJDQ2fUV01h3LJNIqL
|
||||
PuK2eAw5Nz4gJaUBnZ0uDE5AT48fdHS3iIFmYqd+3TgZDfXreNK5xjb8ndHxl+jqcmedCP39PjAy0ryq
|
||||
VIaSQGBPVF+3yOoL6uRraG5a2iR+y8zsLORyU9aJWIXA0NAEG2Nra2/j45OscoEqH86jtuY7ams/cWgj
|
||||
6+vsvge7mXgDToTyjSf0d+/DWb82LtDS0uc8ScpmqLRkms29Aql0bJNm6VM+Q+NNC9YJ0dvrAQdXZ9id
|
||||
6oafr1wlMOA83SuepKK7E6h4sASJZGiTZsnOy0L1FRNMFVnhpLMZEot6YOr6GGe8pH8KxIUTlHtrFK9f
|
||||
AXn5U7C0a4O5Yyf09sexjYasDLD1qAR7beUICngBgeAeF2hqqkZgT0SZGSNQtIO9BFBasob83EVkZ01D
|
||||
KBxGdNQAoiP6cP7cU7ifVsDFRawS6HGerqWOUFLiILtE4H4xEBxRjsO2DjB39kRIQjYikzPhcyENbh4d
|
||||
cBLUw94+hws0NHZxnuJF70kY+w6SMiA35xvCYuqxfaceDhxzwPJPYHxuBb7B12FlL4e1oww2JzJUgp2c
|
||||
p5jLAxQV+ZafHh47hkOOIoSLklBS04Lh0UkMjgzB0T0MR6xlMLORwtIqmQvU1XdwniLC+ig8tN85IqwH
|
||||
3j6NsHMpREBgBS5eqkRgYAn8/e/A2iYOVjbpOM5gS4sYlUCX86Srs4f9ovzbP8fY2InU1LawjugX1Iz1
|
||||
h1pVBKcAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="cCRedAlertMapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@@ -253,50 +455,382 @@
|
||||
XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS
|
||||
fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+
|
||||
tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
|
||||
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALDAAACwwBP0AiyAAAAN5JREFUOE+FUwEOAyEI
|
||||
8+k+7X7GoFBWmZdtISYgtS3csrXsFtvzf2Mv8/8d4Hkec2SLM+IHzJsjdwVAcxQrtl8OsDgBxPMGgKJG
|
||||
SQkwMlI2zSCS+cuL0YCceHEDAcBbM6gTQOhDDpnBxHqVOsmgdYvmfCxk7q+JpDZN4yQOJhOAOtmslGna
|
||||
MYE3AN2HeBEmyvhYZ44mL5rRXkijgoAZAA3nCVBzbzM5vuE8x8xmbGIzqE1LkNwHOO2RZmZOjQYTjoWF
|
||||
g/YYr+qn2QBQSl2ofL8oC6Wb2hIOM8WD+bXOex/mMAFDkP1eQgAAAABJRU5ErkJggg==
|
||||
6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALDAAACwwBP0AiyAAAANZJREFUOE+NUAkOwyAM
|
||||
4+k8rT9jthMHyqJpSG4gPkgZa4zVYf6DCXtnJp7nWdioEp2ZtQ2QGXUkKEajTFXJ22SIPMEewCCG3NNU
|
||||
AA+xQqibD05inq8QBUio9TZzggrwNOxBoz2gABtFpMC3yWhzIvpzB1jMqtszRI+ZIdS1AWpwkyhhE/Iz
|
||||
4ATF5ySewBx74gEFVAiIL1Hud3+pvgPQKGGKbTAfHNc27wCAxC3UfwLxDtGj2ZMR8QYHYTKCNmywFp89
|
||||
gUyJIi6YP0OkKyIBpiDx3UvEeawP5jABQ7IsMkAAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="bitmapToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<data name="toolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACR0lE
|
||||
QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL
|
||||
xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S
|
||||
lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V
|
||||
roiLawdYu+vivwHSWcQM1THz/DQv96+ixeHlVvU71oQFAGTmP+37bdsPBf8WZ4fRFhVEXdcsBQ9srN6Z
|
||||
pjqQhQUCAmcW29JZxA8fvaWyY5YcawdBOy6oANm2H9A3MMypDLNS7b1flJnFtnQWcVmrB2NhMytD9SpA
|
||||
TiUA5+CYInQOjWPrH2V7RBzmijdo9x5VKr+yj6ImD9nmelZsS1UBcme/+OPIJIOfv/Gi201ZXQ/hMfFU
|
||||
Peuktqnbd3QN+U/cXM6tYfmW8ypAQiKdh91TTE7PYHNOYKl6z916F3m+eSNjT1B4vxHjzWoFYrhRwbLN
|
||||
51SAJOynx8vo5Ay9rimKHzu5XtJDpuU1WZY2Eg1WgrXRJOpNxKdcUyBLN6WoAInnyPh3XvW6KW/4MC9O
|
||||
z2ki+Wo1CWklROkMCiT8wEm0kXEsCTmrAiTbDtcEpTVdZOS1oDfWk5xZ6RPeQZeUR8zxK0Qe1BO65xjr
|
||||
t0YotXhjAEAeQ7It8ZSESUjkznIq2bYsTGYW29JZxIs2nFEdLOSdfwFwpvLxRKIY2AAAAABJRU5ErkJg
|
||||
gg==
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALOSURBVDhPfZPdS1NhHMdPWKREEhWE3fRXFBHUXS9ahnZV
|
||||
kV2UvVx5UUQXZmnLJc5ZvmRN2YVhdBGsFxqjFU4jaIavIxWNHXWbb2c7U7c8m+n2yfO00hX0gS8858fv
|
||||
931+z3N+j7SeJEn6An00f2nG2mul4kMF123XufbiGk0dTYwHx4n/iJNKT2dqYYr6z/W0DbahLCusJFaE
|
||||
dHTj7oluDG8MmB1mIlok3USJKhhdRnzffaLgf7i+umh0NKZ3Yuo0IUfkVMoa7XI7tiFb6mu1k2SSxI8E
|
||||
9q63XHpySXQojcyO0NxjSaWsoWoqe2r3kFGWgf2bPRWFaDSKFtE4Yz6NZ8KDZHbVIMf/3V3nmecZUqnE
|
||||
1sqtdIx3iFgsFmNOncM94CavMhdJv+XfJJIJtBWN+HJcSL+8hq4GNpVuIseU88ckqATxjfs4db8QqaCu
|
||||
QAR1+qf72f9oP3ste4X2WfZxoOUA2cZs0cmWu1twjDpYnF8kPBOm5EkJ0nFTHrGlmDBwB9zsMu5ie/V2
|
||||
dlTvYGf1TnbX7CazMhPptsSGWxuwdFmIhqOEJlVKHq8anDIX0jncKQxiyzFGw6N4w16hycgkLT0tZN3J
|
||||
YnP5Zp4OPIVlCAQC9Hr6KKotQjLY7nKj7YYw+Bun18m2e9vYWLaR1v5WEdPPPzE2wav2l+Qb85G8s14O
|
||||
lR3Er/pJJBJCOtPRabIrV89+U8LabdXHkVAohCzL+L1+Lj64gOlV9a9humK5TJWtSvyihYUFtEWNpfgS
|
||||
5e3l1H6qhfjqzsEg8pjM2Lcxnjuec7Ti8NpIq1GVs3VnqH9TjzavMReaIxwMoyoqISVEwB8Qbfu8Pl67
|
||||
XnOk4ggfhzrT38Ps/CznG89T3FCM0/2OweFBpv0zKH5FrJ2fnJRaS8k1HMPe8za9eD3vPe+52nyVogfn
|
||||
yDecIK88l5P38iluKqbO/pBgJLiuWJJ+AqhM3amQCvIQAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="mnuMinimapToPNG.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAACR0lE
|
||||
QVQ4T6WTXUiTARSGdxkRRBdB0IUREV1EKRFEYYuQAklL8sKQfphUoJSUWJbLxAVZWqyBio5WajorM1PL
|
||||
xExUlLQfbU5n0lygRerMP/qxOZ92vpjfCKLAi3P5Puc957xHA2gWUoo49147gWUqbSPrdjOXChrQm56S
|
||||
lFVFvKEcXaqV2OQiohMt7Esw+6Ro5gGeWfhbff0BY9NzDI3N0f/JS6fLy7rd6f8HcNsdOI6EYD8cjK3V
|
||||
roiLawdYu+vivwHSWcQM1THz/DQv96+ixeHlVvU71oQFAGTmP+37bdsPBf8WZ4fRFhVEXdcsBQ9srN6Z
|
||||
pjqQhQUCAmcW29JZxA8fvaWyY5YcawdBOy6oANm2H9A3MMypDLNS7b1flJnFtnQWcVmrB2NhMytD9SpA
|
||||
TiUA5+CYInQOjWPrH2V7RBzmijdo9x5VKr+yj6ImD9nmelZsS1UBcme/+OPIJIOfv/Gi201ZXQ/hMfFU
|
||||
Peuktqnbd3QN+U/cXM6tYfmW8ypAQiKdh91TTE7PYHNOYKl6z916F3m+eSNjT1B4vxHjzWoFYrhRwbLN
|
||||
51SAJOynx8vo5Ay9rimKHzu5XtJDpuU1WZY2Eg1WgrXRJOpNxKdcUyBLN6WoAInnyPh3XvW6KW/4MC9O
|
||||
z2ki+Wo1CWklROkMCiT8wEm0kXEsCTmrAiTbDtcEpTVdZOS1oDfWk5xZ6RPeQZeUR8zxK0Qe1BO65xjr
|
||||
t0YotXhjAEAeQ7It8ZSESUjkznIq2bYsTGYW29JZxIs2nFEdLOSdfwFwpvLxRKIY2AAAAABJRU5ErkJg
|
||||
gg==
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsNAAALDQHtB8AsAAAB+UlE
|
||||
QVQ4T6WRX0hTYRjGve0iiAq6CovsphHWRaXrogshbEIgiEzbjFLQq266WZG76I8kRIRtIZJhW2NOq5Ga
|
||||
uTkbrmZzf2gyTY8ipIwlYkJIIZP563xHZhtbF9YDz3l53vO9v/N93ykA/svKo883w5vRaZzeKV6NxOh1
|
||||
R+keimB7G8TaF6DL6afzpY+OHi/tdg9PbG5M1iF5NAOwU53WNIiyBRBfFvpmbGJeX0bk3FFsxQdgc/OP
|
||||
ZYnya30Dly+aDegdnhCBGV0ZX8+r8JwppPXIbqWXqeRGisTKmnwEVzbAPhgWgeGSw4yWHsJyfD/Gwl1K
|
||||
b3ZZwuxro8nRwE2rAU90TDl/FkBclNBT1T7aj+1VhtOA+wN36ZFsNIcMXLbrqL1VqwBOXagXr7cAz15/
|
||||
ECGvah5Wc3u8GV3/JSpM5aj1pbmADsd7EfKq7o6Oxu56Kswa1DfOojVocwHiv6aVkq/aE17F5Iyznkzx
|
||||
6YufymsXOVFVTPX1KryxAOYXrmzAY8s7EbaHVXUhtMYwLc8l1n4mFS8u/WBqfoXI9FLuDtIAMVxUE+SR
|
||||
I4W6McRJ/QAtXRJzi6vMLnwnKi3z8XMcsT4vYI/Gz9V7KXkHkxRVDnKw3ELJlX7cgThjEwnGYwlGggt/
|
||||
B4ia6TbZDzqze2nnAERjp94G/Lsp+A2CB/zdurHUfAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="fullMapRenderToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsNAAALDQHtB8AsAAACRElE
|
||||
QVQ4T6WTXUiTcRSHdxkRRBdB0IUREV1ETSKIwoyQAsmV5IUhfaBUoJSUWJbLxAVZWixBRUcrNT8qM1PL
|
||||
hpmoKGkf2pzOpLlAi9QtndKHzfm084a9uzCKujjv1Z7n/M85v2mA/yrlk3eng8DKKWsn62YLFwob0ec8
|
||||
JimrhnhDJbGp5cQkFxOVaGZPgsmPBgi8M/y2Pn8D99Qsw+5ZBj746HL6WLMz/e8ELpsd+6FgbAe1WNts
|
||||
ClxSP8jqHef/LJDOAjNsYfrpSZ7vXUGr3ceN2jesCgsQyMzzwfJs2wHtTzg7jPbIICzdMxTes7Jye5oq
|
||||
kIXNB8vM8mzpLPD9B6+p7pwht7yToG3nVIFsew7uHxzhRIZJqY6+T8rM8mzpLHBFmxdjUQvLQ/SqQE4l
|
||||
sGPIrYCO4XGsA2NsjYjDVPWK0N2HlSqo7qe42Uu2qYFlW1JVgdx5Dn4/6mHo4xee9biosPQSHh1PzZMu
|
||||
6pt7/L/WUPDIxcW8OpZuOqsKJCQCj7gm8UxNY3VMYK55y+0GJ/n+eXUxxyi624Txeq0iMVyrYsnGM6pA
|
||||
Evbd62PMM02fc5KShw6ulvaSaX5JlrmdREM52tAoEvU5xKdcUSSLN6SoAonn6PhXXvS5qGx89wtOz20m
|
||||
+XItCWmlRMYaFEn4vuOE6uJYFHxaFUi27c4Jyuq6ychvRW9sIDmz2g/eIjYpn+ijl9Dt1xOy6whrN0co
|
||||
tXB9gED+GJJtiackTEIid5ZTybZlYTKzPFs6C7xg3SlV8O+F5gdwpvLxKZ4mxAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="mnuExport.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALTSURBVDhPdZJbbIthGMd77caFuHDhRkhwIdwhEXHIIhO2
|
||||
kDiFTIYEsYkhs5DIxIYYY6fuvAljmaHWnbANOxjbugN2ajtVrbZbv21fuyrr168/XzunCv+b932f5/n9
|
||||
87zP+6r+VoPOQa7WiLraQnaVjUtlQ1wr66auVc+Pkv+r+ImZu60Oeq3fGP8iMenxM+72obeI3Kl9S0p+
|
||||
4/9NMqpM9FvdSHKAQIAwBY+SX8bqEDmSXE7pw9fhRvm1Jro+uRUwnBz4IPDR5gqLu1wiW4/k8PzN8G+T
|
||||
vJqBsCJZ2XcP2Vm5t5K1sQ8x212huCTJ+Ka99PYb2LD/xoxBTmUPRqsYKggq6NNncBAVX8fSqCou5HUy
|
||||
6f76IwuiKPJlSiAhtZzM289RXSx4gV+WQ8lgF4MmgV2J9SyMvE/SzTY+j7kYm/Rid3qwCx48nikE5ygF
|
||||
5Q0cPHcb1anrT3+1b7RMEJ1QxfIdWjYfq2dHopbdSbVsP11NZJyGTUcrlUEKiBNjNDV3setEIar4K3VM
|
||||
+/whg1dvrSzeXsqKnRo2x9Wy5kAFS5Tzoqhi5kXkM2ddBgazA9eEg5dtOrbF5aGKPn6L98qdgwoa1bQZ
|
||||
WLbzFnPXqzmT9RLdoJ22PiuNHWaausyMCU5sVjP3NE3sSShClaxupPhRR8jgp6pb9MyPVLMgIpsiTS8+
|
||||
n0xAmZPk+4btswWbxcTJlDJS8+pnXuJYigZxyhuC/X4ptGpbDMxelcas1WkMm0bxelwKbGVwSE9TSwdb
|
||||
lL8QgoPKvNNMcnYNsiwhTc9MmoCfksc9ZJW34xQE7ApsNI7wolXH7uNqKup04b8xPqWCc9cf4By18dUz
|
||||
zpQo4HWP454YxWFT2lbu/a5/gENnC7la9Cwc/qnD5++xISady7laml91MzJiRD+sp72zl/TCx2zcn861
|
||||
koZ/w38qvbSRfadLWK+YRcTeJCaplMS0R/8AVarvzz+nF884LWEAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="exitToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMVSURBVDhPZZOLT9N3FMX7vy1ZhiKttEh5zrpWJjgjsFF0
|
||||
bGN0gmFzD7PF6AAlbDHLQghzBYuOltLW0lJmqVBaZ1sBBcOjtOIqfX12W0ic4SS//B753XPPufd8Ff9H
|
||||
bm+Pbf88kf5BQj29BL+6jP9iJ/PfXGXN8YBcOs3Br4eRz+V4Zh4n9vUV4kODJAZvEv/uB5bbO/DpGrDV
|
||||
6gkP3SafzR4mKXSOXO9jo+9n8gszsOgF8yiZH6+xefELYudaWdCfwX6iDs9nJtIvd98mWRkeYetmPzwP
|
||||
8jrg4NXwbdLyvmPqZrXVyOIHHzJTUY2v/hQ2dRWezm7I5/dJ4otLRLp7IOrnpdeGX57npChmNLL6sZFA
|
||||
7UlcJw087P0eh+40zspaLMc0REfu7BOEbgywLR1zITfRaz+xEQiSiMbwftSC44iKaW09a1MOCgjd+oUp
|
||||
VQW2ci2T+sZ9KzMt7aT++B0mRkj2XyflEf8iL/n4H9xtn7JudxaLE745/I3ncGq0RRt3VdriZhTuhrNk
|
||||
xW9u4AZxUxdPm1tZHx4lK4PNZ3PkpXjDZufvej0z0t0lFooE5VVECjZc7zeQ6Opmp8vE6idGHqqrcdXo
|
||||
2AmHi52zmQy+C59je6cEz4kanHJNHhA8kUYK55nzPG5qZqWljUDdKZzVOqKSh4z4Sy4Eye7KPbbMbEcn
|
||||
thKZiaaK+zKDcWUlkVEziqWBIZFVz5Khkfnzbaw9kBwINu5PMler48m3V8m92iW1HSfcd0sGWImlTMNd
|
||||
TQ1bjxZR/Lv+AmudAY+QhEw9ZBIJNq1TzMr63EdVuI8oCX55Sb7v8MLh5J5SzZ/vleHpMJHbO4j2iuUv
|
||||
JkrL8er0BCS6XgmOU1mBW1uHS63FXqZmVjLhPN3EWOlxxtU1bM7536Qxm0oR/vU3xkqUTMrPdimarqzG
|
||||
XlHFlKzNqhbZosZcUsadUjXLYxOHz0SB5JnVjs1wViSqJG3lTIgKixCajx5n9N1jWA1NPLdNk5PNHJS9
|
||||
jUKA0skkq/es+C5fYbq5HUfLBWYv9fLUbOH15tabM1CEQvEf0mmgVGzBvO0AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="propertiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsMAAALDAE/QCLIAAAB/klE
|
||||
QVQ4T6WQ30tTUQDHz39QD0UQRlAPIkgPxh6yhCRCykGBL0WZjOytLKdl7KGHJmFYtAjH7uUWy3XvMswf
|
||||
d3Ou8MdWils1ggZCRQ43lbbAwYpB4vbtnDMzrrsMw4cvB87h8/l+OQTAlqJ7ydL/7MEhGvQ9vQdZ6oLT
|
||||
boVouwV7t4XFIvkFKMGB0nB23rqeX187kPl0CR/VJi5hsBh9VBo2nzuqgdPh0/gxeRhJXwWs8g3cDDSC
|
||||
uH0fwKKMvIMyNI6/8DVTPT/bzh7RwAtqOWZdZWjpacZlbwOIMvIe+XweqdSCBo5HLLhqMnK4tfE4YmoV
|
||||
QsIeeLp240rDXpzpPIXmfiOI7AlzAYMXo3c4PO4fpOdJzAVNXMImHyzfierK7TBU7ELlvh0Pj7XXwOSu
|
||||
B+kdnsFqLo9kMo7O6xeQSMSQpZ8RDr3hktm+A6gz7IfgGoThxEX6UvgrKjAbb9eCOIemObAx6ZUcpqeC
|
||||
MJ+vRWQug0B0WSNgoZJt5MnA22L4dw6LmRV8/p6l8E8Oq6FUkYCFSC8CHJKUUThcPg7bJA/uCyq6HcPr
|
||||
kSeW9AXC84l/zXQ2a/7CmwuzWbNCYdGb0Bc4lLHCAtkPR6+Pw7bHdIGoXWB7GdMX2OXXtHkVS6w5WWie
|
||||
XGtms0VvnMN33d/0BT2uV/xhsykSbLz4v4D8ATko6xzt+1ySAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="resizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAH3SURBVDhPrZJfSFNxFMf3rBk+iIH2oOCTIAlZSGCQPqgIqQ/5tHQpPiikBpIpCnuxYkWCokQg
|
||||
qDcoNYZETZAhbII0dh92DdPNvJuj4f7epWa2vOvrzg/u8uqQkA4cztPn8/uee4/mv5RxgQfN2Xkbm9zc
|
||||
EpujUyY2+w0TbJ5ZBL/9sAyCx2cWMcqZYHj5Dv3PJsF/FjE8aUZrH4eWXg7Njzjoeqb+ShU4/iee7MO4
|
||||
jIB0gPsDI9B2PIYkScmORCK4Vt2iTkUvH4djhzI2fbsJeBC88EUl8Hg8aoESW1bg3zKiP2JY2/qO27pe
|
||||
VGu7k3A4HIbL5TqdYIybZ/DPXzLCuwcQt/exIkZR0dAF3rHKYhMcDAbhcDjUAoKfvzJC2ovhayL2+tYO
|
||||
hM0o+PUIbta349adDgYGAgH4/X7Y7fbTCfQvOHTqx9DY9QS19/oSL3eirK4NlwrKMD1nZqDX62UpLBaL
|
||||
WqAfeo3VjW9oevAUn/gV1Nx9iGW7wCQEp2cXsSmKIhOkTNBjMLI9lV1DoVAysvG9GWlZheCmPyIzrzy1
|
||||
gI6EvrIiIQHt7fP54Ha78WbWhAvZV5CRW5paQBd2/Fed7Mz8CmTkXMfFyzdSC+g86WU6EqfTCUEQYLPZ
|
||||
YLVaGXCyr1bq1AK6bbL+SxeXa1FS1awWnK80miNVQhp+0k4xYAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="showActorNamesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAGOSURBVDhPY/j//z9FGKsgKRirIAiHFm92CyjctB+bHDLGKgjCGa37/gcWbvzftvBaCDZ5GMYq
|
||||
6Je/XtQ3d81/35x1/23j5r7FpgaGsQq6Zaya7Zi8fLZFzML/xgH9QNznj00dCGMVdExa9sUqdqGoWdi0
|
||||
00b+ff8N/LpvYFMHwhgCrmlLE+1iF54AsU3DZ7mZhE79r+fT+U/Pp8MFXS0IYwg4Ji68ahk1WwvGNw6d
|
||||
/ApowH9dz9ZdyOpgGIXjEDdX2Sp61n/DgP4Let7tVw38+67q+fV+0fFs/a9knfNX0SpLBVk9CKNwbGNm
|
||||
bwT6e5+6fZGJik2ulaZThZWmW6OWpmvDfxWbApAhG5HVgzCcYRczg9s4ZNoXTecKUWQFIKzuWDEFaPt/
|
||||
BYsMjCgFExbh06SMgiZt13St+eoQUvoSWYGyXUmEvFnSf2WgC1RsC/4rWqR/UDBL44bJgwl9v25RoGYt
|
||||
JatMLXmTBHgAgrCSTYGoLFBMUjtQS1zTV0tSJ0hL1jgB1QBKMFZB4vF/BgBJP5kepjxMJgAAAABJRU5E
|
||||
rkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="showGridToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAFYSURBVDhPY6AqyJt9/z+UyZA1/TacHd93Cc4OaTwJZ2MAZAPSJt+Es2M6z8PZAbVHMQ0AaQTh
|
||||
7Bn3/mcAbU6fcuN/ysSr/xOBNsd2nfsf0Xr6P8hmkGafyoP/PUr3/ncp3I5pUNZUhLNBmqFMhpDm43C2
|
||||
R+luTI0wALIZykRxdmDtETjbpXAnpgEgZ2cgORukOaId5OzjQGcfBjvbDeTsgu3/7XK3/rfJ3PjfMm0d
|
||||
pkEozgZqhjJRnA3SDGViAlCAQZnA0D4MZzshOdsifS2mAfE9VyDOBoc2wtkgm0F+dsje+t86c9N/89R1
|
||||
/02TVv03jF/x3yB6KaZByKEN8jOUieJskGYoExMEITkbObSRA0wvBpvNcGfvBycSkJ8doKFtDtRskrQa
|
||||
7Gy96GX/daIW/9eKWAjGUO0IgBLa2QhnG8Uvh7OxaoQBZGdbpCJCG9nZeA0gHTAwAACOffGU2o3WzAAA
|
||||
AABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="showRulerToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAEiSURBVDhPvVO7TgJBFN2fovAHNDb+gLGywsbCxoTOxF/wgaLGRPGJNUEeglBaaKExWhF8E1kh
|
||||
Cwsyxzl3d83Gip3Ck5zMvTtzz97cOWPtnFVBbmcusXVaEaZOytg8vsDGUUmYPCxi/aCAtXReuLp/jpW9
|
||||
HCyCxWHML6X8yEP/G2i7wEcHqH8C96/AdQOITc56AvxzAMdxMD696GfAYAgeQlMXN1rAw5uX5+9CAmyZ
|
||||
YDE5NhWXnAffW11Zb1+GstYeve/ZvwILy7uYmEno4jnZGJUiwIGF8bsxKjjtADqNLsBrCmDbjrmADs06
|
||||
oEmUUuj19T033egCdJg7UPjqGc6A1gycdvOkzAToNB2adcCH8WwDV3WI0yIL8FWxKEx/6z9gWT/PHGlW
|
||||
lc2EywAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="fixOpenAreasToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAE/SURBVDhPY0ACokCsBaVhAJsYVsBvbGzsD6T/Q2l+HGI4gTwQ/wcBEA3lYxMDGQKjUQAxLpDH
|
||||
ogYFIJsOY8MwjI/uIjAABRBMEQjg8jt2cSAnC00Qp01AAJOHGQoG6IpxugCIMTRjcwEIoCvGZSgYoIcB
|
||||
NiBv6q79v3Rmwv+0Pv//EU32Xzwr9GqgcnCAbisIgMViGzz6G1cn/t9yZer/C892/e/fnfU/vF/3v3m2
|
||||
ZA9EGVAhFifCxWLanH9uvDzh/8Zrk8Dh1bMn9X//nnSQAd+B8mAAshksCaKhfLiYT7Xh/21X5oDZMLDp
|
||||
0lSQASC1YIDXBRbZ0j+7dyX9b9+VANbcvjMB7AKzLIkfQHk4wBkGJqni3cE9Gv97d6WAbQbRIL5xivhU
|
||||
iDIiANC5HUD8CeRsoM1fjJPFJzEwMDAAAD8wxIeEhxEyAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="setupDefaultPlayersMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAD0SURBVDhPY0AD/9FoogEuDaQZdCzROe5YsvOJwwnODw7EO1S7KomLQaXwArAtIM33WrNef1ra
|
||||
/f9NT/7/U/H2X9f6mXeCVRDjEpDNIM0/N876/3FS8f9byTb/Fzhp34ZK4wVg00HOBtkM0vyiKvT/1WDN
|
||||
/z3G8q/AKohxAcjPIGeDbAZpXmch9mteYfb/Gct2EhWQ/0EBBvIzyNkgm8t8A/9X10/6DwLEGoICXCKK
|
||||
/vfP2fr/2p1nJBkCUwSmHUMLwIZcv/ucJENQAMyQG3coMMQprBBsyO17T8k3xNgj+b9rZBF1DAFhqBDp
|
||||
AGQIlEkNwMAAAP7JtzLCVbRNAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="copySelectionToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAJVSURBVDhPpZPdS5NhGMZ3LKJ/gzsrHg3sIFsm5A46cC3ImmnWOy0/lrMtpdbct5tbH5Op6eZH
|
||||
6lrvtOYqTTdxrUyCTgoKlSwiAjHICAOro7VdPe+7aRSyhC64eeDhvn73/b4Xj+BvRcc8WRPDphKnUYG2
|
||||
iwxam07AY6sqsTVXZKVa0itypyeHQrD63LhZ1MxVTqolvSZZF5ke7dwKQFIt6RUYvJLD9tm3AmxvA2rO
|
||||
uO+1iv0ey6a52yIX0zMj1fJvsb02srEFB7Coy7a3/obYXjsPSLzVQlt3GNp6aXrAk4nBzEf3+oWRQA8J
|
||||
+ztIcOiq1N/rQGKpCecZMTrN9VK2x0R8XQbi7dAJh10tmSmrQPD4bl/2s7CXmR0fBI0Q4ZEOTPraMe67
|
||||
huCAA4EbbRj1tIJ1m0EBoADc6tIzbrs6CaFTc7ncvy3PAGtzfCW+zCL+OYqfn2YQ+xhCfDWyeb8yH8B1
|
||||
ayOc+hohD5hiXYVc7rx5qRnxhUboa/OhO50HrXwnWqoJjA17EV9UIfayHu8eHIW+4QgMytLkfxkbsBfe
|
||||
9lgRW5nC+sMSrE0dwPe5UhgUeyhoN3RnduHHUxnWoxJ8DRXjVX8+lBVFUJ0sTgL8bksul/nyCx/mhwqw
|
||||
eHM/PkSq8H66EsrjO/AmKMHrETEWvCLeHGrLg0ImwtmyfclP8HWbsv1uU3W7vg4ODcOXjT4gmj2/qqb2
|
||||
EJrkB3GuspifzJnV5QWM4pjodxKdZmWmU1cjvHypitgvnCIUQMwqGaEAoqmREAogFEAayosIN/kP8/9J
|
||||
IPgFAlSB3U6URz4AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripLabel1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAI3SURBVDhPpVBtT1JxHPUz9GHatDSlWfbIxEkCAQJe
|
||||
DJUIKEBEx4OkIiiKPC10QS7XyrU2KRFQUKcBEup06hfoVc1euLVe6OnvbVdN75vWi/O7+5+dh91TBuC/
|
||||
wEraS6Yta/EZuvP6I/Pqkxk2DYMLhL1kvGQvmjC1F0FsNwTDsvrbec1ZsJKWnO4gthtEcNMDXUY1z6Zh
|
||||
QB/HeidsXwzoKTxFV04L04rmKLoTxPi2D49T1I+2Wfn31rh0X/FBtM8aYCXm13svMLkbRmwnhOhOABPb
|
||||
fkS2fAhtDMO/7sZYyQXJ9AMiZwnoLujxipiPW/sKnTAuqaBfpKDNtpBvK7QZJQkYhPBNA5GzBJClYVxW
|
||||
w5mz0K26LAVNRo6OeSlUaTGUSSG8pX6o40rwondxf7wOt8O1xHpuRE1aifCmF+qFZrSlJXiUEqElKYBs
|
||||
jg/NAoXBNQcG8nb05624Eai5GNCeUCCw4YEq9adVMdeE5kQjxJ94aE/LidEG5+ce9BJwRqtOA8jSIEvD
|
||||
nNHBR/61JdlEt0pnGyD6WA9BnIs+0ip/9xC1Y9W/OCOVuDZUcRpwbPYT4yhZWpdVYaj4HO61XrgKDrpV
|
||||
mRTTrcRMm86CPtSMBCNkJFmCD0/RiY44RY/FnbgFxbQYjlULbCtdqPFeJXKWANl74UnrQN5BmxnBzQCH
|
||||
mM2wLBlQ6Sk/4RnQR/yWD8EUD42TXNS/vIN7kbqfjOD6aNVh9fCVw0p3+UGF6/JXhmfw1+PfgbLfYY/G
|
||||
d6iLJ+UAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="openRAWebsiteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAANqSURBVDhPXZJvTNR1AIdv03KuXL2pteV8QbnVVmuU
|
||||
xESolRtJG5GxZJIgaN75h0MZZOMMwoOSIPRohAiecnceIGjHcdyheHfA8efAu+Pu4OD412FIBhThKMxJ
|
||||
29PvWJr24nn3fZ7fvt/fRwQ8QnpXapRAvcCkwJ8CdwVmBZqktpRt/z//sLha4EJQuPaTFudcK9Yb3TSP
|
||||
ddPot3DJX8MBa9KyuDXRtMeU8OQjAUF6TKBLPfItM0suxuZ9DM73o5t0YwwMo/b5UHn6qfd0Udp3giRd
|
||||
vHdnfdxTDwe01f4TBBbbGV60M7QwhHvWQ834EA2BCRSucYp7/Zzs6EM3ZKHULiNe875pJSDIkQL3pv5o
|
||||
p3nByKXbRlrmO2i56ePsyCjfD44hNbqQGuwUOIxUTpbh+kVHbFX03zHl78YFA5eNgQqcvxqpXdBz8fc+
|
||||
+ua8lLiHKHaMIm52ITGbyRiuJDMgJ2NChsZTyoXeQraeiroaDEwN/GZAPVVFyZxS+LoP+5yH9KtuxHon
|
||||
n/U5kIwfJXZUTKx/H0mDaeRey8Q2ruWtws23goGlidtW8keOIx3/nMqf26iddJJUd500i43isSukjNSw
|
||||
vzaSfedD+dC8k7SGvfRPN7FZHnZHJO1MufPjgpUcbyZpXgXnbphJrrWT3DhI/Jke0s09yLw6PlVv4bgh
|
||||
kYSKl5BoEum/qScsN/Qv0cG25Gn3bCMKXz5FE23IHZ3sUDs5rI1CqolAogojVRnKF7qPqXeUktUQR/Sp
|
||||
5zCPqHhd9tqMSBhGk87/Hc2Bao70FJDnqWOXtptDmnAa+8u57CpbEescChTmLFT2IvZrowkvXBsMtIlS
|
||||
m3dEC8NYHpwzkmU+QIYlHanJyl7hvkH5ZOthvrlyiK9MYvIMqciNEips+eyqjmTjl6LllSEl1H2gL2k/
|
||||
isF/hrz2bHJtZj6pepmL1xVoe0tQ9RRxrrtQiBzktE2OWLuNF3IeX3o+W7R2JfCRKmadMAzv1y1HsM/8
|
||||
QPVAO9tPhxBTul7418+ypfhpks9HUN6Rxx5NNCE5a+6+Intxw4MpB3mv7J11wjBMbxdFLCu7q1DaDJzt
|
||||
sKDstKIfaGRT4RPsVm0l5NiaxVdlG9ff9x4E7hNR8Ob28Lw3WjblhE4Lj7T0L7dCclbd23BsFc9ki1b/
|
||||
dx7RPxe0rmcJTZoRAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="openRAResourcesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAI6SURBVDhPfZFtSFNRHMb3TQj61pe+VIJ9mPMGldcGyYJe1I2I1qbN6HVL2EJrKGzRmsWkJGaQ
|
||||
RK8Mnc7MuVywNNmLLpNi0YtIm4X2NspkaC5LW7q1p3svbEzv1R88PJzDOT/+nMNzPX2PpXH2B2F3D6Ht
|
||||
0Qs6ZgC85cIIlsPieIICyckVJbyH/hDV3Nxoc8PzLJiSNFBbbIHDO0w1MPYlguevx+DyDTFrmuutvczl
|
||||
VCjYgvuPX1HNTTzxj5GkRBRsgc0VoHrxBNauQVxr7sVcbAGRH3OMgBSr6GNsQZNzkGo28wsJTM/EEJ6Y
|
||||
WVlw195PNfcE3ydnMRqexm1/Nyq8Rsg7L0Fm8kFZ2wJhuXE1I7h5z8MIMon9jWMy+gefx39Ca7PBMHoG
|
||||
jmgHYslZnHhzHLvMduQp6lu2yg1ZPHo8Gq4JrN4RlPaUw/DtGNp/taLntx+HOz9hj3UE2ZYK5FRpC9MC
|
||||
mmQymX64D1+jUF4NQHReglJPMdRhGY4+CGJn4wQEPj3WuqRYp1N3LxJkPlzo4xTISg/233kHUa0U+wIl
|
||||
KGp+i8LL48htUmNNxwFsqNEk0gK6l6ZY78aO+jh2N4RQ5CyBsF2DbYYIyHM+5JiV2Hha42cE9BdxJV9u
|
||||
BFk9DGHdFLbbykCa9NhSHQShHIBAZQJxqErE+tfMCBRX1m8+cutlvnYApO4UCnRdIFRe8BUW8MW6s4RE
|
||||
u4rzYmZyZXXZRNnFxk0HLwTzpMZ5/l5dn0BSIyXElVkAeP8B187ybforr3QAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="wikiDocumentationToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ4SURBVDhPpZN9SFNRGMZvBAVFUUFCQlEUUZBCnQoF
|
||||
+6CMUiwNhUap2ebEr8BKlJKZqGEl1tRELaggNrGJZraKLaOv3TWnEU3ZAnOI5JhzG24T3Bg83XPiDqIJ
|
||||
QX889+Oc9/2d533vezkA/yV2yX9gIqKkHTw53/aRZLe8I2JQxo0BklbTS45XdZMjFU/IgbKHJKGkg+2L
|
||||
yajttaCm5ysU3V9QpTaj/DGPzFuv4tLrn8cVt+lRfO81CpQvIG3sQ26DBnvyW5BY2kk4WScP2f3PCIVC
|
||||
ES0sLKCf/45Tdf3TqdU9032frAgGg39oV04jEorawQB57QaWODIygqGhIfA8D5/Ph2+2H7D/dCEcDmN4
|
||||
eBgmkwmDg4MMsP1MPYis+Tcgu/U9A9Akr9eLmZkZjI2NQavVwm63Y35+HnNzc5idncXExAQDbM5QIC73
|
||||
NjihaZDcecMA9BTqwGAwYHR0FF1dXbDZbAxgNpthNBqh1+tZibGpldghqQeX1/aBNosB6ClutxtOp5MB
|
||||
1Gp1BECduVwujI+PM8D65EvYmnkdXHbzW9osZkuskzqwWCwRQCAQiPRGp9MxwJqDJdh08ho4SZMOKQoN
|
||||
A4gOHA4HA6hUKlitVgbweDysN6KDlYkFiD1RDi7r5kscrVQxgCgaQGFTU1Pw+/3sXVyn5dH78n1SxCSX
|
||||
gUuvewZhsiBMFoi8FfF5Tdh5tgHbsmpRrtTgyt2niDl2GWsPX8SqpCKsSJBj2d4LWLo7F+sOlYJLrdYg
|
||||
p3EgqracVmBj2tWoe1SrkwrBCbO9qIPEwlbslysXdbAk/tzff5coAfBoQ0rFpPC5JoVnXbQYqqiL/y5w
|
||||
vwBd8t4lLDBzngAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="discussionForumsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDhPjZCxT1NRFMa7kpA4sRkSBxIGF535N0hY
|
||||
hEH+Ao27LDDQkHTWRZk0QCIMIuYShjIZSghLIUVMrS3tq21fW1773rMef+e2j4TyGhx+ee+ee77v3PMl
|
||||
5lZ2p2ENPo3gAzyHSRFJDKMGqf2Tgml6gXEjrvs0oNzwzGY6Z+h7PcpgW8V1mmvtwPxuBcZp+cZp+qbs
|
||||
dm09X2mpwfuRBjpVxZWB6KrRNcV6xxRqHXu+z2Cn2QlMlcnaXEJ8cFr89vJNujaf/BougH7p86E+oADL
|
||||
MK0GG1WEftizYp386u1hg1yE1YTX9bnuQy5CLkIugnZTDRaTGxmTyVVM8Kdneba6F6qY/YXVhFyEXIRc
|
||||
hFfaOmupwbndg58Z+KiJfznK676hTlUxuVgRuQivE3Kx51sGA5N3exkr3oUWuQi52GZWuxHnq56U+P9V
|
||||
bavBZSQegx34DFNwRS7SDXu3xPqKCnXykh/lphpkI4MJWIJHg/PK2taxnHx3hEwsavbTactFyZX1/ayK
|
||||
PXhxs8IwXM6C63q+kIsK/kIOTiEFD7QvVhxB0xm5qLgLT+J67hQiEIyDCx14GtejxBYVRA9hCx7H3UfE
|
||||
Fv8fSfwDwZ8JlGSjAbkAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="sourceCodeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAF+SURBVDhPrZDLSkJRGIWPiagPVO9QbxE1aWqjgkZNwmpQ
|
||||
3lIkSI0wzcCo0MiiC6RdLFSQog5aKOaFtMQ0deX+PaJZBx204OfsffZaH2tv7t/kPonir3H5wrB7grDt
|
||||
+NnMC/bfYuZuyVfk4NM8rc2OYwyNjItDto8iZGRSGpXgMzw4LUdrJp3NA+95uAVZEGJtOQ7uyBjPxSHR
|
||||
SiAzyMAZOfifAvRfY9mncGuEWFsbe1dkVBgVkOqleC2kCcTWTF/VGkFaICHWltV9QcZaHRQa0A0QoFPF
|
||||
UoUAg8Nj4gDWQKKTwHntIghTvV6ncCpbFAesuk7JzMTufxO7FXZAuVJFLl9CLJkXB5jsPsH+U9XGnQrF
|
||||
MhLpD9zHcuIA/bqXAuZNHzRru5gzODGzaIFq1oSJ6SWMTqoRekiLA9hBt9jLv71/4jlVQJTP4jKS7A1g
|
||||
DZapwVajgbXZYKrRQKXGWfClvwbs0TofLvKYgT+UwGEg1hvAvr1GFMAO+p1miuO+Ab7ZFVkV6pPjAAAA
|
||||
AElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="issueTrackerToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALnSURBVDhPdZDrL1txGMf3D+z13oqOUavSlp621Gq2
|
||||
F7NiLhuZ2yRkExLDlNnMvSN0iE3EMKZza11Kx2hdasssWUhGsmwum5Bt6jI2jiLx3TlEU5u9+Jzf8+T3
|
||||
+36f831OAPgvHj1CeHQLJHTt3sb3d1O5bv395kgj6RcxLHuxhoB7O18Tq/CxFjW7RAtf8H5Z3tMcac7R
|
||||
E7WC5MPeTc03iVpcV2IeXFT65Qu3hNXcveDbogJLjbmgEXcRa+6dhImu3VXEurDJBQIlD4I6HjIMiTDM
|
||||
tyO1KALSaM6dQ80RAyqnxK3VFeJmYs1bdQHqyRr0fmyAYiQPrEd2iOjxRctoBZyLz8KpwAGOeUxqaiex
|
||||
TuU0Z6dy7nkoBWgaK0Huqyika4KRoomEuIIAq8AeUQ3X4OVnO3X4ns65Q+WEsNGlXqwkjFfVflC+L0am
|
||||
NhxJal+EPfdEfmcQJoZuoWqwEI459hCF2LSbDeiPoIH3lqjjgqjhQjVejozuUCSqfBBWJ0F4oy8+9Edi
|
||||
ZaoV+r44sDKYYKbZbtin2MSbDWiIp1xTSLM/inTxSGiRIrTWE4H1l9HbH48lag+7G9OY6AiCTzYbdkmn
|
||||
984kMGAbZ30gpuE/5mzeVEehdECGsGdeCKj1RmV3IsbbrsC01A3TNwVWZ7SofSKGNNXhFK1hxFjdMxsI
|
||||
y1zknCIWsrUyBNZIUdyVhrZGKZY/qWCaz4bhIRc7KyqM15zfG6uSBBzqzAY0XDl7mJFsheqhclSqovBF
|
||||
n45tYz3I6RswyJ2xNSfD2uxL6EqIxXelxMl/DGgc05nDnLsO0NVewk9qcVtfk7H5OfiAqTAqSgnmhsvQ
|
||||
kcsuOdaAJkvOHZ0zKLD9o2J/+ubUdSoCZ/8kZ2NBfu+EIYe1OJzlwDzWgPq9BXJ5BturepiM1A6MrRao
|
||||
sft7EgujDRhIt2091uBNIWf5tdyJHMljk9Qksj+Tib4MewzetyMpEalPsyH1MgapS7Ee+QMga508U1fU
|
||||
1wAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="developerBountiesToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ8SURBVDhPhZLLT1NBGMW70K2JS7cmxrjU+A9oIGIg
|
||||
FGhEUYkYRYIYaiyCUPqgD2p42hb6BkqLoKUWegt9UKm0JQrSGjdaQErRmLhzY4pE0OPcIRBKfSzO5M7M
|
||||
/Z3vzDfDAfBftUdb06oZ2aE/7WUt7FdbRJE2x3VQhqQQBxqzTDIm+/UwLE+b4j3wffLAsKBFs68Bdczd
|
||||
DJMMYK9I5LQxxsIMHCt2eNfGoXnZAYG7FjWjt3ZNskBWrS9a0oaYFr6Pbjz9YIdt0YyGCQEmUmPoiKpQ
|
||||
7ajE9aFyapIFK0OStH5BAy+B26JKKMNSWBNGDCQMeLw0ACblREtQhKvWS+tZBvJp8brutZrEdSP5bQkb
|
||||
W98x8nYIihnxNrzqhDQoxOWB0s0dhg7a+a5jsueiH73zj+hZ2yJKCusjvUh9TUIVkcG9OgrJlJCtjPLB
|
||||
Mly08A5QA+18p0hGIvXMdVP4ybKNxJbQyiws90u34UATWxlzX2bR7H+AEmOhghqwkbRzXZgkDRpZHqRn
|
||||
7X+vh5zEVoVlGE+OQhRoRJXrBoVnP4cRWguAZ+LivCb3MEcxLbESwfJGD0/qGeo8fPS908G+2EdgB61W
|
||||
P3WPwFFMLjOo9VdvlPWXIk+dK8jpPnOKowhJjrAp2EeiX1DTuLaEZRsma5XOCjCLLqhn21GkLwgU9OSp
|
||||
89Q5RzOa2OS9b7bGLRAwfGhedWJsxQGhtx4XzMUQEhOeqSjJ1eWfzdeeO7EDZhjUMfzjLcHmreCqD3ec
|
||||
VSCGKDYU/iKd9vOM3Kb90F7RodZ1+yB5XWOVwxU/+a4aNupmqaXkNOn0btS/affj5nDFyWu2KzFyVfl7
|
||||
f/i3wPkNOLzMGxqYvkUAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="aboutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJnSURBVDhPbZLtS1NxFMfvf9F/EARBEEFEQdCrXgRGvTMM
|
||||
ClN8URBYkaDUC31RCCZFkj3YnGhmpuh0s+FS51Nr6iLnfMB0W27uSe/udrfr7vp0vdtQs8+Ly+X7Pef8
|
||||
Ducc4V98YYXhHyJ9DoneaYnu8Qg2Z4DNaIJ8yGH+AGNuEeNoBPuKzFJAYS2kshqQ+er0Yuibo2NgFjm9
|
||||
c7BIVss0O2N0TkZQtSIFtpMqW8mM/i8m0rQPOKlu7EeUUnsFHIvbNPZ59aACgajMmduTnCr7Qjgm5VV4
|
||||
0zVGbZOZ1G4HybTKq/4Vrb2tvJ1jJ5Ol1jBPbYuLtJJ7PUeasmoDo45lhG/uEPWt3/PGHhshmbnlMP5w
|
||||
PK9oBRVF+6aw2Bzce9qN0GNb4vkHR87dx+eRX5wosVBUadUmnWtbzaioaQmPe5HSqvcIQ1PrvPw4o5v7
|
||||
cXiCnC4e5fzNQXzhmK5lsyqppIh/bZXymlYEu2uDeqNDM3aXtcfcSohz16xcLDcR3BJ1LaOqSGIEj2eB
|
||||
Gw9bEJa9UeqaR/QB7ce9HuXsFQuXSk1IiqxrcUlCjm9ittq5VW1E2E1q6pzCYl/UAwpM/Axx5GQnRy+0
|
||||
4YvmhhYNbyKLfipq3vG6azy36xXt9UcvLIjJlB60S9ugh2NFbRy/bOCTdUGbltZ6Kkh79xDXH7QQ207u
|
||||
HcqUa50nzWb8waCWukNWkUgoMRKJCFI0iBL302sa5uqdJmbmvYfvfNbto6qhh5qGLqadLlLSb7Yja9hG
|
||||
J7hfZ+RuXScz7v8kFghpO+0wOah43E5x5VtKtBarn/UyPOU5eNOCIPwFCBKiGq2sGKsAAAAASUVORK5C
|
||||
YII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>313, 17</value>
|
||||
</metadata>
|
||||
<data name="cashToolStripStatusLabel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALSSURBVDhPjVLbS5NxGN4/sLm5ZeqWJdlNJ7oIoQPR
|
||||
hWBEIF4VGYUUUSBk0kUidCdTA0UMdBKGkugssxKdeMDcbHn43FjzgGtuNs+HuX07fPu+be7pLdnF1Isu
|
||||
Hvi9vO/ved73fV4RgAMQLMezeHPGcsiUEeUYFYITKj4wpjQFjMq8/bUJQRwhc4Y/stYCcFYg8ANgBxDZ
|
||||
aIHPkG7fX5sQxPFXFaFZwDMIbH0AVhux626DdziV0om1CUEcgXEVdr39iG12IEbKkYVSRJxlcA8cpXRi
|
||||
bUIQh9+oRNilRnDyOvyjF8H2nwI3dQ9buv8kYA1piJJyeP4phJ/5CI1fQ5C5i/XuI5ROrBXxpgxJiDm2
|
||||
zE0oo8ExJQLf03mfPh28vZT2dxX+4Qvw9pyEMFeElS7FQQJuUlUR/l0L8E5a3BxtnUF4Qwuv/jSE2Ufg
|
||||
zbfAGa/Q+wlcHYcQkL+IhWz00UJ2GYAdHWK+4X/z+kcvwzdwDp7PJ6ibfDhbkw8SsKNEEDQj5jUg5hlC
|
||||
lPyPrmuwRvMK1vvgmRsI6rPBWwthbz6EwPMtDRGyi7e9BDddiOBUDvhfj7HcqYBvJBus7gx8X9IR0CnB
|
||||
divg7ZLD/VHOb7bLTOutsjzR9kAqoqQcWdIg7KyEMP+CyB5isV1ODhSQAzlge1LoLvQ0polgpE77wC1W
|
||||
wtUktYs2dJRkhxGij5ylgLzPQXS1GvaWZJo7F2zveeyQ6t5lDu1d5to7GvkT7A1JEK1+TdEGFqrpUxPC
|
||||
jnKEF8rgsxbBqc0CaymE4CjBdu9ZBG2vENvpQWyrjbqtAWu+g9laiVbk6lQUuycfUEtVEJYqELA9w+pI
|
||||
LmY00sHpeiljrUsS5jVS17bhJpGUIOR4Dr/1Nlb6LsFSJS4WOdrlmfb3crWtWcbMNcmEmUYZY62Xqi1v
|
||||
pJnxTTveSjNtDUnquToJM10jESyvxYypUqxmysWZfwCSxP6Dn1PvvAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripStatusLabelMousePosition.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAFNSURBVDhPxZDNSgJhGIW9hSCCbqRFl2B0CUKLoJWLQFoGCUKbVkURFlTQj9li6MckE81FgUqk
|
||||
iUhWlP0Yk43ZjOOYzpzGz28ammwUNz1wePngPec7vBYDoLNr/iegYdLUwPheaTN/oJm6hgTsRjK4eeS+
|
||||
lc0VkLx6xszyHjdin3T19vX3kO0WkAAmnIYRoSxhcTOAcedCyTE1N022/8IbSFCbDl+uwOFawoB1lIiu
|
||||
/oIcZuMgRm06igLcPrBwe4IYsk2Y32qVOaU2nVpNBleqwB9JwmoSQBq4vWFqayKr3/NiFU8sj/3QhWkA
|
||||
YX79iFqbSNU62KKI61wRzPF5+waza4fUCtRlGe+8hPt8CZfZV+z44+0baAGKWl2UPvFSEJC5e0M0lceW
|
||||
euCOGnwIIiLRNIJnKfhOEqS6xxeDezvUWQOb3UkWW2lweIwGWCxff/dVb00F4NUAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>45</value>
|
||||
</metadata>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Editor
|
||||
public class LegacyMapImporter
|
||||
{
|
||||
// Mapping from ra overlay index to type string
|
||||
static string[] raOverlayNames =
|
||||
static string[] redAlertOverlayNames =
|
||||
{
|
||||
"sbag", "cycl", "brik", "fenc", "wood",
|
||||
"gold01", "gold02", "gold03", "gold04",
|
||||
@@ -34,73 +34,77 @@ namespace OpenRA.Editor
|
||||
|
||||
static Dictionary<string, Pair<byte, byte>> overlayResourceMapping = new Dictionary<string, Pair<byte, byte>>()
|
||||
{
|
||||
// RA Gems, Gold
|
||||
{ "gold01", new Pair<byte,byte>(1,0) },
|
||||
{ "gold02", new Pair<byte,byte>(1,1) },
|
||||
{ "gold03", new Pair<byte,byte>(1,2) },
|
||||
{ "gold04", new Pair<byte,byte>(1,3) },
|
||||
// RA Gold & Gems
|
||||
{ "gold01", new Pair<byte, byte>(1, 0) },
|
||||
{ "gold02", new Pair<byte, byte>(1, 1) },
|
||||
{ "gold03", new Pair<byte, byte>(1, 2) },
|
||||
{ "gold04", new Pair<byte, byte>(1, 3) },
|
||||
{ "gem01", new Pair<byte, byte>(2, 0) },
|
||||
{ "gem02", new Pair<byte, byte>(2, 1) },
|
||||
{ "gem03", new Pair<byte, byte>(2, 2) },
|
||||
{ "gem04", new Pair<byte, byte>(2, 3) },
|
||||
|
||||
{ "gem01", new Pair<byte,byte>(2,0) },
|
||||
{ "gem02", new Pair<byte,byte>(2,1) },
|
||||
{ "gem03", new Pair<byte,byte>(2,2) },
|
||||
{ "gem04", new Pair<byte,byte>(2,3) },
|
||||
|
||||
// cnc tiberium
|
||||
{ "ti1", new Pair<byte,byte>(1,0) },
|
||||
{ "ti2", new Pair<byte,byte>(1,1) },
|
||||
{ "ti3", new Pair<byte,byte>(1,2) },
|
||||
{ "ti4", new Pair<byte,byte>(1,3) },
|
||||
{ "ti5", new Pair<byte,byte>(1,4) },
|
||||
{ "ti6", new Pair<byte,byte>(1,5) },
|
||||
{ "ti7", new Pair<byte,byte>(1,6) },
|
||||
{ "ti8", new Pair<byte,byte>(1,7) },
|
||||
{ "ti9", new Pair<byte,byte>(1,8) },
|
||||
{ "ti10", new Pair<byte,byte>(1,9) },
|
||||
{ "ti11", new Pair<byte,byte>(1,10) },
|
||||
{ "ti12", new Pair<byte,byte>(1,11) },
|
||||
// CnC Tiberium
|
||||
{ "ti1", new Pair<byte, byte>(1, 0) },
|
||||
{ "ti2", new Pair<byte, byte>(1, 1) },
|
||||
{ "ti3", new Pair<byte, byte>(1, 2) },
|
||||
{ "ti4", new Pair<byte, byte>(1, 3) },
|
||||
{ "ti5", new Pair<byte, byte>(1, 4) },
|
||||
{ "ti6", new Pair<byte, byte>(1, 5) },
|
||||
{ "ti7", new Pair<byte, byte>(1, 6) },
|
||||
{ "ti8", new Pair<byte, byte>(1, 7) },
|
||||
{ "ti9", new Pair<byte, byte>(1, 8) },
|
||||
{ "ti10", new Pair<byte, byte>(1, 9) },
|
||||
{ "ti11", new Pair<byte, byte>(1, 10) },
|
||||
{ "ti12", new Pair<byte, byte>(1, 11) },
|
||||
};
|
||||
|
||||
static Dictionary<string, string> overlayActorMapping = new Dictionary<string, string>() {
|
||||
// Fences
|
||||
{"sbag","sbag"},
|
||||
{"cycl","cycl"},
|
||||
{"brik","brik"},
|
||||
{"fenc","fenc"},
|
||||
{"wood","wood"},
|
||||
{ "sbag", "sbag" },
|
||||
{ "cycl", "cycl" },
|
||||
{ "brik", "brik" },
|
||||
{ "fenc", "fenc" },
|
||||
{ "wood", "wood" },
|
||||
|
||||
// Fields
|
||||
{"v12","v12"},
|
||||
{"v13","v13"},
|
||||
{"v14","v14"},
|
||||
{"v15","v15"},
|
||||
{"v16","v16"},
|
||||
{"v17","v17"},
|
||||
{"v18","v18"},
|
||||
{ "v12", "v12" },
|
||||
{ "v13", "v13" },
|
||||
{ "v14", "v14" },
|
||||
{ "v15", "v15" },
|
||||
{ "v16", "v16" },
|
||||
{ "v17", "v17" },
|
||||
{ "v18", "v18" },
|
||||
|
||||
// Crates
|
||||
// {"wcrate","crate"},
|
||||
// {"scrate","crate"},
|
||||
// { "wcrate", "crate" },
|
||||
// { "scrate", "crate" },
|
||||
};
|
||||
|
||||
// todo: fix this -- will have bitrotted pretty badly.
|
||||
static Dictionary<string,Pair<Color,Color>> namedColorMapping = new Dictionary<string, Pair<Color, Color>>()
|
||||
// TODO: fix this -- will have bitrotted pretty badly.
|
||||
static Dictionary<string, HSLColor> namedColorMapping = new Dictionary<string, HSLColor>()
|
||||
{
|
||||
{"gold",Pair.New(Color.FromArgb(246,214,121),Color.FromArgb(40,32,8))},
|
||||
{"blue",Pair.New(Color.FromArgb(226,230,246),Color.FromArgb(8,20,52))},
|
||||
{"red",Pair.New(Color.FromArgb(255,20,0),Color.FromArgb(56,0,0))},
|
||||
{"neutral",Pair.New(Color.FromArgb(238,238,238),Color.FromArgb(44,28,24))},
|
||||
{"orange",Pair.New(Color.FromArgb(255,230,149),Color.FromArgb(56,0,0))},
|
||||
{"teal",Pair.New(Color.FromArgb(93,194,165),Color.FromArgb(0,32,32))},
|
||||
{"salmon",Pair.New(Color.FromArgb(210,153,125),Color.FromArgb(56,0,0))},
|
||||
{"green",Pair.New(Color.FromArgb(160,240,140),Color.FromArgb(20,20,20))},
|
||||
{"white",Pair.New(Color.FromArgb(255,255,255),Color.FromArgb(75,75,75))},
|
||||
{"black",Pair.New(Color.FromArgb(80,80,80),Color.FromArgb(5,5,5))},
|
||||
{ "gold", HSLColor.FromRGB(246, 214, 121) },
|
||||
{ "blue", HSLColor.FromRGB(226, 230, 246) },
|
||||
{ "red", HSLColor.FromRGB(255, 20, 0) },
|
||||
{ "neutral", HSLColor.FromRGB(238, 238, 238) },
|
||||
{ "orange", HSLColor.FromRGB(255, 230, 149) },
|
||||
{ "teal", HSLColor.FromRGB(93, 194, 165) },
|
||||
{ "salmon", HSLColor.FromRGB(210, 153, 125) },
|
||||
{ "green", HSLColor.FromRGB(160, 240, 140) },
|
||||
{ "white", HSLColor.FromRGB(255, 255, 255) },
|
||||
{ "black", HSLColor.FromRGB(80, 80, 80) },
|
||||
};
|
||||
|
||||
int MapSize;
|
||||
int ActorCount = 0;
|
||||
Map Map = new Map();
|
||||
List<string> Players = new List<string>();
|
||||
static string Truncate(string s, int maxLength)
|
||||
{
|
||||
return s.Length <= maxLength ? s : s.Substring(0, maxLength);
|
||||
}
|
||||
|
||||
int mapSize;
|
||||
int actorCount = 0;
|
||||
Map map = new Map();
|
||||
List<string> players = new List<string>();
|
||||
Action<string> errorHandler;
|
||||
|
||||
LegacyMapImporter(string filename, Action<string> errorHandler)
|
||||
@@ -112,36 +116,35 @@ namespace OpenRA.Editor
|
||||
public static Map Import(string filename, Action<string> errorHandler)
|
||||
{
|
||||
var converter = new LegacyMapImporter(filename, errorHandler);
|
||||
return converter.Map;
|
||||
return converter.map;
|
||||
}
|
||||
|
||||
enum IniMapFormat { RedAlert = 3, /* otherwise, cnc (2 variants exist, we don't care to differentiate) */ };
|
||||
enum IniMapFormat { RedAlert = 3 } // otherwise, cnc (2 variants exist, we don't care to differentiate)
|
||||
|
||||
public void ConvertIniMap(string iniFile)
|
||||
{
|
||||
|
||||
var file = new IniFile(FileSystem.Open(iniFile));
|
||||
var basic = file.GetSection("Basic");
|
||||
var map = file.GetSection("Map");
|
||||
var mapSection = file.GetSection("Map");
|
||||
var legacyMapFormat = (IniMapFormat)int.Parse(basic.GetValue("NewINIFormat", "0"));
|
||||
var XOffset = int.Parse(map.GetValue("X", "0"));
|
||||
var YOffset = int.Parse(map.GetValue("Y", "0"));
|
||||
var Width = int.Parse(map.GetValue("Width", "0"));
|
||||
var Height = int.Parse(map.GetValue("Height", "0"));
|
||||
MapSize = (legacyMapFormat == IniMapFormat.RedAlert) ? 128 : 64;
|
||||
var offsetX = int.Parse(mapSection.GetValue("X", "0"));
|
||||
var offsetY = int.Parse(mapSection.GetValue("Y", "0"));
|
||||
var width = int.Parse(mapSection.GetValue("Width", "0"));
|
||||
var height = int.Parse(mapSection.GetValue("Height", "0"));
|
||||
mapSize = (legacyMapFormat == IniMapFormat.RedAlert) ? 128 : 64;
|
||||
|
||||
Map.Title = basic.GetValue("Name", "(null)");
|
||||
Map.Author = "Westwood Studios";
|
||||
Map.Tileset = Truncate(map.GetValue("Theater", "TEMPERAT"), 8);
|
||||
Map.MapSize.X = MapSize;
|
||||
Map.MapSize.Y = MapSize;
|
||||
Map.Bounds = Rectangle.FromLTRB(XOffset, YOffset, XOffset + Width, YOffset + Height);
|
||||
Map.Selectable = true;
|
||||
map.Title = basic.GetValue("Name", "(null)");
|
||||
map.Author = "Westwood Studios";
|
||||
map.Tileset = Truncate(mapSection.GetValue("Theater", "TEMPERAT"), 8);
|
||||
map.MapSize.X = mapSize;
|
||||
map.MapSize.Y = mapSize;
|
||||
map.Bounds = Rectangle.FromLTRB(offsetX, offsetY, offsetX + width, offsetY + height);
|
||||
map.Selectable = true;
|
||||
|
||||
Map.Smudges = Lazy.New(() => new List<SmudgeReference>());
|
||||
Map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>());
|
||||
Map.MapResources = Lazy.New(() => new TileReference<byte, byte>[MapSize, MapSize]);
|
||||
Map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[MapSize, MapSize]);
|
||||
map.Smudges = Lazy.New(() => new List<SmudgeReference>());
|
||||
map.Actors = Lazy.New(() => new Dictionary<string, ActorReference>());
|
||||
map.MapResources = Lazy.New(() => new TileReference<byte, byte>[mapSize, mapSize]);
|
||||
map.MapTiles = Lazy.New(() => new TileReference<ushort, byte>[mapSize, mapSize]);
|
||||
|
||||
if (legacyMapFormat == IniMapFormat.RedAlert)
|
||||
{
|
||||
@@ -149,8 +152,9 @@ namespace OpenRA.Editor
|
||||
UnpackRAOverlayData(ReadPackedSection(file.GetSection("OverlayPack")));
|
||||
ReadRATrees(file);
|
||||
}
|
||||
else // CNC
|
||||
else
|
||||
{
|
||||
// CnC
|
||||
UnpackCncTileData(FileSystem.Open(iniFile.Substring(0, iniFile.Length - 4) + ".bin"));
|
||||
ReadCncOverlay(file);
|
||||
ReadCncTrees(file);
|
||||
@@ -161,25 +165,23 @@ namespace OpenRA.Editor
|
||||
LoadActors(file, "INFANTRY");
|
||||
LoadSmudges(file, "SMUDGE");
|
||||
|
||||
foreach (var p in Players)
|
||||
LoadPlayer(file, p, (legacyMapFormat == IniMapFormat.RedAlert));
|
||||
foreach (var p in players)
|
||||
LoadPlayer(file, p, legacyMapFormat == IniMapFormat.RedAlert);
|
||||
|
||||
var wps = file.GetSection("Waypoints")
|
||||
.Where(kv => int.Parse(kv.Value) > 0)
|
||||
.Select(kv => Pair.New(int.Parse(kv.Key),
|
||||
LocationFromMapOffset(int.Parse(kv.Value), MapSize)))
|
||||
LocationFromMapOffset(int.Parse(kv.Value), mapSize)))
|
||||
.ToArray();
|
||||
|
||||
|
||||
// Add waypoint actors
|
||||
foreach( var kv in wps )
|
||||
foreach (var kv in wps)
|
||||
{
|
||||
var a = new ActorReference("mpspawn");
|
||||
var a = new ActorReference("waypoint");
|
||||
a.Add(new LocationInit((CPos)kv.Second));
|
||||
a.Add(new OwnerInit("Neutral"));
|
||||
Map.Actors.Value.Add("spawn" + kv.First, a);
|
||||
map.Actors.Value.Add("waypoint" + kv.First, a);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int2 LocationFromMapOffset(int offset, int mapSize)
|
||||
@@ -190,7 +192,7 @@ namespace OpenRA.Editor
|
||||
static MemoryStream ReadPackedSection(IniSection mapPackSection)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
for (int i = 1; ; i++)
|
||||
for (int i = 1;; i++)
|
||||
{
|
||||
var line = mapPackSection.GetValue(i.ToString(), null);
|
||||
if (line == null)
|
||||
@@ -246,38 +248,38 @@ namespace OpenRA.Editor
|
||||
|
||||
void UnpackRATileData(MemoryStream ms)
|
||||
{
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
Map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
|
||||
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
Map.MapTiles.Value[i, j].type = ReadWord(ms);
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
map.MapTiles.Value[i, j].type = ReadWord(ms);
|
||||
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
Map.MapTiles.Value[i, j].index = ReadByte(ms);
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
map.MapTiles.Value[i, j].index = ReadByte(ms);
|
||||
}
|
||||
|
||||
void UnpackRAOverlayData(MemoryStream ms)
|
||||
{
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
{
|
||||
byte o = ReadByte(ms);
|
||||
var res = Pair.New((byte)0, (byte)0);
|
||||
|
||||
if (o != 255 && overlayResourceMapping.ContainsKey(raOverlayNames[o]))
|
||||
res = overlayResourceMapping[raOverlayNames[o]];
|
||||
if (o != 255 && overlayResourceMapping.ContainsKey(redAlertOverlayNames[o]))
|
||||
res = overlayResourceMapping[redAlertOverlayNames[o]];
|
||||
|
||||
Map.MapResources.Value[i, j] = new TileReference<byte, byte>(res.First, res.Second);
|
||||
map.MapResources.Value[i, j] = new TileReference<byte, byte>(res.First, res.Second);
|
||||
|
||||
if (o != 255 && overlayActorMapping.ContainsKey(raOverlayNames[o]))
|
||||
Map.Actors.Value.Add("Actor" + ActorCount++,
|
||||
new ActorReference(overlayActorMapping[raOverlayNames[o]])
|
||||
if (o != 255 && overlayActorMapping.ContainsKey(redAlertOverlayNames[o]))
|
||||
map.Actors.Value.Add("Actor" + actorCount++,
|
||||
new ActorReference(overlayActorMapping[redAlertOverlayNames[o]])
|
||||
{
|
||||
new LocationInit( new CPos(i, j) ),
|
||||
new OwnerInit( "Neutral" )
|
||||
new LocationInit(new CPos(i, j)),
|
||||
new OwnerInit("Neutral")
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -291,10 +293,10 @@ namespace OpenRA.Editor
|
||||
foreach (KeyValuePair<string, string> kv in terrain)
|
||||
{
|
||||
var loc = int.Parse(kv.Key);
|
||||
Map.Actors.Value.Add("Actor" + ActorCount++,
|
||||
map.Actors.Value.Add("Actor" + actorCount++,
|
||||
new ActorReference(kv.Value.ToLowerInvariant())
|
||||
{
|
||||
new LocationInit(new CPos(loc % MapSize, loc / MapSize)),
|
||||
new LocationInit(new CPos(loc % mapSize, loc / mapSize)),
|
||||
new OwnerInit("Neutral")
|
||||
});
|
||||
}
|
||||
@@ -302,15 +304,15 @@ namespace OpenRA.Editor
|
||||
|
||||
void UnpackCncTileData(Stream ms)
|
||||
{
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
Map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
map.MapTiles.Value[i, j] = new TileReference<ushort, byte>();
|
||||
|
||||
for (int j = 0; j < MapSize; j++)
|
||||
for (int i = 0; i < MapSize; i++)
|
||||
for (int j = 0; j < mapSize; j++)
|
||||
for (int i = 0; i < mapSize; i++)
|
||||
{
|
||||
Map.MapTiles.Value[i, j].type = ReadByte(ms);
|
||||
Map.MapTiles.Value[i, j].index = ReadByte(ms);
|
||||
map.MapTiles.Value[i, j].type = ReadByte(ms);
|
||||
map.MapTiles.Value[i, j].index = ReadByte(ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,16 +325,16 @@ namespace OpenRA.Editor
|
||||
foreach (KeyValuePair<string, string> kv in overlay)
|
||||
{
|
||||
var loc = int.Parse(kv.Key);
|
||||
var cell = new CPos(loc % MapSize, loc / MapSize);
|
||||
var cell = new CPos(loc % mapSize, loc / mapSize);
|
||||
|
||||
var res = Pair.New((byte)0, (byte)0);
|
||||
if (overlayResourceMapping.ContainsKey(kv.Value.ToLower()))
|
||||
res = overlayResourceMapping[kv.Value.ToLower()];
|
||||
|
||||
Map.MapResources.Value[cell.X, cell.Y] = new TileReference<byte, byte>(res.First, res.Second);
|
||||
map.MapResources.Value[cell.X, cell.Y] = new TileReference<byte, byte>(res.First, res.Second);
|
||||
|
||||
if (overlayActorMapping.ContainsKey(kv.Value.ToLower()))
|
||||
Map.Actors.Value.Add("Actor" + ActorCount++,
|
||||
map.Actors.Value.Add("Actor" + actorCount++,
|
||||
new ActorReference(overlayActorMapping[kv.Value.ToLower()])
|
||||
{
|
||||
new LocationInit(cell),
|
||||
@@ -350,10 +352,10 @@ namespace OpenRA.Editor
|
||||
foreach (KeyValuePair<string, string> kv in terrain)
|
||||
{
|
||||
var loc = int.Parse(kv.Key);
|
||||
Map.Actors.Value.Add("Actor" + ActorCount++,
|
||||
map.Actors.Value.Add("Actor" + actorCount++,
|
||||
new ActorReference(kv.Value.Split(',')[0].ToLowerInvariant())
|
||||
{
|
||||
new LocationInit(new CPos(loc % MapSize, loc / MapSize)),
|
||||
new LocationInit(new CPos(loc % mapSize, loc / mapSize)),
|
||||
new OwnerInit("Neutral")
|
||||
});
|
||||
}
|
||||
@@ -363,26 +365,24 @@ namespace OpenRA.Editor
|
||||
{
|
||||
foreach (var s in file.GetSection(section, true))
|
||||
{
|
||||
//Structures: num=owner,type,health,location,turret-facing,trigger
|
||||
//Units: num=owner,type,health,location,facing,action,trigger
|
||||
//Infantry: num=owner,type,health,location,subcell,action,facing,trigger
|
||||
|
||||
// Structures: num=owner,type,health,location,turret-facing,trigger
|
||||
// Units: num=owner,type,health,location,facing,action,trigger
|
||||
// Infantry: num=owner,type,health,location,subcell,action,facing,trigger
|
||||
try
|
||||
{
|
||||
|
||||
var parts = s.Value.Split(',');
|
||||
var loc = int.Parse(parts[3]);
|
||||
if (parts[0] == "")
|
||||
parts[0] = "Neutral";
|
||||
|
||||
if (!Players.Contains(parts[0]))
|
||||
Players.Add(parts[0]);
|
||||
if (!players.Contains(parts[0]))
|
||||
players.Add(parts[0]);
|
||||
|
||||
var actor = new ActorReference(parts[1].ToLowerInvariant())
|
||||
{
|
||||
new LocationInit(new CPos(loc % MapSize, loc / MapSize)),
|
||||
new LocationInit(new CPos(loc % mapSize, loc / mapSize)),
|
||||
new OwnerInit(parts[0]),
|
||||
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo)/256),
|
||||
new HealthInit(float.Parse(parts[2], NumberFormatInfo.InvariantInfo) / 256),
|
||||
new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])),
|
||||
};
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace OpenRA.Editor
|
||||
if (!Rules.Info.ContainsKey(parts[1].ToLowerInvariant()))
|
||||
errorHandler("Ignoring unknown actor type: `{0}`".F(parts[1].ToLowerInvariant()));
|
||||
else
|
||||
Map.Actors.Value.Add("Actor" + ActorCount++, actor);
|
||||
map.Actors.Value.Add("Actor" + actorCount++, actor);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -405,55 +405,84 @@ namespace OpenRA.Editor
|
||||
{
|
||||
foreach (var s in file.GetSection(section, true))
|
||||
{
|
||||
//loc=type,loc,depth
|
||||
// loc=type,loc,depth
|
||||
var parts = s.Value.Split(',');
|
||||
var loc = int.Parse(parts[1]);
|
||||
Map.Smudges.Value.Add(new SmudgeReference(parts[0].ToLowerInvariant(), new int2(loc % MapSize, loc / MapSize), int.Parse(parts[2])));
|
||||
map.Smudges.Value.Add(new SmudgeReference(parts[0].ToLowerInvariant(), new int2(loc % mapSize, loc / mapSize), int.Parse(parts[2])));
|
||||
}
|
||||
}
|
||||
|
||||
void LoadPlayer(IniFile file, string section, bool isRA)
|
||||
{
|
||||
var c = section == "BadGuy" ? "red" :
|
||||
isRA ? "blue" : "gold";
|
||||
|
||||
var color = namedColorMapping[c];
|
||||
string c;
|
||||
string race;
|
||||
switch (section)
|
||||
{
|
||||
case "Spain":
|
||||
c = "gold";
|
||||
race = "allies";
|
||||
break;
|
||||
case "England":
|
||||
c = "green";
|
||||
race = "allies";
|
||||
break;
|
||||
case "Ukraine":
|
||||
c = "orange";
|
||||
race = "soviet";
|
||||
break;
|
||||
case "Germany":
|
||||
c = "black";
|
||||
race = "allies";
|
||||
break;
|
||||
case "France":
|
||||
c = "teal";
|
||||
race = "allies";
|
||||
break;
|
||||
case "Turkey":
|
||||
c = "salmon";
|
||||
race = "allies";
|
||||
break;
|
||||
case "Greece":
|
||||
case "GoodGuy":
|
||||
c = isRA ? "blue" : "gold";
|
||||
race = isRA ? "allies" : "gdi";
|
||||
break;
|
||||
case "USSR":
|
||||
case "BadGuy":
|
||||
c = "red";
|
||||
race = isRA ? "soviet" : "nod";
|
||||
break;
|
||||
case "Special":
|
||||
case "Neutral":
|
||||
default:
|
||||
c = "neutral";
|
||||
race = isRA ? "allies" : "gdi";
|
||||
break;
|
||||
}
|
||||
|
||||
var pr = new PlayerReference
|
||||
{
|
||||
Name = section,
|
||||
OwnsWorld = section == "Neutral",
|
||||
NonCombatant = section == "Neutral",
|
||||
Race = isRA ? (section == "BadGuy" ? "soviet" : "allies") : (section == "BadGuy" ? "nod" : "gdi"),
|
||||
ColorRamp = new ColorRamp(
|
||||
(byte)((color.First.GetHue() / 360.0f) * 255),
|
||||
(byte)(color.First.GetSaturation() * 255),
|
||||
(byte)(color.First.GetBrightness() * 255),
|
||||
(byte)(color.Second.GetBrightness() * 255))
|
||||
Race = race,
|
||||
Color = namedColorMapping[c]
|
||||
};
|
||||
|
||||
var neutral = new [] {"Neutral"};
|
||||
var neutral = new[] { "Neutral" };
|
||||
foreach (var s in file.GetSection(section, true))
|
||||
{
|
||||
Console.WriteLine(s.Key);
|
||||
switch(s.Key)
|
||||
switch (s.Key)
|
||||
{
|
||||
case "Credits":
|
||||
pr.InitialCash = int.Parse(s.Value);
|
||||
break;
|
||||
case "Allies":
|
||||
pr.Allies = s.Value.Split(',').Intersect(Players).Except(neutral).ToArray();
|
||||
pr.Enemies = s.Value.Split(',').SymmetricDifference(Players).Except(neutral).ToArray();
|
||||
pr.Allies = s.Value.Split(',').Intersect(players).Except(neutral).ToArray();
|
||||
pr.Enemies = s.Value.Split(',').SymmetricDifference(players).Except(neutral).ToArray();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Map.Players.Add(section, pr);
|
||||
}
|
||||
|
||||
static string Truncate(string s, int maxLength)
|
||||
{
|
||||
return s.Length <= maxLength ? s : s.Substring(0, maxLength);
|
||||
map.Players.Add(section, pr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
552
OpenRA.Editor/MapSelect.Designer.cs
generated
552
OpenRA.Editor/MapSelect.Designer.cs
generated
@@ -12,70 +12,59 @@ namespace OpenRA.Editor
|
||||
{
|
||||
partial class MapSelect
|
||||
{
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
// TODO:
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
/// <param name="disposing">TODO</param>
|
||||
// TODO:
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором форм Windows
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
// TODO:
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapSelect));
|
||||
this.MapList = new System.Windows.Forms.ListView();
|
||||
this.colMapName = new System.Windows.Forms.ColumnHeader("(отсутствует)");
|
||||
this.ColumnMapName = new System.Windows.Forms.ColumnHeader("(none)");
|
||||
this.MapIconsList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.lblNew = new System.Windows.Forms.Label();
|
||||
this.txtNew = new System.Windows.Forms.TextBox();
|
||||
this.pbMinimap = new System.Windows.Forms.PictureBox();
|
||||
this.pnlBottom = new System.Windows.Forms.Panel();
|
||||
this.txtPathOut = new System.Windows.Forms.TextBox();
|
||||
this.lblPathOut = new System.Windows.Forms.Label();
|
||||
this.lblPath = new System.Windows.Forms.Label();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.lblMapList = new System.Windows.Forms.Label();
|
||||
this.txtDesc = new System.Windows.Forms.TextBox();
|
||||
this.lblDesc = new System.Windows.Forms.Label();
|
||||
this.txtTheater = new System.Windows.Forms.TextBox();
|
||||
this.lblTheater = new System.Windows.Forms.Label();
|
||||
this.txtAuthor = new System.Windows.Forms.TextBox();
|
||||
this.lblAuthor = new System.Windows.Forms.Label();
|
||||
this.txtTitle = new System.Windows.Forms.TextBox();
|
||||
this.lblMapName = new System.Windows.Forms.Label();
|
||||
this.lblMinimap = new System.Windows.Forms.Label();
|
||||
this.ButtonCancel = new System.Windows.Forms.Button();
|
||||
this.ButtonOkay = new System.Windows.Forms.Button();
|
||||
this.NewLabel = new System.Windows.Forms.Label();
|
||||
this.NewText = new System.Windows.Forms.TextBox();
|
||||
this.MiniMapBox = new System.Windows.Forms.PictureBox();
|
||||
this.BottomPanel = new System.Windows.Forms.Panel();
|
||||
this.PathOutText = new System.Windows.Forms.TextBox();
|
||||
this.PathOutLabel = new System.Windows.Forms.Label();
|
||||
this.PathLabel = new System.Windows.Forms.Label();
|
||||
this.SplitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.MapListLabel = new System.Windows.Forms.Label();
|
||||
this.DescTxt = new System.Windows.Forms.TextBox();
|
||||
this.DescLabel = new System.Windows.Forms.Label();
|
||||
this.TheaterText = new System.Windows.Forms.TextBox();
|
||||
this.TheaterLabel = new System.Windows.Forms.Label();
|
||||
this.AuthorText = new System.Windows.Forms.TextBox();
|
||||
this.AuthorLabel = new System.Windows.Forms.Label();
|
||||
this.TitleText = new System.Windows.Forms.TextBox();
|
||||
this.MapNameLabel = new System.Windows.Forms.Label();
|
||||
this.MiniMapLabel = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).BeginInit();
|
||||
this.pnlBottom.SuspendLayout();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)this.MiniMapBox).BeginInit();
|
||||
this.BottomPanel.SuspendLayout();
|
||||
this.SplitContainer1.Panel1.SuspendLayout();
|
||||
this.SplitContainer1.Panel2.SuspendLayout();
|
||||
this.SplitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MapList
|
||||
//
|
||||
|
||||
this.MapList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.colMapName});
|
||||
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.ColumnMapName });
|
||||
this.MapList.FullRowSelect = true;
|
||||
this.MapList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.MapList.LargeImageList = this.MapIconsList;
|
||||
@@ -89,250 +78,198 @@ namespace OpenRA.Editor
|
||||
this.MapList.UseCompatibleStateImageBehavior = false;
|
||||
this.MapList.View = System.Windows.Forms.View.Details;
|
||||
this.MapList.SelectedIndexChanged += new System.EventHandler(this.MapList_SelectedIndexChanged);
|
||||
//
|
||||
// colMapName
|
||||
//
|
||||
this.colMapName.Text = "Map name";
|
||||
this.colMapName.Width = 240;
|
||||
//
|
||||
// MapIconsList
|
||||
//
|
||||
|
||||
this.ColumnMapName.Text = "Map name";
|
||||
this.ColumnMapName.Width = 240;
|
||||
|
||||
this.MapIconsList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
|
||||
this.MapIconsList.ImageSize = new System.Drawing.Size(24, 24);
|
||||
this.MapIconsList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(407, 35);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 3;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOk.Location = new System.Drawing.Point(326, 35);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOk.TabIndex = 2;
|
||||
this.btnOk.Text = "Open";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblNew
|
||||
//
|
||||
this.lblNew.AutoSize = true;
|
||||
this.lblNew.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.lblNew.Location = new System.Drawing.Point(12, 40);
|
||||
this.lblNew.Name = "lblNew";
|
||||
this.lblNew.Size = new System.Drawing.Size(69, 13);
|
||||
this.lblNew.TabIndex = 3;
|
||||
this.lblNew.Text = "Map name:";
|
||||
//
|
||||
// txtNew
|
||||
//
|
||||
this.txtNew.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.txtNew.Location = new System.Drawing.Point(88, 37);
|
||||
this.txtNew.Name = "txtNew";
|
||||
this.txtNew.ReadOnly = true;
|
||||
this.txtNew.Size = new System.Drawing.Size(232, 20);
|
||||
this.txtNew.TabIndex = 1;
|
||||
//
|
||||
// pbMinimap
|
||||
//
|
||||
this.pbMinimap.BackColor = System.Drawing.Color.Black;
|
||||
this.pbMinimap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.pbMinimap.Location = new System.Drawing.Point(32, 25);
|
||||
this.pbMinimap.Name = "pbMinimap";
|
||||
this.pbMinimap.Size = new System.Drawing.Size(124, 124);
|
||||
this.pbMinimap.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pbMinimap.TabIndex = 5;
|
||||
this.pbMinimap.TabStop = false;
|
||||
//
|
||||
// pnlBottom
|
||||
//
|
||||
this.pnlBottom.Controls.Add(this.pictureBox1);
|
||||
this.pnlBottom.Controls.Add(this.txtPathOut);
|
||||
this.pnlBottom.Controls.Add(this.lblPathOut);
|
||||
this.pnlBottom.Controls.Add(this.lblPath);
|
||||
this.pnlBottom.Controls.Add(this.btnCancel);
|
||||
this.pnlBottom.Controls.Add(this.btnOk);
|
||||
this.pnlBottom.Controls.Add(this.txtNew);
|
||||
this.pnlBottom.Controls.Add(this.lblNew);
|
||||
this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pnlBottom.Location = new System.Drawing.Point(0, 332);
|
||||
this.pnlBottom.MaximumSize = new System.Drawing.Size(0, 70);
|
||||
this.pnlBottom.Name = "pnlBottom";
|
||||
this.pnlBottom.Size = new System.Drawing.Size(494, 70);
|
||||
this.pnlBottom.TabIndex = 6;
|
||||
//
|
||||
// txtPathOut
|
||||
//
|
||||
this.txtPathOut.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.txtPathOut.Location = new System.Drawing.Point(55, 10);
|
||||
this.txtPathOut.Name = "txtPathOut";
|
||||
this.txtPathOut.ReadOnly = true;
|
||||
this.txtPathOut.Size = new System.Drawing.Size(265, 20);
|
||||
this.txtPathOut.TabIndex = 0;
|
||||
this.txtPathOut.TextChanged += new System.EventHandler(this.txtPathOut_TextChanged);
|
||||
//
|
||||
// lblPathOut
|
||||
//
|
||||
this.lblPathOut.AutoSize = true;
|
||||
this.lblPathOut.Location = new System.Drawing.Point(55, 13);
|
||||
this.lblPathOut.Name = "lblPathOut";
|
||||
this.lblPathOut.Size = new System.Drawing.Size(0, 13);
|
||||
this.lblPathOut.TabIndex = 6;
|
||||
//
|
||||
// lblPath
|
||||
//
|
||||
this.lblPath.AutoSize = true;
|
||||
this.lblPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.lblPath.Location = new System.Drawing.Point(12, 13);
|
||||
this.lblPath.Name = "lblPath";
|
||||
this.lblPath.Size = new System.Drawing.Size(37, 13);
|
||||
this.lblPath.TabIndex = 5;
|
||||
this.lblPath.Text = "Path:";
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.lblMapList);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.MapList);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.txtDesc);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lblDesc);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.txtTheater);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lblTheater);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.txtAuthor);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lblAuthor);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.txtTitle);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lblMapName);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lblMinimap);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.pbMinimap);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(494, 332);
|
||||
this.splitContainer1.SplitterDistance = 300;
|
||||
this.splitContainer1.TabIndex = 7;
|
||||
//
|
||||
// lblMapList
|
||||
//
|
||||
this.lblMapList.AutoSize = true;
|
||||
this.lblMapList.Location = new System.Drawing.Point(12, 9);
|
||||
this.lblMapList.Name = "lblMapList";
|
||||
this.lblMapList.Size = new System.Drawing.Size(81, 13);
|
||||
this.lblMapList.TabIndex = 1;
|
||||
this.lblMapList.Text = "Available maps:";
|
||||
//
|
||||
// txtDesc
|
||||
//
|
||||
this.txtDesc.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.txtDesc.Location = new System.Drawing.Point(16, 289);
|
||||
this.txtDesc.Name = "txtDesc";
|
||||
this.txtDesc.ReadOnly = true;
|
||||
this.txtDesc.Size = new System.Drawing.Size(162, 20);
|
||||
this.txtDesc.TabIndex = 14;
|
||||
//
|
||||
// lblDesc
|
||||
//
|
||||
this.lblDesc.AutoSize = true;
|
||||
this.lblDesc.Location = new System.Drawing.Point(13, 273);
|
||||
this.lblDesc.Name = "lblDesc";
|
||||
this.lblDesc.Size = new System.Drawing.Size(63, 13);
|
||||
this.lblDesc.TabIndex = 13;
|
||||
this.lblDesc.Text = "Description:";
|
||||
//
|
||||
// txtTheater
|
||||
//
|
||||
this.txtTheater.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.txtTheater.Location = new System.Drawing.Point(16, 252);
|
||||
this.txtTheater.Name = "txtTheater";
|
||||
this.txtTheater.ReadOnly = true;
|
||||
this.txtTheater.Size = new System.Drawing.Size(162, 20);
|
||||
this.txtTheater.TabIndex = 12;
|
||||
//
|
||||
// lblTheater
|
||||
//
|
||||
this.lblTheater.AutoSize = true;
|
||||
this.lblTheater.Location = new System.Drawing.Point(13, 236);
|
||||
this.lblTheater.Name = "lblTheater";
|
||||
this.lblTheater.Size = new System.Drawing.Size(47, 13);
|
||||
this.lblTheater.TabIndex = 11;
|
||||
this.lblTheater.Text = "Tileset:";
|
||||
//
|
||||
// txtAuthor
|
||||
//
|
||||
this.txtAuthor.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.txtAuthor.Location = new System.Drawing.Point(16, 214);
|
||||
this.txtAuthor.Name = "txtAuthor";
|
||||
this.txtAuthor.ReadOnly = true;
|
||||
this.txtAuthor.Size = new System.Drawing.Size(162, 20);
|
||||
this.txtAuthor.TabIndex = 10;
|
||||
//
|
||||
// lblAuthor
|
||||
//
|
||||
this.lblAuthor.AutoSize = true;
|
||||
this.lblAuthor.Location = new System.Drawing.Point(13, 198);
|
||||
this.lblAuthor.Name = "lblAuthor";
|
||||
this.lblAuthor.Size = new System.Drawing.Size(41, 13);
|
||||
this.lblAuthor.TabIndex = 9;
|
||||
this.lblAuthor.Text = "Author:";
|
||||
//
|
||||
// txtTitle
|
||||
//
|
||||
this.txtTitle.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.txtTitle.Location = new System.Drawing.Point(16, 177);
|
||||
this.txtTitle.Name = "txtTitle";
|
||||
this.txtTitle.ReadOnly = true;
|
||||
this.txtTitle.Size = new System.Drawing.Size(162, 20);
|
||||
this.txtTitle.TabIndex = 8;
|
||||
//
|
||||
// lblMapName
|
||||
//
|
||||
this.lblMapName.AutoSize = true;
|
||||
this.lblMapName.Location = new System.Drawing.Point(13, 161);
|
||||
this.lblMapName.Name = "lblMapName";
|
||||
this.lblMapName.Size = new System.Drawing.Size(30, 13);
|
||||
this.lblMapName.TabIndex = 7;
|
||||
this.lblMapName.Text = "Title:";
|
||||
//
|
||||
// lblMinimap
|
||||
//
|
||||
this.lblMinimap.AutoSize = true;
|
||||
this.lblMinimap.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.lblMinimap.Location = new System.Drawing.Point(29, 9);
|
||||
this.lblMinimap.Name = "lblMinimap";
|
||||
this.lblMinimap.Size = new System.Drawing.Size(71, 13);
|
||||
this.lblMinimap.TabIndex = 6;
|
||||
this.lblMinimap.Text = "Map preview:";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
|
||||
this.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(407, 35);
|
||||
this.ButtonCancel.Name = "btnCancel";
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.ButtonCancel.TabIndex = 3;
|
||||
this.ButtonCancel.Text = "Cancel";
|
||||
this.ButtonCancel.UseVisualStyleBackColor = true;
|
||||
|
||||
this.ButtonOkay.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.ButtonOkay.Location = new System.Drawing.Point(326, 35);
|
||||
this.ButtonOkay.Name = "btnOk";
|
||||
this.ButtonOkay.Size = new System.Drawing.Size(75, 23);
|
||||
this.ButtonOkay.TabIndex = 2;
|
||||
this.ButtonOkay.Text = "Open";
|
||||
this.ButtonOkay.UseVisualStyleBackColor = true;
|
||||
|
||||
this.NewLabel.AutoSize = true;
|
||||
this.NewLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.NewLabel.Location = new System.Drawing.Point(12, 40);
|
||||
this.NewLabel.Name = "lblNew";
|
||||
this.NewLabel.Size = new System.Drawing.Size(69, 13);
|
||||
this.NewLabel.TabIndex = 3;
|
||||
this.NewLabel.Text = "Map name:";
|
||||
|
||||
this.NewText.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.NewText.Location = new System.Drawing.Point(88, 37);
|
||||
this.NewText.Name = "txtNew";
|
||||
this.NewText.ReadOnly = true;
|
||||
this.NewText.Size = new System.Drawing.Size(232, 20);
|
||||
this.NewText.TabIndex = 1;
|
||||
|
||||
this.MiniMapBox.BackColor = System.Drawing.Color.Black;
|
||||
this.MiniMapBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.MiniMapBox.Location = new System.Drawing.Point(32, 25);
|
||||
this.MiniMapBox.Name = "pbMinimap";
|
||||
this.MiniMapBox.Size = new System.Drawing.Size(124, 124);
|
||||
this.MiniMapBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.MiniMapBox.TabIndex = 5;
|
||||
this.MiniMapBox.TabStop = false;
|
||||
|
||||
this.BottomPanel.Controls.Add(this.pictureBox1);
|
||||
this.BottomPanel.Controls.Add(this.PathOutText);
|
||||
this.BottomPanel.Controls.Add(this.PathOutLabel);
|
||||
this.BottomPanel.Controls.Add(this.PathLabel);
|
||||
this.BottomPanel.Controls.Add(this.ButtonCancel);
|
||||
this.BottomPanel.Controls.Add(this.ButtonOkay);
|
||||
this.BottomPanel.Controls.Add(this.NewText);
|
||||
this.BottomPanel.Controls.Add(this.NewLabel);
|
||||
this.BottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.BottomPanel.Location = new System.Drawing.Point(0, 332);
|
||||
this.BottomPanel.MaximumSize = new System.Drawing.Size(0, 70);
|
||||
this.BottomPanel.Name = "pnlBottom";
|
||||
this.BottomPanel.Size = new System.Drawing.Size(494, 70);
|
||||
this.BottomPanel.TabIndex = 6;
|
||||
|
||||
this.PathOutText.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.PathOutText.Location = new System.Drawing.Point(55, 10);
|
||||
this.PathOutText.Name = "txtPathOut";
|
||||
this.PathOutText.ReadOnly = true;
|
||||
this.PathOutText.Size = new System.Drawing.Size(265, 20);
|
||||
this.PathOutText.TabIndex = 0;
|
||||
this.PathOutText.TextChanged += new System.EventHandler(this.PathOutTextChanged);
|
||||
|
||||
this.PathOutLabel.AutoSize = true;
|
||||
this.PathOutLabel.Location = new System.Drawing.Point(55, 13);
|
||||
this.PathOutLabel.Name = "lblPathOut";
|
||||
this.PathOutLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.PathOutLabel.TabIndex = 6;
|
||||
|
||||
this.PathLabel.AutoSize = true;
|
||||
this.PathLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.PathLabel.Location = new System.Drawing.Point(12, 13);
|
||||
this.PathLabel.Name = "lblPath";
|
||||
this.PathLabel.Size = new System.Drawing.Size(37, 13);
|
||||
this.PathLabel.TabIndex = 5;
|
||||
this.PathLabel.Text = "Path:";
|
||||
|
||||
this.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.SplitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.SplitContainer1.Name = "splitContainer1";
|
||||
|
||||
this.SplitContainer1.Panel1.Controls.Add(this.MapListLabel);
|
||||
this.SplitContainer1.Panel1.Controls.Add(this.MapList);
|
||||
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.DescTxt);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.DescLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TheaterText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TheaterLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.AuthorText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.AuthorLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TitleText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MapNameLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MiniMapLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MiniMapBox);
|
||||
this.SplitContainer1.Size = new System.Drawing.Size(494, 332);
|
||||
this.SplitContainer1.SplitterDistance = 300;
|
||||
this.SplitContainer1.TabIndex = 7;
|
||||
|
||||
this.MapListLabel.AutoSize = true;
|
||||
this.MapListLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.MapListLabel.Name = "lblMapList";
|
||||
this.MapListLabel.Size = new System.Drawing.Size(81, 13);
|
||||
this.MapListLabel.TabIndex = 1;
|
||||
this.MapListLabel.Text = "Available maps:";
|
||||
|
||||
this.DescTxt.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.DescTxt.Location = new System.Drawing.Point(16, 289);
|
||||
this.DescTxt.Name = "txtDesc";
|
||||
this.DescTxt.ReadOnly = true;
|
||||
this.DescTxt.Size = new System.Drawing.Size(162, 20);
|
||||
this.DescTxt.TabIndex = 14;
|
||||
|
||||
this.DescLabel.AutoSize = true;
|
||||
this.DescLabel.Location = new System.Drawing.Point(13, 273);
|
||||
this.DescLabel.Name = "lblDesc";
|
||||
this.DescLabel.Size = new System.Drawing.Size(63, 13);
|
||||
this.DescLabel.TabIndex = 13;
|
||||
this.DescLabel.Text = "Description:";
|
||||
|
||||
this.TheaterText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.TheaterText.Location = new System.Drawing.Point(16, 252);
|
||||
this.TheaterText.Name = "txtTheater";
|
||||
this.TheaterText.ReadOnly = true;
|
||||
this.TheaterText.Size = new System.Drawing.Size(162, 20);
|
||||
this.TheaterText.TabIndex = 12;
|
||||
|
||||
this.TheaterLabel.AutoSize = true;
|
||||
this.TheaterLabel.Location = new System.Drawing.Point(13, 236);
|
||||
this.TheaterLabel.Name = "lblTheater";
|
||||
this.TheaterLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.TheaterLabel.TabIndex = 11;
|
||||
this.TheaterLabel.Text = "Tileset:";
|
||||
|
||||
this.AuthorText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.AuthorText.Location = new System.Drawing.Point(16, 214);
|
||||
this.AuthorText.Name = "txtAuthor";
|
||||
this.AuthorText.ReadOnly = true;
|
||||
this.AuthorText.Size = new System.Drawing.Size(162, 20);
|
||||
this.AuthorText.TabIndex = 10;
|
||||
|
||||
this.AuthorLabel.AutoSize = true;
|
||||
this.AuthorLabel.Location = new System.Drawing.Point(13, 198);
|
||||
this.AuthorLabel.Name = "lblAuthor";
|
||||
this.AuthorLabel.Size = new System.Drawing.Size(41, 13);
|
||||
this.AuthorLabel.TabIndex = 9;
|
||||
this.AuthorLabel.Text = "Author:";
|
||||
|
||||
this.TitleText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.TitleText.Location = new System.Drawing.Point(16, 177);
|
||||
this.TitleText.Name = "txtTitle";
|
||||
this.TitleText.ReadOnly = true;
|
||||
this.TitleText.Size = new System.Drawing.Size(162, 20);
|
||||
this.TitleText.TabIndex = 8;
|
||||
|
||||
this.MapNameLabel.AutoSize = true;
|
||||
this.MapNameLabel.Location = new System.Drawing.Point(13, 161);
|
||||
this.MapNameLabel.Name = "lblMapName";
|
||||
this.MapNameLabel.Size = new System.Drawing.Size(30, 13);
|
||||
this.MapNameLabel.TabIndex = 7;
|
||||
this.MapNameLabel.Text = "Title:";
|
||||
|
||||
this.MiniMapLabel.AutoSize = true;
|
||||
this.MiniMapLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.MiniMapLabel.Location = new System.Drawing.Point(29, 9);
|
||||
this.MiniMapLabel.Name = "lblMinimap";
|
||||
this.MiniMapLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.MiniMapLabel.TabIndex = 6;
|
||||
this.MiniMapLabel.Text = "Map preview:";
|
||||
|
||||
this.pictureBox1.Image = (System.Drawing.Image)resources.GetObject("pictureBox1.Image");
|
||||
this.pictureBox1.Location = new System.Drawing.Point(336, -9);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(54, 35);
|
||||
this.pictureBox1.TabIndex = 7;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Visible = false;
|
||||
//
|
||||
// MapSelect
|
||||
//
|
||||
this.AcceptButton = this.btnOk;
|
||||
|
||||
this.AcceptButton = this.ButtonOkay;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.CancelButton = this.ButtonCancel;
|
||||
this.ClientSize = new System.Drawing.Size(494, 402);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.pnlBottom);
|
||||
this.Controls.Add(this.SplitContainer1);
|
||||
this.Controls.Add(this.BottomPanel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
@@ -342,44 +279,41 @@ namespace OpenRA.Editor
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Select map";
|
||||
this.Load += new System.EventHandler(this.MapSelect_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbMinimap)).EndInit();
|
||||
this.pnlBottom.ResumeLayout(false);
|
||||
this.pnlBottom.PerformLayout();
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.PerformLayout();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)this.MiniMapBox).EndInit();
|
||||
this.BottomPanel.ResumeLayout(false);
|
||||
this.BottomPanel.PerformLayout();
|
||||
this.SplitContainer1.Panel1.ResumeLayout(false);
|
||||
this.SplitContainer1.Panel1.PerformLayout();
|
||||
this.SplitContainer1.Panel2.ResumeLayout(false);
|
||||
this.SplitContainer1.Panel2.PerformLayout();
|
||||
this.SplitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public System.Windows.Forms.ListView MapList;
|
||||
public System.Windows.Forms.Button btnCancel;
|
||||
public System.Windows.Forms.Button btnOk;
|
||||
public System.Windows.Forms.Label lblNew;
|
||||
public System.Windows.Forms.TextBox txtNew;
|
||||
public System.Windows.Forms.ColumnHeader colMapName;
|
||||
public System.Windows.Forms.Button ButtonCancel;
|
||||
public System.Windows.Forms.Button ButtonOkay;
|
||||
public System.Windows.Forms.Label NewLabel;
|
||||
public System.Windows.Forms.TextBox NewText;
|
||||
public System.Windows.Forms.ColumnHeader ColumnMapName;
|
||||
public System.Windows.Forms.ImageList MapIconsList;
|
||||
public System.Windows.Forms.PictureBox pbMinimap;
|
||||
public System.Windows.Forms.Panel pnlBottom;
|
||||
public System.Windows.Forms.SplitContainer splitContainer1;
|
||||
public System.Windows.Forms.Label lblMinimap;
|
||||
public System.Windows.Forms.TextBox txtTheater;
|
||||
public System.Windows.Forms.Label lblTheater;
|
||||
public System.Windows.Forms.TextBox txtAuthor;
|
||||
public System.Windows.Forms.Label lblAuthor;
|
||||
public System.Windows.Forms.TextBox txtTitle;
|
||||
public System.Windows.Forms.Label lblMapName;
|
||||
public System.Windows.Forms.TextBox txtDesc;
|
||||
public System.Windows.Forms.Label lblDesc;
|
||||
public System.Windows.Forms.Label lblMapList;
|
||||
public System.Windows.Forms.Label lblPathOut;
|
||||
public System.Windows.Forms.Label lblPath;
|
||||
public System.Windows.Forms.TextBox txtPathOut;
|
||||
public System.Windows.Forms.PictureBox MiniMapBox;
|
||||
public System.Windows.Forms.Panel BottomPanel;
|
||||
public System.Windows.Forms.SplitContainer SplitContainer1;
|
||||
public System.Windows.Forms.Label MiniMapLabel;
|
||||
public System.Windows.Forms.TextBox TheaterText;
|
||||
public System.Windows.Forms.Label TheaterLabel;
|
||||
public System.Windows.Forms.TextBox AuthorText;
|
||||
public System.Windows.Forms.Label AuthorLabel;
|
||||
public System.Windows.Forms.TextBox TitleText;
|
||||
public System.Windows.Forms.Label MapNameLabel;
|
||||
public System.Windows.Forms.TextBox DescTxt;
|
||||
public System.Windows.Forms.Label DescLabel;
|
||||
public System.Windows.Forms.Label MapListLabel;
|
||||
public System.Windows.Forms.Label PathOutLabel;
|
||||
public System.Windows.Forms.Label PathLabel;
|
||||
public System.Windows.Forms.TextBox PathOutText;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,19 @@ namespace OpenRA.Editor
|
||||
{
|
||||
public string MapFolderPath;
|
||||
|
||||
public bool DirectoryIsEmpty(string path)
|
||||
{
|
||||
return !Directory.GetFileSystemEntries(path).Any();
|
||||
}
|
||||
|
||||
public MapSelect(string currentMod)
|
||||
{
|
||||
MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", currentMod, "maps" }
|
||||
MapFolderPath = new string[] { Platform.SupportDir, "maps", currentMod }
|
||||
.Aggregate(Path.Combine);
|
||||
|
||||
if (!Directory.Exists(MapFolderPath))
|
||||
Directory.CreateDirectory(MapFolderPath);
|
||||
|
||||
InitializeComponent();
|
||||
MapIconsList.Images.Add(pictureBox1.Image);
|
||||
}
|
||||
@@ -32,7 +40,10 @@ namespace OpenRA.Editor
|
||||
void MapSelect_Load(object sender, EventArgs e)
|
||||
{
|
||||
MapList.Items.Clear();
|
||||
txtPathOut.Text = MapFolderPath;
|
||||
PathOutText.Text = MapFolderPath;
|
||||
|
||||
if (DirectoryIsEmpty(MapFolderPath))
|
||||
return;
|
||||
|
||||
foreach (var map in ModData.FindMapsIn(MapFolderPath))
|
||||
{
|
||||
@@ -44,7 +55,7 @@ namespace OpenRA.Editor
|
||||
}
|
||||
|
||||
// hack
|
||||
if (txtNew.Text != "unnamed")
|
||||
if (NewText.Text != "unnamed")
|
||||
MapList.Items[0].Selected = true;
|
||||
}
|
||||
|
||||
@@ -52,31 +63,30 @@ namespace OpenRA.Editor
|
||||
{
|
||||
if (MapList.SelectedItems.Count == 1)
|
||||
{
|
||||
txtNew.Text = MapList.SelectedItems[0].Text;
|
||||
txtNew.Tag = MapList.SelectedItems[0].Tag;
|
||||
NewText.Text = MapList.SelectedItems[0].Text;
|
||||
NewText.Tag = MapList.SelectedItems[0].Tag;
|
||||
|
||||
var map = new Map(txtNew.Tag as string);
|
||||
txtTitle.Text = map.Title;
|
||||
txtAuthor.Text = map.Author;
|
||||
txtTheater.Text = map.Tileset;
|
||||
txtDesc.Text = map.Description;
|
||||
pbMinimap.Image = null;
|
||||
var map = new Map(NewText.Tag as string);
|
||||
TitleText.Text = map.Title;
|
||||
AuthorText.Text = map.Author;
|
||||
TheaterText.Text = map.Tileset;
|
||||
DescTxt.Text = map.Description;
|
||||
MiniMapBox.Image = null;
|
||||
|
||||
try
|
||||
{
|
||||
pbMinimap.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
|
||||
MiniMapBox.Image = Minimap.AddStaticResources(map, Minimap.TerrainBitmap(map, true));
|
||||
}
|
||||
catch (Exception ed)
|
||||
{
|
||||
Console.WriteLine("No map preview image found: {0}", ed.ToString());
|
||||
}
|
||||
finally { }
|
||||
}
|
||||
}
|
||||
|
||||
void txtPathOut_TextChanged(object sender, EventArgs e)
|
||||
void PathOutTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
MapFolderPath = txtPathOut.Text;
|
||||
MapFolderPath = PathOutText.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
169
OpenRA.Editor/NewMapDialog.Designer.cs
generated
Executable file → Normal file
169
OpenRA.Editor/NewMapDialog.Designer.cs
generated
Executable file → Normal file
@@ -24,9 +24,8 @@ namespace OpenRA.Editor
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -43,20 +42,20 @@ namespace OpenRA.Editor
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.height = new System.Windows.Forms.NumericUpDown();
|
||||
this.width = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.MapHeight = new System.Windows.Forms.NumericUpDown();
|
||||
this.MapWidth = new System.Windows.Forms.NumericUpDown();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.theater = new System.Windows.Forms.ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
|
||||
this.TheaterBox = new System.Windows.Forms.ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
@@ -108,121 +107,121 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// cordonBottom
|
||||
//
|
||||
this.cordonBottom.Location = new System.Drawing.Point(280, 75);
|
||||
this.cordonBottom.Maximum = new decimal(new int[] {
|
||||
this.CordonBottom.Location = new System.Drawing.Point(280, 75);
|
||||
this.CordonBottom.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonBottom.Name = "cordonBottom";
|
||||
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonBottom.TabIndex = 5;
|
||||
this.cordonBottom.Value = new decimal(new int[] {
|
||||
this.CordonBottom.Name = "cordonBottom";
|
||||
this.CordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonBottom.TabIndex = 5;
|
||||
this.CordonBottom.Value = new decimal(new int[] {
|
||||
112,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonBottom.Enter += new System.EventHandler(this.SelectText);
|
||||
this.CordonBottom.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonTop
|
||||
//
|
||||
this.cordonTop.Location = new System.Drawing.Point(280, 49);
|
||||
this.cordonTop.Maximum = new decimal(new int[] {
|
||||
this.CordonTop.Location = new System.Drawing.Point(280, 49);
|
||||
this.CordonTop.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonTop.Name = "cordonTop";
|
||||
this.cordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonTop.TabIndex = 3;
|
||||
this.cordonTop.Value = new decimal(new int[] {
|
||||
this.CordonTop.Name = "cordonTop";
|
||||
this.CordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonTop.TabIndex = 3;
|
||||
this.CordonTop.Value = new decimal(new int[] {
|
||||
16,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonTop.Enter += new System.EventHandler(this.SelectText);
|
||||
this.CordonTop.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonRight
|
||||
//
|
||||
this.cordonRight.Location = new System.Drawing.Point(169, 75);
|
||||
this.cordonRight.Maximum = new decimal(new int[] {
|
||||
this.CordonRight.Location = new System.Drawing.Point(169, 75);
|
||||
this.CordonRight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonRight.Name = "cordonRight";
|
||||
this.cordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonRight.TabIndex = 4;
|
||||
this.cordonRight.Value = new decimal(new int[] {
|
||||
this.CordonRight.Name = "cordonRight";
|
||||
this.CordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonRight.TabIndex = 4;
|
||||
this.CordonRight.Value = new decimal(new int[] {
|
||||
112,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonRight.Enter += new System.EventHandler(this.SelectText);
|
||||
this.CordonRight.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonLeft
|
||||
//
|
||||
this.cordonLeft.Location = new System.Drawing.Point(169, 49);
|
||||
this.cordonLeft.Maximum = new decimal(new int[] {
|
||||
this.CordonLeft.Location = new System.Drawing.Point(169, 49);
|
||||
this.CordonLeft.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonLeft.Name = "cordonLeft";
|
||||
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonLeft.TabIndex = 2;
|
||||
this.cordonLeft.Value = new decimal(new int[] {
|
||||
this.CordonLeft.Name = "cordonLeft";
|
||||
this.CordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonLeft.TabIndex = 2;
|
||||
this.CordonLeft.Value = new decimal(new int[] {
|
||||
16,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonLeft.Enter += new System.EventHandler(this.SelectText);
|
||||
this.CordonLeft.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// height
|
||||
//
|
||||
this.height.Increment = new decimal(new int[] {
|
||||
this.MapHeight.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.height.Location = new System.Drawing.Point(280, 23);
|
||||
this.height.Maximum = new decimal(new int[] {
|
||||
this.MapHeight.Location = new System.Drawing.Point(280, 23);
|
||||
this.MapHeight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.height.Name = "height";
|
||||
this.height.Size = new System.Drawing.Size(105, 20);
|
||||
this.height.TabIndex = 1;
|
||||
this.height.Value = new decimal(new int[] {
|
||||
this.MapHeight.Name = "height";
|
||||
this.MapHeight.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapHeight.TabIndex = 1;
|
||||
this.MapHeight.Value = new decimal(new int[] {
|
||||
128,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.height.Enter += new System.EventHandler(this.SelectText);
|
||||
this.MapHeight.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// width
|
||||
//
|
||||
this.width.Increment = new decimal(new int[] {
|
||||
this.MapWidth.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.width.Location = new System.Drawing.Point(169, 23);
|
||||
this.width.Maximum = new decimal(new int[] {
|
||||
this.MapWidth.Location = new System.Drawing.Point(169, 23);
|
||||
this.MapWidth.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.width.Name = "width";
|
||||
this.width.Size = new System.Drawing.Size(105, 20);
|
||||
this.width.TabIndex = 0;
|
||||
this.width.Value = new decimal(new int[] {
|
||||
this.MapWidth.Name = "width";
|
||||
this.MapWidth.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapWidth.TabIndex = 0;
|
||||
this.MapWidth.Value = new decimal(new int[] {
|
||||
128,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.width.Enter += new System.EventHandler(this.SelectText);
|
||||
this.MapWidth.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
@@ -235,12 +234,12 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// theater
|
||||
//
|
||||
this.theater.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.theater.FormattingEnabled = true;
|
||||
this.theater.Location = new System.Drawing.Point(169, 121);
|
||||
this.theater.Name = "theater";
|
||||
this.theater.Size = new System.Drawing.Size(216, 21);
|
||||
this.theater.TabIndex = 6;
|
||||
this.TheaterBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.TheaterBox.FormattingEnabled = true;
|
||||
this.TheaterBox.Location = new System.Drawing.Point(169, 121);
|
||||
this.TheaterBox.Name = "theater";
|
||||
this.TheaterBox.Size = new System.Drawing.Size(216, 21);
|
||||
this.TheaterBox.TabIndex = 6;
|
||||
//
|
||||
// NewMapDialog
|
||||
//
|
||||
@@ -249,29 +248,29 @@ namespace OpenRA.Editor
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(418, 210);
|
||||
this.Controls.Add(this.theater);
|
||||
this.Controls.Add(this.TheaterBox);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.cordonBottom);
|
||||
this.Controls.Add(this.cordonTop);
|
||||
this.Controls.Add(this.cordonRight);
|
||||
this.Controls.Add(this.cordonLeft);
|
||||
this.Controls.Add(this.height);
|
||||
this.Controls.Add(this.width);
|
||||
this.Controls.Add(this.CordonBottom);
|
||||
this.Controls.Add(this.CordonTop);
|
||||
this.Controls.Add(this.CordonRight);
|
||||
this.Controls.Add(this.CordonLeft);
|
||||
this.Controls.Add(this.MapHeight);
|
||||
this.Controls.Add(this.MapWidth);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "NewMapDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Map";
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -284,13 +283,13 @@ namespace OpenRA.Editor
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
public System.Windows.Forms.NumericUpDown cordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown cordonTop;
|
||||
public System.Windows.Forms.NumericUpDown cordonRight;
|
||||
public System.Windows.Forms.NumericUpDown cordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown height;
|
||||
public System.Windows.Forms.NumericUpDown width;
|
||||
public System.Windows.Forms.NumericUpDown CordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown CordonTop;
|
||||
public System.Windows.Forms.NumericUpDown CordonRight;
|
||||
public System.Windows.Forms.NumericUpDown CordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown MapHeight;
|
||||
public System.Windows.Forms.NumericUpDown MapWidth;
|
||||
private System.Windows.Forms.Label label4;
|
||||
public System.Windows.Forms.ComboBox theater;
|
||||
public System.Windows.Forms.ComboBox TheaterBox;
|
||||
}
|
||||
}
|
||||
@@ -116,9 +116,9 @@
|
||||
<Compile Include="PropertiesDialog.Designer.cs">
|
||||
<DependentUpon>PropertiesDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="ActorPropertiesDialog.resx">
|
||||
<DependentUpon>ActorPropertiesDialog.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Editor
|
||||
static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main( string[] args )
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if (args.Length >= 2 && args[0] == "--convert")
|
||||
{
|
||||
@@ -40,12 +40,13 @@ namespace OpenRA.Editor
|
||||
|
||||
static void UpgradeMaps(string mod)
|
||||
{
|
||||
var MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" }
|
||||
var mapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" }
|
||||
.Aggregate(Path.Combine);
|
||||
|
||||
foreach (var path in ModData.FindMapsIn(MapFolderPath))
|
||||
foreach (var path in ModData.FindMapsIn(mapFolderPath))
|
||||
{
|
||||
var map = new Map(path);
|
||||
|
||||
// Touch the lazy bits to initialize them
|
||||
map.Actors.Force();
|
||||
map.Smudges.Force();
|
||||
@@ -54,6 +55,5 @@ namespace OpenRA.Editor
|
||||
map.Save(path);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenRA.Editor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("OpenRA.Editor")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e18ea68f-f344-46c9-b026-8bda76fa91f8")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
85
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
85
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
@@ -24,9 +24,8 @@ namespace OpenRA.Editor
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -41,13 +40,13 @@ namespace OpenRA.Editor
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.title = new System.Windows.Forms.TextBox();
|
||||
this.TitleBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.desc = new System.Windows.Forms.TextBox();
|
||||
this.selectable = new System.Windows.Forms.CheckBox();
|
||||
this.DescBox = new System.Windows.Forms.TextBox();
|
||||
this.SelectableCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.author = new System.Windows.Forms.TextBox();
|
||||
this.useAsShellmap = new System.Windows.Forms.CheckBox();
|
||||
this.AuthorBox = new System.Windows.Forms.TextBox();
|
||||
this.ShellmapCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
@@ -83,10 +82,10 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// title
|
||||
//
|
||||
this.title.Location = new System.Drawing.Point(66, 47);
|
||||
this.title.Name = "title";
|
||||
this.title.Size = new System.Drawing.Size(286, 20);
|
||||
this.title.TabIndex = 17;
|
||||
this.TitleBox.Location = new System.Drawing.Point(66, 47);
|
||||
this.TitleBox.Name = "title";
|
||||
this.TitleBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.TitleBox.TabIndex = 17;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
@@ -99,20 +98,20 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// desc
|
||||
//
|
||||
this.desc.Location = new System.Drawing.Point(66, 73);
|
||||
this.desc.Name = "desc";
|
||||
this.desc.Size = new System.Drawing.Size(286, 20);
|
||||
this.desc.TabIndex = 17;
|
||||
this.DescBox.Location = new System.Drawing.Point(66, 73);
|
||||
this.DescBox.Name = "desc";
|
||||
this.DescBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.DescBox.TabIndex = 17;
|
||||
//
|
||||
// selectable
|
||||
//
|
||||
this.selectable.AutoSize = true;
|
||||
this.selectable.Location = new System.Drawing.Point(118, 138);
|
||||
this.selectable.Name = "selectable";
|
||||
this.selectable.Size = new System.Drawing.Size(130, 17);
|
||||
this.selectable.TabIndex = 18;
|
||||
this.selectable.Text = "Show in Map Chooser";
|
||||
this.selectable.UseVisualStyleBackColor = true;
|
||||
this.SelectableCheckBox.AutoSize = true;
|
||||
this.SelectableCheckBox.Location = new System.Drawing.Point(118, 138);
|
||||
this.SelectableCheckBox.Name = "selectable";
|
||||
this.SelectableCheckBox.Size = new System.Drawing.Size(130, 17);
|
||||
this.SelectableCheckBox.TabIndex = 18;
|
||||
this.SelectableCheckBox.Text = "Show in Map Chooser";
|
||||
this.SelectableCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
@@ -125,20 +124,20 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// author
|
||||
//
|
||||
this.author.Location = new System.Drawing.Point(66, 99);
|
||||
this.author.Name = "author";
|
||||
this.author.Size = new System.Drawing.Size(286, 20);
|
||||
this.author.TabIndex = 17;
|
||||
this.AuthorBox.Location = new System.Drawing.Point(66, 99);
|
||||
this.AuthorBox.Name = "author";
|
||||
this.AuthorBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.AuthorBox.TabIndex = 17;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.useAsShellmap.AutoSize = true;
|
||||
this.useAsShellmap.Location = new System.Drawing.Point(118, 161);
|
||||
this.useAsShellmap.Name = "checkBox1";
|
||||
this.useAsShellmap.Size = new System.Drawing.Size(105, 17);
|
||||
this.useAsShellmap.TabIndex = 18;
|
||||
this.useAsShellmap.Text = "Use as Shellmap";
|
||||
this.useAsShellmap.UseVisualStyleBackColor = true;
|
||||
this.ShellmapCheckBox.AutoSize = true;
|
||||
this.ShellmapCheckBox.Location = new System.Drawing.Point(118, 161);
|
||||
this.ShellmapCheckBox.Name = "checkBox1";
|
||||
this.ShellmapCheckBox.Size = new System.Drawing.Size(105, 17);
|
||||
this.ShellmapCheckBox.TabIndex = 18;
|
||||
this.ShellmapCheckBox.Text = "Use as Shellmap";
|
||||
this.ShellmapCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PropertiesDialog
|
||||
//
|
||||
@@ -147,13 +146,13 @@ namespace OpenRA.Editor
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(370, 228);
|
||||
this.Controls.Add(this.useAsShellmap);
|
||||
this.Controls.Add(this.selectable);
|
||||
this.Controls.Add(this.author);
|
||||
this.Controls.Add(this.ShellmapCheckBox);
|
||||
this.Controls.Add(this.SelectableCheckBox);
|
||||
this.Controls.Add(this.AuthorBox);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.desc);
|
||||
this.Controls.Add(this.DescBox);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.title);
|
||||
this.Controls.Add(this.TitleBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
@@ -171,12 +170,12 @@ namespace OpenRA.Editor
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
public System.Windows.Forms.TextBox title;
|
||||
public System.Windows.Forms.TextBox TitleBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
public System.Windows.Forms.TextBox desc;
|
||||
public System.Windows.Forms.CheckBox selectable;
|
||||
public System.Windows.Forms.TextBox DescBox;
|
||||
public System.Windows.Forms.CheckBox SelectableCheckBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
public System.Windows.Forms.TextBox author;
|
||||
public System.Windows.Forms.CheckBox useAsShellmap;
|
||||
public System.Windows.Forms.TextBox AuthorBox;
|
||||
public System.Windows.Forms.CheckBox ShellmapCheckBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Editor
|
||||
|
||||
public static ActorTemplate RenderActor(ActorInfo info, TileSet tileset, Palette p)
|
||||
{
|
||||
var image = RenderSimple.GetImage(info);
|
||||
var image = RenderSprites.GetImage(info);
|
||||
|
||||
using (var s = FileSystem.OpenWithExts(image, tileset.Extensions))
|
||||
{
|
||||
|
||||
127
OpenRA.Editor/ResizeDialog.Designer.cs
generated
127
OpenRA.Editor/ResizeDialog.Designer.cs
generated
@@ -24,9 +24,8 @@ namespace OpenRA.Editor
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -38,41 +37,41 @@ namespace OpenRA.Editor
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.width = new System.Windows.Forms.NumericUpDown();
|
||||
this.MapWidth = new System.Windows.Forms.NumericUpDown();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.cordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.cordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.height = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.width)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.height)).BeginInit();
|
||||
this.MapHeight = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// width
|
||||
//
|
||||
this.width.Increment = new decimal(new int[] {
|
||||
this.MapWidth.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.width.Location = new System.Drawing.Point(161, 18);
|
||||
this.width.Maximum = new decimal(new int[] {
|
||||
this.MapWidth.Location = new System.Drawing.Point(161, 18);
|
||||
this.MapWidth.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.width.Name = "width";
|
||||
this.width.Size = new System.Drawing.Size(105, 20);
|
||||
this.width.TabIndex = 0;
|
||||
this.MapWidth.Name = "width";
|
||||
this.MapWidth.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapWidth.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@@ -94,51 +93,51 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// cordonLeft
|
||||
//
|
||||
this.cordonLeft.Location = new System.Drawing.Point(161, 44);
|
||||
this.cordonLeft.Maximum = new decimal(new int[] {
|
||||
this.CordonLeft.Location = new System.Drawing.Point(161, 44);
|
||||
this.CordonLeft.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonLeft.Name = "cordonLeft";
|
||||
this.cordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonLeft.TabIndex = 0;
|
||||
this.CordonLeft.Name = "cordonLeft";
|
||||
this.CordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonLeft.TabIndex = 0;
|
||||
//
|
||||
// cordonTop
|
||||
//
|
||||
this.cordonTop.Location = new System.Drawing.Point(272, 44);
|
||||
this.cordonTop.Maximum = new decimal(new int[] {
|
||||
this.CordonTop.Location = new System.Drawing.Point(272, 44);
|
||||
this.CordonTop.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonTop.Name = "cordonTop";
|
||||
this.cordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonTop.TabIndex = 0;
|
||||
this.CordonTop.Name = "cordonTop";
|
||||
this.CordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonTop.TabIndex = 0;
|
||||
//
|
||||
// cordonRight
|
||||
//
|
||||
this.cordonRight.Location = new System.Drawing.Point(161, 70);
|
||||
this.cordonRight.Maximum = new decimal(new int[] {
|
||||
this.CordonRight.Location = new System.Drawing.Point(161, 70);
|
||||
this.CordonRight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonRight.Name = "cordonRight";
|
||||
this.cordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonRight.TabIndex = 0;
|
||||
this.CordonRight.Name = "cordonRight";
|
||||
this.CordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonRight.TabIndex = 0;
|
||||
//
|
||||
// cordonBottom
|
||||
//
|
||||
this.cordonBottom.Location = new System.Drawing.Point(272, 70);
|
||||
this.cordonBottom.Maximum = new decimal(new int[] {
|
||||
this.CordonBottom.Location = new System.Drawing.Point(272, 70);
|
||||
this.CordonBottom.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.cordonBottom.Name = "cordonBottom";
|
||||
this.cordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.cordonBottom.TabIndex = 0;
|
||||
this.CordonBottom.Name = "cordonBottom";
|
||||
this.CordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonBottom.TabIndex = 0;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
@@ -171,20 +170,20 @@ namespace OpenRA.Editor
|
||||
//
|
||||
// height
|
||||
//
|
||||
this.height.Increment = new decimal(new int[] {
|
||||
this.MapHeight.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.height.Location = new System.Drawing.Point(272, 18);
|
||||
this.height.Maximum = new decimal(new int[] {
|
||||
this.MapHeight.Location = new System.Drawing.Point(272, 18);
|
||||
this.MapHeight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.height.Name = "height";
|
||||
this.height.Size = new System.Drawing.Size(105, 20);
|
||||
this.height.TabIndex = 0;
|
||||
this.MapHeight.Name = "height";
|
||||
this.MapHeight.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapHeight.TabIndex = 0;
|
||||
//
|
||||
// ResizeDialog
|
||||
//
|
||||
@@ -198,22 +197,22 @@ namespace OpenRA.Editor
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.cordonBottom);
|
||||
this.Controls.Add(this.cordonTop);
|
||||
this.Controls.Add(this.cordonRight);
|
||||
this.Controls.Add(this.cordonLeft);
|
||||
this.Controls.Add(this.height);
|
||||
this.Controls.Add(this.width);
|
||||
this.Controls.Add(this.CordonBottom);
|
||||
this.Controls.Add(this.CordonTop);
|
||||
this.Controls.Add(this.CordonRight);
|
||||
this.Controls.Add(this.CordonLeft);
|
||||
this.Controls.Add(this.MapHeight);
|
||||
this.Controls.Add(this.MapWidth);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "ResizeDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Resize Map";
|
||||
((System.ComponentModel.ISupportInitialize)(this.width)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.height)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -226,11 +225,11 @@ namespace OpenRA.Editor
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
public System.Windows.Forms.NumericUpDown width;
|
||||
public System.Windows.Forms.NumericUpDown cordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown cordonTop;
|
||||
public System.Windows.Forms.NumericUpDown cordonRight;
|
||||
public System.Windows.Forms.NumericUpDown cordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown height;
|
||||
public System.Windows.Forms.NumericUpDown MapWidth;
|
||||
public System.Windows.Forms.NumericUpDown CordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown CordonTop;
|
||||
public System.Windows.Forms.NumericUpDown CordonRight;
|
||||
public System.Windows.Forms.NumericUpDown CordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown MapHeight;
|
||||
}
|
||||
}
|
||||
@@ -17,21 +17,21 @@ namespace OpenRA.Editor
|
||||
{
|
||||
class ResourceTool : ITool
|
||||
{
|
||||
ResourceTemplate Resource;
|
||||
ResourceTemplate resourceTemplate;
|
||||
|
||||
public ResourceTool(ResourceTemplate resource) { Resource = resource; }
|
||||
public ResourceTool(ResourceTemplate resource) { resourceTemplate = resource; }
|
||||
|
||||
public void Apply(Surface surface)
|
||||
{
|
||||
surface.Map.MapResources.Value[surface.GetBrushLocation().X, surface.GetBrushLocation().Y]
|
||||
= new TileReference<byte, byte>
|
||||
{
|
||||
type = (byte)Resource.Info.ResourceType,
|
||||
index = (byte)random.Next(Resource.Info.SpriteNames.Length)
|
||||
type = (byte)resourceTemplate.Info.ResourceType,
|
||||
index = (byte)random.Next(resourceTemplate.Info.SpriteNames.Length)
|
||||
};
|
||||
|
||||
var ch = new int2((surface.GetBrushLocation().X) / Surface.ChunkSize,
|
||||
(surface.GetBrushLocation().Y) / Surface.ChunkSize);
|
||||
var ch = new int2(surface.GetBrushLocation().X / Surface.ChunkSize,
|
||||
surface.GetBrushLocation().Y / Surface.ChunkSize);
|
||||
|
||||
if (surface.Chunks.ContainsKey(ch))
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Editor
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
surface.DrawImage(g, Resource.Bitmap, surface.GetBrushLocation(), false, null);
|
||||
surface.DrawImage(g, resourceTemplate.Bitmap, surface.GetBrushLocation(), false, null);
|
||||
}
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
344
OpenRA.Editor/Settings.StyleCop
Normal file
344
OpenRA.Editor/Settings.StyleCop
Normal file
@@ -0,0 +1,344 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<Analyzers>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
|
||||
<Rules>
|
||||
<Rule Name="ElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="EnumerationItemsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationMustContainValidXml">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustHaveSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementDocumentationMustHaveSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustHaveSummaryText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParametersMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementReturnValueMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementReturnValueDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="VoidReturnValueMustNotBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParametersMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationTextMustNotBeEmpty">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationTextMustContainWhitespace">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationMustMeetCharacterPercentage">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="IncludedDocumentationXPathDoesNotExist">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileMustHaveHeader">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustShowCopyright">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustHaveCopyrightText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustContainFileName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustHaveValidCompanyText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
|
||||
<Rules>
|
||||
<Rule Name="TabsMustNotBeUsed">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
|
||||
<Rules>
|
||||
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="StatementMustNotBeOnSingleLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementMustNotBeOnSingleLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="CurlyBracketsMustNotBeOmitted">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustBeSeparatedByBlankLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
|
||||
<Rules>
|
||||
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustAppearInTheCorrectOrder">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustBeOrderedByAccess">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
|
||||
<Rules>
|
||||
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="UseStringEmptyForEmptyStrings">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PrefixLocalCallsWithThis">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PrefixCallsCorrectly">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ParameterMustFollowComma">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
|
||||
<Rules>
|
||||
<Rule Name="AccessModifierMustBeDeclared">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FieldsMustBePrivate">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileMayOnlyContainASingleClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
</Analyzers>
|
||||
</StyleCopSettings>
|
||||
@@ -21,22 +21,44 @@ using SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
static class ActorReferenceExts
|
||||
{
|
||||
public static CPos Location(this ActorReference ar)
|
||||
{
|
||||
return (CPos)ar.InitDict.Get<LocationInit>().value;
|
||||
}
|
||||
|
||||
public static void DrawStringContrast(this SGraphics g, Font f, string s, int x, int y, Brush fg, Brush bg)
|
||||
{
|
||||
g.DrawString(s, f, bg, x - 1, y - 1);
|
||||
g.DrawString(s, f, bg, x + 1, y - 1);
|
||||
g.DrawString(s, f, bg, x - 1, y + 1);
|
||||
g.DrawString(s, f, bg, x + 1, y + 1);
|
||||
|
||||
g.DrawString(s, f, fg, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
class Surface : Control
|
||||
{
|
||||
public Map Map { get; private set; }
|
||||
public TileSet TileSet { get; private set; }
|
||||
public TileSetRenderer TileSetRenderer { get; private set; }
|
||||
public Palette Palette { get; private set; }
|
||||
public Palette PlayerPalette { get; private set; }
|
||||
public int2 Offset;
|
||||
|
||||
public int2 GetOffset() { return Offset; }
|
||||
|
||||
public float Zoom = 1.0f;
|
||||
|
||||
ITool Tool;
|
||||
ITool currentTool;
|
||||
|
||||
public bool IsPanning;
|
||||
public bool IsErasing;
|
||||
public bool ShowActorNames;
|
||||
public bool ShowGrid;
|
||||
public bool ShowRuler;
|
||||
|
||||
public bool IsPaste { get { return TileSelection != null && ResourceSelection != null; } }
|
||||
public TileReference<ushort, byte>[,] TileSelection;
|
||||
@@ -50,26 +72,31 @@ namespace OpenRA.Editor
|
||||
public event Action<string> MousePositionChanged = _ => { };
|
||||
public event Action<KeyValuePair<string, ActorReference>> ActorDoubleClicked = _ => { };
|
||||
|
||||
Dictionary<string, ActorTemplate> ActorTemplates = new Dictionary<string, ActorTemplate>();
|
||||
Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
|
||||
Dictionary<string, ActorTemplate> actorTemplates = new Dictionary<string, ActorTemplate>();
|
||||
public Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
|
||||
|
||||
static readonly Font MarkerFont = new Font(FontFamily.GenericSansSerif, 12.0f, FontStyle.Regular);
|
||||
static readonly SolidBrush TextBrush = new SolidBrush(Color.Red);
|
||||
|
||||
public Keys GetModifiers() { return ModifierKeys; }
|
||||
|
||||
public void Bind(Map m, TileSet ts, Palette p)
|
||||
public void Bind(Map m, TileSet ts, TileSetRenderer tsr, Palette p, Palette pp)
|
||||
{
|
||||
Map = m;
|
||||
TileSet = ts;
|
||||
TileSetRenderer = tsr;
|
||||
Palette = p;
|
||||
PlayerPalettes = null;
|
||||
PlayerPalette = pp;
|
||||
playerPalettes = null;
|
||||
Chunks.Clear();
|
||||
Tool = null;
|
||||
currentTool = null;
|
||||
}
|
||||
|
||||
public void SetTool(ITool tool) { Tool = tool; ClearSelection(); }
|
||||
public void SetTool(ITool tool) { currentTool = tool; ClearSelection(); }
|
||||
|
||||
public void BindActorTemplates(IEnumerable<ActorTemplate> templates)
|
||||
{
|
||||
ActorTemplates = templates.ToDictionary(a => a.Info.Name.ToLowerInvariant());
|
||||
actorTemplates = templates.ToDictionary(a => a.Info.Name.ToLowerInvariant());
|
||||
}
|
||||
|
||||
public void BindResourceTemplates(IEnumerable<ResourceTemplate> templates)
|
||||
@@ -92,7 +119,8 @@ namespace OpenRA.Editor
|
||||
static readonly Pen SelectionPen = new Pen(Color.Blue);
|
||||
static readonly Pen PastePen = new Pen(Color.Green);
|
||||
static readonly Pen CordonPen = new Pen(Color.Red);
|
||||
int2 MousePos;
|
||||
|
||||
int2 mousePos;
|
||||
|
||||
public void Scroll(int2 dx)
|
||||
{
|
||||
@@ -144,18 +172,18 @@ namespace OpenRA.Editor
|
||||
|
||||
if (Map == null) return;
|
||||
|
||||
var oldMousePos = MousePos;
|
||||
MousePos = new int2(e.Location);
|
||||
var oldMousePos = mousePos;
|
||||
mousePos = new int2(e.Location);
|
||||
MousePositionChanged(GetBrushLocation().ToString());
|
||||
|
||||
if (e.Button == MouseButtons.Middle || (e.Button != MouseButtons.None && IsPanning))
|
||||
Scroll(oldMousePos - MousePos);
|
||||
Scroll(oldMousePos - mousePos);
|
||||
else
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
if (e.Button == MouseButtons.Right || (IsErasing && e.Button == MouseButtons.Left))
|
||||
Erase();
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||
Draw();
|
||||
|
||||
Invalidate();
|
||||
@@ -173,7 +201,7 @@ namespace OpenRA.Editor
|
||||
brushLocation.Y < 0)
|
||||
return;
|
||||
|
||||
Tool = null;
|
||||
currentTool = null;
|
||||
|
||||
var key = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == brushLocation);
|
||||
if (key.Key != null) Map.Actors.Value.Remove(key.Key);
|
||||
@@ -181,7 +209,7 @@ namespace OpenRA.Editor
|
||||
if (Map.MapResources.Value[brushLocation.X, brushLocation.Y].type != 0)
|
||||
{
|
||||
Map.MapResources.Value[brushLocation.X, brushLocation.Y] = new TileReference<byte, byte>();
|
||||
var ch = new int2((brushLocation.X) / ChunkSize, (brushLocation.Y) / ChunkSize);
|
||||
var ch = new int2(brushLocation.X / ChunkSize, brushLocation.Y / ChunkSize);
|
||||
if (Chunks.ContainsKey(ch))
|
||||
{
|
||||
Chunks[ch].Dispose();
|
||||
@@ -195,9 +223,9 @@ namespace OpenRA.Editor
|
||||
|
||||
void Draw()
|
||||
{
|
||||
if (Tool != null)
|
||||
if (currentTool != null)
|
||||
{
|
||||
Tool.Apply(this);
|
||||
currentTool.Apply(this);
|
||||
AfterChange();
|
||||
}
|
||||
else if (IsPaste)
|
||||
@@ -215,7 +243,7 @@ namespace OpenRA.Editor
|
||||
if (!IsPanning)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right) Erase();
|
||||
if (e.Button == MouseButtons.Left)
|
||||
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||
{
|
||||
Draw();
|
||||
if (!IsPaste)
|
||||
@@ -230,8 +258,7 @@ namespace OpenRA.Editor
|
||||
|
||||
Bitmap RenderChunk(int u, int v)
|
||||
{
|
||||
|
||||
var bitmap = new Bitmap(ChunkSize * TileSet.TileSize, ChunkSize * TileSet.TileSize);
|
||||
var bitmap = new Bitmap(ChunkSize * TileSetRenderer.TileSize.Width, ChunkSize * TileSetRenderer.TileSize.Height);
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
@@ -245,12 +272,12 @@ namespace OpenRA.Editor
|
||||
for (var j = 0; j < ChunkSize; j++)
|
||||
{
|
||||
var tr = Map.MapTiles.Value[u * ChunkSize + i, v * ChunkSize + j];
|
||||
var tile = TileSet.Templates[tr.type].Data;
|
||||
var index = (tr.index < tile.TileBitmapBytes.Count) ? tr.index : (byte)0;
|
||||
var rawImage = tile.TileBitmapBytes[index];
|
||||
for (var x = 0; x < TileSet.TileSize; x++)
|
||||
for (var y = 0; y < TileSet.TileSize; y++)
|
||||
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = Palette.GetColor(rawImage[x + TileSet.TileSize * y]).ToArgb();
|
||||
var tile = TileSetRenderer.Data(tr.type);
|
||||
var index = (tr.index < tile.Count) ? tr.index : (byte)0;
|
||||
var rawImage = tile[index];
|
||||
for (var x = 0; x < TileSetRenderer.TileSize.Width; x++)
|
||||
for (var y = 0; y < TileSetRenderer.TileSize.Height; y++)
|
||||
p[(j * TileSetRenderer.TileSize.Width + y) * stride + i * TileSetRenderer.TileSize.Width + x] = Palette.GetColor(rawImage[x + TileSetRenderer.TileSize.Width * y]).ToArgb();
|
||||
|
||||
if (Map.MapResources.Value[u * ChunkSize + i, v * ChunkSize + j].type != 0)
|
||||
{
|
||||
@@ -261,12 +288,12 @@ namespace OpenRA.Editor
|
||||
int* q = (int*)srcdata.Scan0.ToPointer();
|
||||
var srcstride = srcdata.Stride >> 2;
|
||||
|
||||
for (var x = 0; x < TileSet.TileSize; x++)
|
||||
for (var y = 0; y < TileSet.TileSize; y++)
|
||||
for (var x = 0; x < TileSetRenderer.TileSize.Width; x++)
|
||||
for (var y = 0; y < TileSetRenderer.TileSize.Height; y++)
|
||||
{
|
||||
var c = q[y * srcstride + x];
|
||||
if ((c & 0xff000000) != 0) /* quick & dirty, i cbf doing real alpha */
|
||||
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = c;
|
||||
p[(j * TileSetRenderer.TileSize.Width + y) * stride + i * TileSetRenderer.TileSize.Width + x] = c;
|
||||
}
|
||||
|
||||
resourceImage.UnlockBits(srcdata);
|
||||
@@ -277,12 +304,12 @@ namespace OpenRA.Editor
|
||||
bitmap.UnlockBits(data);
|
||||
|
||||
if (ShowGrid)
|
||||
using( var g = SGraphics.FromImage(bitmap) )
|
||||
using (var g = SGraphics.FromImage(bitmap))
|
||||
{
|
||||
var rect = new Rectangle(0,0,bitmap.Width, bitmap.Height);
|
||||
ControlPaint.DrawGrid( g, rect, new Size(2, Game.CellSize), Color.DarkRed );
|
||||
ControlPaint.DrawGrid( g, rect, new Size(Game.CellSize, 2), Color.DarkRed );
|
||||
ControlPaint.DrawGrid( g, rect, new Size(Game.CellSize, Game.CellSize), Color.Red );
|
||||
var rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(2, Game.CellSize), Color.DarkRed);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(Game.CellSize, 2), Color.DarkRed);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(Game.CellSize, Game.CellSize), Color.Red);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
@@ -290,32 +317,35 @@ namespace OpenRA.Editor
|
||||
|
||||
public CPos GetBrushLocation()
|
||||
{
|
||||
var vX = (int)Math.Floor((MousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((MousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos(vX / TileSet.TileSize, vY / TileSet.TileSize);
|
||||
var vX = (int)Math.Floor((mousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((mousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos(vX / TileSetRenderer.TileSize.Width, vY / TileSetRenderer.TileSize.Height);
|
||||
}
|
||||
|
||||
public CPos GetBrushLocationBR()
|
||||
{
|
||||
var vX = (int)Math.Floor((MousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((MousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos((vX + TileSet.TileSize - 1) / TileSet.TileSize,
|
||||
(vY + TileSet.TileSize - 1) / TileSet.TileSize);
|
||||
var vX = (int)Math.Floor((mousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((mousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos((vX + TileSetRenderer.TileSize.Width - 1) / TileSetRenderer.TileSize.Width,
|
||||
(vY + TileSetRenderer.TileSize.Height - 1) / TileSetRenderer.TileSize.Height);
|
||||
}
|
||||
|
||||
public void DrawActor(SGraphics g, CPos p, ActorTemplate t, ColorPalette cp)
|
||||
{
|
||||
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
|
||||
DrawImage(g, t.Bitmap, p, centered, cp);
|
||||
var actorPalette = cp;
|
||||
if (t.Appearance != null && t.Appearance.UseTerrainPalette)
|
||||
actorPalette = Palette.AsSystemPalette();
|
||||
DrawImage(g, t.Bitmap, p, centered, actorPalette);
|
||||
}
|
||||
|
||||
float2 GetDrawPosition(CPos location, Bitmap bmp, bool centered)
|
||||
{
|
||||
float offsetX = centered ? bmp.Width / 2 - TileSet.TileSize / 2 : 0;
|
||||
float drawX = TileSet.TileSize * location.X * Zoom + Offset.X - offsetX;
|
||||
float offsetX = centered ? bmp.Width / 2 - TileSetRenderer.TileSize.Width / 2 : 0;
|
||||
float drawX = TileSetRenderer.TileSize.Width * location.X * Zoom + Offset.X - offsetX;
|
||||
|
||||
float offsetY = centered ? bmp.Height / 2 - TileSet.TileSize / 2 : 0;
|
||||
float drawY = TileSet.TileSize * location.Y * Zoom + Offset.Y - offsetY;
|
||||
float offsetY = centered ? bmp.Height / 2 - TileSetRenderer.TileSize.Height / 2 : 0;
|
||||
float drawY = TileSetRenderer.TileSize.Height * location.Y * Zoom + Offset.Y - offsetY;
|
||||
|
||||
return new float2(drawX, drawY);
|
||||
}
|
||||
@@ -347,18 +377,18 @@ namespace OpenRA.Editor
|
||||
{
|
||||
var pr = Map.Players[name];
|
||||
var pcpi = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
|
||||
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.ColorRamp);
|
||||
return new Palette(Palette, remap).AsSystemPalette();
|
||||
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.Color, pcpi.Ramp);
|
||||
return new Palette(PlayerPalette, remap).AsSystemPalette();
|
||||
}
|
||||
|
||||
Cache<string, ColorPalette> PlayerPalettes;
|
||||
Cache<string, ColorPalette> playerPalettes;
|
||||
|
||||
public ColorPalette GetPaletteForPlayer(string player)
|
||||
{
|
||||
if (PlayerPalettes == null)
|
||||
PlayerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayerInner);
|
||||
if (playerPalettes == null)
|
||||
playerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayerInner);
|
||||
|
||||
return PlayerPalettes[player];
|
||||
return playerPalettes[player];
|
||||
}
|
||||
|
||||
ColorPalette GetPaletteForActor(ActorReference ar)
|
||||
@@ -381,26 +411,26 @@ namespace OpenRA.Editor
|
||||
var x = new int2(u / ChunkSize, v / ChunkSize);
|
||||
if (!Chunks.ContainsKey(x)) Chunks[x] = RenderChunk(u / ChunkSize, v / ChunkSize);
|
||||
|
||||
Bitmap bmp = Chunks[x];
|
||||
var bmp = Chunks[x];
|
||||
|
||||
float DrawX = TileSet.TileSize * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
|
||||
float DrawY = TileSet.TileSize * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
|
||||
var drawX = TileSetRenderer.TileSize.Width * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
|
||||
var drawY = TileSetRenderer.TileSize.Height * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
|
||||
RectangleF sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
|
||||
RectangleF destRect = new RectangleF(DrawX, DrawY, bmp.Width * Zoom, bmp.Height * Zoom);
|
||||
RectangleF destRect = new RectangleF(drawX, drawY, bmp.Width * Zoom, bmp.Height * Zoom);
|
||||
e.Graphics.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
e.Graphics.DrawRectangle(CordonPen,
|
||||
Map.Bounds.Left * TileSet.TileSize * Zoom + Offset.X,
|
||||
Map.Bounds.Top * TileSet.TileSize * Zoom + Offset.Y,
|
||||
Map.Bounds.Width * TileSet.TileSize * Zoom,
|
||||
Map.Bounds.Height * TileSet.TileSize * Zoom);
|
||||
Map.Bounds.Left * TileSetRenderer.TileSize.Width * Zoom + Offset.X,
|
||||
Map.Bounds.Top * TileSetRenderer.TileSize.Height * Zoom + Offset.Y,
|
||||
Map.Bounds.Width * TileSetRenderer.TileSize.Width * Zoom,
|
||||
Map.Bounds.Height * TileSetRenderer.TileSize.Height * Zoom);
|
||||
|
||||
e.Graphics.DrawRectangle(SelectionPen,
|
||||
(SelectionStart.X * TileSet.TileSize * Zoom) + Offset.X,
|
||||
(SelectionStart.Y * TileSet.TileSize * Zoom) + Offset.Y,
|
||||
(SelectionEnd - SelectionStart).X * TileSet.TileSize * Zoom,
|
||||
(SelectionEnd - SelectionStart).Y * TileSet.TileSize * Zoom);
|
||||
(SelectionStart.X * TileSetRenderer.TileSize.Width * Zoom) + Offset.X,
|
||||
(SelectionStart.Y * TileSetRenderer.TileSize.Height * Zoom) + Offset.Y,
|
||||
(SelectionEnd - SelectionStart).X * TileSetRenderer.TileSize.Width * Zoom,
|
||||
(SelectionEnd - SelectionStart).Y * TileSetRenderer.TileSize.Height * Zoom);
|
||||
|
||||
if (IsPaste)
|
||||
{
|
||||
@@ -409,16 +439,16 @@ namespace OpenRA.Editor
|
||||
var height = Math.Abs((SelectionStart - SelectionEnd).Y);
|
||||
|
||||
e.Graphics.DrawRectangle(PastePen,
|
||||
(loc.X * TileSet.TileSize * Zoom) + Offset.X,
|
||||
(loc.Y * TileSet.TileSize * Zoom) + Offset.Y,
|
||||
width * (TileSet.TileSize * Zoom),
|
||||
height * (TileSet.TileSize * Zoom));
|
||||
(loc.X * TileSetRenderer.TileSize.Width * Zoom) + Offset.X,
|
||||
(loc.Y * TileSetRenderer.TileSize.Height * Zoom) + Offset.Y,
|
||||
width * (TileSetRenderer.TileSize.Width * Zoom),
|
||||
height * (TileSetRenderer.TileSize.Height * Zoom));
|
||||
}
|
||||
|
||||
foreach (var ar in Map.Actors.Value)
|
||||
{
|
||||
if (ActorTemplates.ContainsKey(ar.Value.Type))
|
||||
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type],
|
||||
if (actorTemplates.ContainsKey(ar.Value.Type))
|
||||
DrawActor(e.Graphics, ar.Value.Location(), actorTemplates[ar.Value.Type],
|
||||
GetPaletteForActor(ar.Value));
|
||||
else
|
||||
Console.WriteLine("Warning: Unknown or excluded actor: {0}", ar.Value.Type);
|
||||
@@ -428,19 +458,40 @@ namespace OpenRA.Editor
|
||||
foreach (var ar in Map.Actors.Value)
|
||||
if (!ar.Key.StartsWith("Actor")) // if it has a custom name
|
||||
e.Graphics.DrawStringContrast(Font, ar.Key,
|
||||
(int)(ar.Value.Location().X * TileSet.TileSize * Zoom + Offset.X),
|
||||
(int)(ar.Value.Location().Y * TileSet.TileSize * Zoom + Offset.Y),
|
||||
(int)(ar.Value.Location().X * TileSetRenderer.TileSize.Width * Zoom + Offset.X),
|
||||
(int)(ar.Value.Location().Y * TileSetRenderer.TileSize.Height * Zoom + Offset.Y),
|
||||
Brushes.White,
|
||||
Brushes.Black);
|
||||
|
||||
if (Tool != null)
|
||||
Tool.Preview(this, e.Graphics);
|
||||
if (ShowRuler && Zoom > 0.2)
|
||||
{
|
||||
for (int i = Map.Bounds.Left; i <= Map.Bounds.Right; i += 8)
|
||||
{
|
||||
if (i % 8 == 0)
|
||||
{
|
||||
PointF point = new PointF(i * TileSetRenderer.TileSize.Width * Zoom + Offset.X, (Map.Bounds.Top - 8) * TileSetRenderer.TileSize.Height * Zoom + Offset.Y);
|
||||
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
|
||||
}
|
||||
}
|
||||
|
||||
if (Tool == null)
|
||||
for (int i = Map.Bounds.Top; i <= Map.Bounds.Bottom; i += 8)
|
||||
{
|
||||
if (i % 8 == 0)
|
||||
{
|
||||
PointF point = new PointF((Map.Bounds.Left - 8) * TileSetRenderer.TileSize.Width * Zoom + Offset.X, i * TileSetRenderer.TileSize.Height * Zoom + Offset.Y);
|
||||
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentTool != null)
|
||||
currentTool.Preview(this, e.Graphics);
|
||||
|
||||
if (currentTool == null)
|
||||
{
|
||||
var x = Map.Actors.Value.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
|
||||
if (x.Key != null)
|
||||
DrawActorBorder(e.Graphics, x.Value.Location(), ActorTemplates[x.Value.Type]);
|
||||
DrawActorBorder(e.Graphics, x.Value.Location(), actorTemplates[x.Value.Type]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,7 +513,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
//todo: crash prevention
|
||||
// TODO: crash prevention
|
||||
TileSelection[x, y] = Map.MapTiles.Value[start.X + x, start.Y + y];
|
||||
ResourceSelection[x, y] = Map.MapResources.Value[start.X + x, start.Y + y];
|
||||
}
|
||||
@@ -482,7 +533,7 @@ namespace OpenRA.Editor
|
||||
var mapX = loc.X + x;
|
||||
var mapY = loc.Y + y;
|
||||
|
||||
//todo: crash prevention for outside of bounds
|
||||
// TODO: crash prevention for outside of bounds
|
||||
Map.MapTiles.Value[mapX, mapY] = TileSelection[x, y];
|
||||
Map.MapResources.Value[mapX, mapY] = ResourceSelection[x, y];
|
||||
|
||||
@@ -494,6 +545,7 @@ namespace OpenRA.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
@@ -505,22 +557,4 @@ namespace OpenRA.Editor
|
||||
ResourceSelection = null;
|
||||
}
|
||||
}
|
||||
|
||||
static class ActorReferenceExts
|
||||
{
|
||||
public static CPos Location(this ActorReference ar)
|
||||
{
|
||||
return (CPos)ar.InitDict.Get<LocationInit>().value;
|
||||
}
|
||||
|
||||
public static void DrawStringContrast(this SGraphics g, Font f, string s, int x, int y, Brush fg, Brush bg)
|
||||
{
|
||||
g.DrawString(s, f, bg, x - 1, y - 1);
|
||||
g.DrawString(s, f, bg, x + 1, y - 1);
|
||||
g.DrawString(s, f, bg, x - 1, y + 1);
|
||||
g.DrawString(s, f, bg, x + 1, y + 1);
|
||||
|
||||
g.DrawString(s, f, fg, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,14 +39,15 @@ namespace OpenRA.FileFormats
|
||||
default: s.Push(int.Parse(t)); break;
|
||||
}
|
||||
}
|
||||
|
||||
return s.Pop();
|
||||
}
|
||||
|
||||
static void ApplyBinop( Stack<int> s, Func<int,int,int> f )
|
||||
static void ApplyBinop(Stack<int> s, Func<int, int, int> f)
|
||||
{
|
||||
var x = s.Pop();
|
||||
var y = s.Pop();
|
||||
s.Push( f(x,y) );
|
||||
s.Push(f(x, y));
|
||||
}
|
||||
|
||||
static IEnumerable<string> ToPostfix(IEnumerable<string> toks, Dictionary<string, int> syms)
|
||||
|
||||
@@ -41,41 +41,6 @@ namespace OpenRA
|
||||
return a.GetTypes().Select(t => t.Namespace).Distinct().Where(n => n != null);
|
||||
}
|
||||
|
||||
public static string ReadAllText(this Stream s)
|
||||
{
|
||||
using (s)
|
||||
using (var sr = new StreamReader(s))
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
|
||||
public static byte[] ReadAllBytes(this Stream s)
|
||||
{
|
||||
using (s)
|
||||
{
|
||||
var data = new byte[s.Length - s.Position];
|
||||
s.Read(data, 0, data.Length);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Write(this Stream s, byte[] data)
|
||||
{
|
||||
s.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
public static IEnumerable<string> ReadAllLines(this Stream s)
|
||||
{
|
||||
using (var sr = new StreamReader(s))
|
||||
for (; ; )
|
||||
{
|
||||
var line = sr.ReadLine();
|
||||
if (line == null)
|
||||
yield break;
|
||||
else
|
||||
yield return line;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasAttribute<T>(this MemberInfo mi)
|
||||
{
|
||||
return mi.GetCustomAttributes(typeof(T), true).Length != 0;
|
||||
@@ -145,6 +110,14 @@ namespace OpenRA
|
||||
return xs[r.Next(xs.Length)];
|
||||
}
|
||||
|
||||
public static T RandomOrDefault<T>(this IEnumerable<T> ts, Thirdparty.Random r)
|
||||
{
|
||||
if (!ts.Any())
|
||||
return default(T);
|
||||
|
||||
return ts.Random(r);
|
||||
}
|
||||
|
||||
public static float Product(this IEnumerable<float> xs)
|
||||
{
|
||||
return xs.Aggregate(1f, (a, x) => a * x);
|
||||
@@ -156,9 +129,9 @@ namespace OpenRA
|
||||
return xs.Except(ys).Concat(ys.Except(xs));
|
||||
}
|
||||
|
||||
public static IEnumerable<T> Iterate<T>( this T t, Func<T,T> f )
|
||||
public static IEnumerable<T> Iterate<T>(this T t, Func<T, T> f)
|
||||
{
|
||||
for(;;) { yield return t; t = f(t); }
|
||||
for (;;) { yield return t; t = f(t); }
|
||||
}
|
||||
|
||||
public static int NextPowerOf2(int v)
|
||||
@@ -172,6 +145,11 @@ namespace OpenRA
|
||||
return v;
|
||||
}
|
||||
|
||||
public static bool IsPowerOf2(int v)
|
||||
{
|
||||
return (v & (v - 1)) == 0;
|
||||
}
|
||||
|
||||
public static Size NextPowerOf2(this Size s) { return new Size(NextPowerOf2(s.Width), NextPowerOf2(s.Height)); }
|
||||
|
||||
public static string JoinWith<T>(this IEnumerable<T> ts, string j)
|
||||
@@ -179,7 +157,7 @@ namespace OpenRA
|
||||
return string.Join(j, ts.Select(t => t.ToString()).ToArray());
|
||||
}
|
||||
|
||||
public static IEnumerable<T> Append<T>( this IEnumerable<T> ts, params T[] moreTs)
|
||||
public static IEnumerable<T> Append<T>(this IEnumerable<T> ts, params T[] moreTs)
|
||||
{
|
||||
return ts.Concat(moreTs);
|
||||
}
|
||||
@@ -226,8 +204,8 @@ namespace OpenRA
|
||||
// If any duplicates were found, log it and throw a descriptive error
|
||||
if (dupKeys.Count > 0)
|
||||
{
|
||||
string badKeysFormatted = String.Join(", ", dupKeys.Select(p => "{0}: [{1}]".F(logKey(p.Key), String.Join(",", p.Value.ToArray()))).ToArray());
|
||||
string msg = "{0}, duplicate values found for the following keys: {1}".F(debugName, badKeysFormatted);
|
||||
var badKeysFormatted = string.Join(", ", dupKeys.Select(p => "{0}: [{1}]".F(logKey(p.Key), string.Join(",", p.Value.ToArray()))).ToArray());
|
||||
var msg = "{0}, duplicate values found for the following keys: {1}".F(debugName, badKeysFormatted);
|
||||
Log.Write("debug", msg);
|
||||
throw new ArgumentException(msg);
|
||||
}
|
||||
@@ -254,7 +232,31 @@ namespace OpenRA
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T[,] ResizeArray<T>(T[,] ts, T t, int width, int height)
|
||||
{
|
||||
var result = new T[width, height];
|
||||
for (var i = 0; i < width; i++)
|
||||
for (var j = 0; j < height; j++)
|
||||
result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
|
||||
? ts[i, j] : t;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Rectangle Bounds(this Bitmap b) { return new Rectangle(0, 0, b.Width, b.Height); }
|
||||
|
||||
public static int ToBits(this IEnumerable<bool> bits)
|
||||
{
|
||||
var i = 0;
|
||||
var result = 0;
|
||||
foreach (var b in bits)
|
||||
if (b)
|
||||
result |= 1 << i++;
|
||||
else
|
||||
i++;
|
||||
if (i > 33)
|
||||
throw new InvalidOperationException("ToBits only accepts up to 32 values.");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Enum<T>
|
||||
|
||||
@@ -11,57 +11,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public static class FieldLoader
|
||||
{
|
||||
public static Func<string,Type,string,object> InvalidValueAction = (s,t,f) =>
|
||||
public static Func<string, Type, string, object> InvalidValueAction = (s, t, f) =>
|
||||
{
|
||||
throw new InvalidOperationException("FieldLoader: Cannot parse `{0}` into `{1}.{2}` ".F(s,f,t) );
|
||||
throw new InvalidOperationException("FieldLoader: Cannot parse `{0}` into `{1}.{2}` ".F(s, f, t));
|
||||
};
|
||||
|
||||
public static Action<string,Type> UnknownFieldAction = (s,f) =>
|
||||
public static Action<string, Type> UnknownFieldAction = (s, f) =>
|
||||
{
|
||||
throw new NotImplementedException( "FieldLoader: Missing field `{0}` on `{1}`".F( s, f.Name ) );
|
||||
throw new NotImplementedException("FieldLoader: Missing field `{0}` on `{1}`".F(s, f.Name));
|
||||
};
|
||||
|
||||
public static void Load( object self, MiniYaml my )
|
||||
public static void Load(object self, MiniYaml my)
|
||||
{
|
||||
var loadDict = typeLoadInfo[ self.GetType() ];
|
||||
var loadDict = typeLoadInfo[self.GetType()];
|
||||
|
||||
foreach( var kv in loadDict )
|
||||
foreach (var kv in loadDict)
|
||||
{
|
||||
object val;
|
||||
if( kv.Value != null )
|
||||
val = kv.Value( kv.Key.Name, kv.Key.FieldType, my );
|
||||
else if( !TryGetValueFromYaml( kv.Key.Name, kv.Key.FieldType, my, out val ) )
|
||||
if (kv.Value != null)
|
||||
val = kv.Value(kv.Key.Name, kv.Key.FieldType, my);
|
||||
else if (!TryGetValueFromYaml(kv.Key.Name, kv.Key.FieldType, my, out val))
|
||||
continue;
|
||||
|
||||
kv.Key.SetValue( self, val );
|
||||
kv.Key.SetValue(self, val);
|
||||
}
|
||||
}
|
||||
|
||||
static bool TryGetValueFromYaml( string fieldName, Type fieldType, MiniYaml yaml, out object ret )
|
||||
static bool TryGetValueFromYaml(string fieldName, Type fieldType, MiniYaml yaml, out object ret)
|
||||
{
|
||||
ret = null;
|
||||
var n = yaml.Nodes.Where( x=>x.Key == fieldName ).ToList();
|
||||
if( n.Count == 0 )
|
||||
var n = yaml.Nodes.Where(x => x.Key == fieldName).ToList();
|
||||
if (n.Count == 0)
|
||||
return false;
|
||||
if( n.Count == 1 && n[ 0 ].Value.Nodes.Count == 0 )
|
||||
if (n.Count == 1 && n[0].Value.Nodes.Count == 0)
|
||||
{
|
||||
ret = GetValue( fieldName, fieldType, n[ 0 ].Value.Value );
|
||||
ret = GetValue(fieldName, fieldType, n[0].Value.Value);
|
||||
return true;
|
||||
}
|
||||
else if ( n.Count > 1 )
|
||||
else if (n.Count > 1)
|
||||
{
|
||||
throw new InvalidOperationException("The field {0} has multiple definitions:\n{1}"
|
||||
.F(fieldName, n.Select(m => "\t- " + m.Location).JoinWith("\n")));
|
||||
}
|
||||
throw new InvalidOperationException( "TryGetValueFromYaml: unable to load field {0} (of type {1})".F( fieldName, fieldType ) );
|
||||
|
||||
throw new InvalidOperationException("TryGetValueFromYaml: unable to load field {0} (of type {1})".F(fieldName, fieldType));
|
||||
}
|
||||
|
||||
public static T Load<T>(MiniYaml y) where T : new()
|
||||
@@ -71,19 +72,19 @@ namespace OpenRA.FileFormats
|
||||
return t;
|
||||
}
|
||||
|
||||
static readonly object[] NoIndexes = {};
|
||||
public static void LoadField( object self, string key, string value )
|
||||
static readonly object[] NoIndexes = { };
|
||||
public static void LoadField(object self, string key, string value)
|
||||
{
|
||||
var field = self.GetType().GetField( key.Trim() );
|
||||
var field = self.GetType().GetField(key.Trim());
|
||||
|
||||
if( field != null )
|
||||
if (field != null)
|
||||
{
|
||||
if (!field.HasAttribute<FieldFromYamlKeyAttribute>())
|
||||
field.SetValue( self, GetValue( field.Name, field.FieldType, value ) );
|
||||
field.SetValue(self, GetValue(field.Name, field.FieldType, value));
|
||||
return;
|
||||
}
|
||||
|
||||
var prop = self.GetType().GetProperty( key.Trim() );
|
||||
var prop = self.GetType().GetProperty(key.Trim());
|
||||
|
||||
if (prop != null)
|
||||
{
|
||||
@@ -92,47 +93,48 @@ namespace OpenRA.FileFormats
|
||||
return;
|
||||
}
|
||||
|
||||
UnknownFieldAction( key.Trim(), self.GetType() );
|
||||
UnknownFieldAction(key.Trim(), self.GetType());
|
||||
}
|
||||
|
||||
public static T GetValue<T>( string field, string value )
|
||||
public static T GetValue<T>(string field, string value)
|
||||
{
|
||||
return (T) GetValue( field, typeof(T), value );
|
||||
return (T)GetValue(field, typeof(T), value);
|
||||
}
|
||||
|
||||
public static object GetValue( string field, Type fieldType, string x )
|
||||
public static object GetValue(string field, Type fieldType, string x)
|
||||
{
|
||||
if (x != null) x = x.Trim();
|
||||
if( fieldType == typeof( int ) )
|
||||
|
||||
if (fieldType == typeof(int))
|
||||
{
|
||||
int res;
|
||||
if (int.TryParse(x,out res))
|
||||
if (int.TryParse(x, out res))
|
||||
return res;
|
||||
return InvalidValueAction(x,fieldType, field);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if( fieldType == typeof( ushort ) )
|
||||
else if (fieldType == typeof(ushort))
|
||||
{
|
||||
ushort res;
|
||||
if (ushort.TryParse(x,out res))
|
||||
if (ushort.TryParse(x, out res))
|
||||
return res;
|
||||
return InvalidValueAction(x,fieldType, field);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(float))
|
||||
{
|
||||
float res;
|
||||
if (float.TryParse(x.Replace("%",""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
|
||||
return res * (x.Contains( '%' ) ? 0.01f : 1f);
|
||||
return InvalidValueAction(x,fieldType, field);
|
||||
if (float.TryParse(x.Replace("%", ""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
|
||||
return res * (x.Contains('%') ? 0.01f : 1f);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(decimal))
|
||||
{
|
||||
decimal res;
|
||||
if (decimal.TryParse(x.Replace("%",""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
|
||||
return res * (x.Contains( '%' ) ? 0.01m : 1m);
|
||||
return InvalidValueAction(x,fieldType, field);
|
||||
if (decimal.TryParse(x.Replace("%", ""), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out res))
|
||||
return res * (x.Contains('%') ? 0.01m : 1m);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(string))
|
||||
@@ -145,18 +147,75 @@ namespace OpenRA.FileFormats
|
||||
return Color.FromArgb(int.Parse(parts[0]).Clamp(0, 255), int.Parse(parts[1]).Clamp(0, 255), int.Parse(parts[2]).Clamp(0, 255));
|
||||
if (parts.Length == 4)
|
||||
return Color.FromArgb(int.Parse(parts[0]).Clamp(0, 255), int.Parse(parts[1]).Clamp(0, 255), int.Parse(parts[2]).Clamp(0, 255), int.Parse(parts[3]).Clamp(0, 255));
|
||||
return InvalidValueAction(x,fieldType, field);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(ColorRamp))
|
||||
else if (fieldType == typeof(HSLColor))
|
||||
{
|
||||
var parts = x.Split(',');
|
||||
if (parts.Length == 4)
|
||||
return new ColorRamp(
|
||||
|
||||
// Allow old ColorRamp format to be parsed as HSLColor
|
||||
if (parts.Length == 3 || parts.Length == 4)
|
||||
return new HSLColor(
|
||||
(byte)int.Parse(parts[0]).Clamp(0, 255),
|
||||
(byte)int.Parse(parts[1]).Clamp(0, 255),
|
||||
(byte)int.Parse(parts[2]).Clamp(0, 255),
|
||||
(byte)int.Parse(parts[3]).Clamp(0, 255));
|
||||
(byte)int.Parse(parts[2]).Clamp(0, 255));
|
||||
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(WRange))
|
||||
{
|
||||
WRange res;
|
||||
if (WRange.TryParse(x, out res))
|
||||
return res;
|
||||
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(WVec))
|
||||
{
|
||||
var parts = x.Split(',');
|
||||
if (parts.Length == 3)
|
||||
{
|
||||
WRange rx, ry, rz;
|
||||
if (WRange.TryParse(parts[0], out rx) && WRange.TryParse(parts[1], out ry) && WRange.TryParse(parts[2], out rz))
|
||||
return new WVec(rx, ry, rz);
|
||||
}
|
||||
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(WPos))
|
||||
{
|
||||
var parts = x.Split(',');
|
||||
if (parts.Length == 3)
|
||||
{
|
||||
WRange rx, ry, rz;
|
||||
if (WRange.TryParse(parts[0], out rx) && WRange.TryParse(parts[1], out ry) && WRange.TryParse(parts[2], out rz))
|
||||
return new WPos(rx, ry, rz);
|
||||
}
|
||||
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(WAngle))
|
||||
{
|
||||
int res;
|
||||
if (int.TryParse(x, out res))
|
||||
return new WAngle(res);
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(WRot))
|
||||
{
|
||||
var parts = x.Split(',');
|
||||
if (parts.Length == 3)
|
||||
{
|
||||
int rr, rp, ry;
|
||||
if (int.TryParse(x, out rr) && int.TryParse(x, out rp) && int.TryParse(x, out ry))
|
||||
return new WRot(new WAngle(rr), new WAngle(rp), new WAngle(ry));
|
||||
}
|
||||
|
||||
return InvalidValueAction(x, fieldType, field);
|
||||
}
|
||||
@@ -183,11 +242,13 @@ namespace OpenRA.FileFormats
|
||||
ret.SetValue(GetValue(field, fieldType.GetElementType(), parts[i].Trim()), i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(int2))
|
||||
{
|
||||
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
return new int2(int.Parse(parts[0]), int.Parse(parts[1]));
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(float2))
|
||||
{
|
||||
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -200,11 +261,13 @@ namespace OpenRA.FileFormats
|
||||
yy = res * (parts[1].Contains('%') ? 0.01f : 1f);
|
||||
return new float2(xx, yy);
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(Rectangle))
|
||||
{
|
||||
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
return new Rectangle(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
|
||||
}
|
||||
|
||||
else if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Bits<>))
|
||||
{
|
||||
var parts = x.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -213,62 +276,69 @@ namespace OpenRA.FileFormats
|
||||
return fieldType.GetConstructor(argTypes).Invoke(argValues);
|
||||
}
|
||||
|
||||
UnknownFieldAction("[Type] {0}".F(x),fieldType);
|
||||
else if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Nullable<>))
|
||||
{
|
||||
var innerType = fieldType.GetGenericArguments().First();
|
||||
var innerValue = GetValue("Nullable<T>", innerType, x);
|
||||
return fieldType.GetConstructor(new []{ innerType }).Invoke(new []{ innerValue });
|
||||
}
|
||||
|
||||
UnknownFieldAction("[Type] {0}".F(x), fieldType);
|
||||
return null;
|
||||
}
|
||||
|
||||
static object ParseYesNo( string p, System.Type fieldType, string field )
|
||||
static object ParseYesNo(string p, System.Type fieldType, string field)
|
||||
{
|
||||
p = p.ToLowerInvariant();
|
||||
if( p == "yes" ) return true;
|
||||
if( p == "true" ) return true;
|
||||
if( p == "no" ) return false;
|
||||
if( p == "false" ) return false;
|
||||
return InvalidValueAction(p,fieldType, field);
|
||||
if (p == "yes") return true;
|
||||
if (p == "true") return true;
|
||||
if (p == "no") return false;
|
||||
if (p == "false") return false;
|
||||
return InvalidValueAction(p, fieldType, field);
|
||||
}
|
||||
|
||||
static Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>> typeLoadInfo = new Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>>( GetTypeLoadInfo );
|
||||
static Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>> typeLoadInfo = new Cache<Type, Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>>(GetTypeLoadInfo);
|
||||
|
||||
static Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>> GetTypeLoadInfo( Type type )
|
||||
static Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>> GetTypeLoadInfo(Type type)
|
||||
{
|
||||
var ret = new Dictionary<FieldInfo, Func<string, Type, MiniYaml, object>>();
|
||||
|
||||
foreach( var ff in type.GetFields() )
|
||||
foreach (var ff in type.GetFields())
|
||||
{
|
||||
var field = ff;
|
||||
var ignore = field.GetCustomAttributes<IgnoreAttribute>( false );
|
||||
var loadUsing = field.GetCustomAttributes<LoadUsingAttribute>( false );
|
||||
var fromYamlKey = field.GetCustomAttributes<FieldFromYamlKeyAttribute>( false );
|
||||
if( loadUsing.Length != 0 )
|
||||
ret[ field ] = ( _1, fieldType, yaml ) => loadUsing[ 0 ].LoaderFunc( field )( yaml );
|
||||
else if( fromYamlKey.Length != 0 )
|
||||
ret[ field ] = ( f, ft, yaml ) => GetValue( f, ft, yaml.Value );
|
||||
else if( ignore.Length == 0 )
|
||||
ret[ field ] = null;
|
||||
var ignore = field.GetCustomAttributes<IgnoreAttribute>(false);
|
||||
var loadUsing = field.GetCustomAttributes<LoadUsingAttribute>(false);
|
||||
var fromYamlKey = field.GetCustomAttributes<FieldFromYamlKeyAttribute>(false);
|
||||
if (loadUsing.Length != 0)
|
||||
ret[field] = (_1, fieldType, yaml) => loadUsing[0].LoaderFunc(field)(yaml);
|
||||
else if (fromYamlKey.Length != 0)
|
||||
ret[field] = (f, ft, yaml) => GetValue(f, ft, yaml.Value);
|
||||
else if (ignore.Length == 0)
|
||||
ret[field] = null;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
[AttributeUsage( AttributeTargets.Field )]
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class IgnoreAttribute : Attribute { }
|
||||
|
||||
[AttributeUsage( AttributeTargets.Field )]
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class LoadUsingAttribute : Attribute
|
||||
{
|
||||
Func<MiniYaml, object> loaderFuncCache;
|
||||
public readonly string Loader;
|
||||
|
||||
public LoadUsingAttribute( string loader )
|
||||
public LoadUsingAttribute(string loader)
|
||||
{
|
||||
Loader = loader;
|
||||
}
|
||||
|
||||
internal Func<MiniYaml, object> LoaderFunc( FieldInfo field )
|
||||
internal Func<MiniYaml, object> LoaderFunc(FieldInfo field)
|
||||
{
|
||||
const BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
|
||||
if( loaderFuncCache == null )
|
||||
loaderFuncCache = (Func<MiniYaml, object>)Delegate.CreateDelegate( typeof( Func<MiniYaml, object> ), field.DeclaringType.GetMethod( Loader, bf ) );
|
||||
const BindingFlags BindingFlag = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
|
||||
if (loaderFuncCache == null)
|
||||
loaderFuncCache = (Func<MiniYaml, object>)Delegate.CreateDelegate(typeof(Func<MiniYaml, object>), field.DeclaringType.GetMethod(Loader, BindingFlag));
|
||||
return loaderFuncCache;
|
||||
}
|
||||
}
|
||||
@@ -281,15 +351,15 @@ namespace OpenRA.FileFormats
|
||||
var nodes = new List<MiniYamlNode>();
|
||||
string root = null;
|
||||
|
||||
foreach( var f in o.GetType().GetFields( BindingFlags.Public | BindingFlags.Instance ) )
|
||||
foreach (var f in o.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
|
||||
{
|
||||
if( f.HasAttribute<FieldFromYamlKeyAttribute>() )
|
||||
root = FormatValue( o, f );
|
||||
if (f.HasAttribute<FieldFromYamlKeyAttribute>())
|
||||
root = FormatValue(o, f);
|
||||
else
|
||||
nodes.Add( new MiniYamlNode( f.Name, FormatValue( o, f ) ) );
|
||||
nodes.Add(new MiniYamlNode(f.Name, FormatValue(o, f)));
|
||||
}
|
||||
|
||||
return new MiniYaml( root, nodes );
|
||||
return new MiniYaml(root, nodes);
|
||||
}
|
||||
|
||||
public static MiniYaml SaveDifferences(object o, object from)
|
||||
@@ -298,16 +368,14 @@ namespace OpenRA.FileFormats
|
||||
throw new InvalidOperationException("FieldLoader: can't diff objects of different types");
|
||||
|
||||
var fields = o.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
.Where(f => FormatValue(o,f) != FormatValue(from,f));
|
||||
.Where(f => FormatValue(o, f) != FormatValue(from, f));
|
||||
|
||||
return new MiniYaml( null, fields.Select( f => new MiniYamlNode(
|
||||
f.Name,
|
||||
FormatValue( o, f ) ) ).ToList() );
|
||||
return new MiniYaml(null, fields.Select(f => new MiniYamlNode(f.Name, FormatValue(o, f))).ToList());
|
||||
}
|
||||
|
||||
public static MiniYamlNode SaveField(object o, string field)
|
||||
{
|
||||
return new MiniYamlNode(field, FieldSaver.FormatValue( o, o.GetType().GetField(field) ));
|
||||
return new MiniYamlNode(field, FieldSaver.FormatValue(o, o.GetType().GetField(field)));
|
||||
}
|
||||
|
||||
public static string FormatValue(object v, Type t)
|
||||
@@ -351,4 +419,11 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
|
||||
public class FieldFromYamlKeyAttribute : Attribute { }
|
||||
|
||||
// mirrors DescriptionAttribute from System.ComponentModel but we dont want to have to use that everywhere.
|
||||
public class DescAttribute : Attribute
|
||||
{
|
||||
public readonly string[] Lines;
|
||||
public DescAttribute(params string[] lines) { Lines = lines; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public static class AudLoader
|
||||
{
|
||||
static int[] IndexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 };
|
||||
static int[] StepTable = {
|
||||
static int[] indexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 };
|
||||
static int[] stepTable = {
|
||||
7, 8, 9, 10, 11, 12, 13, 14, 16,
|
||||
17, 19, 21, 23, 25, 28, 31, 34, 37,
|
||||
41, 45, 50, 55, 60, 66, 73, 80, 88,
|
||||
@@ -62,14 +62,14 @@ namespace OpenRA.FileFormats
|
||||
var sb = (b & 8) != 0;
|
||||
b &= 7;
|
||||
|
||||
var delta = (StepTable[index] * b) / 4 + StepTable[index] / 8;
|
||||
var delta = (stepTable[index] * b) / 4 + stepTable[index] / 8;
|
||||
if (sb) delta = -delta;
|
||||
|
||||
current += delta;
|
||||
if (current > short.MaxValue) current = short.MaxValue;
|
||||
if (current < short.MinValue) current = short.MinValue;
|
||||
|
||||
index += IndexAdjust[b];
|
||||
index += indexAdjust[b];
|
||||
if (index < 0) index = 0;
|
||||
if (index > 88) index = 88;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenRA.FileFormats
|
||||
var sampleRate = br.ReadUInt16();
|
||||
/*var dataSize = */ br.ReadInt32();
|
||||
var outputSize = br.ReadInt32();
|
||||
var flags = (SoundFlags) br.ReadByte();
|
||||
var flags = (SoundFlags)br.ReadByte();
|
||||
|
||||
var samples = outputSize;
|
||||
if (0 != (flags & SoundFlags.Stereo)) samples /= 2;
|
||||
|
||||
@@ -59,24 +59,24 @@ namespace OpenRA.FileFormats
|
||||
// Decode PKWare Compression Library stream.
|
||||
public static byte[] Decompress(byte[] src)
|
||||
{
|
||||
BitReader br = new BitReader(src);
|
||||
var br = new BitReader(src);
|
||||
|
||||
// Are literals coded?
|
||||
int coded = br.ReadBits(8);
|
||||
var coded = br.ReadBits(8);
|
||||
|
||||
if (coded < 0 || coded > 1)
|
||||
throw new NotImplementedException("Invalid datastream");
|
||||
bool EncodedLiterals = (coded == 1);
|
||||
var EncodedLiterals = coded == 1;
|
||||
|
||||
// log2(dictionary size) - 6
|
||||
int dict = br.ReadBits(8);
|
||||
var dict = br.ReadBits(8);
|
||||
if (dict < 4 || dict > 6)
|
||||
throw new InvalidDataException("Invalid dictionary size");
|
||||
|
||||
// output state
|
||||
ushort next = 0; // index of next write location in out[]
|
||||
bool first = true; // true to check distances (for first 4K)
|
||||
byte[] outBuffer = new byte[MAXWIN]; // output buffer and sliding window
|
||||
var first = true; // true to check distances (for first 4K)
|
||||
var outBuffer = new byte[MAXWIN]; // output buffer and sliding window
|
||||
var ms = new MemoryStream();
|
||||
|
||||
// decode literals and length/distance pairs
|
||||
@@ -86,9 +86,11 @@ namespace OpenRA.FileFormats
|
||||
if (br.ReadBits(1) == 1)
|
||||
{
|
||||
// Length
|
||||
int symbol = Decode(lencode, br);
|
||||
int len = lengthbase[symbol] + br.ReadBits(extra[symbol]);
|
||||
if (len == 519) // Magic number for "done"
|
||||
var symbol = Decode(lencode, br);
|
||||
var len = lengthbase[symbol] + br.ReadBits(extra[symbol]);
|
||||
|
||||
// Magic number for "done"
|
||||
if (len == 519)
|
||||
{
|
||||
for (int i = 0; i < next; i++)
|
||||
ms.WriteByte(outBuffer[i]);
|
||||
@@ -97,7 +99,7 @@ namespace OpenRA.FileFormats
|
||||
|
||||
// Distance
|
||||
symbol = len == 2 ? 2 : dict;
|
||||
int dist = Decode(distcode, br) << symbol;
|
||||
var dist = Decode(distcode, br) << symbol;
|
||||
dist += br.ReadBits(symbol);
|
||||
dist++;
|
||||
|
||||
@@ -107,10 +109,10 @@ namespace OpenRA.FileFormats
|
||||
// copy length bytes from distance bytes back
|
||||
do
|
||||
{
|
||||
int dest = next;
|
||||
int source = dest - dist;
|
||||
var dest = next;
|
||||
var source = dest - dist;
|
||||
|
||||
int copy = MAXWIN;
|
||||
var copy = MAXWIN;
|
||||
if (next < dist)
|
||||
{
|
||||
source += copy;
|
||||
@@ -127,7 +129,7 @@ namespace OpenRA.FileFormats
|
||||
// copy with old-fashioned memcpy semantics
|
||||
// in case of overlapping ranges. this is NOT
|
||||
// the same as Array.Copy()
|
||||
while( copy-- > 0 )
|
||||
while (copy-- > 0)
|
||||
outBuffer[dest++] = outBuffer[source++];
|
||||
|
||||
// Flush window to outstream
|
||||
@@ -140,9 +142,10 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
} while (len != 0);
|
||||
}
|
||||
else // literal value
|
||||
// literal value
|
||||
else
|
||||
{
|
||||
int symbol = EncodedLiterals ? Decode(litcode, br) : br.ReadBits(8);
|
||||
var symbol = EncodedLiterals ? Decode(litcode, br) : br.ReadBits(8);
|
||||
outBuffer[next++] = (byte)symbol;
|
||||
if (next == MAXWIN)
|
||||
{
|
||||
@@ -160,9 +163,9 @@ namespace OpenRA.FileFormats
|
||||
// Decode a code using huffman table h.
|
||||
static int Decode(Huffman h, BitReader br)
|
||||
{
|
||||
int code = 0; // len bits being decoded
|
||||
int first = 0; // first code of length len
|
||||
int index = 0; // index of first code of length len in symbol table
|
||||
var code = 0; // len bits being decoded
|
||||
var first = 0; // first code of length len
|
||||
var index = 0; // index of first code of length len in symbol table
|
||||
short next = 1;
|
||||
while (true)
|
||||
{
|
||||
@@ -193,8 +196,8 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public int ReadBits(int count)
|
||||
{
|
||||
int ret = 0;
|
||||
int filled = 0;
|
||||
var ret = 0;
|
||||
var filled = 0;
|
||||
while (filled < count)
|
||||
{
|
||||
if (bitCount == 0)
|
||||
@@ -208,6 +211,7 @@ namespace OpenRA.FileFormats
|
||||
bitCount--;
|
||||
filled++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -226,21 +230,22 @@ namespace OpenRA.FileFormats
|
||||
public short[] Count; // number of symbols of each length
|
||||
public short[] Symbol; // canonically ordered symbols
|
||||
|
||||
public Huffman(byte[] rep, int n, short SymbolCount)
|
||||
public Huffman(byte[] rep, int n, short symbolCount)
|
||||
{
|
||||
short[] length = new short[256]; // code lengths
|
||||
int s = 0; // current symbol
|
||||
var length = new short[256]; // code lengths
|
||||
var s = 0; // current symbol
|
||||
|
||||
// convert compact repeat counts into symbol bit length list
|
||||
foreach (byte code in rep)
|
||||
{
|
||||
int num = (code >> 4) + 1; // Number of codes (top four bits plus 1)
|
||||
byte len = (byte)(code & 15); // Code length (low four bits)
|
||||
var num = (code >> 4) + 1; // Number of codes (top four bits plus 1)
|
||||
var len = (byte)(code & 15); // Code length (low four bits)
|
||||
do
|
||||
{
|
||||
length[s++] = len;
|
||||
} while (--num > 0);
|
||||
}
|
||||
|
||||
n = s;
|
||||
|
||||
// count number of codes of each length
|
||||
@@ -253,24 +258,22 @@ namespace OpenRA.FileFormats
|
||||
return;
|
||||
|
||||
// check for an over-subscribed or incomplete set of lengths
|
||||
int left = 1; // one possible code of zero length
|
||||
var left = 1; // one possible code of zero length
|
||||
for (int len = 1; len <= Blast.MAXBITS; len++)
|
||||
{
|
||||
left <<= 1;
|
||||
// one more bit, double codes left
|
||||
left -= Count[len];
|
||||
// deduct count from possible codes
|
||||
left <<= 1; // one more bit, double codes left
|
||||
left -= Count[len]; // deduct count from possible codes
|
||||
if (left < 0)
|
||||
throw new InvalidDataException ("over subscribed code set");
|
||||
throw new InvalidDataException("over subscribed code set");
|
||||
}
|
||||
|
||||
// generate offsets into symbol table for each length for sorting
|
||||
short[] offs = new short[Blast.MAXBITS + 1];
|
||||
var offs = new short[Blast.MAXBITS + 1];
|
||||
for (int len = 1; len < Blast.MAXBITS; len++)
|
||||
offs[len + 1] = (short)(offs[len] + Count[len]);
|
||||
|
||||
// put symbols in table sorted by length, by symbol order within each length
|
||||
Symbol = new short[SymbolCount];
|
||||
Symbol = new short[symbolCount];
|
||||
for (short i = 0; i < n; i++)
|
||||
if (length[i] != 0)
|
||||
Symbol[offs[length[i]]++] = i;
|
||||
|
||||
125
OpenRA.FileFormats/FileFormats/CRC32.cs
Normal file
125
OpenRA.FileFormats/FileFormats/CRC32.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Static class that uses a lookup table to calculates CRC32
|
||||
/// checksums of input strings.
|
||||
/// </summary>
|
||||
public static class CRC32
|
||||
{
|
||||
/// <summary>
|
||||
/// The CRC32 lookup table
|
||||
/// </summary>
|
||||
static uint[] lookUp = new uint[256]
|
||||
{
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
||||
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
|
||||
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
|
||||
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
|
||||
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
|
||||
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
|
||||
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
|
||||
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
|
||||
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
|
||||
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
|
||||
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
|
||||
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
|
||||
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
|
||||
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
|
||||
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
|
||||
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
|
||||
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
|
||||
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
|
||||
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
|
||||
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
|
||||
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
|
||||
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// A fast (native) CRC32 implementation that can be used on a regular byte arrays.
|
||||
/// </summary>
|
||||
/// <param name="data">The data from which to calculate the checksum.</param>
|
||||
/// <param name="polynomal">The polynomal.</param>
|
||||
/// <returns>
|
||||
/// The calculated checksum.
|
||||
/// </returns>
|
||||
public static uint Calculate(byte[] data, uint polynomal = 0xFFFFFFFF)
|
||||
{
|
||||
uint crc = polynomal;
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ data[i]];
|
||||
crc ^= polynomal;
|
||||
return crc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A fast (native) CRC32 implementation that can be used on a pinned byte array using
|
||||
/// default polynomal.
|
||||
/// </summary>
|
||||
/// <param name="data"> [in,out] If non-null, the.</param>
|
||||
/// <param name="len"> The length of the data data.</param>
|
||||
/// <param name="polynomal">The polynomal to xor with.</param>
|
||||
/// <returns>The calculated checksum.</returns>
|
||||
public static unsafe uint Calculate(byte* data, uint len, uint polynomal = 0xFFFFFFFF)
|
||||
{
|
||||
uint crc = polynomal;
|
||||
for (int i = 0; i < len; i++)
|
||||
crc = (crc >> 8) ^ lookUp[(crc & 0xFF) ^ *data++];
|
||||
crc ^= polynomal;
|
||||
return crc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,93 +20,93 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
Dictionary<string, IniSection> sections = new Dictionary<string, IniSection>();
|
||||
|
||||
public IniFile( Stream s )
|
||||
public IniFile(Stream s)
|
||||
{
|
||||
Load( s );
|
||||
Load(s);
|
||||
}
|
||||
|
||||
public IniFile( params Stream[] streams )
|
||||
public IniFile(params Stream[] streams)
|
||||
{
|
||||
foreach( var s in streams )
|
||||
Load( s );
|
||||
foreach (var s in streams)
|
||||
Load(s);
|
||||
}
|
||||
|
||||
public void Load( Stream s )
|
||||
public void Load(Stream s)
|
||||
{
|
||||
StreamReader reader = new StreamReader( s );
|
||||
StreamReader reader = new StreamReader(s);
|
||||
IniSection currentSection = null;
|
||||
|
||||
while( !reader.EndOfStream )
|
||||
while (!reader.EndOfStream)
|
||||
{
|
||||
string line = reader.ReadLine();
|
||||
var line = reader.ReadLine();
|
||||
|
||||
if( line.Length == 0 ) continue;
|
||||
if (line.Length == 0) continue;
|
||||
|
||||
switch( line[ 0 ] )
|
||||
switch (line[0])
|
||||
{
|
||||
case ';': break;
|
||||
case '[': currentSection = ProcessSection( line ); break;
|
||||
default: ProcessEntry( line, currentSection ); break;
|
||||
case '[': currentSection = ProcessSection(line); break;
|
||||
default: ProcessEntry(line, currentSection); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Regex sectionPattern = new Regex( @"^\[([^]]*)\]" );
|
||||
Regex sectionPattern = new Regex(@"^\[([^]]*)\]");
|
||||
|
||||
IniSection ProcessSection( string line )
|
||||
IniSection ProcessSection(string line)
|
||||
{
|
||||
Match m = sectionPattern.Match( line );
|
||||
if( m == null || !m.Success )
|
||||
Match m = sectionPattern.Match(line);
|
||||
if (m == null || !m.Success)
|
||||
return null;
|
||||
string sectionName = m.Groups[ 1 ].Value.ToLowerInvariant();
|
||||
string sectionName = m.Groups[1].Value.ToLowerInvariant();
|
||||
|
||||
IniSection ret;
|
||||
if( !sections.TryGetValue( sectionName, out ret ) )
|
||||
sections.Add( sectionName, ret = new IniSection( sectionName ) );
|
||||
if (!sections.TryGetValue(sectionName, out ret))
|
||||
sections.Add(sectionName, ret = new IniSection(sectionName));
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ProcessEntry( string line, IniSection currentSection )
|
||||
bool ProcessEntry(string line, IniSection currentSection)
|
||||
{
|
||||
int comment = line.IndexOf( ';' );
|
||||
if( comment >= 0 )
|
||||
line = line.Substring( 0, comment );
|
||||
var comment = line.IndexOf(';');
|
||||
if (comment >= 0)
|
||||
line = line.Substring(0, comment);
|
||||
|
||||
line = line.Trim();
|
||||
if( line.Length == 0 )
|
||||
if (line.Length == 0)
|
||||
return false;
|
||||
|
||||
var key = line;
|
||||
var value = "";
|
||||
int eq = line.IndexOf( '=' );
|
||||
if( eq >= 0 )
|
||||
int eq = line.IndexOf('=');
|
||||
if (eq >= 0)
|
||||
{
|
||||
key = line.Substring( 0, eq );
|
||||
value = line.Substring( eq + 1, line.Length - eq - 1 );
|
||||
key = line.Substring(0, eq);
|
||||
value = line.Substring(eq + 1, line.Length - eq - 1);
|
||||
}
|
||||
|
||||
if( currentSection == null )
|
||||
throw new InvalidOperationException( "No current INI section" );
|
||||
if (currentSection == null)
|
||||
throw new InvalidOperationException("No current INI section");
|
||||
|
||||
if( !currentSection.Contains( key ) )
|
||||
currentSection.Add( key, value );
|
||||
if (!currentSection.Contains(key))
|
||||
currentSection.Add(key, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
public IniSection GetSection( string s )
|
||||
public IniSection GetSection(string s)
|
||||
{
|
||||
return GetSection( s, false );
|
||||
return GetSection(s, false);
|
||||
}
|
||||
|
||||
public IniSection GetSection( string s, bool allowFail )
|
||||
public IniSection GetSection(string s, bool allowFail)
|
||||
{
|
||||
IniSection section;
|
||||
if( sections.TryGetValue( s.ToLowerInvariant(), out section ) )
|
||||
if (sections.TryGetValue(s.ToLowerInvariant(), out section))
|
||||
return section;
|
||||
|
||||
if( allowFail )
|
||||
return new IniSection( s );
|
||||
throw new InvalidOperationException( "Section does not exist in map or rules: " + s );
|
||||
if (allowFail)
|
||||
return new IniSection(s);
|
||||
throw new InvalidOperationException("Section does not exist in map or rules: " + s);
|
||||
}
|
||||
|
||||
public IEnumerable<IniSection> Sections { get { return sections.Values; } }
|
||||
@@ -117,25 +117,25 @@ namespace OpenRA.FileFormats
|
||||
public string Name { get; private set; }
|
||||
Dictionary<string, string> values = new Dictionary<string, string>();
|
||||
|
||||
public IniSection( string name )
|
||||
public IniSection(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public void Add( string key, string value )
|
||||
public void Add(string key, string value)
|
||||
{
|
||||
values[key] = value;
|
||||
}
|
||||
|
||||
public bool Contains( string key )
|
||||
public bool Contains(string key)
|
||||
{
|
||||
return values.ContainsKey( key );
|
||||
return values.ContainsKey(key);
|
||||
}
|
||||
|
||||
public string GetValue( string key, string defaultValue )
|
||||
public string GetValue(string key, string defaultValue)
|
||||
{
|
||||
string s;
|
||||
return values.TryGetValue( key, out s ) ? s : defaultValue;
|
||||
return values.TryGetValue(key, out s) ? s : defaultValue;
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
|
||||
|
||||
75
OpenRA.FileFormats/FileFormats/WavLoader.cs
Normal file
75
OpenRA.FileFormats/FileFormats/WavLoader.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class WavLoader
|
||||
{
|
||||
public readonly int FileSize;
|
||||
public readonly string Format;
|
||||
|
||||
public readonly int FmtChunkSize;
|
||||
public readonly int AudioFormat;
|
||||
public readonly int Channels;
|
||||
public readonly int SampleRate;
|
||||
public readonly int ByteRate;
|
||||
public readonly int BlockAlign;
|
||||
public readonly int BitsPerSample;
|
||||
|
||||
public readonly int DataSize;
|
||||
public readonly byte[] RawOutput;
|
||||
|
||||
public WavLoader(Stream s)
|
||||
{
|
||||
while (s.Position < s.Length)
|
||||
{
|
||||
if ((s.Position & 1) == 1)
|
||||
s.ReadByte(); // Alignment
|
||||
|
||||
var type = s.ReadASCII(4);
|
||||
switch (type)
|
||||
{
|
||||
case "RIFF":
|
||||
FileSize = s.ReadInt32();
|
||||
Format = s.ReadASCII(4);
|
||||
if (Format != "WAVE")
|
||||
throw new NotSupportedException("Not a canonical WAVE file.");
|
||||
break;
|
||||
case "fmt ":
|
||||
FmtChunkSize = s.ReadInt32();
|
||||
if (FmtChunkSize != 16)
|
||||
throw new NotSupportedException("{0} fmt chunk size is not a supported encoding scheme.".F(FmtChunkSize));
|
||||
AudioFormat = s.ReadInt16();
|
||||
if (AudioFormat != 1)
|
||||
throw new NotSupportedException("Non-PCM compression is not supported.");
|
||||
Channels = s.ReadInt16();
|
||||
SampleRate = s.ReadInt32();
|
||||
ByteRate = s.ReadInt32();
|
||||
BlockAlign = s.ReadInt16();
|
||||
BitsPerSample = s.ReadInt16();
|
||||
break;
|
||||
case "data":
|
||||
DataSize = s.ReadInt32();
|
||||
RawOutput = s.ReadBytes(DataSize);
|
||||
break;
|
||||
default:
|
||||
// Ignore unknown chunks
|
||||
var chunkSize = s.ReadInt32();
|
||||
s.ReadBytes(chunkSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
44
OpenRA.FileFormats/FileFormats/XccGlobalDatabase.cs
Normal file
44
OpenRA.FileFormats/FileFormats/XccGlobalDatabase.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class XccGlobalDatabase
|
||||
{
|
||||
public readonly string[] Entries;
|
||||
public XccGlobalDatabase(Stream s)
|
||||
{
|
||||
var entries = new List<string>();
|
||||
var reader = new BinaryReader(s);
|
||||
while (reader.PeekChar() > -1)
|
||||
{
|
||||
var count = reader.ReadInt32();
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var chars = new List<char>();
|
||||
char c;
|
||||
|
||||
// Read filename
|
||||
while ((c = reader.ReadChar()) != 0)
|
||||
chars.Add(c);
|
||||
entries.Add(new string(chars.ToArray()));
|
||||
|
||||
// Skip comment
|
||||
while ((c = reader.ReadChar()) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
Entries = entries.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
67
OpenRA.FileFormats/FileFormats/XccLocalDatabase.cs
Normal file
67
OpenRA.FileFormats/FileFormats/XccLocalDatabase.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class XccLocalDatabase
|
||||
{
|
||||
public readonly string[] Entries;
|
||||
public XccLocalDatabase(Stream s)
|
||||
{
|
||||
// Skip unnecessary header data
|
||||
s.Seek(48, SeekOrigin.Begin);
|
||||
var reader = new BinaryReader(s);
|
||||
var count = reader.ReadInt32();
|
||||
Entries = new string[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var chars = new List<char>();
|
||||
char c;
|
||||
while ((c = reader.ReadChar()) != 0)
|
||||
chars.Add(c);
|
||||
|
||||
Entries[i] = new string(chars.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public XccLocalDatabase(IEnumerable<string> filenames)
|
||||
{
|
||||
Entries = filenames.ToArray();
|
||||
}
|
||||
|
||||
public byte[] Data()
|
||||
{
|
||||
var data = new MemoryStream();
|
||||
using (var writer = new BinaryWriter(data))
|
||||
{
|
||||
writer.Write(Encoding.ASCII.GetBytes("XCC by Olaf van der Spek"));
|
||||
writer.Write(new byte[] {0x1A,0x04,0x17,0x27,0x10,0x19,0x80,0x00});
|
||||
|
||||
writer.Write((int)(Entries.Aggregate(Entries.Length, (a,b) => a + b.Length) + 52)); // Size
|
||||
writer.Write((int)0); // Type
|
||||
writer.Write((int)0); // Version
|
||||
writer.Write((int)0); // Game/Format (0 == TD)
|
||||
writer.Write((int)Entries.Length); // Entries
|
||||
foreach (var e in Entries)
|
||||
{
|
||||
writer.Write(Encoding.ASCII.GetBytes(e));
|
||||
writer.Write((byte)0);
|
||||
}
|
||||
}
|
||||
|
||||
return data.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
102
OpenRA.FileFormats/Filesystem/D2kSoundResources.cs
Normal file
102
OpenRA.FileFormats/Filesystem/D2kSoundResources.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class D2kSoundResources : IFolder
|
||||
{
|
||||
readonly Stream s;
|
||||
|
||||
readonly string filename;
|
||||
readonly List<string> filenames;
|
||||
readonly int priority;
|
||||
|
||||
readonly Dictionary<uint, PackageEntry> index = new Dictionary<uint, PackageEntry>();
|
||||
|
||||
public D2kSoundResources(string filename, int priority)
|
||||
{
|
||||
this.filename = filename;
|
||||
this.priority = priority;
|
||||
|
||||
s = FileSystem.Open(filename);
|
||||
s.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
filenames = new List<string>();
|
||||
|
||||
var headerLength = s.ReadUInt32();
|
||||
while (s.Position < headerLength + 4)
|
||||
{
|
||||
var name = s.ReadASCIIZ();
|
||||
var offset = s.ReadUInt32();
|
||||
var length = s.ReadUInt32();
|
||||
|
||||
var hash = PackageEntry.HashFilename(name, PackageHashType.Classic);
|
||||
if (!index.ContainsKey(hash))
|
||||
index.Add(hash, new PackageEntry(hash, offset, length));
|
||||
|
||||
filenames.Add(name);
|
||||
}
|
||||
}
|
||||
|
||||
public Stream GetContent(uint hash)
|
||||
{
|
||||
PackageEntry e;
|
||||
if (!index.TryGetValue(hash, out e))
|
||||
return null;
|
||||
|
||||
s.Seek(e.Offset, SeekOrigin.Begin);
|
||||
var data = new byte[e.Length];
|
||||
s.Read(data, 0, (int)e.Length);
|
||||
|
||||
return new MemoryStream(data);
|
||||
}
|
||||
|
||||
public Stream GetContent(string filename)
|
||||
{
|
||||
return GetContent(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
||||
}
|
||||
|
||||
public bool Exists(string filename)
|
||||
{
|
||||
return index.ContainsKey(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
||||
}
|
||||
|
||||
public IEnumerable<string> AllFileNames()
|
||||
{
|
||||
return filenames;
|
||||
}
|
||||
|
||||
public string Name { get { return filename; } }
|
||||
|
||||
public int Priority { get { return 1000 + priority; }}
|
||||
|
||||
public IEnumerable<uint> ClassicHashes()
|
||||
{
|
||||
return index.Keys;
|
||||
}
|
||||
|
||||
public IEnumerable<uint> CrcHashes()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void Write(Dictionary<string, byte[]> contents)
|
||||
{
|
||||
throw new NotImplementedException("Cannot save Dune 2000 Sound Resources.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,29 +18,33 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public static class FileSystem
|
||||
{
|
||||
static List<IFolder> mountedFolders = new List<IFolder>();
|
||||
public static List<IFolder> MountedFolders = new List<IFolder>();
|
||||
static Cache<uint, List<IFolder>> classicHashIndex = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
||||
static Cache<uint, List<IFolder>> crcHashIndex = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
||||
|
||||
static Cache<uint, List<IFolder>> allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
||||
public static List<string> FolderPaths = new List<string>();
|
||||
|
||||
static void MountInner(IFolder folder)
|
||||
{
|
||||
mountedFolders.Add(folder);
|
||||
MountedFolders.Add(folder);
|
||||
|
||||
foreach( var hash in folder.AllFileHashes() )
|
||||
foreach (var hash in folder.ClassicHashes())
|
||||
{
|
||||
var l = allFiles[hash];
|
||||
if( !l.Contains( folder ) )
|
||||
l.Add( folder );
|
||||
var l = classicHashIndex[hash];
|
||||
if (!l.Contains(folder))
|
||||
l.Add(folder);
|
||||
}
|
||||
|
||||
foreach (var hash in folder.CrcHashes())
|
||||
{
|
||||
var l = crcHashIndex[hash];
|
||||
if (!l.Contains(folder))
|
||||
l.Add(folder);
|
||||
}
|
||||
}
|
||||
|
||||
static int order = 0;
|
||||
|
||||
static IFolder OpenPackage(string filename)
|
||||
{
|
||||
return OpenPackage(filename, order++);
|
||||
}
|
||||
|
||||
public static IFolder CreatePackage(string filename, int order, Dictionary<string, byte[]> content)
|
||||
{
|
||||
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
|
||||
@@ -49,20 +53,28 @@ namespace OpenRA.FileFormats
|
||||
return new ZipFile(filename, order, content);
|
||||
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new ZipFile(filename, order, content);
|
||||
else if (filename.EndsWith(".RS", StringComparison.InvariantCultureIgnoreCase))
|
||||
throw new NotImplementedException("Creating .RS archives is unsupported");
|
||||
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
|
||||
throw new NotImplementedException("Creating .Z archives is unsupported");
|
||||
else
|
||||
return new Folder(filename, order, content);
|
||||
}
|
||||
|
||||
public static IFolder OpenPackage(string filename, int order)
|
||||
public static IFolder OpenPackage(string filename, string annotation, int order)
|
||||
{
|
||||
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new MixFile(filename, order);
|
||||
{
|
||||
var type = string.IsNullOrEmpty(annotation) ? PackageHashType.Classic :
|
||||
FieldLoader.GetValue<PackageHashType>("(value)", annotation);
|
||||
return new MixFile(filename, type, order);
|
||||
}
|
||||
else if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new ZipFile(filename, order);
|
||||
else if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new ZipFile(filename, order);
|
||||
else if (filename.EndsWith(".RS", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new D2kSoundResources(filename, order);
|
||||
else if (filename.EndsWith(".Z", StringComparison.InvariantCultureIgnoreCase))
|
||||
return new InstallShieldPackage(filename, order);
|
||||
else
|
||||
@@ -70,6 +82,11 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
|
||||
public static void Mount(string name)
|
||||
{
|
||||
Mount(name, null);
|
||||
}
|
||||
|
||||
public static void Mount(string name, string annotation)
|
||||
{
|
||||
var optional = name.StartsWith("~");
|
||||
if (optional) name = name.Substring(1);
|
||||
@@ -78,7 +95,8 @@ namespace OpenRA.FileFormats
|
||||
if (name.StartsWith("^"))
|
||||
name = Platform.SupportDir+name.Substring(1);
|
||||
|
||||
var a = (Action)(() => FileSystem.MountInner(OpenPackage(name)));
|
||||
FolderPaths.Add(name);
|
||||
Action a = () => FileSystem.MountInner(OpenPackage(name, annotation, order++));
|
||||
|
||||
if (optional)
|
||||
try { a(); }
|
||||
@@ -89,30 +107,36 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public static void UnmountAll()
|
||||
{
|
||||
mountedFolders.Clear();
|
||||
allFiles = new Cache<uint, List<IFolder>>( _ => new List<IFolder>() );
|
||||
MountedFolders.Clear();
|
||||
FolderPaths.Clear();
|
||||
classicHashIndex = new Cache<uint, List<IFolder>>(_ => new List<IFolder>());
|
||||
crcHashIndex = new Cache<uint, List<IFolder>>(_ => new List<IFolder>());
|
||||
}
|
||||
|
||||
public static bool Unmount(IFolder mount)
|
||||
{
|
||||
return (mountedFolders.RemoveAll(f => f == mount) > 0);
|
||||
return (MountedFolders.RemoveAll(f => f == mount) > 0);
|
||||
}
|
||||
|
||||
public static void Mount(IFolder mount)
|
||||
{
|
||||
if (!mountedFolders.Contains(mount)) mountedFolders.Add(mount);
|
||||
if (!MountedFolders.Contains(mount)) MountedFolders.Add(mount);
|
||||
}
|
||||
|
||||
public static void LoadFromManifest( Manifest manifest )
|
||||
public static void LoadFromManifest(Manifest manifest)
|
||||
{
|
||||
UnmountAll();
|
||||
foreach (var dir in manifest.Folders) Mount(dir);
|
||||
foreach (var pkg in manifest.Packages) Mount(pkg);
|
||||
foreach (var dir in manifest.Folders)
|
||||
Mount(dir);
|
||||
|
||||
foreach (var pkg in manifest.Packages)
|
||||
Mount(pkg.Key, pkg.Value);
|
||||
}
|
||||
|
||||
static Stream GetFromCache( Cache<uint, List<IFolder>> index, string filename )
|
||||
static Stream GetFromCache(PackageHashType type, string filename)
|
||||
{
|
||||
var folder = index[PackageEntry.HashFilename(filename)]
|
||||
var index = type == PackageHashType.CRC32 ? crcHashIndex : classicHashIndex;
|
||||
var folder = index[PackageEntry.HashFilename(filename, type)]
|
||||
.Where(x => x.Exists(filename))
|
||||
.OrderBy(x => x.Priority)
|
||||
.FirstOrDefault();
|
||||
@@ -125,21 +149,25 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public static Stream Open(string filename) { return OpenWithExts(filename, ""); }
|
||||
|
||||
public static Stream OpenWithExts( string filename, params string[] exts )
|
||||
public static Stream OpenWithExts(string filename, params string[] exts)
|
||||
{
|
||||
if( filename.IndexOfAny( new char[] { '/', '\\' } ) == -1 )
|
||||
if (filename.IndexOfAny(new char[] { '/', '\\' } ) == -1)
|
||||
{
|
||||
foreach( var ext in exts )
|
||||
foreach (var ext in exts)
|
||||
{
|
||||
var s = GetFromCache( allFiles, filename + ext );
|
||||
if( s != null )
|
||||
var s = GetFromCache(PackageHashType.Classic, filename + ext);
|
||||
if (s != null)
|
||||
return s;
|
||||
|
||||
s = GetFromCache(PackageHashType.CRC32, filename + ext);
|
||||
if (s != null)
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
foreach( var ext in exts )
|
||||
foreach (var ext in exts)
|
||||
{
|
||||
var folder = mountedFolders
|
||||
var folder = MountedFolders
|
||||
.Where(x => x.Exists(filename + ext))
|
||||
.OrderByDescending(x => x.Priority)
|
||||
.FirstOrDefault();
|
||||
@@ -151,7 +179,7 @@ namespace OpenRA.FileFormats
|
||||
throw new FileNotFoundException("File not found: {0}".F(filename), filename);
|
||||
}
|
||||
|
||||
public static bool Exists(string filename) { return mountedFolders.Any(f => f.Exists(filename)); }
|
||||
public static bool Exists(string filename) { return MountedFolders.Any(f => f.Exists(filename)); }
|
||||
|
||||
static Dictionary<string, Assembly> assemblyCache = new Dictionary<string, Assembly>();
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ namespace OpenRA.FileFormats
|
||||
public class Folder : IFolder
|
||||
{
|
||||
readonly string path;
|
||||
|
||||
int priority;
|
||||
readonly int priority;
|
||||
|
||||
// Create a new folder package
|
||||
public Folder(string path, int priority, Dictionary<string, byte[]> contents)
|
||||
@@ -45,22 +44,30 @@ namespace OpenRA.FileFormats
|
||||
catch { return null; }
|
||||
}
|
||||
|
||||
public IEnumerable<uint> AllFileHashes()
|
||||
public IEnumerable<uint> ClassicHashes()
|
||||
{
|
||||
foreach( var filename in Directory.GetFiles( path, "*", SearchOption.TopDirectoryOnly ) )
|
||||
yield return PackageEntry.HashFilename( Path.GetFileName(filename) );
|
||||
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly))
|
||||
yield return PackageEntry.HashFilename(Path.GetFileName(filename), PackageHashType.Classic);
|
||||
}
|
||||
|
||||
public IEnumerable<uint> CrcHashes()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public IEnumerable<string> AllFileNames()
|
||||
{
|
||||
foreach (var filename in Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly))
|
||||
yield return Path.GetFileName(filename);
|
||||
}
|
||||
|
||||
public bool Exists(string filename)
|
||||
{
|
||||
return File.Exists(Path.Combine(path,filename));
|
||||
return File.Exists(Path.Combine(path, filename));
|
||||
}
|
||||
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return priority; }
|
||||
}
|
||||
public int Priority { get { return priority; } }
|
||||
public string Name { get { return path; } }
|
||||
|
||||
public void Write(Dictionary<string, byte[]> contents)
|
||||
{
|
||||
|
||||
@@ -18,13 +18,17 @@ namespace OpenRA.FileFormats
|
||||
public class InstallShieldPackage : IFolder
|
||||
{
|
||||
readonly Dictionary<uint, PackageEntry> index = new Dictionary<uint, PackageEntry>();
|
||||
readonly List<string> filenames;
|
||||
readonly Stream s;
|
||||
readonly long dataStart = 255;
|
||||
int priority;
|
||||
readonly int priority;
|
||||
readonly string filename;
|
||||
|
||||
public InstallShieldPackage(string filename, int priority)
|
||||
{
|
||||
this.filename = filename;
|
||||
this.priority = priority;
|
||||
filenames = new List<string>();
|
||||
s = FileSystem.Open(filename);
|
||||
|
||||
// Parse package header
|
||||
@@ -45,11 +49,20 @@ namespace OpenRA.FileFormats
|
||||
// Parse the directory list
|
||||
s.Seek(TOCAddress, SeekOrigin.Begin);
|
||||
BinaryReader TOCreader = new BinaryReader(s);
|
||||
|
||||
var fileCountInDirs = new List<uint>();
|
||||
// Parse directories
|
||||
for (var i = 0; i < DirCount; i++)
|
||||
ParseDirectory(TOCreader);
|
||||
fileCountInDirs.Add(ParseDirectory(TOCreader));
|
||||
|
||||
// Parse files
|
||||
foreach (var fileCount in fileCountInDirs)
|
||||
for (var i = 0; i < fileCount; i++)
|
||||
ParseFile(reader);
|
||||
|
||||
}
|
||||
|
||||
void ParseDirectory(BinaryReader reader)
|
||||
uint ParseDirectory(BinaryReader reader)
|
||||
{
|
||||
// Parse directory header
|
||||
var FileCount = reader.ReadUInt16();
|
||||
@@ -59,10 +72,7 @@ namespace OpenRA.FileFormats
|
||||
|
||||
// Skip to the end of the chunk
|
||||
reader.ReadBytes(ChunkSize - NameLength - 6);
|
||||
|
||||
// Parse files
|
||||
for (var i = 0; i < FileCount; i++)
|
||||
ParseFile(reader);
|
||||
return FileCount;
|
||||
}
|
||||
|
||||
uint AccumulatedData = 0;
|
||||
@@ -76,8 +86,10 @@ namespace OpenRA.FileFormats
|
||||
var NameLength = reader.ReadByte();
|
||||
var FileName = new String(reader.ReadChars(NameLength));
|
||||
|
||||
var hash = PackageEntry.HashFilename(FileName);
|
||||
index.Add(hash, new PackageEntry(hash,AccumulatedData, CompressedSize));
|
||||
var hash = PackageEntry.HashFilename(FileName, PackageHashType.Classic);
|
||||
if (!index.ContainsKey(hash))
|
||||
index.Add(hash, new PackageEntry(hash,AccumulatedData, CompressedSize));
|
||||
filenames.Add(FileName);
|
||||
AccumulatedData += CompressedSize;
|
||||
|
||||
// Skip to the end of the chunk
|
||||
@@ -90,33 +102,40 @@ namespace OpenRA.FileFormats
|
||||
if (!index.TryGetValue(hash, out e))
|
||||
return null;
|
||||
|
||||
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
|
||||
byte[] data = new byte[ e.Length ];
|
||||
s.Read( data, 0, (int)e.Length );
|
||||
s.Seek(dataStart + e.Offset, SeekOrigin.Begin);
|
||||
var data = new byte[e.Length];
|
||||
s.Read(data, 0, (int)e.Length);
|
||||
|
||||
return new MemoryStream(Blast.Decompress(data));
|
||||
}
|
||||
|
||||
public Stream GetContent(string filename)
|
||||
{
|
||||
return GetContent(PackageEntry.HashFilename(filename));
|
||||
return GetContent(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
||||
}
|
||||
|
||||
public IEnumerable<uint> AllFileHashes()
|
||||
public IEnumerable<uint> ClassicHashes()
|
||||
{
|
||||
return index.Keys;
|
||||
}
|
||||
|
||||
public IEnumerable<uint> CrcHashes()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public IEnumerable<string> AllFileNames()
|
||||
{
|
||||
return filenames;
|
||||
}
|
||||
|
||||
public bool Exists(string filename)
|
||||
{
|
||||
return index.ContainsKey(PackageEntry.HashFilename(filename));
|
||||
return index.ContainsKey(PackageEntry.HashFilename(filename, PackageHashType.Classic));
|
||||
}
|
||||
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 2000 + priority; }
|
||||
}
|
||||
public int Priority { get { return 2000 + priority; }}
|
||||
public string Name { get { return filename; } }
|
||||
|
||||
public void Write(Dictionary<string, byte[]> contents)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
@@ -19,127 +20,145 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
Stream GetContent(string filename);
|
||||
bool Exists(string filename);
|
||||
IEnumerable<uint> AllFileHashes();
|
||||
IEnumerable<uint> ClassicHashes();
|
||||
IEnumerable<uint> CrcHashes();
|
||||
IEnumerable<string> AllFileNames();
|
||||
void Write(Dictionary<string, byte[]> contents);
|
||||
int Priority { get; }
|
||||
string Name { get; }
|
||||
}
|
||||
|
||||
public class MixFile : IFolder
|
||||
{
|
||||
readonly Dictionary<uint, PackageEntry> index;
|
||||
readonly bool isRmix, isEncrypted;
|
||||
readonly long dataStart;
|
||||
readonly Stream s;
|
||||
int priority;
|
||||
readonly int priority;
|
||||
readonly string filename;
|
||||
readonly PackageHashType type;
|
||||
|
||||
// Create a new MixFile
|
||||
// Save a mix to disk with the given contents
|
||||
public MixFile(string filename, int priority, Dictionary<string, byte[]> contents)
|
||||
{
|
||||
this.filename = filename;
|
||||
this.priority = priority;
|
||||
this.type = PackageHashType.Classic;
|
||||
|
||||
if (File.Exists(filename))
|
||||
File.Delete(filename);
|
||||
|
||||
s = File.Create(filename);
|
||||
index = new Dictionary<uint, PackageEntry>();
|
||||
contents.Add("local mix database.dat", new XccLocalDatabase(contents.Keys.Append("local mix database.dat")).Data());
|
||||
Write(contents);
|
||||
}
|
||||
|
||||
public MixFile(string filename, int priority)
|
||||
public MixFile(string filename, PackageHashType type, int priority)
|
||||
{
|
||||
this.filename = filename;
|
||||
this.priority = priority;
|
||||
this.type = type;
|
||||
s = FileSystem.Open(filename);
|
||||
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
uint signature = reader.ReadUInt32();
|
||||
// Detect format type
|
||||
s.Seek(0, SeekOrigin.Begin);
|
||||
var isCncMix = s.ReadUInt16() != 0;
|
||||
|
||||
isRmix = 0 == (signature & ~(uint)(MixFileFlags.Checksum | MixFileFlags.Encrypted));
|
||||
// The C&C mix format doesn't contain any flags or encryption
|
||||
var isEncrypted = false;
|
||||
if (!isCncMix)
|
||||
isEncrypted = (s.ReadUInt16() & 0x2) != 0;
|
||||
|
||||
if (isRmix)
|
||||
List<PackageEntry> entries;
|
||||
if (isEncrypted)
|
||||
{
|
||||
isEncrypted = 0 != (signature & (uint)MixFileFlags.Encrypted);
|
||||
if( isEncrypted )
|
||||
{
|
||||
index = ParseRaHeader(s, out dataStart).ToDictionaryWithConflictLog(x => x.Hash,
|
||||
"MixFile.RaHeader", null, x => "(offs={0}, len={1})".F(x.Offset, x.Length)
|
||||
);
|
||||
return;
|
||||
}
|
||||
long unused;
|
||||
entries = ParseHeader(DecryptHeader(s, 4, out dataStart), 0, out unused);
|
||||
}
|
||||
else
|
||||
s.Seek( 0, SeekOrigin.Begin );
|
||||
entries = ParseHeader(s, isCncMix ? 0 : 4, out dataStart);
|
||||
|
||||
isEncrypted = false;
|
||||
index = ParseTdHeader(s, out dataStart).ToDictionaryWithConflictLog(x => x.Hash,
|
||||
"MixFile.TdHeader", null, x => "(offs={0}, len={1})".F(x.Offset, x.Length)
|
||||
index = entries.ToDictionaryWithConflictLog(x => x.Hash,
|
||||
"{0} ({1} format, Encrypted: {2}, DataStart: {3})".F(filename, (isCncMix ? "C&C" : "RA/TS/RA2"), isEncrypted, dataStart),
|
||||
null, x => "(offs={0}, len={1})".F(x.Offset, x.Length)
|
||||
);
|
||||
}
|
||||
|
||||
const long headerStart = 84;
|
||||
|
||||
List<PackageEntry> ParseRaHeader(Stream s, out long dataStart)
|
||||
List<PackageEntry> ParseHeader(Stream s, long offset, out long headerEnd)
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
byte[] keyblock = reader.ReadBytes(80);
|
||||
byte[] blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
|
||||
s.Seek(offset, SeekOrigin.Begin);
|
||||
var numFiles = s.ReadUInt16();
|
||||
/*uint dataSize = */s.ReadUInt32();
|
||||
|
||||
uint[] h = ReadUints(reader, 2);
|
||||
var items = new List<PackageEntry>();
|
||||
for (var i = 0; i < numFiles; i++)
|
||||
items.Add(new PackageEntry(s));
|
||||
|
||||
Blowfish fish = new Blowfish(blowfishKey);
|
||||
MemoryStream ms = Decrypt( h, fish );
|
||||
BinaryReader reader2 = new BinaryReader(ms);
|
||||
|
||||
ushort numFiles = reader2.ReadUInt16();
|
||||
reader2.ReadUInt32(); /*datasize*/
|
||||
|
||||
s.Position = headerStart;
|
||||
reader = new BinaryReader(s);
|
||||
|
||||
int byteCount = 6 + numFiles * PackageEntry.Size;
|
||||
h = ReadUints( reader, ( byteCount + 3 ) / 4 );
|
||||
|
||||
ms = Decrypt( h, fish );
|
||||
|
||||
dataStart = headerStart + byteCount + ( ( ~byteCount + 1 ) & 7 );
|
||||
|
||||
long ds;
|
||||
return ParseTdHeader( ms, out ds );
|
||||
headerEnd = offset + 6 + numFiles*PackageEntry.Size;
|
||||
return items;
|
||||
}
|
||||
|
||||
static MemoryStream Decrypt( uint[] h, Blowfish fish )
|
||||
MemoryStream DecryptHeader(Stream s, long offset, out long headerEnd)
|
||||
{
|
||||
uint[] decrypted = fish.Decrypt( h );
|
||||
s.Seek(offset, SeekOrigin.Begin);
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
BinaryWriter writer = new BinaryWriter( ms );
|
||||
foreach( uint t in decrypted )
|
||||
writer.Write( t );
|
||||
// Decrypt blowfish key
|
||||
var keyblock = s.ReadBytes(80);
|
||||
var blowfishKey = new BlowfishKeyProvider().DecryptKey(keyblock);
|
||||
var fish = new Blowfish(blowfishKey);
|
||||
|
||||
// Decrypt first block to work out the header length
|
||||
var ms = Decrypt(ReadBlocks(s, offset + 80, 1), fish);
|
||||
var numFiles = ms.ReadUInt16();
|
||||
|
||||
// Decrypt the full header - round bytes up to a full block
|
||||
var blockCount = (13 + numFiles*PackageEntry.Size)/8;
|
||||
headerEnd = offset + 80 + blockCount*8;
|
||||
|
||||
return Decrypt(ReadBlocks(s, offset + 80, blockCount), fish);
|
||||
}
|
||||
|
||||
static MemoryStream Decrypt(uint[] h, Blowfish fish)
|
||||
{
|
||||
var decrypted = fish.Decrypt(h);
|
||||
|
||||
var ms = new MemoryStream();
|
||||
var writer = new BinaryWriter(ms);
|
||||
foreach(var t in decrypted)
|
||||
writer.Write(t);
|
||||
writer.Flush();
|
||||
|
||||
ms.Position = 0;
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
return ms;
|
||||
}
|
||||
|
||||
uint[] ReadUints(BinaryReader r, int count)
|
||||
uint[] ReadBlocks(Stream s, long offset, int count)
|
||||
{
|
||||
uint[] ret = new uint[count];
|
||||
for (int i = 0; i < ret.Length; i++)
|
||||
ret[i] = r.ReadUInt32();
|
||||
s.Seek(offset, SeekOrigin.Begin);
|
||||
|
||||
// A block is a single encryption unit (represented as two 32-bit integers)
|
||||
var ret = new uint[2*count];
|
||||
for (var i = 0; i < ret.Length; i++)
|
||||
ret[i] = s.ReadUInt32();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<PackageEntry> ParseTdHeader(Stream s, out long dataStart)
|
||||
uint? FindMatchingHash(string filename)
|
||||
{
|
||||
List<PackageEntry> items = new List<PackageEntry>();
|
||||
var hash = PackageEntry.HashFilename(filename, type);
|
||||
if (index.ContainsKey(hash))
|
||||
return hash;
|
||||
|
||||
BinaryReader reader = new BinaryReader(s);
|
||||
ushort numFiles = reader.ReadUInt16();
|
||||
/*uint dataSize = */reader.ReadUInt32();
|
||||
// Maybe we were given a raw hash?
|
||||
uint raw;
|
||||
if (!uint.TryParse(filename, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out raw))
|
||||
return null;
|
||||
|
||||
for (int i = 0; i < numFiles; i++)
|
||||
items.Add(new PackageEntry(reader));
|
||||
if ("{0:X}".F(raw) == filename && index.ContainsKey(raw))
|
||||
return raw;
|
||||
|
||||
dataStart = s.Position;
|
||||
return items;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream GetContent(uint hash)
|
||||
@@ -148,33 +167,71 @@ namespace OpenRA.FileFormats
|
||||
if (!index.TryGetValue(hash, out e))
|
||||
return null;
|
||||
|
||||
s.Seek( dataStart + e.Offset, SeekOrigin.Begin );
|
||||
byte[] data = new byte[ e.Length ];
|
||||
s.Read( data, 0, (int)e.Length );
|
||||
s.Seek(dataStart + e.Offset, SeekOrigin.Begin);
|
||||
var data = new byte[e.Length];
|
||||
s.Read(data, 0, (int)e.Length);
|
||||
return new MemoryStream(data);
|
||||
}
|
||||
|
||||
public Stream GetContent(string filename)
|
||||
{
|
||||
return GetContent(PackageEntry.HashFilename(filename));
|
||||
var hash = FindMatchingHash(filename);
|
||||
return hash.HasValue ? GetContent(hash.Value) : null;
|
||||
}
|
||||
|
||||
public IEnumerable<uint> AllFileHashes()
|
||||
static readonly uint[] Nothing = {};
|
||||
public IEnumerable<uint> ClassicHashes()
|
||||
{
|
||||
return index.Keys;
|
||||
if (type == PackageHashType.Classic)
|
||||
return index.Keys;
|
||||
|
||||
return Nothing;
|
||||
}
|
||||
|
||||
public IEnumerable<uint> CrcHashes()
|
||||
{
|
||||
if (type == PackageHashType.CRC32)
|
||||
return index.Keys;
|
||||
|
||||
return Nothing;
|
||||
}
|
||||
|
||||
public IEnumerable<string> AllFileNames()
|
||||
{
|
||||
var lookup = new Dictionary<uint, string>();
|
||||
if (Exists("local mix database.dat"))
|
||||
{
|
||||
var db = new XccLocalDatabase(GetContent("local mix database.dat"));
|
||||
foreach (var e in db.Entries)
|
||||
{
|
||||
var hash = PackageEntry.HashFilename(e, type);
|
||||
if (!lookup.ContainsKey(hash))
|
||||
lookup.Add(hash, e);
|
||||
}
|
||||
}
|
||||
|
||||
if (FileSystem.Exists("global mix database.dat"))
|
||||
{
|
||||
var db = new XccGlobalDatabase(FileSystem.Open("global mix database.dat"));
|
||||
foreach (var e in db.Entries)
|
||||
{
|
||||
var hash = PackageEntry.HashFilename(e, type);
|
||||
if (!lookup.ContainsKey(hash))
|
||||
lookup.Add(hash, e);
|
||||
}
|
||||
}
|
||||
|
||||
return index.Keys.Select(k => lookup.ContainsKey(k) ? lookup[k] : "{0:X}".F(k));
|
||||
}
|
||||
|
||||
public bool Exists(string filename)
|
||||
{
|
||||
return index.ContainsKey(PackageEntry.HashFilename(filename));
|
||||
}
|
||||
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 1000 + priority; }
|
||||
return FindMatchingHash(filename).HasValue;
|
||||
}
|
||||
|
||||
public int Priority { get { return 1000 + priority; } }
|
||||
public string Name { get { return filename; } }
|
||||
|
||||
public void Write(Dictionary<string, byte[]> contents)
|
||||
{
|
||||
// Cannot modify existing mixfile - rename existing file and
|
||||
@@ -190,14 +247,14 @@ namespace OpenRA.FileFormats
|
||||
var items = new List<PackageEntry>();
|
||||
foreach (var kv in contents)
|
||||
{
|
||||
uint length = (uint)kv.Value.Length;
|
||||
uint hash = PackageEntry.HashFilename(Path.GetFileName(kv.Key));
|
||||
var length = (uint)kv.Value.Length;
|
||||
var hash = PackageEntry.HashFilename(Path.GetFileName(kv.Key), type);
|
||||
items.Add(new PackageEntry(hash, dataSize, length));
|
||||
dataSize += length;
|
||||
}
|
||||
|
||||
// Write the new file
|
||||
s.Seek(0,SeekOrigin.Begin);
|
||||
s.Seek(0, SeekOrigin.Begin);
|
||||
using (var writer = new BinaryWriter(s))
|
||||
{
|
||||
// Write file header
|
||||
@@ -214,11 +271,4 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Flags]
|
||||
enum MixFileFlags : uint
|
||||
{
|
||||
Checksum = 0x10000,
|
||||
Encrypted = 0x20000,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public Stream GetContent(string filename)
|
||||
{
|
||||
|
||||
using (var z = pkg.GetInputStream(pkg.GetEntry(filename)))
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
@@ -65,10 +64,21 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<uint> AllFileHashes()
|
||||
public IEnumerable<uint> ClassicHashes()
|
||||
{
|
||||
foreach(ZipEntry entry in pkg)
|
||||
yield return PackageEntry.HashFilename(entry.Name);
|
||||
yield return PackageEntry.HashFilename(entry.Name, PackageHashType.Classic);
|
||||
}
|
||||
|
||||
public IEnumerable<uint> CrcHashes()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public IEnumerable<string> AllFileNames()
|
||||
{
|
||||
foreach(ZipEntry entry in pkg)
|
||||
yield return entry.Name;
|
||||
}
|
||||
|
||||
public bool Exists(string filename)
|
||||
@@ -76,10 +86,8 @@ namespace OpenRA.FileFormats
|
||||
return pkg.GetEntry(filename) != null;
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 500 + priority; }
|
||||
}
|
||||
public int Priority { get { return 500 + priority; } }
|
||||
public string Name { get { return filename; } }
|
||||
|
||||
public void Write(Dictionary<string, byte[]> contents)
|
||||
{
|
||||
|
||||
@@ -36,23 +36,23 @@ namespace OpenRA.FileFormats
|
||||
public readonly byte[] LookupTable;
|
||||
public byte[] Image;
|
||||
|
||||
public Dune2ImageHeader(BinaryReader reader)
|
||||
public Dune2ImageHeader(Stream s)
|
||||
{
|
||||
Flags = (Dune2ImageFlags)reader.ReadUInt16();
|
||||
Slices = reader.ReadByte();
|
||||
Width = reader.ReadUInt16();
|
||||
Height = reader.ReadByte();
|
||||
FileSize = reader.ReadUInt16();
|
||||
DataSize = reader.ReadUInt16();
|
||||
Flags = (Dune2ImageFlags)s.ReadUInt16();
|
||||
Slices = s.ReadUInt8();
|
||||
Width = s.ReadUInt16();
|
||||
Height = s.ReadUInt8();
|
||||
FileSize = s.ReadUInt16();
|
||||
DataSize = s.ReadUInt16();
|
||||
|
||||
if (Flags == Dune2ImageFlags.L16_F80_F2_1 ||
|
||||
Flags == Dune2ImageFlags.L16_F80_F2_2 ||
|
||||
Flags == Dune2ImageFlags.Ln_F80_F2)
|
||||
{
|
||||
int n = Flags == Dune2ImageFlags.Ln_F80_F2 ? reader.ReadByte() : (byte)16;
|
||||
int n = Flags == Dune2ImageFlags.Ln_F80_F2 ? s.ReadUInt8() : (byte)16;
|
||||
LookupTable = new byte[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
LookupTable[i] = reader.ReadByte();
|
||||
LookupTable[i] = s.ReadUInt8();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -78,16 +78,14 @@ namespace OpenRA.FileFormats
|
||||
|
||||
List<Dune2ImageHeader> headers = new List<Dune2ImageHeader>();
|
||||
|
||||
public Dune2ShpReader(Stream stream)
|
||||
public Dune2ShpReader(Stream s)
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
|
||||
ImageCount = reader.ReadUInt16();
|
||||
ImageCount = s.ReadUInt16();
|
||||
|
||||
//Last offset is pointer to end of file.
|
||||
uint[] offsets = new uint[ImageCount + 1];
|
||||
|
||||
uint temp = reader.ReadUInt32();
|
||||
uint temp = s.ReadUInt32();
|
||||
|
||||
//If fourth byte in file is non-zero, the offsets are two bytes each.
|
||||
bool twoByteOffsets = (temp & 0xFF0000) > 0;
|
||||
@@ -100,13 +98,13 @@ namespace OpenRA.FileFormats
|
||||
offsets[0] = temp + 2;
|
||||
|
||||
for (int i = twoByteOffsets ? 2 : 1; i < ImageCount + 1; i++)
|
||||
offsets[i] = (twoByteOffsets ? reader.ReadUInt16() : reader.ReadUInt32()) + 2;
|
||||
offsets[i] = (twoByteOffsets ? s.ReadUInt16() : s.ReadUInt32()) + 2;
|
||||
|
||||
for (int i = 0; i < ImageCount; i++)
|
||||
{
|
||||
reader.BaseStream.Seek(offsets[i], SeekOrigin.Begin);
|
||||
Dune2ImageHeader header = new Dune2ImageHeader(reader);
|
||||
byte[] imgData = reader.ReadBytes(header.FileSize);
|
||||
s.Seek(offsets[i], SeekOrigin.Begin);
|
||||
Dune2ImageHeader header = new Dune2ImageHeader(s);
|
||||
byte[] imgData = s.ReadBytes(header.FileSize);
|
||||
header.Image = new byte[header.Height * header.Width];
|
||||
|
||||
//Decode image data
|
||||
|
||||
57
OpenRA.FileFormats/Graphics/HvaReader.cs
Normal file
57
OpenRA.FileFormats/Graphics/HvaReader.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class HvaReader
|
||||
{
|
||||
public readonly uint FrameCount;
|
||||
public readonly uint LimbCount;
|
||||
public readonly float[] Transforms;
|
||||
|
||||
public HvaReader(Stream s)
|
||||
{
|
||||
// Index swaps for transposing a matrix
|
||||
var ids = new byte[]{0,4,8,12,1,5,9,13,2,6,10,14};
|
||||
|
||||
s.Seek(16, SeekOrigin.Begin);
|
||||
FrameCount = s.ReadUInt32();
|
||||
LimbCount = s.ReadUInt32();
|
||||
|
||||
// Skip limb names
|
||||
s.Seek(16*LimbCount, SeekOrigin.Current);
|
||||
Transforms = new float[16*FrameCount*LimbCount];
|
||||
for (var j = 0; j < FrameCount; j++)
|
||||
for (var i = 0; i < LimbCount; i++)
|
||||
{
|
||||
// Convert to column-major matrices and add the final matrix row
|
||||
var c = 16*(LimbCount*j + i);
|
||||
Transforms[c + 3] = 0;
|
||||
Transforms[c + 7] = 0;
|
||||
Transforms[c + 11] = 0;
|
||||
Transforms[c + 15] = 1;
|
||||
|
||||
for (var k = 0; k < 12; k++)
|
||||
Transforms[c + ids[k]] = s.ReadFloat();
|
||||
}
|
||||
}
|
||||
|
||||
public static HvaReader Load(string filename)
|
||||
{
|
||||
using (var s = File.OpenRead(filename))
|
||||
return new HvaReader(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,15 +32,17 @@ namespace OpenRA.FileFormats.Graphics
|
||||
IGraphicsDevice Create( Size size, WindowMode windowMode );
|
||||
}
|
||||
|
||||
public enum BlendMode { None, Alpha, Additive }
|
||||
|
||||
public interface IGraphicsDevice
|
||||
{
|
||||
IVertexBuffer<Vertex> CreateVertexBuffer( int length );
|
||||
ITexture CreateTexture( Bitmap bitmap );
|
||||
ITexture CreateTexture();
|
||||
IFrameBuffer CreateFrameBuffer(Size s);
|
||||
IShader CreateShader( string name );
|
||||
|
||||
Size WindowSize { get; }
|
||||
int GpuMemoryUsed { get; }
|
||||
|
||||
void Clear();
|
||||
void Present();
|
||||
@@ -51,6 +53,11 @@ namespace OpenRA.FileFormats.Graphics
|
||||
void SetLineWidth( float width );
|
||||
void EnableScissor( int left, int top, int width, int height );
|
||||
void DisableScissor();
|
||||
|
||||
void EnableDepthBuffer();
|
||||
void DisableDepthBuffer();
|
||||
|
||||
void SetBlendMode(BlendMode mode);
|
||||
}
|
||||
|
||||
public interface IVertexBuffer<T>
|
||||
@@ -61,9 +68,12 @@ namespace OpenRA.FileFormats.Graphics
|
||||
|
||||
public interface IShader
|
||||
{
|
||||
void SetValue( string name, float x, float y );
|
||||
void SetValue( string param, ITexture texture );
|
||||
void Render( Action a );
|
||||
void SetVec(string name, float x);
|
||||
void SetVec(string name, float x, float y);
|
||||
void SetVec(string name, float[] vec, int length);
|
||||
void SetTexture(string param, ITexture texture);
|
||||
void SetMatrix(string param, float[] mtx);
|
||||
void Render(Action a);
|
||||
}
|
||||
|
||||
public interface ITexture
|
||||
@@ -71,6 +81,15 @@ namespace OpenRA.FileFormats.Graphics
|
||||
void SetData(Bitmap bitmap);
|
||||
void SetData(uint[,] colors);
|
||||
void SetData(byte[] colors, int width, int height);
|
||||
byte[] GetData();
|
||||
Size Size { get; }
|
||||
}
|
||||
|
||||
public interface IFrameBuffer
|
||||
{
|
||||
void Bind();
|
||||
void Unbind();
|
||||
ITexture Texture { get; }
|
||||
}
|
||||
|
||||
public enum PrimitiveType
|
||||
|
||||
97
OpenRA.FileFormats/Graphics/R8Reader.cs
Normal file
97
OpenRA.FileFormats/Graphics/R8Reader.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class R8Image
|
||||
{
|
||||
public readonly Size Size;
|
||||
public readonly int2 Offset;
|
||||
public readonly byte[] Image;
|
||||
|
||||
// Legacy variable. Can be removed when the utility command is made sensible.
|
||||
public readonly Size FrameSize;
|
||||
|
||||
public R8Image(Stream s)
|
||||
{
|
||||
// Scan forward until we find some data
|
||||
var type = s.ReadUInt8();
|
||||
while (type == 0)
|
||||
type = s.ReadUInt8();
|
||||
|
||||
var width = s.ReadInt32();
|
||||
var height = s.ReadInt32();
|
||||
var x = s.ReadInt32();
|
||||
var y = s.ReadInt32();
|
||||
|
||||
Size = new Size(width, height);
|
||||
Offset = new int2(width/2 - x, height/2 - y);
|
||||
|
||||
/*var imageOffset = */s.ReadInt32();
|
||||
var paletteOffset = s.ReadInt32();
|
||||
var bpp = s.ReadUInt8();
|
||||
if (bpp != 8)
|
||||
throw new InvalidDataException("Error: {0} bits per pixel are not supported.".F(bpp));
|
||||
|
||||
var frameHeight = s.ReadUInt8();
|
||||
var frameWidth = s.ReadUInt8();
|
||||
FrameSize = new Size(frameWidth, frameHeight);
|
||||
|
||||
// Skip alignment byte
|
||||
s.ReadUInt8();
|
||||
|
||||
// Ignore palette header
|
||||
if (type == 1 && paletteOffset != 0)
|
||||
s.Seek(8, SeekOrigin.Current);
|
||||
|
||||
Image = s.ReadBytes(width*height);
|
||||
|
||||
// Ignore palette data
|
||||
if (type == 1 && paletteOffset != 0)
|
||||
s.Seek(512, SeekOrigin.Current);
|
||||
}
|
||||
}
|
||||
|
||||
public class R8Reader : IEnumerable<R8Image>
|
||||
{
|
||||
readonly List<R8Image> headers = new List<R8Image>();
|
||||
|
||||
public readonly int Frames;
|
||||
public R8Reader(Stream stream)
|
||||
{
|
||||
while (stream.Position < stream.Length)
|
||||
{
|
||||
headers.Add(new R8Image(stream));
|
||||
Frames++;
|
||||
}
|
||||
}
|
||||
|
||||
public R8Image this[int index]
|
||||
{
|
||||
get { return headers[index]; }
|
||||
}
|
||||
|
||||
public IEnumerator<R8Image> GetEnumerator()
|
||||
{
|
||||
return headers.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,9 +62,9 @@ namespace OpenRA.FileFormats
|
||||
|
||||
int recurseDepth = 0;
|
||||
|
||||
public ShpReader( Stream stream )
|
||||
public ShpReader(Stream stream)
|
||||
{
|
||||
using( var reader = new BinaryReader( stream ) )
|
||||
using (var reader = new BinaryReader(stream))
|
||||
{
|
||||
ImageCount = reader.ReadUInt16();
|
||||
reader.ReadUInt16();
|
||||
@@ -73,60 +73,60 @@ namespace OpenRA.FileFormats
|
||||
Height = reader.ReadUInt16();
|
||||
reader.ReadUInt32();
|
||||
|
||||
for( int i = 0 ; i < ImageCount ; i++ )
|
||||
headers.Add( new ImageHeader( reader ) );
|
||||
for (int i = 0 ; i < ImageCount ; i++)
|
||||
headers.Add(new ImageHeader(reader));
|
||||
|
||||
new ImageHeader( reader ); // end-of-file header
|
||||
new ImageHeader( reader ); // all-zeroes header
|
||||
new ImageHeader(reader); // end-of-file header
|
||||
new ImageHeader(reader); // all-zeroes header
|
||||
|
||||
var offsets = headers.ToDictionary(h => h.Offset, h =>h);
|
||||
|
||||
for( int i = 0 ; i < ImageCount ; i++ )
|
||||
for (int i = 0 ; i < ImageCount ; i++)
|
||||
{
|
||||
var h = headers[ i ];
|
||||
if( h.Format == Format.Format20 )
|
||||
h.RefImage = headers[ i - 1 ];
|
||||
if (h.Format == Format.Format20)
|
||||
h.RefImage = headers[i - 1];
|
||||
|
||||
else if( h.Format == Format.Format40 )
|
||||
if( !offsets.TryGetValue( h.RefOffset, out h.RefImage ) )
|
||||
throw new InvalidDataException( "Reference doesnt point to image data {0}->{1}".F(h.Offset, h.RefOffset) );
|
||||
else if (h.Format == Format.Format40)
|
||||
if (!offsets.TryGetValue(h.RefOffset, out h.RefImage))
|
||||
throw new InvalidDataException("Reference doesnt point to image data {0}->{1}".F(h.Offset, h.RefOffset));
|
||||
}
|
||||
|
||||
foreach( ImageHeader h in headers )
|
||||
Decompress( stream, h );
|
||||
foreach (ImageHeader h in headers)
|
||||
Decompress(stream, h);
|
||||
}
|
||||
}
|
||||
|
||||
public ImageHeader this[ int index ]
|
||||
public ImageHeader this[int index]
|
||||
{
|
||||
get { return headers[ index ]; }
|
||||
get { return headers[index]; }
|
||||
}
|
||||
|
||||
void Decompress( Stream stream, ImageHeader h )
|
||||
void Decompress(Stream stream, ImageHeader h)
|
||||
{
|
||||
if( recurseDepth > ImageCount )
|
||||
throw new InvalidDataException( "Format20/40 headers contain infinite loop" );
|
||||
if (recurseDepth > ImageCount)
|
||||
throw new InvalidDataException("Format20/40 headers contain infinite loop");
|
||||
|
||||
switch( h.Format )
|
||||
switch(h.Format)
|
||||
{
|
||||
case Format.Format20:
|
||||
case Format.Format40:
|
||||
{
|
||||
if( h.RefImage.Image == null )
|
||||
if (h.RefImage.Image == null)
|
||||
{
|
||||
++recurseDepth;
|
||||
Decompress( stream, h.RefImage );
|
||||
Decompress(stream, h.RefImage);
|
||||
--recurseDepth;
|
||||
}
|
||||
|
||||
h.Image = CopyImageData( h.RefImage.Image );
|
||||
h.Image = CopyImageData(h.RefImage.Image);
|
||||
Format40.DecodeInto(ReadCompressedData(stream, h), h.Image);
|
||||
break;
|
||||
}
|
||||
case Format.Format80:
|
||||
{
|
||||
var imageBytes = new byte[ Width * Height ];
|
||||
Format80.DecodeInto( ReadCompressedData( stream, h ), imageBytes );
|
||||
var imageBytes = new byte[Width * Height];
|
||||
Format80.DecodeInto(ReadCompressedData(stream, h), imageBytes);
|
||||
h.Image = imageBytes;
|
||||
break;
|
||||
}
|
||||
@@ -135,11 +135,11 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] ReadCompressedData( Stream stream, ImageHeader h )
|
||||
static byte[] ReadCompressedData(Stream stream, ImageHeader h)
|
||||
{
|
||||
stream.Position = h.Offset;
|
||||
// Actually, far too big. There's no length field with the correct length though :(
|
||||
var compressedLength = (int)( stream.Length - stream.Position );
|
||||
// TODO: Actually, far too big. There's no length field with the correct length though :(
|
||||
var compressedLength = (int)(stream.Length - stream.Position);
|
||||
|
||||
var compressedBytes = new byte[ compressedLength ];
|
||||
stream.Read( compressedBytes, 0, compressedLength );
|
||||
@@ -147,11 +147,11 @@ namespace OpenRA.FileFormats
|
||||
return compressedBytes;
|
||||
}
|
||||
|
||||
byte[] CopyImageData( byte[] baseImage )
|
||||
byte[] CopyImageData(byte[] baseImage)
|
||||
{
|
||||
var imageData = new byte[ Width * Height ];
|
||||
for( int i = 0 ; i < Width * Height ; i++ )
|
||||
imageData[ i ] = baseImage[ i ];
|
||||
var imageData = new byte[Width * Height];
|
||||
for (int i = 0 ; i < Width * Height ; i++)
|
||||
imageData[i] = baseImage[i];
|
||||
|
||||
return imageData;
|
||||
}
|
||||
|
||||
615
OpenRA.FileFormats/Graphics/ShpTSReader.cs
Normal file
615
OpenRA.FileFormats/Graphics/ShpTSReader.cs
Normal file
@@ -0,0 +1,615 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
|
||||
public struct Header
|
||||
{
|
||||
public ushort A;
|
||||
// Unknown
|
||||
// Width and Height of the images
|
||||
public ushort Width;
|
||||
public ushort Height;
|
||||
public ushort NumImages;
|
||||
}
|
||||
|
||||
public class HeaderImage
|
||||
{
|
||||
public ushort x;
|
||||
public ushort y;
|
||||
public ushort cx;
|
||||
public ushort cy;
|
||||
// cx and cy are width n height of stored image
|
||||
public byte compression;
|
||||
public byte[] align;
|
||||
public byte[] transparent;
|
||||
public int zero;
|
||||
public int offset;
|
||||
public byte[] Image;
|
||||
}
|
||||
|
||||
public struct SHPData
|
||||
{
|
||||
public HeaderImage HeaderImage;
|
||||
public byte[] Databuffer;
|
||||
public byte[] FrameImage;
|
||||
}
|
||||
|
||||
public struct SHP
|
||||
{
|
||||
public Header Header;
|
||||
public SHPData[] Data;
|
||||
}
|
||||
|
||||
|
||||
public class ShpTSReader : IEnumerable<HeaderImage>
|
||||
{
|
||||
public readonly int ImageCount;
|
||||
public readonly ushort Width;
|
||||
public readonly ushort Height;
|
||||
public readonly ushort Width2;
|
||||
public readonly ushort Height2;
|
||||
public int arroff = 0;
|
||||
public int erri = 0;
|
||||
public int errj = 0;
|
||||
public int errk = 0;
|
||||
public int errl = 0;
|
||||
|
||||
public static int FindNextOffsetFrom(SHP SHP, int Init, int Last)
|
||||
{
|
||||
int result;
|
||||
result = 0;
|
||||
Last++;
|
||||
while ((result == 0) && (Init < Last))
|
||||
{
|
||||
result = SHP.Data[Init].HeaderImage.offset;
|
||||
Init++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private readonly List<HeaderImage> headers = new List<HeaderImage>();
|
||||
|
||||
public ShpTSReader(Stream s)
|
||||
{
|
||||
|
||||
SHP SHP = new SHP();
|
||||
int FileSize;
|
||||
int x;
|
||||
int k = 0;
|
||||
int l = 0;
|
||||
|
||||
int ImageSize;
|
||||
int NextOffset;
|
||||
|
||||
byte[] FData;
|
||||
byte cp;
|
||||
byte[] Databuffer;
|
||||
|
||||
FileSize = (int)s.Length;
|
||||
// Get Header
|
||||
SHP.Header.A = s.ReadUInt16();
|
||||
SHP.Header.Width = s.ReadUInt16();
|
||||
SHP.Header.Height = s.ReadUInt16();
|
||||
SHP.Header.NumImages = s.ReadUInt16();
|
||||
|
||||
SHP.Data = new SHPData[SHP.Header.NumImages + 1];
|
||||
|
||||
ImageCount = SHP.Header.NumImages;
|
||||
|
||||
for (x = 1; x <= SHP.Header.NumImages; x++)
|
||||
{
|
||||
SHP.Data[x].HeaderImage = new HeaderImage();
|
||||
|
||||
SHP.Data[x].HeaderImage.x = s.ReadUInt16();
|
||||
SHP.Data[x].HeaderImage.y = s.ReadUInt16();
|
||||
SHP.Data[x].HeaderImage.cx = s.ReadUInt16();
|
||||
SHP.Data[x].HeaderImage.cy = s.ReadUInt16();
|
||||
|
||||
SHP.Data[x].HeaderImage.compression = s.ReadUInt8();
|
||||
SHP.Data[x].HeaderImage.align = s.ReadBytes(3);
|
||||
s.ReadInt32();
|
||||
SHP.Data[x].HeaderImage.zero = s.ReadUInt8();
|
||||
SHP.Data[x].HeaderImage.transparent = s.ReadBytes(3);
|
||||
|
||||
SHP.Data[x].HeaderImage.offset = s.ReadInt32();
|
||||
|
||||
}
|
||||
|
||||
Width = SHP.Header.Width;
|
||||
Height = SHP.Header.Height;
|
||||
|
||||
for (int i = 0; i < ImageCount; i++)
|
||||
{
|
||||
headers.Add(SHP.Data[i+1].HeaderImage);
|
||||
}
|
||||
|
||||
// Read and decode each image from the file
|
||||
for (x = 1; x <= SHP.Header.NumImages; x++)
|
||||
{
|
||||
headers[x - 1].Image = new byte[(Width * Height)];
|
||||
for (int i = 0; i < headers[x - 1].Image.Length; i++)
|
||||
headers[x - 1].Image[i] = 0;
|
||||
|
||||
FData = new byte[(Width * Height)];
|
||||
|
||||
// Does it really reads the frame?
|
||||
if (SHP.Data[x].HeaderImage.offset != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Now it checks the compression:
|
||||
if ((SHP.Data[x].HeaderImage.compression == 3))
|
||||
{
|
||||
// decode it
|
||||
// Compression 3
|
||||
NextOffset = FindNextOffsetFrom(SHP, x + 1, SHP.Header.NumImages);
|
||||
if (NextOffset != 0)
|
||||
{
|
||||
|
||||
ImageSize = NextOffset - SHP.Data[x].HeaderImage.offset;
|
||||
Databuffer = new byte[ImageSize];
|
||||
for (int i = 0; i < ImageSize; i++)
|
||||
{
|
||||
s.Seek(SHP.Data[x].HeaderImage.offset + i, SeekOrigin.Begin);
|
||||
Databuffer[i] = s.ReadUInt8();
|
||||
}
|
||||
SHP.Data[x].Databuffer = new byte[(SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy)];
|
||||
Decode3(Databuffer, ref SHP.Data[x].Databuffer, SHP.Data[x].HeaderImage.cx, SHP.Data[x].HeaderImage.cy, ref FileSize);
|
||||
|
||||
k = 0;
|
||||
l = 0;
|
||||
for (int i = 0; i < Height; i++)
|
||||
{
|
||||
erri = i;
|
||||
for (int j = SHP.Data[x].HeaderImage.x; j < Width; j++)
|
||||
{
|
||||
errj = j;
|
||||
errl = l;
|
||||
errk = k;
|
||||
arroff = i + j + l;
|
||||
|
||||
if (((j + 1) > (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x)) || ((i + 1) > (SHP.Data[x].HeaderImage.cy)))
|
||||
cp = 0;
|
||||
else
|
||||
cp = SHP.Data[x].Databuffer[i + (j - SHP.Data[x].HeaderImage.x) + l];
|
||||
|
||||
FData[i + j + k] = cp;
|
||||
|
||||
if (j == (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x - 1))
|
||||
l = l + (SHP.Data[x].HeaderImage.cx - 1);
|
||||
|
||||
if (j == (Width - 1))
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
//FData = headers[x - 1].Image;
|
||||
k = 0;
|
||||
for (int i = 0; i < (Height - SHP.Data[x].HeaderImage.y); i++)
|
||||
{
|
||||
for (int j = 0; j < Width; j++)
|
||||
{
|
||||
headers[x - 1].Image[i + j + k + (Width * SHP.Data[x].HeaderImage.y)] = FData[i + j + k];
|
||||
if (j == (Width - 1))
|
||||
{
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
ImageSize = 0;
|
||||
ImageSize = FileSize - SHP.Data[x].HeaderImage.offset;
|
||||
Databuffer = new byte[ImageSize];
|
||||
for (int i = 0; i < ImageSize; i++)
|
||||
{
|
||||
s.Seek(SHP.Data[x].HeaderImage.offset + i, SeekOrigin.Begin);
|
||||
Databuffer[i] = s.ReadUInt8();
|
||||
}
|
||||
SHP.Data[x].Databuffer = new byte[((SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy))];
|
||||
|
||||
Decode3(Databuffer, ref SHP.Data[x].Databuffer, SHP.Data[x].HeaderImage.cx, SHP.Data[x].HeaderImage.cy, ref ImageSize);
|
||||
|
||||
k = 0;
|
||||
l = 0;
|
||||
for (int i = 0; i < Height; i++)
|
||||
{
|
||||
erri = i;
|
||||
for (int j = SHP.Data[x].HeaderImage.x; j < Width; j++)
|
||||
{
|
||||
errj = j;
|
||||
errl = l;
|
||||
errk = k;
|
||||
arroff = i + j + l;
|
||||
|
||||
if (((j + 1) > (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x)) || ((i + 1) > (SHP.Data[x].HeaderImage.cy)))
|
||||
cp = 0;
|
||||
else
|
||||
cp = SHP.Data[x].Databuffer[i + (j - SHP.Data[x].HeaderImage.x) + l];
|
||||
|
||||
FData[i + j + k] = cp;
|
||||
|
||||
if (j == (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x - 1))
|
||||
l = l + (SHP.Data[x].HeaderImage.cx - 1);
|
||||
|
||||
if (j == (Width - 1))
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
//FData = headers[x - 1].Image;
|
||||
k = 0;
|
||||
for (int i = 0; i < (Height - SHP.Data[x].HeaderImage.y); i++)
|
||||
{
|
||||
for (int j = 0; j < Width; j++)
|
||||
{
|
||||
headers[x - 1].Image[i + j + k + (Width * SHP.Data[x].HeaderImage.y)] = FData[i + j + k];
|
||||
if (j == (Width - 1))
|
||||
{
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((SHP.Data[x].HeaderImage.compression == 2))
|
||||
{
|
||||
NextOffset = FindNextOffsetFrom(SHP, x + 1, SHP.Header.NumImages);
|
||||
if (NextOffset != 0)
|
||||
{
|
||||
ImageSize = NextOffset - SHP.Data[x].HeaderImage.offset;
|
||||
SHP.Data[x].Databuffer = new byte[(SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy)];
|
||||
Databuffer = new byte[ImageSize];
|
||||
for (int i = 0; i < ImageSize; i++)
|
||||
{
|
||||
s.Seek(SHP.Data[x].HeaderImage.offset + i, SeekOrigin.Begin);
|
||||
Databuffer[i] = s.ReadUInt8();
|
||||
}
|
||||
|
||||
Decode2(Databuffer, ref SHP.Data[x].Databuffer, SHP.Data[x].HeaderImage.cx, SHP.Data[x].HeaderImage.cy, ref ImageSize);
|
||||
|
||||
k = 0;
|
||||
l = 0;
|
||||
for (int i = 0; i < Height; i++)
|
||||
{
|
||||
erri = i;
|
||||
for (int j = SHP.Data[x].HeaderImage.x; j < Width; j++)
|
||||
{
|
||||
errj = j;
|
||||
errl = l;
|
||||
errk = k;
|
||||
arroff = i + j + l;
|
||||
|
||||
if (((j + 1) > (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x)) || ((i + 1) > (SHP.Data[x].HeaderImage.cy)))
|
||||
cp = 0;
|
||||
else
|
||||
cp = SHP.Data[x].Databuffer[i + (j - SHP.Data[x].HeaderImage.x) + l];
|
||||
|
||||
FData[i + j + k] = cp;
|
||||
|
||||
if (j == (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x - 1))
|
||||
l = l + (SHP.Data[x].HeaderImage.cx - 1);
|
||||
|
||||
if (j == (Width - 1))
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
//FData = headers[x - 1].Image;
|
||||
k = 0;
|
||||
for (int i = 0; i < (Height - SHP.Data[x].HeaderImage.y); i++)
|
||||
{
|
||||
for (int j = 0; j < Width; j++)
|
||||
{
|
||||
headers[x - 1].Image[i + j + k + (Width * SHP.Data[x].HeaderImage.y)] = FData[i + j + k];
|
||||
if (j == (Width - 1))
|
||||
{
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compression 2
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageSize = 0;
|
||||
ImageSize = FileSize - SHP.Data[x].HeaderImage.offset;
|
||||
Databuffer = new byte[ImageSize];
|
||||
for (int i = 0; i < ImageSize; i++)
|
||||
{
|
||||
s.Seek(SHP.Data[x].HeaderImage.offset + i, SeekOrigin.Begin);
|
||||
Databuffer[i] = s.ReadUInt8();
|
||||
}
|
||||
SHP.Data[x].Databuffer = new byte[((SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy))];
|
||||
Decode2(Databuffer, ref SHP.Data[x].Databuffer, SHP.Data[x].HeaderImage.cx, SHP.Data[x].HeaderImage.cy, ref ImageSize);
|
||||
|
||||
k = 0;
|
||||
l = 0;
|
||||
for (int i = 0; i < Height; i++)
|
||||
{
|
||||
erri = i;
|
||||
for (int j = SHP.Data[x].HeaderImage.x; j < Width; j++)
|
||||
{
|
||||
errj = j;
|
||||
errl = l;
|
||||
errk = k;
|
||||
arroff = i + j + l;
|
||||
|
||||
if (((j + 1) > (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x)) || ((i + 1) > (SHP.Data[x].HeaderImage.cy)))
|
||||
cp = 0;
|
||||
else
|
||||
cp = SHP.Data[x].Databuffer[i + (j - SHP.Data[x].HeaderImage.x) + l];
|
||||
|
||||
FData[i + j + k] = cp;
|
||||
|
||||
if (j == (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x - 1))
|
||||
l = l + (SHP.Data[x].HeaderImage.cx - 1);
|
||||
|
||||
if (j == (Width - 1))
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
//FData = headers[x - 1].Image;
|
||||
k = 0;
|
||||
for (int i = 0; i < (Height - SHP.Data[x].HeaderImage.y); i++)
|
||||
{
|
||||
for (int j = 0; j < Width; j++)
|
||||
{
|
||||
headers[x - 1].Image[i + j + k + (Width * SHP.Data[x].HeaderImage.y)] = FData[i + j + k];
|
||||
if (j == (Width - 1))
|
||||
{
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Compression 2
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Compression 1
|
||||
ImageSize = (int)(SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy);
|
||||
Databuffer = new byte[ImageSize];
|
||||
for (int i = 0; i < ImageSize; i++)
|
||||
{
|
||||
s.Seek(SHP.Data[x].HeaderImage.offset + i, SeekOrigin.Begin);
|
||||
Databuffer[i] = s.ReadUInt8();
|
||||
}
|
||||
SHP.Data[x].Databuffer = new byte[(SHP.Data[x].HeaderImage.cx * SHP.Data[x].HeaderImage.cy)];
|
||||
SHP.Data[x].Databuffer = Databuffer;
|
||||
|
||||
k = 0;
|
||||
l = 0;
|
||||
for (int i = 0; i < Height; i++)
|
||||
{
|
||||
erri = i;
|
||||
for (int j = SHP.Data[x].HeaderImage.x; j < Width; j++)
|
||||
{
|
||||
errj = j;
|
||||
errl = l;
|
||||
errk = k;
|
||||
arroff = i + j + l;
|
||||
|
||||
if (((j + 1) > (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x)) || ((i + 1) > (SHP.Data[x].HeaderImage.cy)))
|
||||
cp = 0;
|
||||
else
|
||||
cp = SHP.Data[x].Databuffer[i + (j - SHP.Data[x].HeaderImage.x) + l];
|
||||
|
||||
FData[i + j + k] = cp;
|
||||
|
||||
if (j == (SHP.Data[x].HeaderImage.cx + SHP.Data[x].HeaderImage.x - 1))
|
||||
l = l + (SHP.Data[x].HeaderImage.cx - 1);
|
||||
|
||||
if (j == (Width - 1))
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
//FData = headers[x - 1].Image;
|
||||
k = 0;
|
||||
for (int i = 0; i < (Height - SHP.Data[x].HeaderImage.y); i++)
|
||||
{
|
||||
for (int j = 0; j < Width; j++)
|
||||
{
|
||||
headers[x - 1].Image[i + j + k + (Width * SHP.Data[x].HeaderImage.y)] = FData[i + j + k];
|
||||
if (j == (Width - 1))
|
||||
{
|
||||
k = k + (Width - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
// Set the shp's databuffer to the result after decompression
|
||||
}
|
||||
//Width = Width2;
|
||||
//Height = Height2;
|
||||
}
|
||||
|
||||
public HeaderImage this[int index]
|
||||
{
|
||||
get { return headers[index]; }
|
||||
}
|
||||
|
||||
public static void ReInterpretWordFromBytes(byte Byte1, byte Byte2, ref ushort FullValue)
|
||||
{
|
||||
FullValue = (ushort)((Byte2 * 256) + Byte1);
|
||||
}
|
||||
|
||||
public static void ReInterpretWordFromBytes(byte Byte1, byte Byte2, ref uint FullValue)
|
||||
{
|
||||
FullValue = (uint)((Byte2 * 256) + Byte1);
|
||||
}
|
||||
|
||||
// Compression 3:
|
||||
public static void Decode3(byte[] Source, ref byte[] Dest, int cx, int cy, ref int max)
|
||||
{
|
||||
int SP;
|
||||
int DP;
|
||||
int x;
|
||||
int y;
|
||||
int Count;
|
||||
int v;
|
||||
int maxdp;
|
||||
ushort Pos;
|
||||
maxdp = cx * cy;
|
||||
SP = 0;
|
||||
DP = 0;
|
||||
Pos = 0;
|
||||
try
|
||||
{
|
||||
for (y = 1; y <= cy; y++)
|
||||
{
|
||||
ReInterpretWordFromBytes(Source[SP], Source[SP + 1], ref Pos);
|
||||
|
||||
Count = Pos - 2;
|
||||
|
||||
SP = SP + 2;
|
||||
|
||||
x = 0;
|
||||
while (Count > 0)
|
||||
{
|
||||
Count = Count - 1;
|
||||
if ((SP > max) || (DP > maxdp))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// SP has reached max value, exit
|
||||
v = Source[SP];
|
||||
SP++;
|
||||
if (v != 0)
|
||||
{
|
||||
if ((SP > max) || (DP > maxdp))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
x++;
|
||||
Dest[DP] += (byte)v;
|
||||
}
|
||||
DP++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Count -= 1;
|
||||
v = Source[SP];
|
||||
|
||||
SP++;
|
||||
if ((x + v) > cx)
|
||||
{
|
||||
v = cx - x;
|
||||
}
|
||||
x = x + v;
|
||||
while (v > 0)
|
||||
{
|
||||
if ((SP > max) || (DP > maxdp))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
v -= 1;
|
||||
Dest[DP] = 0;
|
||||
|
||||
}
|
||||
DP++;
|
||||
// SP has reached max value, exit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((SP >= max) || (DP >= maxdp))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// SP has reached max value, exit
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void Decode2(byte[] Source, ref byte[] Dest, int cx, int cy, ref int max)
|
||||
{
|
||||
int SP;
|
||||
int DP;
|
||||
int y;
|
||||
int Count;
|
||||
int maxdp;
|
||||
ushort Pos;
|
||||
maxdp = cx * cy;
|
||||
SP = 0;
|
||||
DP = 0;
|
||||
Pos = 0;
|
||||
try
|
||||
{
|
||||
for (y = 1; y <= cy; y++)
|
||||
{
|
||||
ReInterpretWordFromBytes(Source[SP], Source[SP + 1], ref Pos);
|
||||
Count = Pos - 2;
|
||||
SP += 2;
|
||||
while (Count > 0)
|
||||
{
|
||||
Count -= 1;
|
||||
if ((SP > max) || (DP > maxdp))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// SP has reached max value, exit
|
||||
Dest[DP] = Source[SP];
|
||||
SP++;
|
||||
DP++;
|
||||
}
|
||||
if ((SP >= max) || (DP >= maxdp))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// SP has reached max value, exit
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<HeaderImage> GetEnumerator()
|
||||
{
|
||||
return headers.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public Size Size { get { return new Size(Width, Height); } }
|
||||
}
|
||||
}
|
||||
97
OpenRA.FileFormats/Graphics/TileSetRenderer.cs
Normal file
97
OpenRA.FileFormats/Graphics/TileSetRenderer.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public class TileSetRenderer
|
||||
{
|
||||
public TileSet TileSet;
|
||||
Dictionary<ushort, List<byte[]>> templates;
|
||||
public Size TileSize;
|
||||
|
||||
List<byte[]> LoadTemplate(string filename, string[] exts, Cache<string, R8Reader> r8Cache, int[] frames)
|
||||
{
|
||||
if (exts.Contains(".R8") && FileSystem.Exists(filename+".R8"))
|
||||
{
|
||||
var data = new List<byte[]>();
|
||||
|
||||
foreach (var f in frames)
|
||||
data.Add(f >= 0 ? r8Cache[filename][f].Image : null);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
using (var s = FileSystem.OpenWithExts(filename, exts))
|
||||
return new Terrain(s).TileBitmapBytes;
|
||||
}
|
||||
|
||||
public TileSetRenderer(TileSet tileset, Size tileSize)
|
||||
{
|
||||
this.TileSet = tileset;
|
||||
this.TileSize = tileSize;
|
||||
|
||||
templates = new Dictionary<ushort, List<byte[]>>();
|
||||
var r8Cache = new Cache<string, R8Reader>(s => new R8Reader(FileSystem.OpenWithExts(s, ".R8")));
|
||||
foreach (var t in TileSet.Templates)
|
||||
templates.Add(t.Key, LoadTemplate(t.Value.Image, tileset.Extensions, r8Cache, t.Value.Frames));
|
||||
}
|
||||
|
||||
public Bitmap RenderTemplate(ushort id, Palette p)
|
||||
{
|
||||
var template = TileSet.Templates[id];
|
||||
var templateData = templates[id];
|
||||
|
||||
var bitmap = new Bitmap(TileSize.Width * template.Size.X, TileSize.Height * template.Size.Y,
|
||||
PixelFormat.Format8bppIndexed);
|
||||
|
||||
bitmap.Palette = p.AsSystemPalette();
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||
|
||||
unsafe
|
||||
{
|
||||
var q = (byte*)data.Scan0.ToPointer();
|
||||
var stride = data.Stride;
|
||||
|
||||
for (var u = 0; u < template.Size.X; u++)
|
||||
for (var v = 0; v < template.Size.Y; v++)
|
||||
if (templateData[u + v * template.Size.X] != null)
|
||||
{
|
||||
var rawImage = templateData[u + v * template.Size.X];
|
||||
for (var i = 0; i < TileSize.Width; i++)
|
||||
for (var j = 0; j < TileSize.Height; j++)
|
||||
q[(v * TileSize.Width + j) * stride + u * TileSize.Width + i] = rawImage[i + TileSize.Width * j];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < TileSize.Width; i++)
|
||||
for (var j = 0; j < TileSize.Height; j++)
|
||||
q[(v * TileSize.Width + j) * stride + u * TileSize.Width + i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public List<byte[]> Data(ushort id)
|
||||
{
|
||||
return templates[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,5 +24,12 @@ namespace OpenRA.FileFormats.Graphics
|
||||
this.u = uv.X; this.v = uv.Y;
|
||||
this.p = pc.X; this.c = pc.Y;
|
||||
}
|
||||
|
||||
public Vertex(float[] xyz, float2 uv, float2 pc)
|
||||
{
|
||||
this.x = xyz[0]; this.y = xyz[1]; this.z = xyz[2];
|
||||
this.u = uv.X; this.v = uv.Y;
|
||||
this.p = pc.X; this.c = pc.Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,67 +46,66 @@ namespace OpenRA.FileFormats
|
||||
public byte[] AudioData { get { return audioData; } }
|
||||
public int CurrentFrame { get { return currentFrame; } }
|
||||
|
||||
public VqaReader( Stream stream )
|
||||
public VqaReader(Stream stream)
|
||||
{
|
||||
this.stream = stream;
|
||||
BinaryReader reader = new BinaryReader( stream );
|
||||
|
||||
// Decode FORM chunk
|
||||
if (new String(reader.ReadChars(4)) != "FORM")
|
||||
if (stream.ReadASCII(4) != "FORM")
|
||||
throw new InvalidDataException("Invalid vqa (invalid FORM section)");
|
||||
/*var length = */ reader.ReadUInt32();
|
||||
/*var length = */ stream.ReadUInt32();
|
||||
|
||||
if (new String(reader.ReadChars(8)) != "WVQAVQHD")
|
||||
if (stream.ReadASCII(8) != "WVQAVQHD")
|
||||
throw new InvalidDataException("Invalid vqa (not WVQAVQHD)");
|
||||
/* var length = */reader.ReadUInt32();
|
||||
/* var length = */stream.ReadUInt32();
|
||||
|
||||
/*var version = */reader.ReadUInt16();
|
||||
/*var flags = */reader.ReadUInt16();
|
||||
Frames = reader.ReadUInt16();
|
||||
Width = reader.ReadUInt16();
|
||||
Height = reader.ReadUInt16();
|
||||
/*var version = */stream.ReadUInt16();
|
||||
/*var flags = */stream.ReadUInt16();
|
||||
Frames = stream.ReadUInt16();
|
||||
Width = stream.ReadUInt16();
|
||||
Height = stream.ReadUInt16();
|
||||
|
||||
blockWidth = reader.ReadByte();
|
||||
blockHeight = reader.ReadByte();
|
||||
Framerate = reader.ReadByte();
|
||||
cbParts = reader.ReadByte();
|
||||
blockWidth = stream.ReadUInt8();
|
||||
blockHeight = stream.ReadUInt8();
|
||||
Framerate = stream.ReadUInt8();
|
||||
cbParts = stream.ReadUInt8();
|
||||
blocks = new int2(Width / blockWidth, Height / blockHeight);
|
||||
|
||||
numColors = reader.ReadUInt16();
|
||||
/*var maxBlocks = */reader.ReadUInt16();
|
||||
/*var unknown1 = */reader.ReadUInt16();
|
||||
/*var unknown2 = */reader.ReadUInt32();
|
||||
numColors = stream.ReadUInt16();
|
||||
/*var maxBlocks = */stream.ReadUInt16();
|
||||
/*var unknown1 = */stream.ReadUInt16();
|
||||
/*var unknown2 = */stream.ReadUInt32();
|
||||
|
||||
// Audio
|
||||
/*var freq = */reader.ReadUInt16();
|
||||
/*var channels = */reader.ReadByte();
|
||||
/*var bits = */reader.ReadByte();
|
||||
/*var unknown3 = */reader.ReadChars(14);
|
||||
/*var freq = */stream.ReadUInt16();
|
||||
/*var channels = */stream.ReadByte();
|
||||
/*var bits = */stream.ReadByte();
|
||||
/*var unknown3 = */stream.ReadBytes(14);
|
||||
|
||||
|
||||
var frameSize = Exts.NextPowerOf2(Math.Max(Width,Height));
|
||||
var frameSize = Exts.NextPowerOf2(Math.Max(Width, Height));
|
||||
cbf = new byte[Width*Height];
|
||||
cbp = new byte[Width*Height];
|
||||
palette = new uint[numColors];
|
||||
origData = new byte[2*blocks.X*blocks.Y];
|
||||
frameData = new uint[frameSize,frameSize];
|
||||
frameData = new uint[frameSize, frameSize];
|
||||
|
||||
var type = new String(reader.ReadChars(4));
|
||||
var type = stream.ReadASCII(4);
|
||||
if (type != "FINF")
|
||||
{
|
||||
reader.ReadBytes(27);
|
||||
type = new String(reader.ReadChars(4));
|
||||
stream.Seek(27, SeekOrigin.Current);
|
||||
type = stream.ReadASCII(4);
|
||||
}
|
||||
|
||||
/*var length = */reader.ReadUInt16();
|
||||
/*var unknown4 = */reader.ReadUInt16();
|
||||
/*var length = */stream.ReadUInt16();
|
||||
/*var unknown4 = */stream.ReadUInt16();
|
||||
|
||||
// Frame offsets
|
||||
offsets = new UInt32[Frames];
|
||||
for (int i = 0; i < Frames; i++)
|
||||
{
|
||||
offsets[i] = reader.ReadUInt32();
|
||||
if (offsets[i] > 0x40000000) offsets[i] -= 0x40000000;
|
||||
offsets[i] = stream.ReadUInt32();
|
||||
if (offsets[i] > 0x40000000)
|
||||
offsets[i] -= 0x40000000;
|
||||
offsets[i] <<= 1;
|
||||
}
|
||||
|
||||
@@ -130,28 +129,28 @@ namespace OpenRA.FileFormats
|
||||
for (var i = 0; i < Frames; i++)
|
||||
{
|
||||
stream.Seek(offsets[i], SeekOrigin.Begin);
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
var end = (i < Frames - 1) ? offsets[i + 1] : stream.Length;
|
||||
|
||||
while (reader.BaseStream.Position < end)
|
||||
while (stream.Position < end)
|
||||
{
|
||||
var type = new String(reader.ReadChars(4));
|
||||
var length = int2.Swap(reader.ReadUInt32());
|
||||
var type = stream.ReadASCII(4);
|
||||
var length = int2.Swap(stream.ReadUInt32());
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case "SND0":
|
||||
case "SND2":
|
||||
var rawAudio = reader.ReadBytes((int)length);
|
||||
var rawAudio = stream.ReadBytes((int)length);
|
||||
ms.Write(rawAudio);
|
||||
compressed = (type == "SND2");
|
||||
break;
|
||||
default:
|
||||
reader.ReadBytes((int)length);
|
||||
stream.ReadBytes((int)length);
|
||||
break;
|
||||
}
|
||||
|
||||
if (reader.PeekChar() == 0) reader.ReadByte();
|
||||
// Chunks are aligned on even bytes; advance by a byte if the next one is null
|
||||
if (stream.Peek() == 0) stream.ReadByte();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,48 +170,47 @@ namespace OpenRA.FileFormats
|
||||
|
||||
// Seek to the start of the frame
|
||||
stream.Seek(offsets[currentFrame], SeekOrigin.Begin);
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
var end = (currentFrame < Frames - 1) ? offsets[currentFrame+1] : stream.Length;
|
||||
|
||||
while(reader.BaseStream.Position < end)
|
||||
while (stream.Position < end)
|
||||
{
|
||||
var type = new String(reader.ReadChars(4));
|
||||
var length = int2.Swap(reader.ReadUInt32());
|
||||
var type = stream.ReadASCII(4);
|
||||
var length = int2.Swap(stream.ReadUInt32());
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case "VQFR":
|
||||
DecodeVQFR(reader);
|
||||
DecodeVQFR(stream);
|
||||
break;
|
||||
default:
|
||||
// Don't parse sound here.
|
||||
reader.ReadBytes((int)length);
|
||||
stream.ReadBytes((int)length);
|
||||
break;
|
||||
}
|
||||
|
||||
// Chunks are aligned on even bytes; advance by a byte if the next one is null
|
||||
if (reader.PeekChar() == 0) reader.ReadByte();
|
||||
if (stream.Peek() == 0) stream.ReadByte();
|
||||
}
|
||||
}
|
||||
|
||||
// VQA Frame
|
||||
public void DecodeVQFR(BinaryReader reader)
|
||||
public void DecodeVQFR(Stream s)
|
||||
{
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
// Chunks are aligned on even bytes; may be padded with a single null
|
||||
if (reader.PeekChar() == 0) reader.ReadByte();
|
||||
var type = new String(reader.ReadChars(4));
|
||||
int subchunkLength = (int)int2.Swap(reader.ReadUInt32());
|
||||
if (s.Peek() == 0) s.ReadByte();
|
||||
var type = s.ReadASCII(4);
|
||||
int subchunkLength = (int)int2.Swap(s.ReadUInt32());
|
||||
|
||||
switch(type)
|
||||
{
|
||||
// Full frame-modifier
|
||||
case "CBFZ":
|
||||
Format80.DecodeInto( reader.ReadBytes(subchunkLength), cbf );
|
||||
Format80.DecodeInto(s.ReadBytes(subchunkLength), cbf);
|
||||
break;
|
||||
case "CBF0":
|
||||
cbf = reader.ReadBytes(subchunkLength);
|
||||
cbf = s.ReadBytes(subchunkLength);
|
||||
break;
|
||||
|
||||
// frame-modifier chunk
|
||||
@@ -224,12 +222,12 @@ namespace OpenRA.FileFormats
|
||||
if (type == "CBP0")
|
||||
cbf = (byte[])cbp.Clone();
|
||||
else
|
||||
Format80.DecodeInto( cbp, cbf );
|
||||
Format80.DecodeInto(cbp, cbf);
|
||||
|
||||
cbOffset = cbChunk = 0;
|
||||
}
|
||||
|
||||
var bytes = reader.ReadBytes(subchunkLength);
|
||||
var bytes = s.ReadBytes(subchunkLength);
|
||||
bytes.CopyTo(cbp,cbOffset);
|
||||
cbOffset += subchunkLength;
|
||||
cbChunk++;
|
||||
@@ -239,16 +237,16 @@ namespace OpenRA.FileFormats
|
||||
case "CPL0":
|
||||
for (int i = 0; i < numColors; i++)
|
||||
{
|
||||
byte r = (byte)(reader.ReadByte() << 2);
|
||||
byte g = (byte)(reader.ReadByte() << 2);
|
||||
byte b = (byte)(reader.ReadByte() << 2);
|
||||
byte r = (byte)(s.ReadUInt8() << 2);
|
||||
byte g = (byte)(s.ReadUInt8() << 2);
|
||||
byte b = (byte)(s.ReadUInt8() << 2);
|
||||
palette[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
|
||||
}
|
||||
break;
|
||||
|
||||
// Frame data
|
||||
case "VPTZ":
|
||||
Format80.DecodeInto( reader.ReadBytes(subchunkLength), origData );
|
||||
Format80.DecodeInto(s.ReadBytes(subchunkLength), origData);
|
||||
// This is the last subchunk
|
||||
return;
|
||||
default:
|
||||
|
||||
158
OpenRA.FileFormats/Graphics/VxlReader.cs
Normal file
158
OpenRA.FileFormats/Graphics/VxlReader.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public enum NormalType { TiberianSun = 2, RedAlert2 = 4 }
|
||||
public class VxlElement
|
||||
{
|
||||
public byte Color;
|
||||
public byte Normal;
|
||||
}
|
||||
|
||||
public class VxlLimb
|
||||
{
|
||||
public string Name;
|
||||
public float Scale;
|
||||
public float[] Bounds;
|
||||
public byte[] Size;
|
||||
public NormalType Type;
|
||||
|
||||
public uint VoxelCount;
|
||||
public Dictionary<byte, VxlElement>[,] VoxelMap;
|
||||
}
|
||||
|
||||
public class VxlReader
|
||||
{
|
||||
public readonly uint LimbCount;
|
||||
public VxlLimb[] Limbs;
|
||||
|
||||
uint BodySize;
|
||||
|
||||
void ReadVoxelData(Stream s, VxlLimb l)
|
||||
{
|
||||
var baseSize = l.Size[0]*l.Size[1];
|
||||
var colStart = new int[baseSize];
|
||||
for (var i = 0; i < baseSize; i++)
|
||||
colStart[i] = s.ReadInt32();
|
||||
s.Seek(4*baseSize, SeekOrigin.Current);
|
||||
var dataStart = s.Position;
|
||||
|
||||
// Count the voxels in this limb
|
||||
l.VoxelCount = 0;
|
||||
for (var i = 0; i < baseSize; i++)
|
||||
{
|
||||
// Empty column
|
||||
if (colStart[i] == -1)
|
||||
continue;
|
||||
|
||||
s.Seek(dataStart + colStart[i], SeekOrigin.Begin);
|
||||
var z = 0;
|
||||
do
|
||||
{
|
||||
z += s.ReadUInt8();
|
||||
var count = s.ReadUInt8();
|
||||
z += count;
|
||||
l.VoxelCount += count;
|
||||
s.Seek(2*count + 1, SeekOrigin.Current);
|
||||
} while (z < l.Size[2]);
|
||||
}
|
||||
|
||||
// Read the data
|
||||
l.VoxelMap = new Dictionary<byte, VxlElement>[l.Size[0],l.Size[1]];
|
||||
for (var i = 0; i < baseSize; i++)
|
||||
{
|
||||
// Empty column
|
||||
if (colStart[i] == -1)
|
||||
continue;
|
||||
|
||||
s.Seek(dataStart + colStart[i], SeekOrigin.Begin);
|
||||
|
||||
byte x = (byte)(i % l.Size[0]);
|
||||
byte y = (byte)(i / l.Size[0]);
|
||||
byte z = 0;
|
||||
l.VoxelMap[x,y] = new Dictionary<byte, VxlElement>();
|
||||
do
|
||||
{
|
||||
z += s.ReadUInt8();
|
||||
var count = s.ReadUInt8();
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
var v = new VxlElement();
|
||||
v.Color = s.ReadUInt8();
|
||||
v.Normal = s.ReadUInt8();
|
||||
|
||||
l.VoxelMap[x,y].Add(z, v);
|
||||
z++;
|
||||
}
|
||||
// Skip duplicate count
|
||||
s.ReadUInt8();
|
||||
} while (z < l.Size[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public VxlReader(Stream s)
|
||||
{
|
||||
|
||||
if (!s.ReadASCII(16).StartsWith("Voxel Animation"))
|
||||
throw new InvalidDataException("Invalid vxl header");
|
||||
|
||||
s.ReadUInt32();
|
||||
LimbCount = s.ReadUInt32();
|
||||
s.ReadUInt32();
|
||||
BodySize = s.ReadUInt32();
|
||||
s.Seek(770, SeekOrigin.Current);
|
||||
|
||||
// Read Limb headers
|
||||
Limbs = new VxlLimb[LimbCount];
|
||||
for (var i = 0; i < LimbCount; i++)
|
||||
{
|
||||
Limbs[i] = new VxlLimb();
|
||||
Limbs[i].Name = s.ReadASCII(16);
|
||||
s.Seek(12, SeekOrigin.Current);
|
||||
}
|
||||
|
||||
// Skip to the Limb footers
|
||||
s.Seek(802 + 28*LimbCount + BodySize, SeekOrigin.Begin);
|
||||
|
||||
var LimbDataOffset = new uint[LimbCount];
|
||||
for (var i = 0; i < LimbCount; i++)
|
||||
{
|
||||
LimbDataOffset[i] = s.ReadUInt32();
|
||||
s.Seek(8, SeekOrigin.Current);
|
||||
Limbs[i].Scale = s.ReadFloat();
|
||||
s.Seek(48, SeekOrigin.Current);
|
||||
|
||||
Limbs[i].Bounds = new float[6];
|
||||
for (var j = 0; j < 6; j++)
|
||||
Limbs[i].Bounds[j] = s.ReadFloat();
|
||||
Limbs[i].Size = s.ReadBytes(3);
|
||||
Limbs[i].Type = (NormalType)s.ReadByte();
|
||||
}
|
||||
|
||||
for (var i = 0; i < LimbCount; i++)
|
||||
{
|
||||
s.Seek(802 + 28*LimbCount + LimbDataOffset[i], SeekOrigin.Begin);
|
||||
ReadVoxelData(s, Limbs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public static VxlReader Load(string filename)
|
||||
{
|
||||
using (var s = File.OpenRead(filename))
|
||||
return new VxlReader(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,34 +12,54 @@ using System.Drawing;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public struct ColorRamp
|
||||
public struct HSLColor
|
||||
{
|
||||
public byte H,S,L,R;
|
||||
public readonly byte H;
|
||||
public readonly byte S;
|
||||
public readonly byte L;
|
||||
public readonly Color RGB;
|
||||
|
||||
public ColorRamp(byte h, byte s, byte l, byte r)
|
||||
public HSLColor(byte h, byte s, byte l)
|
||||
{
|
||||
H = h; S = s; L = l; R = r;
|
||||
H = h;
|
||||
S = s;
|
||||
L = l;
|
||||
RGB = RGBFromHSL(H / 255f, S / 255f, L / 255f);
|
||||
}
|
||||
|
||||
/* returns a color along the Lum ramp */
|
||||
public Color GetColor( float t )
|
||||
public void ToHSV(out float h, out float s, out float v)
|
||||
{
|
||||
return ColorFromHSL( H / 255f, S / 255f, float2.Lerp( L / 255f, L*R / (255f * 255f), t ) );
|
||||
var ll = 2*L / 255f;
|
||||
var ss = S / 255f * ((ll <= 1) ? ll : 2 - ll);
|
||||
|
||||
h = H / 255f;
|
||||
s = (2 * ss) / (ll + ss);
|
||||
v = (ll + ss) / 2;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
public static HSLColor FromHSV(float h, float s, float v)
|
||||
{
|
||||
return "{0},{1},{2},{3}".F(H, S, L, R);
|
||||
var ll = 0.5f*(2 - s)*v;
|
||||
var ss = (ll >= 1 || v <= 0) ? 0 : 0.5f*s*v / (ll <= 0.5f ? ll : 1 - ll);
|
||||
return new HSLColor((byte)(255*h), (byte)(255*ss), (byte)(255*ll));
|
||||
}
|
||||
|
||||
// hk is hue in the range [0,1] instead of [0,360]
|
||||
static Color ColorFromHSL(float hk, float s, float l)
|
||||
public static HSLColor FromRGB(int r, int g, int b)
|
||||
{
|
||||
var c = Color.FromArgb(r, g, b);
|
||||
var h = (byte)((c.GetHue() / 360.0f) * 255);
|
||||
var s = (byte)(c.GetSaturation() * 255);
|
||||
var l = (byte)(c.GetBrightness() * 255);
|
||||
return new HSLColor(h, s, l);
|
||||
}
|
||||
|
||||
public static Color RGBFromHSL(float h, float s, float l)
|
||||
{
|
||||
// Convert from HSL to RGB
|
||||
var q = (l < 0.5f) ? l * (1 + s) : l + s - (l * s);
|
||||
var p = 2 * l - q;
|
||||
|
||||
float[] trgb = { hk + 1 / 3.0f, hk, hk - 1/3.0f };
|
||||
float[] trgb = { h + 1 / 3.0f, h, h - 1/3.0f };
|
||||
float[] rgb = { 0, 0, 0 };
|
||||
|
||||
for (int k = 0; k < 3; k++)
|
||||
@@ -59,21 +79,26 @@ namespace OpenRA.FileFormats
|
||||
return Color.FromArgb((int)(rgb[0] * 255), (int)(rgb[1] * 255), (int)(rgb[2] * 255));
|
||||
}
|
||||
|
||||
public static bool operator ==(ColorRamp me, ColorRamp other)
|
||||
public override string ToString()
|
||||
{
|
||||
return (me.H == other.H && me.S == other.S && me.L == other.L && me.R == other.R );
|
||||
return "{0},{1},{2}".F(H, S, L);
|
||||
}
|
||||
|
||||
public static bool operator !=(ColorRamp me, ColorRamp other) { return !(me == other); }
|
||||
public static bool operator ==(HSLColor me, HSLColor other)
|
||||
{
|
||||
return (me.H == other.H && me.S == other.S && me.L == other.L);
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return H.GetHashCode() ^ S.GetHashCode() ^ L.GetHashCode() ^ R.GetHashCode(); }
|
||||
public static bool operator !=(HSLColor me, HSLColor other) { return !(me == other); }
|
||||
|
||||
public override int GetHashCode() { return H.GetHashCode() ^ S.GetHashCode() ^ L.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
ColorRamp o = (ColorRamp)obj;
|
||||
HSLColor o = (HSLColor)obj;
|
||||
return o == this;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
@@ -18,10 +19,14 @@ namespace OpenRA.FileFormats
|
||||
public class Manifest
|
||||
{
|
||||
public readonly string[]
|
||||
Mods, Folders, Packages, Rules, ServerTraits,
|
||||
Sequences, Cursors, Chrome, Assemblies, ChromeLayout,
|
||||
Weapons, Voices, Notifications, Music, Movies, TileSets, ChromeMetrics;
|
||||
Mods, Folders, Rules, ServerTraits,
|
||||
Sequences, VoxelSequences, Cursors, Chrome, Assemblies, ChromeLayout,
|
||||
Weapons, Voices, Notifications, Music, Movies, TileSets,
|
||||
ChromeMetrics, PackageContents;
|
||||
|
||||
public readonly Dictionary<string, string> Packages;
|
||||
public readonly MiniYaml LoadScreen;
|
||||
public readonly MiniYaml LobbyDefaults;
|
||||
public readonly Dictionary<string, Pair<string,int>> Fonts;
|
||||
public readonly int TileSize = 24;
|
||||
|
||||
@@ -29,15 +34,16 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
Mods = mods;
|
||||
var yaml = new MiniYaml(null, mods
|
||||
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
|
||||
.Select(m => MiniYaml.FromFile("mods{0}{1}{0}mod.yaml".F(Path.DirectorySeparatorChar, m)))
|
||||
.Aggregate(MiniYaml.MergeLiberal)).NodesDict;
|
||||
|
||||
// Todo: Use fieldloader
|
||||
// TODO: Use fieldloader
|
||||
Folders = YamlList(yaml, "Folders");
|
||||
Packages = YamlList(yaml, "Packages");
|
||||
Packages = yaml["Packages"].NodesDict.ToDictionary(x => x.Key, x => x.Value.Value);
|
||||
Rules = YamlList(yaml, "Rules");
|
||||
ServerTraits = YamlList(yaml, "ServerTraits");
|
||||
Sequences = YamlList(yaml, "Sequences");
|
||||
VoxelSequences = YamlList(yaml, "VoxelSequences");
|
||||
Cursors = YamlList(yaml, "Cursors");
|
||||
Chrome = YamlList(yaml, "Chrome");
|
||||
Assemblies = YamlList(yaml, "Assemblies");
|
||||
@@ -49,8 +55,10 @@ namespace OpenRA.FileFormats
|
||||
Movies = YamlList(yaml, "Movies");
|
||||
TileSets = YamlList(yaml, "TileSets");
|
||||
ChromeMetrics = YamlList(yaml, "ChromeMetrics");
|
||||
PackageContents = YamlList(yaml, "PackageContents");
|
||||
|
||||
LoadScreen = yaml["LoadScreen"];
|
||||
LobbyDefaults = yaml["LobbyDefaults"];
|
||||
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key,
|
||||
x => Pair.New(x.Value.NodesDict["Font"].Value,
|
||||
int.Parse(x.Value.NodesDict["Size"].Value)));
|
||||
|
||||
@@ -21,15 +21,17 @@ namespace OpenRA.FileFormats
|
||||
public bool NonCombatant = false;
|
||||
public bool Playable = false;
|
||||
public string Bot = null;
|
||||
public bool DefaultStartingUnits = false;
|
||||
public string StartingUnitsClass = null;
|
||||
public bool AllowBots = true;
|
||||
public bool Required = false;
|
||||
|
||||
public bool LockRace = false;
|
||||
public string Race;
|
||||
|
||||
// ColorRamp naming retained for backward compatibility
|
||||
public bool LockColor = false;
|
||||
public ColorRamp ColorRamp = new ColorRamp(0,0,238,34);
|
||||
public HSLColor ColorRamp = new HSLColor(0,0,238);
|
||||
public HSLColor Color { get { return ColorRamp; } set { ColorRamp = value; }}
|
||||
|
||||
public bool LockSpawn = false;
|
||||
public int Spawn = 0;
|
||||
@@ -37,7 +39,6 @@ namespace OpenRA.FileFormats
|
||||
public bool LockTeam = false;
|
||||
public int Team = 0;
|
||||
|
||||
public int InitialCash = 0;
|
||||
public string[] Allies = {};
|
||||
public string[] Enemies = {};
|
||||
|
||||
|
||||
@@ -16,16 +16,15 @@ namespace OpenRA.FileFormats
|
||||
public class Terrain
|
||||
{
|
||||
public readonly List<byte[]> TileBitmapBytes = new List<byte[]>();
|
||||
public readonly int Width;
|
||||
public readonly int Height;
|
||||
|
||||
public Terrain( Stream stream, int size )
|
||||
public Terrain(Stream stream)
|
||||
{
|
||||
// Try loading as a cnc .tem
|
||||
BinaryReader reader = new BinaryReader( stream );
|
||||
int Width = reader.ReadUInt16();
|
||||
int Height = reader.ReadUInt16();
|
||||
|
||||
if( Width != size || Height != size )
|
||||
throw new InvalidDataException( "{0}x{1} != {2}x{2}".F(Width, Height, size ) );
|
||||
Width = reader.ReadUInt16();
|
||||
Height = reader.ReadUInt16();
|
||||
|
||||
/*NumTiles = */reader.ReadUInt16();
|
||||
/*Zero1 = */reader.ReadUInt16();
|
||||
@@ -65,8 +64,8 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
if (b != 255)
|
||||
{
|
||||
stream.Position = ImgStart + b * size * size;
|
||||
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(size * size));
|
||||
stream.Position = ImgStart + b * Width * Height;
|
||||
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(Width * Height));
|
||||
}
|
||||
else
|
||||
TileBitmapBytes.Add(null);
|
||||
|
||||
@@ -35,24 +35,25 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public ushort Id;
|
||||
public string Image;
|
||||
public int[] Frames;
|
||||
public int2 Size;
|
||||
public bool PickAny;
|
||||
public string Category;
|
||||
|
||||
[FieldLoader.LoadUsing( "LoadTiles" )]
|
||||
[FieldLoader.LoadUsing("LoadTiles")]
|
||||
public Dictionary<byte, string> Tiles = new Dictionary<byte, string>();
|
||||
|
||||
public TileTemplate() {}
|
||||
public TileTemplate(MiniYaml my) { FieldLoader.Load( this, my ); }
|
||||
public TileTemplate(MiniYaml my) { FieldLoader.Load(this, my); }
|
||||
|
||||
static object LoadTiles( MiniYaml y )
|
||||
static object LoadTiles(MiniYaml y)
|
||||
{
|
||||
return y.NodesDict["Tiles"].NodesDict.ToDictionary(
|
||||
t => byte.Parse(t.Key),
|
||||
t => t.Value.Value );
|
||||
t => t.Value.Value);
|
||||
}
|
||||
|
||||
static readonly string[] Fields = { "Id", "Image", "Size", "PickAny" };
|
||||
static readonly string[] Fields = { "Id", "Image", "Frames", "Size", "PickAny" };
|
||||
|
||||
public MiniYaml Save()
|
||||
{
|
||||
@@ -60,36 +61,39 @@ namespace OpenRA.FileFormats
|
||||
foreach (var field in Fields)
|
||||
{
|
||||
FieldInfo f = this.GetType().GetField(field);
|
||||
if (f.GetValue(this) == null) continue;
|
||||
root.Add( new MiniYamlNode( field, FieldSaver.FormatValue( this, f ) ) );
|
||||
if (f.GetValue(this) == null)
|
||||
continue;
|
||||
|
||||
root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f)));
|
||||
}
|
||||
|
||||
root.Add( new MiniYamlNode( "Tiles", null,
|
||||
Tiles.Select( x => new MiniYamlNode( x.Key.ToString(), x.Value ) ).ToList() ) );
|
||||
root.Add(new MiniYamlNode("Tiles", null,
|
||||
Tiles.Select(x => new MiniYamlNode(x.Key.ToString(), x.Value)).ToList()));
|
||||
|
||||
return new MiniYaml(null, root);
|
||||
}
|
||||
|
||||
public Terrain Data;
|
||||
}
|
||||
|
||||
public class TileSet
|
||||
{
|
||||
public string Name;
|
||||
public string Id;
|
||||
public int SheetSize = 512;
|
||||
public string Palette;
|
||||
public int TileSize = 24;
|
||||
public string PlayerPalette;
|
||||
public string[] Extensions;
|
||||
public int WaterPaletteRotationBase = 0x60;
|
||||
public Dictionary<string, TerrainTypeInfo> Terrain = new Dictionary<string, TerrainTypeInfo>();
|
||||
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
|
||||
public string[] EditorTemplateOrder;
|
||||
|
||||
static readonly string[] fields = {"Name", "TileSize", "Id", "Palette", "Extensions"};
|
||||
static readonly string[] fields = {"Name", "TileSize", "Id", "SheetSize", "Palette", "Extensions"};
|
||||
|
||||
public TileSet() {}
|
||||
|
||||
public TileSet( string filepath )
|
||||
public TileSet(string filepath)
|
||||
{
|
||||
var yaml = MiniYaml.DictFromFile( filepath );
|
||||
var yaml = MiniYaml.DictFromFile(filepath);
|
||||
|
||||
// General info
|
||||
FieldLoader.Load(this, yaml["General"]);
|
||||
@@ -103,14 +107,6 @@ namespace OpenRA.FileFormats
|
||||
.Select(y => new TileTemplate(y)).ToDictionary(t => t.Id);
|
||||
}
|
||||
|
||||
public void LoadTiles()
|
||||
{
|
||||
foreach (var t in Templates)
|
||||
if (t.Value.Data == null)
|
||||
using( var s = FileSystem.OpenWithExts(t.Value.Image, Extensions) )
|
||||
t.Value.Data = new Terrain(s, TileSize);
|
||||
}
|
||||
|
||||
public void Save(string filepath)
|
||||
{
|
||||
var root = new List<MiniYamlNode>();
|
||||
@@ -119,82 +115,34 @@ namespace OpenRA.FileFormats
|
||||
foreach (var field in fields)
|
||||
{
|
||||
FieldInfo f = this.GetType().GetField(field);
|
||||
if (f.GetValue(this) == null) continue;
|
||||
gen.Add( new MiniYamlNode( field, FieldSaver.FormatValue( this, f ) ) );
|
||||
if (f.GetValue(this) == null)
|
||||
continue;
|
||||
|
||||
gen.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f)));
|
||||
}
|
||||
|
||||
root.Add( new MiniYamlNode( "General", null, gen ) );
|
||||
root.Add(new MiniYamlNode("General", null, gen));
|
||||
|
||||
root.Add( new MiniYamlNode( "Terrain", null,
|
||||
Terrain.Select( t => new MiniYamlNode(
|
||||
"TerrainType@{0}".F( t.Value.Type ),
|
||||
t.Value.Save() ) ).ToList() ) );
|
||||
root.Add(new MiniYamlNode( "Terrain", null,
|
||||
Terrain.Select(t => new MiniYamlNode(
|
||||
"TerrainType@{0}".F(t.Value.Type),
|
||||
t.Value.Save())).ToList()));
|
||||
|
||||
root.Add( new MiniYamlNode( "Templates", null,
|
||||
Templates.Select( t => new MiniYamlNode(
|
||||
"Template@{0}".F( t.Value.Id ),
|
||||
t.Value.Save() ) ).ToList() ) );
|
||||
root.Add(new MiniYamlNode("Templates", null,
|
||||
Templates.Select(t => new MiniYamlNode(
|
||||
"Template@{0}".F(t.Value.Id),
|
||||
t.Value.Save())).ToList()));
|
||||
root.WriteToFile(filepath);
|
||||
}
|
||||
|
||||
public byte[] GetBytes(TileReference<ushort,byte> r)
|
||||
{
|
||||
TileTemplate tile;
|
||||
if( Templates.TryGetValue( r.type, out tile ) )
|
||||
return tile.Data.TileBitmapBytes[ r.index ];
|
||||
|
||||
byte[] missingTile = new byte[ TileSize * TileSize ];
|
||||
for( int i = 0 ; i < missingTile.Length ; i++ )
|
||||
missingTile[ i ] = 0x36;
|
||||
|
||||
return missingTile;
|
||||
}
|
||||
|
||||
public string GetTerrainType(TileReference<ushort, byte> r)
|
||||
{
|
||||
var tt = Templates[r.type].Tiles;
|
||||
string ret;
|
||||
if (!tt.TryGetValue(r.index, out ret))
|
||||
return "Clear"; // Default walkable
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Bitmap RenderTemplate(ushort n, Palette p)
|
||||
{
|
||||
var template = Templates[n];
|
||||
|
||||
var bitmap = new Bitmap(TileSize * template.Size.X, TileSize * template.Size.Y,
|
||||
PixelFormat.Format8bppIndexed);
|
||||
|
||||
bitmap.Palette = p.AsSystemPalette();
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||
|
||||
unsafe
|
||||
{
|
||||
byte* q = (byte*)data.Scan0.ToPointer();
|
||||
var stride = data.Stride;
|
||||
|
||||
for (var u = 0; u < template.Size.X; u++)
|
||||
for (var v = 0; v < template.Size.Y; v++)
|
||||
if (template.Data.TileBitmapBytes[u + v * template.Size.X] != null)
|
||||
{
|
||||
var rawImage = template.Data.TileBitmapBytes[u + v * template.Size.X];
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
q[(v * TileSize + j) * stride + u * TileSize + i] = rawImage[i + TileSize * j];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
q[(v * TileSize + j) * stride + u * TileSize + i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,255 +17,6 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
using MiniYamlNodes = List<MiniYamlNode>;
|
||||
|
||||
public class MiniYamlNode
|
||||
{
|
||||
public struct SourceLocation
|
||||
{
|
||||
public string Filename; public int Line;
|
||||
public override string ToString() { return "{0}:{1}".F(Filename, Line); }
|
||||
}
|
||||
|
||||
public SourceLocation Location;
|
||||
public string Key;
|
||||
public MiniYaml Value;
|
||||
|
||||
public MiniYamlNode( string k, MiniYaml v )
|
||||
{
|
||||
Key = k;
|
||||
Value = v;
|
||||
}
|
||||
|
||||
public MiniYamlNode( string k, MiniYaml v, SourceLocation loc )
|
||||
: this( k, v )
|
||||
{
|
||||
Location = loc;
|
||||
}
|
||||
|
||||
public MiniYamlNode( string k, string v )
|
||||
: this( k, v, null )
|
||||
{
|
||||
}
|
||||
public MiniYamlNode( string k, string v, List<MiniYamlNode> n )
|
||||
: this( k, new MiniYaml( v, n ) )
|
||||
{
|
||||
}
|
||||
|
||||
public MiniYamlNode( string k, string v, List<MiniYamlNode> n, SourceLocation loc )
|
||||
: this( k, new MiniYaml( v, n ), loc )
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{{YamlNode: {0} @ {1}}}".F(Key, Location);
|
||||
}
|
||||
}
|
||||
|
||||
public class MiniYaml
|
||||
{
|
||||
public string Value;
|
||||
public List<MiniYamlNode> Nodes;
|
||||
|
||||
public Dictionary<string, MiniYaml> NodesDict
|
||||
{
|
||||
get
|
||||
{
|
||||
var ret = new Dictionary<string, MiniYaml>();
|
||||
foreach (var y in Nodes)
|
||||
{
|
||||
if (ret.ContainsKey(y.Key))
|
||||
throw new InvalidDataException("Duplicate key `{0}' in MiniYaml".F(y.Key));
|
||||
ret.Add(y.Key, y.Value);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public MiniYaml( string value ) : this( value, null ) { }
|
||||
|
||||
public MiniYaml( string value, List<MiniYamlNode> nodes )
|
||||
{
|
||||
Value = value;
|
||||
Nodes = nodes ?? new List<MiniYamlNode>();
|
||||
}
|
||||
|
||||
public static MiniYaml FromDictionary<K, V>( Dictionary<K, V> dict )
|
||||
{
|
||||
return new MiniYaml( null, dict.Select( x => new MiniYamlNode( x.Key.ToString(), new MiniYaml( x.Value.ToString() ) ) ).ToList() );
|
||||
}
|
||||
|
||||
public static MiniYaml FromList<T>( List<T> list )
|
||||
{
|
||||
return new MiniYaml( null, list.Select( x => new MiniYamlNode( x.ToString(), new MiniYaml( null ) ) ).ToList() );
|
||||
}
|
||||
|
||||
static List<MiniYamlNode> FromLines(string[] lines, string filename)
|
||||
{
|
||||
var levels = new List<List<MiniYamlNode>>();
|
||||
levels.Add(new List<MiniYamlNode>());
|
||||
|
||||
var lineNo = 0;
|
||||
foreach (var ll in lines)
|
||||
{
|
||||
var line = ll;
|
||||
++lineNo;
|
||||
if (line.Contains('#'))
|
||||
line = line.Substring(0, line.IndexOf('#')).TrimEnd(' ', '\t');
|
||||
var t = line.TrimStart(' ', '\t');
|
||||
if (t.Length == 0)
|
||||
continue;
|
||||
var level = line.Length - t.Length;
|
||||
var location = new MiniYamlNode.SourceLocation { Filename = filename, Line = lineNo };
|
||||
|
||||
if (levels.Count <= level)
|
||||
throw new YamlException("Bad indent in miniyaml at {0}".F (location));
|
||||
while (levels.Count > level + 1)
|
||||
levels.RemoveAt(levels.Count - 1);
|
||||
|
||||
var d = new List<MiniYamlNode>();
|
||||
var rhs = SplitAtColon( ref t );
|
||||
levels[ level ].Add( new MiniYamlNode( t, rhs, d, location ) );
|
||||
|
||||
levels.Add(d);
|
||||
}
|
||||
return levels[ 0 ];
|
||||
}
|
||||
|
||||
static string SplitAtColon( ref string t )
|
||||
{
|
||||
var colon = t.IndexOf(':');
|
||||
if( colon == -1 )
|
||||
return null;
|
||||
var ret = t.Substring( colon + 1 ).Trim();
|
||||
if( ret.Length == 0 )
|
||||
ret = null;
|
||||
t = t.Substring( 0, colon ).Trim();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromFileInPackage( string path )
|
||||
{
|
||||
StreamReader reader = new StreamReader( FileSystem.Open(path) );
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
while( !reader.EndOfStream )
|
||||
lines.Add(reader.ReadLine());
|
||||
reader.Close();
|
||||
|
||||
return FromLines(lines.ToArray(), path);
|
||||
}
|
||||
|
||||
public static Dictionary<string, MiniYaml> DictFromFile( string path )
|
||||
{
|
||||
return FromFile( path ).ToDictionary( x => x.Key, x => x.Value );
|
||||
}
|
||||
|
||||
public static Dictionary<string, MiniYaml> DictFromStream( Stream stream )
|
||||
{
|
||||
return FromStream( stream ).ToDictionary( x => x.Key, x => x.Value );
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromFile( string path )
|
||||
{
|
||||
return FromLines(File.ReadAllLines( path ), path);
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromStream(Stream s)
|
||||
{
|
||||
using (var reader = new StreamReader(s))
|
||||
return FromString(reader.ReadToEnd());
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromString(string text)
|
||||
{
|
||||
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), "<no filename available>");
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
|
||||
{
|
||||
return Merge(a, b, false);
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> MergeStrict(List<MiniYamlNode> a, List<MiniYamlNode> b)
|
||||
{
|
||||
return Merge(a, b, true);
|
||||
}
|
||||
|
||||
static List<MiniYamlNode> Merge( List<MiniYamlNode> a, List<MiniYamlNode> b, bool throwErrors )
|
||||
{
|
||||
if( a.Count == 0 )
|
||||
return b;
|
||||
if( b.Count == 0 )
|
||||
return a;
|
||||
|
||||
var ret = new List<MiniYamlNode>();
|
||||
|
||||
var aDict = a.ToDictionary( x => x.Key );
|
||||
var bDict = b.ToDictionary( x => x.Key );
|
||||
var keys = aDict.Keys.Union( bDict.Keys ).ToList();
|
||||
|
||||
var noInherit = keys.Where(x => x.Length > 0 && x[0] == '-')
|
||||
.ToDictionary(x => x.Substring(1), x => false);
|
||||
|
||||
foreach( var key in keys )
|
||||
{
|
||||
MiniYamlNode aa, bb;
|
||||
aDict.TryGetValue( key, out aa );
|
||||
bDict.TryGetValue( key, out bb );
|
||||
|
||||
if( noInherit.ContainsKey( key ) )
|
||||
{
|
||||
if (!throwErrors)
|
||||
if (aa != null)
|
||||
ret.Add(aa);
|
||||
|
||||
noInherit[key] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var loc = aa == null ? default( MiniYamlNode.SourceLocation ) : aa.Location;
|
||||
var merged = ( aa == null || bb == null ) ? aa ?? bb : new MiniYamlNode( key, Merge( aa.Value, bb.Value, throwErrors ), loc );
|
||||
ret.Add( merged );
|
||||
}
|
||||
}
|
||||
|
||||
if (throwErrors)
|
||||
if (noInherit.ContainsValue(false))
|
||||
throw new YamlException("Bogus yaml removals: {0}".F(
|
||||
noInherit.Where(x => !x.Value).JoinWith(", ")));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static MiniYaml MergeLiberal(MiniYaml a, MiniYaml b)
|
||||
{
|
||||
return Merge(a, b, false);
|
||||
}
|
||||
|
||||
public static MiniYaml MergeStrict(MiniYaml a, MiniYaml b)
|
||||
{
|
||||
return Merge(a, b, true);
|
||||
}
|
||||
|
||||
static MiniYaml Merge( MiniYaml a, MiniYaml b, bool throwErrors )
|
||||
{
|
||||
if( a == null )
|
||||
return b;
|
||||
if( b == null )
|
||||
return a;
|
||||
|
||||
return new MiniYaml( a.Value ?? b.Value, Merge( a.Nodes, b.Nodes, throwErrors ) );
|
||||
}
|
||||
|
||||
public IEnumerable<string> ToLines(string name)
|
||||
{
|
||||
yield return name + ": " + Value;
|
||||
if (Nodes != null)
|
||||
foreach (var line in Nodes.ToLines(false))
|
||||
yield return "\t" + line;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MiniYamlExts
|
||||
{
|
||||
public static void WriteToFile(this MiniYamlNodes y, string filename)
|
||||
@@ -290,6 +41,257 @@ namespace OpenRA.FileFormats
|
||||
}
|
||||
}
|
||||
|
||||
public class MiniYamlNode
|
||||
{
|
||||
public struct SourceLocation
|
||||
{
|
||||
public string Filename; public int Line;
|
||||
public override string ToString() { return "{0}:{1}".F(Filename, Line); }
|
||||
}
|
||||
|
||||
public SourceLocation Location;
|
||||
public string Key;
|
||||
public MiniYaml Value;
|
||||
|
||||
public MiniYamlNode(string k, MiniYaml v)
|
||||
{
|
||||
Key = k;
|
||||
Value = v;
|
||||
}
|
||||
|
||||
public MiniYamlNode(string k, MiniYaml v, SourceLocation loc)
|
||||
: this(k, v)
|
||||
{
|
||||
Location = loc;
|
||||
}
|
||||
|
||||
public MiniYamlNode(string k, string v)
|
||||
: this(k, v, null) { }
|
||||
|
||||
public MiniYamlNode(string k, string v, List<MiniYamlNode> n)
|
||||
: this(k, new MiniYaml(v, n)) { }
|
||||
|
||||
public MiniYamlNode(string k, string v, List<MiniYamlNode> n, SourceLocation loc)
|
||||
: this(k, new MiniYaml(v, n), loc) { }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{{YamlNode: {0} @ {1}}}".F(Key, Location);
|
||||
}
|
||||
}
|
||||
|
||||
public class MiniYaml
|
||||
{
|
||||
public string Value;
|
||||
public List<MiniYamlNode> Nodes;
|
||||
|
||||
public Dictionary<string, MiniYaml> NodesDict
|
||||
{
|
||||
get
|
||||
{
|
||||
var ret = new Dictionary<string, MiniYaml>();
|
||||
foreach (var y in Nodes)
|
||||
{
|
||||
if (ret.ContainsKey(y.Key))
|
||||
throw new InvalidDataException("Duplicate key `{0}' in {1}".F(y.Key, y.Location));
|
||||
ret.Add(y.Key, y.Value);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public MiniYaml(string value) : this(value, null) { }
|
||||
|
||||
public MiniYaml(string value, List<MiniYamlNode> nodes)
|
||||
{
|
||||
Value = value;
|
||||
Nodes = nodes ?? new List<MiniYamlNode>();
|
||||
}
|
||||
|
||||
public static MiniYaml FromDictionary<K, V>(Dictionary<K, V> dict)
|
||||
{
|
||||
return new MiniYaml(null, dict.Select(x => new MiniYamlNode(x.Key.ToString(), new MiniYaml(x.Value.ToString()))).ToList());
|
||||
}
|
||||
|
||||
public static MiniYaml FromList<T>(List<T> list)
|
||||
{
|
||||
return new MiniYaml(null, list.Select(x => new MiniYamlNode(x.ToString(), new MiniYaml(null))).ToList());
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> NodesOrEmpty(MiniYaml y, string s)
|
||||
{
|
||||
return y.NodesDict.ContainsKey(s) ? y.NodesDict[s].Nodes : new List<MiniYamlNode>();
|
||||
}
|
||||
|
||||
static List<MiniYamlNode> FromLines(string[] lines, string filename)
|
||||
{
|
||||
var levels = new List<List<MiniYamlNode>>();
|
||||
levels.Add(new List<MiniYamlNode>());
|
||||
|
||||
var lineNo = 0;
|
||||
foreach (var ll in lines)
|
||||
{
|
||||
var line = ll;
|
||||
++lineNo;
|
||||
if (line.Contains('#'))
|
||||
line = line.Substring(0, line.IndexOf('#')).TrimEnd(' ', '\t');
|
||||
var t = line.TrimStart(' ', '\t');
|
||||
if (t.Length == 0)
|
||||
continue;
|
||||
var level = line.Length - t.Length;
|
||||
var location = new MiniYamlNode.SourceLocation { Filename = filename, Line = lineNo };
|
||||
|
||||
if (levels.Count <= level)
|
||||
throw new YamlException("Bad indent in miniyaml at {0}".F(location));
|
||||
while (levels.Count > level + 1)
|
||||
levels.RemoveAt(levels.Count - 1);
|
||||
|
||||
var d = new List<MiniYamlNode>();
|
||||
var rhs = SplitAtColon(ref t);
|
||||
levels[level].Add(new MiniYamlNode(t, rhs, d, location));
|
||||
|
||||
levels.Add(d);
|
||||
}
|
||||
|
||||
return levels[0];
|
||||
}
|
||||
|
||||
static string SplitAtColon(ref string t)
|
||||
{
|
||||
var colon = t.IndexOf(':');
|
||||
if (colon == -1)
|
||||
return null;
|
||||
var ret = t.Substring(colon + 1).Trim();
|
||||
if (ret.Length == 0)
|
||||
ret = null;
|
||||
t = t.Substring(0, colon).Trim();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromFileInPackage(string path)
|
||||
{
|
||||
StreamReader reader = new StreamReader(FileSystem.Open(path));
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
while (!reader.EndOfStream)
|
||||
lines.Add(reader.ReadLine());
|
||||
reader.Close();
|
||||
|
||||
return FromLines(lines.ToArray(), path);
|
||||
}
|
||||
|
||||
public static Dictionary<string, MiniYaml> DictFromFile(string path)
|
||||
{
|
||||
return FromFile(path).ToDictionary(x => x.Key, x => x.Value);
|
||||
}
|
||||
|
||||
public static Dictionary<string, MiniYaml> DictFromStream(Stream stream)
|
||||
{
|
||||
return FromStream(stream).ToDictionary(x => x.Key, x => x.Value);
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromFile(string path)
|
||||
{
|
||||
return FromLines(File.ReadAllLines(path), path);
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromStream(Stream s)
|
||||
{
|
||||
using (var reader = new StreamReader(s))
|
||||
return FromString(reader.ReadToEnd());
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> FromString(string text)
|
||||
{
|
||||
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), "<no filename available>");
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
|
||||
{
|
||||
return Merge(a, b, false);
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> MergeStrict(List<MiniYamlNode> a, List<MiniYamlNode> b)
|
||||
{
|
||||
return Merge(a, b, true);
|
||||
}
|
||||
|
||||
static List<MiniYamlNode> Merge(List<MiniYamlNode> a, List<MiniYamlNode> b, bool throwErrors)
|
||||
{
|
||||
if (a.Count == 0)
|
||||
return b;
|
||||
if (b.Count == 0)
|
||||
return a;
|
||||
|
||||
var ret = new List<MiniYamlNode>();
|
||||
|
||||
var dictA = a.ToDictionaryWithConflictLog(x => x.Key, "MiniYaml.Merge", null, x => "{0} (at {1})".F(x.Key, x.Location));
|
||||
var dictB = b.ToDictionaryWithConflictLog(x => x.Key, "MiniYaml.Merge", null, x => "{0} (at {1})".F(x.Key, x.Location));
|
||||
var keys = dictA.Keys.Union(dictB.Keys).ToList();
|
||||
|
||||
var noInherit = keys.Where(x => x.Length > 0 && x[0] == '-')
|
||||
.ToDictionary(x => x.Substring(1), x => false);
|
||||
|
||||
foreach (var key in keys)
|
||||
{
|
||||
MiniYamlNode aa, bb;
|
||||
dictA.TryGetValue(key, out aa);
|
||||
dictB.TryGetValue(key, out bb);
|
||||
|
||||
if (noInherit.ContainsKey(key))
|
||||
{
|
||||
if (!throwErrors)
|
||||
if (aa != null)
|
||||
ret.Add(aa);
|
||||
|
||||
noInherit[key] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var loc = aa == null ? default(MiniYamlNode.SourceLocation) : aa.Location;
|
||||
var merged = (aa == null || bb == null) ? aa ?? bb : new MiniYamlNode(key, Merge(aa.Value, bb.Value, throwErrors), loc);
|
||||
ret.Add(merged);
|
||||
}
|
||||
}
|
||||
|
||||
if (throwErrors)
|
||||
if (noInherit.ContainsValue(false))
|
||||
throw new YamlException("Bogus yaml removals: {0}".F(
|
||||
noInherit.Where(x => !x.Value).JoinWith(", ")));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static MiniYaml MergeLiberal(MiniYaml a, MiniYaml b)
|
||||
{
|
||||
return Merge(a, b, false);
|
||||
}
|
||||
|
||||
public static MiniYaml MergeStrict(MiniYaml a, MiniYaml b)
|
||||
{
|
||||
return Merge(a, b, true);
|
||||
}
|
||||
|
||||
static MiniYaml Merge(MiniYaml a, MiniYaml b, bool throwErrors)
|
||||
{
|
||||
if (a == null)
|
||||
return b;
|
||||
if (b == null)
|
||||
return a;
|
||||
|
||||
return new MiniYaml(a.Value ?? b.Value, Merge(a.Nodes, b.Nodes, throwErrors));
|
||||
}
|
||||
|
||||
public IEnumerable<string> ToLines(string name)
|
||||
{
|
||||
yield return name + ": " + Value;
|
||||
if (Nodes != null)
|
||||
foreach (var line in Nodes.ToLines(false))
|
||||
yield return "\t" + line;
|
||||
}
|
||||
}
|
||||
|
||||
public class YamlException : Exception
|
||||
{
|
||||
public YamlException(string s) : base(s) { }
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ColorRamp.cs" />
|
||||
<Compile Include="Evaluator.cs" />
|
||||
<Compile Include="Exts.cs" />
|
||||
<Compile Include="FieldLoader.cs" />
|
||||
@@ -85,6 +84,7 @@
|
||||
<Compile Include="FileFormats\Blast.cs" />
|
||||
<Compile Include="FileFormats\Blowfish.cs" />
|
||||
<Compile Include="FileFormats\BlowfishKeyProvider.cs" />
|
||||
<Compile Include="FileFormats\CRC32.cs" />
|
||||
<Compile Include="FileFormats\Format2.cs" />
|
||||
<Compile Include="FileFormats\Format40.cs" />
|
||||
<Compile Include="FileFormats\Format80.cs" />
|
||||
@@ -126,12 +126,27 @@
|
||||
<Compile Include="Primitives\Set.cs" />
|
||||
<Compile Include="Primitives\float2.cs" />
|
||||
<Compile Include="Primitives\int2.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Support\Log.cs" />
|
||||
<Compile Include="Support\Stopwatch.cs" />
|
||||
<Compile Include="Support\Timer.cs" />
|
||||
<Compile Include="Thirdparty\Random.cs" />
|
||||
<Compile Include="Random.cs" />
|
||||
<Compile Include="TypeDictionary.cs" />
|
||||
<Compile Include="WPos.cs" />
|
||||
<Compile Include="WVec.cs" />
|
||||
<Compile Include="WAngle.cs" />
|
||||
<Compile Include="WRot.cs" />
|
||||
<Compile Include="WRange.cs" />
|
||||
<Compile Include="HSLColor.cs" />
|
||||
<Compile Include="Graphics\ShpTSReader.cs" />
|
||||
<Compile Include="FileFormats\XccLocalDatabase.cs" />
|
||||
<Compile Include="FileFormats\XccGlobalDatabase.cs" />
|
||||
<Compile Include="Graphics\VxlReader.cs" />
|
||||
<Compile Include="Graphics\HvaReader.cs" />
|
||||
<Compile Include="StreamExts.cs" />
|
||||
<Compile Include="FileFormats\WavLoader.cs" />
|
||||
<Compile Include="Filesystem\D2kSoundResources.cs" />
|
||||
<Compile Include="Graphics\R8Reader.cs" />
|
||||
<Compile Include="Graphics\TileSetRenderer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -8,19 +8,21 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRA.FileFormats
|
||||
{
|
||||
public enum PackageHashType { Classic, CRC32 }
|
||||
|
||||
public class PackageEntry
|
||||
{
|
||||
public readonly uint Hash;
|
||||
public readonly uint Offset;
|
||||
public readonly uint Length;
|
||||
|
||||
|
||||
public PackageEntry(uint hash, uint offset, uint length)
|
||||
{
|
||||
Hash = hash;
|
||||
@@ -28,11 +30,11 @@ namespace OpenRA.FileFormats
|
||||
Length = length;
|
||||
}
|
||||
|
||||
public PackageEntry(BinaryReader r)
|
||||
public PackageEntry(Stream s)
|
||||
{
|
||||
Hash = r.ReadUInt32();
|
||||
Offset = r.ReadUInt32();
|
||||
Length = r.ReadUInt32();
|
||||
Hash = s.ReadUInt32();
|
||||
Offset = s.ReadUInt32();
|
||||
Length = s.ReadUInt32();
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter w)
|
||||
@@ -51,33 +53,55 @@ namespace OpenRA.FileFormats
|
||||
return "0x{0:x8} - offset 0x{1:x8} - length 0x{2:x8}".F(Hash, Offset, Length);
|
||||
}
|
||||
|
||||
public static uint HashFilename(string name)
|
||||
public static uint HashFilename(string name, PackageHashType type)
|
||||
{
|
||||
if (name.Length > 12)
|
||||
name = name.Substring(0, 12);
|
||||
switch(type)
|
||||
{
|
||||
case PackageHashType.Classic:
|
||||
{
|
||||
name = name.ToUpperInvariant();
|
||||
if (name.Length % 4 != 0)
|
||||
name = name.PadRight(name.Length + (4 - name.Length % 4), '\0');
|
||||
|
||||
name = name.ToUpperInvariant();
|
||||
if (name.Length % 4 != 0)
|
||||
name = name.PadRight(name.Length + (4 - name.Length % 4), '\0');
|
||||
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
|
||||
BinaryReader reader = new BinaryReader(ms);
|
||||
|
||||
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
|
||||
BinaryReader reader = new BinaryReader(ms);
|
||||
int len = name.Length >> 2;
|
||||
uint result = 0;
|
||||
|
||||
int len = name.Length >> 2;
|
||||
uint result = 0;
|
||||
while (len-- != 0)
|
||||
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
|
||||
|
||||
while (len-- != 0)
|
||||
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
case PackageHashType.CRC32:
|
||||
{
|
||||
name = name.ToUpperInvariant();
|
||||
var l = name.Length;
|
||||
int a = l >> 2;
|
||||
if ((l & 3) != 0)
|
||||
{
|
||||
name += (char)(l - (a << 2));
|
||||
int i = 3 - (l & 3);
|
||||
while (i-- != 0)
|
||||
name += name[a << 2];
|
||||
}
|
||||
return CRC32.Calculate(Encoding.ASCII.GetBytes(name));
|
||||
}
|
||||
|
||||
default: throw new NotImplementedException("Unknown hash type `{0}`".F(type));
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<uint, string> Names = new Dictionary<uint,string>();
|
||||
|
||||
public static void AddStandardName(string s)
|
||||
{
|
||||
uint hash = HashFilename(s);
|
||||
uint hash = HashFilename(s, PackageHashType.Classic); // RA1 and TD
|
||||
Names.Add(hash, s);
|
||||
uint crcHash = HashFilename(s, PackageHashType.CRC32); // TS
|
||||
Names.Add(crcHash, s);
|
||||
}
|
||||
|
||||
public const int Size = 12;
|
||||
|
||||
@@ -39,6 +39,12 @@ namespace OpenRA.FileFormats
|
||||
get { return colors; }
|
||||
}
|
||||
|
||||
public void ApplyRemap(IPaletteRemap r)
|
||||
{
|
||||
for(int i = 0; i < 256; i++)
|
||||
colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)colors[i]),i).ToArgb();
|
||||
}
|
||||
|
||||
public Palette(Stream s, int[] remapShadow)
|
||||
{
|
||||
colors = new uint[256];
|
||||
@@ -61,9 +67,8 @@ namespace OpenRA.FileFormats
|
||||
|
||||
public Palette(Palette p, IPaletteRemap r)
|
||||
{
|
||||
colors = new uint[256];
|
||||
for(int i = 0; i < 256; i++)
|
||||
colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)p.colors[i]),i).ToArgb();
|
||||
colors = (uint[])p.colors.Clone();
|
||||
ApplyRemap(r);
|
||||
}
|
||||
|
||||
public Palette(Palette p)
|
||||
@@ -71,6 +76,13 @@ namespace OpenRA.FileFormats
|
||||
colors = (uint[])p.colors.Clone();
|
||||
}
|
||||
|
||||
public Palette(uint[] data)
|
||||
{
|
||||
if (data.Length != 256)
|
||||
throw new InvalidDataException("Attempting to create palette with incorrect array size");
|
||||
colors = (uint[])data.Clone();
|
||||
}
|
||||
|
||||
public ColorPalette AsSystemPalette()
|
||||
{
|
||||
ColorPalette pal;
|
||||
@@ -88,6 +100,21 @@ namespace OpenRA.FileFormats
|
||||
return pal;
|
||||
}
|
||||
|
||||
public Bitmap AsBitmap()
|
||||
{
|
||||
var b = new Bitmap(256, 1, PixelFormat.Format32bppArgb);
|
||||
var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
unsafe
|
||||
{
|
||||
uint* c = (uint*)data.Scan0;
|
||||
for (var x = 0; x < 256; x++)
|
||||
*(c + x) = colors[x];
|
||||
}
|
||||
b.UnlockBits(data);
|
||||
return b;
|
||||
}
|
||||
|
||||
public static Palette Load(string filename, int[] remap)
|
||||
{
|
||||
using(var s = File.OpenRead(filename))
|
||||
|
||||
@@ -49,6 +49,10 @@ namespace OpenRA
|
||||
{
|
||||
get
|
||||
{
|
||||
// Use a local directory in the game root if it exists
|
||||
if (Directory.Exists("Support"))
|
||||
return "Support" + Path.DirectorySeparatorChar;
|
||||
|
||||
var dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||
|
||||
switch (CurrentPlatform)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
@@ -24,18 +25,19 @@ namespace OpenRA.FileFormats
|
||||
return Ramp[i];
|
||||
}
|
||||
|
||||
public PlayerColorRemap(int[] Ramp, ColorRamp c)
|
||||
public PlayerColorRemap(int[] Ramp, HSLColor c, float rampFraction)
|
||||
{
|
||||
var c1 = c.GetColor(0);
|
||||
var c2 = c.GetColor(1); // temptemp: this can be expressed better
|
||||
|
||||
// Increase luminosity if required to represent the full ramp
|
||||
var rampRange = (byte)((1 - rampFraction)*c.L);
|
||||
var c1 = new HSLColor(c.H, c.S, (byte)Math.Max(rampRange, c.L)).RGB;
|
||||
var c2 = new HSLColor(c.H, c.S, (byte)Math.Max(0, c.L - rampRange)).RGB;
|
||||
var baseIndex = Ramp[0];
|
||||
var RemapRamp = Ramp.Select(r => r - Ramp[0]).ToArray();
|
||||
|
||||
if (Ramp[0] > Ramp[15]) // reversed remapping
|
||||
{
|
||||
{
|
||||
baseIndex = Ramp[15];
|
||||
for (int i=15; i>0; i--)
|
||||
for (var i = 15; i > 0; i--)
|
||||
RemapRamp = Ramp.Select(r => r - Ramp[15]).ToArray();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("OpenRA.FileFormats")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("OpenRA.FileFormats")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007,2009,2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -20,6 +20,7 @@ namespace OpenRA.Thirdparty
|
||||
int index = 0;
|
||||
|
||||
public int Last;
|
||||
public int TotalCount = 0;
|
||||
|
||||
public Random() : this(Environment.TickCount) { }
|
||||
|
||||
@@ -41,13 +42,14 @@ namespace OpenRA.Thirdparty
|
||||
y ^= y >> 18;
|
||||
|
||||
index = (index + 1) % 624;
|
||||
TotalCount++;
|
||||
Last = (int)(y % int.MaxValue);
|
||||
return Last;
|
||||
}
|
||||
|
||||
public int Next(int low, int high) { return low + Next() % (high - low); }
|
||||
public int Next(int high) { return Next() % high; }
|
||||
public double NextDouble() { return Math.Abs(Next() / (double)0x7fffffff); }
|
||||
public float NextFloat() { return Math.Abs(Next() / (float)0x7fffffff); }
|
||||
|
||||
void Generate()
|
||||
{
|
||||
349
OpenRA.FileFormats/Settings.StyleCop
Normal file
349
OpenRA.FileFormats/Settings.StyleCop
Normal file
@@ -0,0 +1,349 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<Analyzers>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
|
||||
<Rules>
|
||||
<Rule Name="ElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="EnumerationItemsMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationMustContainValidXml">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustHaveSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementDocumentationMustHaveSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustHaveSummaryText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParametersMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementParameterDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementReturnValueMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementReturnValueDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="VoidReturnValueMustNotBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParametersMustBeDocumented">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationTextMustNotBeEmpty">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationTextMustContainWhitespace">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationMustMeetCharacterPercentage">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="IncludedDocumentationXPathDoesNotExist">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileMustHaveHeader">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustShowCopyright">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustHaveCopyrightText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustContainFileName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderMustHaveValidCompanyText">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
|
||||
<Rules>
|
||||
<Rule Name="TabsMustNotBeUsed">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
|
||||
<Rules>
|
||||
<Rule Name="CurlyBracketsForMultiLineStatementsMustNotShareLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="StatementMustNotBeOnSingleLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementMustNotBeOnSingleLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="CurlyBracketsMustNotBeOmitted">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustBeSeparatedByBlankLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ChainedStatementBlocksMustNotBePrecededByBlankLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
|
||||
<Rules>
|
||||
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustAppearInTheCorrectOrder">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ElementsMustBeOrderedByAccess">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
|
||||
<Rules>
|
||||
<Rule Name="CodeMustNotContainMultipleStatementsOnOneLine">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="UseStringEmptyForEmptyStrings">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PrefixLocalCallsWithThis">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="PrefixCallsCorrectly">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ParameterMustFollowComma">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
|
||||
<Rules>
|
||||
<Rule Name="AccessModifierMustBeDeclared">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FieldsMustBePrivate">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="FileMayOnlyContainASingleClass">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
|
||||
<RuleSettings>
|
||||
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||
</RuleSettings>
|
||||
</Rule>
|
||||
</Rules>
|
||||
<AnalyzerSettings />
|
||||
</Analyzer>
|
||||
</Analyzers>
|
||||
</StyleCopSettings>
|
||||
138
OpenRA.FileFormats/StreamExts.cs
Executable file
138
OpenRA.FileFormats/StreamExts.cs
Executable file
@@ -0,0 +1,138 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public static class StreamExts
|
||||
{
|
||||
public static byte[] ReadBytes(this Stream s, int count)
|
||||
{
|
||||
if (count < 0)
|
||||
throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
|
||||
|
||||
var buf = new byte[count];
|
||||
if (s.Read(buf, 0, count) < count)
|
||||
throw new EndOfStreamException();
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
public static int Peek(this Stream s)
|
||||
{
|
||||
var buf = new byte[1];
|
||||
if (s.Read(buf, 0, 1) == 0)
|
||||
return -1;
|
||||
|
||||
s.Seek(s.Position - 1, SeekOrigin.Begin);
|
||||
return buf[0];
|
||||
}
|
||||
|
||||
public static byte ReadUInt8(this Stream s)
|
||||
{
|
||||
return s.ReadBytes(1)[0];
|
||||
}
|
||||
|
||||
public static ushort ReadUInt16(this Stream s)
|
||||
{
|
||||
return BitConverter.ToUInt16(s.ReadBytes(2), 0);
|
||||
}
|
||||
|
||||
public static short ReadInt16(this Stream s)
|
||||
{
|
||||
return BitConverter.ToInt16(s.ReadBytes(2), 0);
|
||||
}
|
||||
|
||||
public static uint ReadUInt32(this Stream s)
|
||||
{
|
||||
return BitConverter.ToUInt32(s.ReadBytes(4), 0);
|
||||
}
|
||||
|
||||
public static int ReadInt32(this Stream s)
|
||||
{
|
||||
return BitConverter.ToInt32(s.ReadBytes(4), 0);
|
||||
}
|
||||
|
||||
public static float ReadFloat(this Stream s)
|
||||
{
|
||||
return BitConverter.ToSingle(s.ReadBytes(4), 0);
|
||||
}
|
||||
|
||||
public static double ReadDouble(this Stream s)
|
||||
{
|
||||
return BitConverter.ToDouble(s.ReadBytes(8), 0);
|
||||
}
|
||||
|
||||
public static string ReadASCII(this Stream s, int length)
|
||||
{
|
||||
return new string(Encoding.ASCII.GetChars(s.ReadBytes(length)));
|
||||
}
|
||||
|
||||
public static string ReadASCIIZ(this Stream s)
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
var buf = new byte[1];
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (s.Read(buf, 0, 1) < 1)
|
||||
throw new EndOfStreamException();
|
||||
|
||||
if (buf[0] == 0)
|
||||
break;
|
||||
|
||||
bytes.Add(buf[0]);
|
||||
}
|
||||
|
||||
return new string(Encoding.ASCII.GetChars(bytes.ToArray()));
|
||||
}
|
||||
|
||||
public static string ReadAllText(this Stream s)
|
||||
{
|
||||
using (s)
|
||||
using (var sr = new StreamReader(s))
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
|
||||
public static byte[] ReadAllBytes(this Stream s)
|
||||
{
|
||||
using (s)
|
||||
{
|
||||
var data = new byte[s.Length - s.Position];
|
||||
s.Read(data, 0, data.Length);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Write(this Stream s, byte[] data)
|
||||
{
|
||||
s.Write(data, 0, data.Length);
|
||||
}
|
||||
|
||||
public static IEnumerable<string> ReadAllLines(this Stream s)
|
||||
{
|
||||
using (var sr = new StreamReader(s))
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
var line = sr.ReadLine();
|
||||
if (line == null)
|
||||
yield break;
|
||||
else
|
||||
yield return line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA
|
||||
public static class Log
|
||||
{
|
||||
static string LogPathPrefix = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + Path.DirectorySeparatorChar;
|
||||
static Dictionary<string, ChannelInfo> channels = new Dictionary<string,ChannelInfo>();
|
||||
public static readonly Dictionary<string, ChannelInfo> Channels = new Dictionary<string, ChannelInfo>();
|
||||
|
||||
public static string LogPath
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA
|
||||
|
||||
public static void AddChannel(string channelName, string baseFilename)
|
||||
{
|
||||
if (channels.ContainsKey(channelName)) return;
|
||||
if (Channels.ContainsKey(channelName)) return;
|
||||
|
||||
foreach (var filename in FilenamesForChannel(channelName, baseFilename))
|
||||
try
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA
|
||||
var writer = File.CreateText(filename);
|
||||
writer.AutoFlush = true;
|
||||
|
||||
channels.Add(channelName,
|
||||
Channels.Add(channelName,
|
||||
new ChannelInfo()
|
||||
{
|
||||
Filename = filename,
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA
|
||||
public static void Write(string channel, string format, params object[] args)
|
||||
{
|
||||
ChannelInfo info;
|
||||
if (!channels.TryGetValue(channel, out info))
|
||||
if (!Channels.TryGetValue(channel, out info))
|
||||
throw new Exception("Tried logging to non-existant channel " + channel);
|
||||
|
||||
info.Writer.WriteLine(format, args);
|
||||
|
||||
159
OpenRA.FileFormats/WAngle.cs
Normal file
159
OpenRA.FileFormats/WAngle.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 1D angle - 1024 units = 360 degrees.
|
||||
/// </summary>
|
||||
public struct WAngle
|
||||
{
|
||||
public readonly int Angle;
|
||||
|
||||
public WAngle(int a)
|
||||
{
|
||||
Angle = a % 1024;
|
||||
if (Angle < 0)
|
||||
Angle += 1024;
|
||||
}
|
||||
public static readonly WAngle Zero = new WAngle(0);
|
||||
public static WAngle FromFacing(int facing) { return new WAngle(facing*4); }
|
||||
public static WAngle FromDegrees(int degrees) { return new WAngle(degrees*1024/360); }
|
||||
public static WAngle operator +(WAngle a, WAngle b) { return new WAngle(a.Angle + b.Angle); }
|
||||
public static WAngle operator -(WAngle a, WAngle b) { return new WAngle(a.Angle - b.Angle); }
|
||||
public static WAngle operator -(WAngle a) { return new WAngle(-a.Angle); }
|
||||
|
||||
public static bool operator ==(WAngle me, WAngle other) { return (me.Angle == other.Angle); }
|
||||
public static bool operator !=(WAngle me, WAngle other) { return !(me == other); }
|
||||
|
||||
public override int GetHashCode() { return Angle.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
WAngle o = (WAngle)obj;
|
||||
return o == this;
|
||||
}
|
||||
|
||||
public int Sin() { return new WAngle(Angle - 256).Cos(); }
|
||||
|
||||
public int Cos()
|
||||
{
|
||||
if (Angle <= 256)
|
||||
return CosineTable[Angle];
|
||||
if (Angle <= 512)
|
||||
return -CosineTable[512 - Angle];
|
||||
return -new WAngle(Angle - 512).Cos();
|
||||
}
|
||||
|
||||
public int Tan()
|
||||
{
|
||||
if (Angle <= 256)
|
||||
return TanTable[Angle];
|
||||
if (Angle <= 512)
|
||||
return -TanTable[512 - Angle];
|
||||
return new WAngle(Angle - 512).Tan();
|
||||
}
|
||||
|
||||
public static WAngle ArcTan(int y, int x) { return ArcTan(y, x, 1); }
|
||||
public static WAngle ArcTan(int y, int x, int stride)
|
||||
{
|
||||
if (y == 0)
|
||||
return new WAngle(x >= 0 ? 0 : 512);
|
||||
|
||||
if (x == 0)
|
||||
return new WAngle(Math.Sign(y)*256);
|
||||
|
||||
var ay = Math.Abs(y);
|
||||
var ax = Math.Abs(x);
|
||||
|
||||
// Find the closest angle that satisfies y = x*tan(theta)
|
||||
var bestVal = int.MaxValue;
|
||||
var bestAngle = 0;
|
||||
for (var i = 0; i < 256; i+= stride)
|
||||
{
|
||||
var val = Math.Abs(1024*ay - ax*TanTable[i]);
|
||||
if (val < bestVal)
|
||||
{
|
||||
bestVal = val;
|
||||
bestAngle = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate quadrant
|
||||
if (x < 0 && y > 0)
|
||||
bestAngle = 512 - bestAngle;
|
||||
else if (x < 0 && y < 0)
|
||||
bestAngle = 512 + bestAngle;
|
||||
else if (x > 0 && y < 0)
|
||||
bestAngle = 1024 - bestAngle;
|
||||
|
||||
return new WAngle(bestAngle);
|
||||
}
|
||||
|
||||
// Must not be used outside rendering code
|
||||
public float RendererRadians() { return (float)(Angle * Math.PI / 512f); }
|
||||
public float RendererDegrees() { return Angle * 0.3515625f; }
|
||||
|
||||
public override string ToString() { return "{0}".F(Angle); }
|
||||
|
||||
static int[] CosineTable =
|
||||
{
|
||||
1024, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1022, 1022, 1022, 1021,
|
||||
1021, 1020, 1020, 1019, 1019, 1018, 1017, 1017, 1016, 1015, 1014, 1013,
|
||||
1012, 1011, 1010, 1009, 1008, 1007, 1006, 1005, 1004, 1003, 1001, 1000,
|
||||
999, 997, 996, 994, 993, 991, 990, 988, 986, 985, 983, 981, 979, 978,
|
||||
976, 974, 972, 970, 968, 966, 964, 962, 959, 957, 955, 953, 950, 948,
|
||||
946, 943, 941, 938, 936, 933, 930, 928, 925, 922, 920, 917, 914, 911,
|
||||
908, 906, 903, 900, 897, 894, 890, 887, 884, 881, 878, 875, 871, 868,
|
||||
865, 861, 858, 854, 851, 847, 844, 840, 837, 833, 829, 826, 822, 818,
|
||||
814, 811, 807, 803, 799, 795, 791, 787, 783, 779, 775, 771, 767, 762,
|
||||
758, 754, 750, 745, 741, 737, 732, 728, 724, 719, 715, 710, 706, 701,
|
||||
696, 692, 687, 683, 678, 673, 668, 664, 659, 654, 649, 644, 639, 634,
|
||||
629, 625, 620, 615, 609, 604, 599, 594, 589, 584, 579, 574, 568, 563,
|
||||
558, 553, 547, 542, 537, 531, 526, 521, 515, 510, 504, 499, 493, 488,
|
||||
482, 477, 471, 466, 460, 454, 449, 443, 437, 432, 426, 420, 414, 409,
|
||||
403, 397, 391, 386, 380, 374, 368, 362, 356, 350, 344, 339, 333, 327,
|
||||
321, 315, 309, 303, 297, 291, 285, 279, 273, 267, 260, 254, 248, 242,
|
||||
236, 230, 224, 218, 212, 205, 199, 193, 187, 181, 175, 168, 162, 156,
|
||||
150, 144, 137, 131, 125, 119, 112, 106, 100, 94, 87, 81, 75, 69, 62,
|
||||
56, 50, 43, 37, 31, 25, 18, 12, 6, 0
|
||||
};
|
||||
|
||||
static int[] TanTable =
|
||||
{
|
||||
0, 6, 12, 18, 25, 31, 37, 44, 50, 56, 62, 69, 75, 81, 88, 94, 100, 107,
|
||||
113, 119, 126, 132, 139, 145, 151, 158, 164, 171, 177, 184, 190, 197,
|
||||
203, 210, 216, 223, 229, 236, 243, 249, 256, 263, 269, 276, 283, 290,
|
||||
296, 303, 310, 317, 324, 331, 338, 345, 352, 359, 366, 373, 380, 387,
|
||||
395, 402, 409, 416, 424, 431, 438, 446, 453, 461, 469, 476, 484, 492,
|
||||
499, 507, 515, 523, 531, 539, 547, 555, 563, 571, 580, 588, 596, 605,
|
||||
613, 622, 630, 639, 648, 657, 666, 675, 684, 693, 702, 711, 721, 730,
|
||||
740, 749, 759, 769, 779, 789, 799, 809, 819, 829, 840, 850, 861, 872,
|
||||
883, 894, 905, 916, 928, 939, 951, 963, 974, 986, 999, 1011, 1023, 1036,
|
||||
1049, 1062, 1075, 1088, 1102, 1115, 1129, 1143, 1158, 1172, 1187, 1201,
|
||||
1216, 1232, 1247, 1263, 1279, 1295, 1312, 1328, 1345, 1363, 1380, 1398,
|
||||
1416, 1435, 1453, 1473, 1492, 1512, 1532, 1553, 1574, 1595, 1617, 1639,
|
||||
1661, 1684, 1708, 1732, 1756, 1782, 1807, 1833, 1860, 1887, 1915, 1944,
|
||||
1973, 2003, 2034, 2065, 2098, 2131, 2165, 2199, 2235, 2272, 2310, 2348,
|
||||
2388, 2429, 2472, 2515, 2560, 2606, 2654, 2703, 2754, 2807, 2861, 2918,
|
||||
2976, 3036, 3099, 3164, 3232, 3302, 3375, 3451, 3531, 3613, 3700, 3790,
|
||||
3885, 3984, 4088, 4197, 4311, 4432, 4560, 4694, 4836, 4987, 5147, 5318,
|
||||
5499, 5693, 5901, 6124, 6364, 6622, 6903, 7207, 7539, 7902, 8302, 8743,
|
||||
9233, 9781, 10396, 11094, 11891, 12810, 13882, 15148, 16667, 18524, 20843,
|
||||
23826, 27801, 33366, 41713, 55622, 83438, 166883, int.MaxValue
|
||||
};
|
||||
}
|
||||
}
|
||||
88
OpenRA.FileFormats/WPos.cs
Normal file
88
OpenRA.FileFormats/WPos.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 3d World position - 1024 units = 1 cell.
|
||||
/// </summary>
|
||||
public struct WPos
|
||||
{
|
||||
public readonly int X, Y, Z;
|
||||
|
||||
public WPos(int x, int y, int z) { X = x; Y = y; Z = z; }
|
||||
public WPos(WRange x, WRange y, WRange z) { X = x.Range; Y = y.Range; Z = z.Range; }
|
||||
|
||||
public static readonly WPos Zero = new WPos(0, 0, 0);
|
||||
|
||||
public static explicit operator WVec(WPos a) { return new WVec(a.X, a.Y, a.Z); }
|
||||
|
||||
public static WPos operator +(WPos a, WVec b) { return new WPos(a.X + b.X, a.Y + b.Y, a.Z + b.Z); }
|
||||
public static WPos operator -(WPos a, WVec b) { return new WPos(a.X - b.X, a.Y - b.Y, a.Z - b.Z); }
|
||||
public static WVec operator -(WPos a, WPos b) { return new WVec(a.X - b.X, a.Y - b.Y, a.Z - b.Z); }
|
||||
|
||||
public static bool operator ==(WPos me, WPos other) { return (me.X == other.X && me.Y == other.Y && me.Z == other.Z); }
|
||||
public static bool operator !=(WPos me, WPos other) { return !(me == other); }
|
||||
|
||||
public static WPos Lerp(WPos a, WPos b, int mul, int div) { return a + (b - a) * mul / div; }
|
||||
|
||||
public static WPos LerpQuadratic(WPos a, WPos b, WAngle pitch, int mul, int div)
|
||||
{
|
||||
// Start with a linear lerp between the points
|
||||
var ret = Lerp(a, b, mul, div);
|
||||
|
||||
if (pitch.Angle == 0)
|
||||
return ret;
|
||||
|
||||
// Add an additional quadratic variation to height
|
||||
// Uses fp to avoid integer overflow
|
||||
var offset = (int)((float)((float)(b - a).Length*pitch.Tan()*mul*(div - mul)) / (float)(1024*div*div));
|
||||
return new WPos(ret.X, ret.Y, ret.Z + offset);
|
||||
}
|
||||
|
||||
public static WPos Average(params WPos[] list)
|
||||
{
|
||||
if (list == null || list.Length == 0)
|
||||
return WPos.Zero;
|
||||
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
var z = 0;
|
||||
foreach(var pos in list)
|
||||
{
|
||||
x += pos.X;
|
||||
y += pos.Y;
|
||||
z += pos.Z;
|
||||
}
|
||||
|
||||
x /= list.Length;
|
||||
y /= list.Length;
|
||||
z /= list.Length;
|
||||
|
||||
return new WPos(x,y,z);
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
WPos o = (WPos)obj;
|
||||
return o == this;
|
||||
}
|
||||
|
||||
public override string ToString() { return "{0},{1},{2}".F(X, Y, Z); }
|
||||
}
|
||||
}
|
||||
92
OpenRA.FileFormats/WRange.cs
Normal file
92
OpenRA.FileFormats/WRange.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 1d world distance - 1024 units = 1 cell.
|
||||
/// </summary>
|
||||
public struct WRange
|
||||
{
|
||||
public readonly int Range;
|
||||
|
||||
public WRange(int r) { Range = r; }
|
||||
public static readonly WRange Zero = new WRange(0);
|
||||
public static WRange FromCells(int cells) { return new WRange(1024*cells); }
|
||||
|
||||
public static WRange operator +(WRange a, WRange b) { return new WRange(a.Range + b.Range); }
|
||||
public static WRange operator -(WRange a, WRange b) { return new WRange(a.Range - b.Range); }
|
||||
public static WRange operator -(WRange a) { return new WRange(-a.Range); }
|
||||
public static WRange operator /(WRange a, int b) { return new WRange(a.Range / b); }
|
||||
public static WRange operator *(WRange a, int b) { return new WRange(a.Range * b); }
|
||||
public static WRange operator *(int a, WRange b) { return new WRange(a * b.Range); }
|
||||
|
||||
public static bool operator ==(WRange me, WRange other) { return (me.Range == other.Range); }
|
||||
public static bool operator !=(WRange me, WRange other) { return !(me == other); }
|
||||
|
||||
// Sampled a N-sample probability density function in the range [-1024..1024]
|
||||
// 1 sample produces a rectangular probability
|
||||
// 2 samples produces a triangular probability
|
||||
// ...
|
||||
// N samples approximates a true gaussian
|
||||
public static WRange FromPDF(Thirdparty.Random r, int samples)
|
||||
{
|
||||
return new WRange(Exts.MakeArray(samples, _ => r.Next(-1024, 1024))
|
||||
.Sum() / samples);
|
||||
}
|
||||
|
||||
public static bool TryParse(string s, out WRange result)
|
||||
{
|
||||
s = s.ToLowerInvariant();
|
||||
var components = s.Split('c');
|
||||
int cell = 0;
|
||||
int subcell = 0;
|
||||
result = WRange.Zero;
|
||||
|
||||
switch (components.Length)
|
||||
{
|
||||
case 2:
|
||||
if (!int.TryParse(components[0], out cell) ||
|
||||
!int.TryParse(components[1], out subcell))
|
||||
return false;
|
||||
break;
|
||||
case 1:
|
||||
if (!int.TryParse(components[0], out subcell))
|
||||
return false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
// Propagate sign to fractional part
|
||||
if (cell < 0)
|
||||
subcell = -subcell;
|
||||
|
||||
result = new WRange(1024*cell + subcell);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return Range.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
WRange o = (WRange)obj;
|
||||
return o == this;
|
||||
}
|
||||
|
||||
public override string ToString() { return "{0}".F(Range); }
|
||||
}
|
||||
}
|
||||
109
OpenRA.FileFormats/WRot.cs
Normal file
109
OpenRA.FileFormats/WRot.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 3d World rotation.
|
||||
/// </summary>
|
||||
public struct WRot
|
||||
{
|
||||
public readonly WAngle Roll, Pitch, Yaw;
|
||||
|
||||
public WRot(WAngle roll, WAngle pitch, WAngle yaw) { Roll = roll; Pitch = pitch; Yaw = yaw; }
|
||||
public static readonly WRot Zero = new WRot(WAngle.Zero, WAngle.Zero, WAngle.Zero);
|
||||
|
||||
public static WRot FromFacing(int facing) { return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)); }
|
||||
public static WRot FromYaw(WAngle yaw) { return new WRot(WAngle.Zero, WAngle.Zero, yaw); }
|
||||
public static WRot operator +(WRot a, WRot b) { return new WRot(a.Roll + b.Roll, a.Pitch + b.Pitch, a.Yaw + b.Yaw); }
|
||||
public static WRot operator -(WRot a, WRot b) { return new WRot(a.Roll - b.Roll, a.Pitch - b.Pitch, a.Yaw - b.Yaw); }
|
||||
public static WRot operator -(WRot a) { return new WRot(-a.Roll, -a.Pitch, -a.Yaw); }
|
||||
|
||||
public static bool operator ==(WRot me, WRot other) { return (me.Roll == other.Roll &&
|
||||
me.Pitch == other.Pitch && me.Yaw == other.Yaw); }
|
||||
public static bool operator !=(WRot me, WRot other) { return !(me == other); }
|
||||
|
||||
public WRot WithYaw(WAngle yaw)
|
||||
{
|
||||
return new WRot(Roll, Pitch, yaw);
|
||||
}
|
||||
|
||||
public int[] AsQuarternion()
|
||||
{
|
||||
// Angles increase clockwise
|
||||
var r = new WAngle(-Roll.Angle / 2);
|
||||
var p = new WAngle(-Pitch.Angle / 2);
|
||||
var y = new WAngle(-Yaw.Angle / 2);
|
||||
var cr = (long)r.Cos();
|
||||
var sr = (long)r.Sin();
|
||||
var cp = (long)p.Cos();
|
||||
var sp = (long)p.Sin();
|
||||
var cy = (long)y.Cos();
|
||||
var sy = (long)y.Sin();
|
||||
|
||||
// Normalized to 1024 == 1.0
|
||||
return new int[4]
|
||||
{
|
||||
(int)((sr*cp*cy - cr*sp*sy) / 1048576), // x
|
||||
(int)((cr*sp*cy + sr*cp*sy) / 1048576), // y
|
||||
(int)((cr*cp*sy - sr*sp*cy) / 1048576), // z
|
||||
(int)((cr*cp*cy + sr*sp*sy) / 1048576) // w
|
||||
};
|
||||
}
|
||||
|
||||
public int[] AsMatrix()
|
||||
{
|
||||
var q = AsQuarternion();
|
||||
|
||||
// Theoretically 1024**2, but may differ slightly due to rounding
|
||||
var lsq = q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3];
|
||||
|
||||
// Quarternion components use 10 bits, so there's no risk of overflow
|
||||
var mtx = new int[16];
|
||||
mtx[0] = lsq - 2*(q[1]*q[1] + q[2]*q[2]);
|
||||
mtx[1] = 2*(q[0]*q[1] + q[2]*q[3]);
|
||||
mtx[2] = 2*(q[0]*q[2] - q[1]*q[3]);
|
||||
mtx[3] = 0;
|
||||
|
||||
mtx[4] = 2*(q[0]*q[1] - q[2]*q[3]);
|
||||
mtx[5] = lsq - 2*(q[0]*q[0] + q[2]*q[2]);
|
||||
mtx[6] = 2*(q[1]*q[2] + q[0]*q[3]);
|
||||
mtx[7] = 0;
|
||||
|
||||
mtx[8] = 2*(q[0]*q[2] + q[1]*q[3]);
|
||||
mtx[9] = 2*(q[1]*q[2] - q[0]*q[3]);
|
||||
mtx[10] = lsq - 2*(q[0]*q[0] + q[1]*q[1]);
|
||||
mtx[11] = 0;
|
||||
|
||||
mtx[12] = 0;
|
||||
mtx[13] = 0;
|
||||
mtx[14] = 0;
|
||||
mtx[15] = lsq;
|
||||
|
||||
return mtx;
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return Roll.GetHashCode() ^ Pitch.GetHashCode() ^ Yaw.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
WRot o = (WRot)obj;
|
||||
return o == this;
|
||||
}
|
||||
|
||||
public override string ToString() { return "{0},{1},{2}".F(Roll, Pitch, Yaw); }
|
||||
}
|
||||
}
|
||||
95
OpenRA.FileFormats/WVec.cs
Normal file
95
OpenRA.FileFormats/WVec.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
/// <summary>
|
||||
/// 3d World vector for describing offsets and distances - 1024 units = 1 cell.
|
||||
/// </summary>
|
||||
public struct WVec
|
||||
{
|
||||
public readonly int X, Y, Z;
|
||||
|
||||
public WVec(int x, int y, int z) { X = x; Y = y; Z = z; }
|
||||
public WVec(WRange x, WRange y, WRange z) { X = x.Range; Y = y.Range; Z = z.Range; }
|
||||
|
||||
public static readonly WVec Zero = new WVec(0, 0, 0);
|
||||
|
||||
public static WVec operator +(WVec a, WVec b) { return new WVec(a.X + b.X, a.Y + b.Y, a.Z + b.Z); }
|
||||
public static WVec operator -(WVec a, WVec b) { return new WVec(a.X - b.X, a.Y - b.Y, a.Z - b.Z); }
|
||||
public static WVec operator -(WVec a) { return new WVec(-a.X, -a.Y, -a.Z); }
|
||||
public static WVec operator /(WVec a, int b) { return new WVec(a.X / b, a.Y / b, a.Z / b); }
|
||||
public static WVec operator *(int a, WVec b) { return new WVec(a * b.X, a * b.Y, a * b.Z); }
|
||||
public static WVec operator *(WVec a, int b) { return b*a; }
|
||||
|
||||
public static bool operator ==(WVec me, WVec other) { return (me.X == other.X && me.Y == other.Y && me.Z == other.Z); }
|
||||
public static bool operator !=(WVec me, WVec other) { return !(me == other); }
|
||||
|
||||
public static int Dot(WVec a, WVec b) { return a.X * b.X + a.Y * b.Y + a.Z * b.Z; }
|
||||
public long LengthSquared { get { return (long)X * X + (long)Y * Y + (long)Z * Z; } }
|
||||
public int Length { get { return (int)Math.Sqrt(LengthSquared); } }
|
||||
public long HorizontalLengthSquared { get { return (long)X * X + (long)Y * Y; } }
|
||||
public int HorizontalLength { get { return (int)Math.Sqrt(HorizontalLengthSquared); } }
|
||||
|
||||
public WVec Rotate(WRot rot)
|
||||
{
|
||||
var mtx = rot.AsMatrix();
|
||||
var lx = (long)X;
|
||||
var ly = (long)Y;
|
||||
var lz = (long)Z;
|
||||
return new WVec(
|
||||
(int)((lx * mtx[0] + ly*mtx[4] + lz*mtx[8]) / mtx[15]),
|
||||
(int)((lx * mtx[1] + ly*mtx[5] + lz*mtx[9]) / mtx[15]),
|
||||
(int)((lx * mtx[2] + ly*mtx[6] + lz*mtx[10]) / mtx[15]));
|
||||
}
|
||||
|
||||
public static WVec Lerp(WVec a, WVec b, int mul, int div) { return a + (b - a) * mul / div; }
|
||||
|
||||
public static WVec LerpQuadratic(WVec a, WVec b, WAngle pitch, int mul, int div)
|
||||
{
|
||||
// Start with a linear lerp between the points
|
||||
var ret = Lerp(a, b, mul, div);
|
||||
|
||||
if (pitch.Angle == 0)
|
||||
return ret;
|
||||
|
||||
// Add an additional quadratic variation to height
|
||||
// Uses fp to avoid integer overflow
|
||||
var offset = (int)((float)((float)(b - a).Length*pitch.Tan()*mul*(div - mul)) / (float)(1024*div*div));
|
||||
return new WVec(ret.X, ret.Y, ret.Z + offset);
|
||||
}
|
||||
|
||||
// Sampled a N-sample probability density function in the range [-1024..1024, -1024..1024]
|
||||
// 1 sample produces a rectangular probability
|
||||
// 2 samples produces a triangular probability
|
||||
// ...
|
||||
// N samples approximates a true gaussian
|
||||
public static WVec FromPDF(Thirdparty.Random r, int samples)
|
||||
{
|
||||
return new WVec(WRange.FromPDF(r, samples), WRange.FromPDF(r, samples), WRange.Zero);
|
||||
}
|
||||
|
||||
public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
WVec o = (WVec)obj;
|
||||
return o == this;
|
||||
}
|
||||
|
||||
public override string ToString() { return "{0},{1},{2}".F(X, Y, Z); }
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA
|
||||
@@ -25,41 +26,43 @@ namespace OpenRA
|
||||
public readonly uint ActorID;
|
||||
|
||||
Lazy<IOccupySpace> occupySpace;
|
||||
IHasLocation HasLocation;
|
||||
Lazy<IMove> Move;
|
||||
Lazy<IFacing> Facing;
|
||||
|
||||
public Cached<Rectangle> Bounds;
|
||||
public Cached<Rectangle> ExtendedBounds;
|
||||
|
||||
public IOccupySpace OccupiesSpace { get { return occupySpace.Value; } }
|
||||
|
||||
public CPos Location { get { return occupySpace.Value.TopLeft; } }
|
||||
public PPos CenterLocation { get { return PPos.FromWPos(occupySpace.Value.CenterPosition); } }
|
||||
public WPos CenterPosition { get { return occupySpace.Value.CenterPosition; } }
|
||||
|
||||
public PPos CenterLocation
|
||||
public WRot Orientation
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasLocation == null)
|
||||
HasLocation = Trait<IHasLocation>();
|
||||
return HasLocation.PxPosition;
|
||||
// TODO: Support non-zero pitch/roll in IFacing (IOrientation?)
|
||||
var facing = Facing.Value != null ? Facing.Value.Facing : 0;
|
||||
return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing));
|
||||
}
|
||||
}
|
||||
|
||||
[Sync]
|
||||
public Player Owner;
|
||||
[Sync] public Player Owner;
|
||||
|
||||
Activity currentActivity;
|
||||
public Group Group;
|
||||
public int Generation;
|
||||
|
||||
internal Actor(World world, string name, TypeDictionary initDict )
|
||||
internal Actor(World world, string name, TypeDictionary initDict)
|
||||
{
|
||||
var init = new ActorInitializer( this, initDict );
|
||||
var init = new ActorInitializer(this, initDict);
|
||||
|
||||
World = world;
|
||||
ActorID = world.NextAID();
|
||||
if( initDict.Contains<OwnerInit>() )
|
||||
if (initDict.Contains<OwnerInit>())
|
||||
Owner = init.Get<OwnerInit,Player>();
|
||||
|
||||
occupySpace = Lazy.New( () => TraitOrDefault<IOccupySpace>() );
|
||||
occupySpace = Lazy.New(() => TraitOrDefault<IOccupySpace>());
|
||||
|
||||
if (name != null)
|
||||
{
|
||||
@@ -71,7 +74,7 @@ namespace OpenRA
|
||||
AddTrait(trait.Create(init));
|
||||
}
|
||||
|
||||
Move = Lazy.New( () => TraitOrDefault<IMove>() );
|
||||
Facing = Lazy.New(() => TraitOrDefault<IFacing>());
|
||||
|
||||
Size = Lazy.New(() =>
|
||||
{
|
||||
@@ -79,17 +82,14 @@ namespace OpenRA
|
||||
if (si != null && si.Bounds != null)
|
||||
return new int2(si.Bounds[0], si.Bounds[1]);
|
||||
|
||||
// auto size from render
|
||||
var firstSprite = TraitsImplementing<IRender>().SelectMany(ApplyIRender).FirstOrDefault();
|
||||
if (firstSprite.Sprite == null) return int2.Zero;
|
||||
return (firstSprite.Sprite.size * firstSprite.Scale).ToInt2();
|
||||
return TraitsImplementing<IAutoSelectionSize>().Select(x => x.SelectionSize(this)).FirstOrDefault();
|
||||
});
|
||||
|
||||
ApplyIRender = x => x.Render(this);
|
||||
ApplyRenderModifier = (m, p) => p.ModifyRender(this, m);
|
||||
ApplyIRender = (x, wr) => x.Render(this, wr);
|
||||
ApplyRenderModifier = (m, p, wr) => p.ModifyRender(this, wr, m);
|
||||
|
||||
Bounds = Cached.New( () => CalculateBounds(false) );
|
||||
ExtendedBounds = Cached.New( () => CalculateBounds(true) );
|
||||
Bounds = Cached.New(() => CalculateBounds(false));
|
||||
ExtendedBounds = Cached.New(() => CalculateBounds(true));
|
||||
}
|
||||
|
||||
public void Tick()
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA
|
||||
Bounds.Invalidate();
|
||||
ExtendedBounds.Invalidate();
|
||||
|
||||
currentActivity = Util.RunActivity( this, currentActivity );
|
||||
currentActivity = Traits.Util.RunActivity(this, currentActivity);
|
||||
}
|
||||
|
||||
public bool IsIdle
|
||||
@@ -108,13 +108,13 @@ namespace OpenRA
|
||||
OpenRA.FileFormats.Lazy<int2> Size;
|
||||
|
||||
// note: these delegates are cached to avoid massive allocation.
|
||||
Func<IRender, IEnumerable<Renderable>> ApplyIRender;
|
||||
Func<IEnumerable<Renderable>, IRenderModifier, IEnumerable<Renderable>> ApplyRenderModifier;
|
||||
public IEnumerable<Renderable> Render()
|
||||
Func<IRender, WorldRenderer, IEnumerable<IRenderable>> ApplyIRender;
|
||||
Func<IEnumerable<IRenderable>, IRenderModifier, WorldRenderer, IEnumerable<IRenderable>> ApplyRenderModifier;
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
var mods = TraitsImplementing<IRenderModifier>();
|
||||
var sprites = TraitsImplementing<IRender>().SelectMany(ApplyIRender);
|
||||
return mods.Aggregate(sprites, ApplyRenderModifier);
|
||||
var sprites = TraitsImplementing<IRender>().SelectMany(x => ApplyIRender(x, wr));
|
||||
return mods.Aggregate(sprites, (m,p) => ApplyRenderModifier(m,p,wr));
|
||||
}
|
||||
|
||||
// When useAltitude = true, the bounding box is extended
|
||||
@@ -129,24 +129,17 @@ namespace OpenRA
|
||||
var si = Info.Traits.GetOrDefault<SelectableInfo>();
|
||||
if (si != null && si.Bounds != null && si.Bounds.Length > 2)
|
||||
{
|
||||
#if true
|
||||
loc += new PVecInt(si.Bounds[2], si.Bounds[3]);
|
||||
#else
|
||||
loc.X += si.Bounds[2];
|
||||
loc.Y += si.Bounds[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
var move = Move.Value;
|
||||
if (move != null)
|
||||
var ios = occupySpace.Value;
|
||||
if (ios != null)
|
||||
{
|
||||
#if true
|
||||
loc -= new PVecInt(0, move.Altitude);
|
||||
#else
|
||||
loc.Y -= move.Altitude;
|
||||
#endif
|
||||
var altitude = ios.CenterPosition.Z * Game.CellSize / 1024;
|
||||
loc -= new PVecInt(0, altitude);
|
||||
|
||||
if (useAltitude)
|
||||
size = new PVecInt(size.X, size.Y + move.Altitude);
|
||||
size = new PVecInt(size.X, size.Y + altitude);
|
||||
}
|
||||
|
||||
return new Rectangle(loc.X, loc.Y, size.X, size.Y);
|
||||
@@ -235,15 +228,21 @@ namespace OpenRA
|
||||
} );
|
||||
}
|
||||
|
||||
// todo: move elsewhere.
|
||||
// TODO: move elsewhere.
|
||||
public void ChangeOwner(Player newOwner)
|
||||
{
|
||||
World.AddFrameEndTask(w =>
|
||||
{
|
||||
var oldOwner = Owner;
|
||||
|
||||
// momentarily remove from world so the ownership queries don't get confused
|
||||
w.Remove(this);
|
||||
Owner = newOwner;
|
||||
Generation++;
|
||||
w.Add(this);
|
||||
|
||||
foreach (var t in this.TraitsImplementing<INotifyOwnerChanged>())
|
||||
t.OnOwnerChanged(this, oldOwner, newOwner);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace OpenRA
|
||||
[FieldFromYamlKey] public readonly int value = 0;
|
||||
public SubCellInit() { }
|
||||
public SubCellInit(int init) { value = init; }
|
||||
public SubCellInit(SubCell init) { value = (int)init; }
|
||||
public SubCell Value(World world) { return (SubCell)value; }
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,16 @@ namespace OpenRA
|
||||
SubCell.BottomLeft, SubCell.BottomRight }.Any(b => !AnyUnitsAt(a,b));
|
||||
}
|
||||
|
||||
public SubCell? FreeSubCell(CPos a)
|
||||
{
|
||||
if (!HasFreeSubCell(a))
|
||||
return null;
|
||||
|
||||
return new[]{ SubCell.TopLeft, SubCell.TopRight, SubCell.Center,
|
||||
SubCell.BottomLeft, SubCell.BottomRight }.First(b => !AnyUnitsAt(a,b));
|
||||
}
|
||||
|
||||
|
||||
public bool AnyUnitsAt(CPos a)
|
||||
{
|
||||
return influence[ a.X, a.Y ] != null;
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace OpenRA
|
||||
public readonly int X, Y;
|
||||
|
||||
public CPos(int x, int y) { X = x; Y = y; }
|
||||
|
||||
public static readonly CPos Zero = new CPos(0, 0);
|
||||
|
||||
public static explicit operator CPos(int2 a) { return new CPos(a.X, a.Y); }
|
||||
@@ -42,6 +41,10 @@ namespace OpenRA
|
||||
public int2 ToInt2() { return new int2(X, Y); }
|
||||
public PPos ToPPos() { return new PPos(Game.CellSize * X, Game.CellSize * Y); }
|
||||
|
||||
public WPos CenterPosition { get { return new WPos(1024 * X + 512, 1024 * Y + 512, 0); } }
|
||||
public WPos TopLeft { get { return new WPos(1024 * X, 1024 * Y, 0); } }
|
||||
public WPos BottomRight { get { return new WPos(1024 * X + 1023, 1024 * Y + 1023, 0); } }
|
||||
|
||||
public CPos Clamp(Rectangle r)
|
||||
{
|
||||
return new CPos(Math.Min(r.Right, Math.Max(X, r.Left)),
|
||||
@@ -68,4 +71,10 @@ namespace OpenRA
|
||||
public static CPos TopLeftAsCPos(this Rectangle r) { return new CPos(r.Left, r.Top); }
|
||||
public static CPos BottomRightAsCPos(this Rectangle r) { return new CPos(r.Right, r.Bottom); }
|
||||
}
|
||||
}
|
||||
|
||||
public static class WorldCoordinateExtensions
|
||||
{
|
||||
public static CPos ToCPos(this WPos a) { return new CPos(a.X / 1024, a.Y / 1024); }
|
||||
public static CVec ToCVec(this WVec a) { return new CVec(a.X / 1024, a.Y / 1024); }
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ namespace OpenRA
|
||||
|
||||
public float2 ToFloat2() { return new float2(X, Y); }
|
||||
public int2 ToInt2() { return new int2(X, Y); }
|
||||
public WVec ToWVec() { return new WVec(X*1024, Y*1024, 0); }
|
||||
|
||||
public CVec Clamp(Rectangle r)
|
||||
{
|
||||
@@ -72,5 +73,17 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
public override string ToString() { return "{0},{1}".F(X, Y); }
|
||||
|
||||
public static readonly CVec[] directions =
|
||||
{
|
||||
new CVec(-1, -1),
|
||||
new CVec(-1, 0),
|
||||
new CVec(-1, 1),
|
||||
new CVec(0, -1),
|
||||
new CVec(0, 1),
|
||||
new CVec(1, -1),
|
||||
new CVec(1, 0),
|
||||
new CVec(1, 1),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Effects
|
||||
@@ -25,12 +26,12 @@ namespace OpenRA.Effects
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
public void Tick(World world)
|
||||
{
|
||||
if (--delay <= 0)
|
||||
world.AddFrameEndTask(w => { w.Remove(this); a(); });
|
||||
}
|
||||
|
||||
public IEnumerable<Renderable> Render() { yield break; }
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr) { yield break; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,36 +10,44 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Effects
|
||||
{
|
||||
public class FlashTarget : IEffect
|
||||
{
|
||||
Actor target;
|
||||
Player player;
|
||||
int remainingTicks = 4;
|
||||
|
||||
public FlashTarget(Actor target)
|
||||
: this(target, null) { }
|
||||
|
||||
public FlashTarget(Actor target, Player asPlayer)
|
||||
{
|
||||
this.target = target;
|
||||
player = asPlayer;
|
||||
foreach (var e in target.World.Effects.OfType<FlashTarget>().Where(a => a.target == target).ToArray())
|
||||
target.World.Remove(e);
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
public void Tick(World world)
|
||||
{
|
||||
if (--remainingTicks == 0 || !target.IsInWorld)
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
}
|
||||
|
||||
public IEnumerable<Renderable> Render()
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr)
|
||||
{
|
||||
if (!target.IsInWorld)
|
||||
yield break;
|
||||
if (target.IsInWorld && remainingTicks % 2 == 0)
|
||||
{
|
||||
var palette = wr.Palette(player == null ? "highlight" : "highlight" + player.InternalName);
|
||||
return target.Render(wr)
|
||||
.Where(r => !r.IsDecoration)
|
||||
.Select(r => r.WithPalette(palette));
|
||||
}
|
||||
|
||||
if (remainingTicks % 2 == 0)
|
||||
foreach (var r in target.Render())
|
||||
yield return r.WithPalette("highlight");
|
||||
return SpriteRenderable.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Effects
|
||||
{
|
||||
public interface IEffect
|
||||
{
|
||||
void Tick( World world );
|
||||
IEnumerable<Renderable> Render();
|
||||
void Tick(World world);
|
||||
IEnumerable<IRenderable> Render(WorldRenderer r);
|
||||
}
|
||||
}
|
||||
|
||||
121
OpenRA.Game/Game.cs
Executable file → Normal file
121
OpenRA.Game/Game.cs
Executable file → Normal file
@@ -29,6 +29,8 @@ namespace OpenRA
|
||||
{
|
||||
public static int CellSize { get { return modData.Manifest.TileSize; } }
|
||||
|
||||
public static MouseButtonPreference mouseButtonPreference = new MouseButtonPreference();
|
||||
|
||||
public static ModData modData;
|
||||
static WorldRenderer worldRenderer;
|
||||
|
||||
@@ -56,7 +58,7 @@ namespace OpenRA
|
||||
|
||||
static string ChooseReplayFilename()
|
||||
{
|
||||
return DateTime.UtcNow.ToString("OpenRA-yyyy-MM-ddTHHmmssZ.rep");
|
||||
return DateTime.UtcNow.ToString("OpenRA-yyyy-MM-ddTHHmmssZ");
|
||||
}
|
||||
|
||||
static void JoinInner(OrderManager om)
|
||||
@@ -120,17 +122,17 @@ namespace OpenRA
|
||||
public static void RunAfterTick(Action a) { delayedActions.Add(a); }
|
||||
public static void RunAfterDelay(int delay, Action a) { delayedActions.Add(a, delay); }
|
||||
|
||||
static void Tick( OrderManager orderManager, Viewport viewPort )
|
||||
static void Tick(OrderManager orderManager, Viewport viewPort)
|
||||
{
|
||||
if (orderManager.Connection.ConnectionState != lastConnectionState)
|
||||
{
|
||||
lastConnectionState = orderManager.Connection.ConnectionState;
|
||||
ConnectionStateChanged( orderManager );
|
||||
ConnectionStateChanged(orderManager);
|
||||
}
|
||||
|
||||
Tick( orderManager );
|
||||
if( worldRenderer != null && orderManager.world != worldRenderer.world )
|
||||
Tick( worldRenderer.world.orderManager );
|
||||
Tick(orderManager);
|
||||
if (worldRenderer != null && orderManager.world != worldRenderer.world)
|
||||
Tick(worldRenderer.world.orderManager);
|
||||
|
||||
using (new PerfSample("render"))
|
||||
{
|
||||
@@ -147,12 +149,12 @@ namespace OpenRA
|
||||
delayedActions.PerformActions();
|
||||
}
|
||||
|
||||
static void Tick( OrderManager orderManager )
|
||||
static void Tick(OrderManager orderManager)
|
||||
{
|
||||
int t = Environment.TickCount;
|
||||
int dt = t - orderManager.LastTickTime;
|
||||
if (dt >= Settings.Game.Timestep)
|
||||
using( new PerfSample( "tick_time" ) )
|
||||
using (new PerfSample("tick_time"))
|
||||
{
|
||||
orderManager.LastTickTime += Settings.Game.Timestep;
|
||||
Ui.Tick();
|
||||
@@ -160,26 +162,26 @@ namespace OpenRA
|
||||
if (orderManager.GameStarted)
|
||||
++Viewport.TicksSinceLastMove;
|
||||
Sound.Tick();
|
||||
Sync.CheckSyncUnchanged( world, () => { orderManager.TickImmediate(); } );
|
||||
Sync.CheckSyncUnchanged(world, orderManager.TickImmediate);
|
||||
|
||||
if (world != null)
|
||||
{
|
||||
var isNetTick = LocalTick % NetTickScale == 0;
|
||||
|
||||
if ((!isNetTick || orderManager.IsReadyForNextFrame) && !orderManager.GamePaused )
|
||||
if (!isNetTick || orderManager.IsReadyForNextFrame)
|
||||
{
|
||||
++orderManager.LocalFrameNumber;
|
||||
|
||||
Log.Write("debug", "--Tick: {0} ({1})", LocalTick, isNetTick ? "net" : "local");
|
||||
|
||||
if (isNetTick) orderManager.Tick();
|
||||
|
||||
if (isNetTick)
|
||||
orderManager.Tick();
|
||||
|
||||
Sync.CheckSyncUnchanged(world, () =>
|
||||
{
|
||||
world.OrderGenerator.Tick(world);
|
||||
world.Selection.Tick(world);
|
||||
});
|
||||
{
|
||||
world.OrderGenerator.Tick(world);
|
||||
world.Selection.Tick(world);
|
||||
});
|
||||
|
||||
world.Tick();
|
||||
|
||||
@@ -188,7 +190,8 @@ namespace OpenRA
|
||||
else
|
||||
if (orderManager.NetFrameNumber == 0)
|
||||
orderManager.LastTickTime = Environment.TickCount;
|
||||
|
||||
|
||||
Sync.CheckSyncUnchanged(world, () => world.TickRender(worldRenderer));
|
||||
viewport.Tick();
|
||||
}
|
||||
}
|
||||
@@ -208,23 +211,27 @@ namespace OpenRA
|
||||
|
||||
var map = modData.PrepareMap(mapUID);
|
||||
viewport = new Viewport(new int2(Renderer.Resolution), map.Bounds, Renderer);
|
||||
orderManager.world = new World(modData.Manifest, map, orderManager) { IsShellmap = isShellmap };
|
||||
orderManager.world = new World(modData.Manifest, map, orderManager, isShellmap);
|
||||
worldRenderer = new WorldRenderer(orderManager.world);
|
||||
|
||||
if (orderManager.GameStarted) return;
|
||||
Ui.SelectedWidget = null;
|
||||
Ui.MouseFocusWidget = null;
|
||||
Ui.KeyboardFocusWidget = null;
|
||||
|
||||
orderManager.LocalFrameNumber = 0;
|
||||
orderManager.LastTickTime = Environment.TickCount;
|
||||
orderManager.StartGame();
|
||||
worldRenderer.RefreshPalette();
|
||||
|
||||
if (!isShellmap)
|
||||
Sound.PlayNotification(null, "Speech", "StartGame", null);
|
||||
}
|
||||
|
||||
public static bool IsHost
|
||||
{
|
||||
get
|
||||
get
|
||||
{
|
||||
var client= orderManager.LobbyInfo.ClientWithIndex (
|
||||
var client= orderManager.LobbyInfo.ClientWithIndex(
|
||||
orderManager.Connection.LocalClientId);
|
||||
return ((client!=null) && client.IsAdmin);
|
||||
}
|
||||
@@ -232,7 +239,7 @@ namespace OpenRA
|
||||
|
||||
public static Dictionary<String, Mod> CurrentMods
|
||||
{
|
||||
get { return Mod.AllMods.Where( k => modData.Manifest.Mods.Contains( k.Key )).ToDictionary( k => k.Key, k => k.Value ); }
|
||||
get { return Mod.AllMods.Where(k => modData.Manifest.Mods.Contains(k.Key)).ToDictionary(k => k.Key, k => k.Value); }
|
||||
}
|
||||
|
||||
static Modifiers modifiers;
|
||||
@@ -251,6 +258,16 @@ namespace OpenRA
|
||||
Log.AddChannel("perf", "perf.log");
|
||||
Log.AddChannel("debug", "debug.log");
|
||||
Log.AddChannel("sync", "syncreport.log");
|
||||
Log.AddChannel("server", "server.log");
|
||||
Log.AddChannel("sound", "sound.log");
|
||||
|
||||
if (Settings.Server.DiscoverNatDevices)
|
||||
UPnP.TryNatDiscovery();
|
||||
else
|
||||
{
|
||||
Settings.Server.NatDeviceAvailable = false;
|
||||
Settings.Server.AllowPortForward = false;
|
||||
}
|
||||
|
||||
FileSystem.Mount("."); // Needed to access shaders
|
||||
Renderer.Initialize( Game.Settings.Graphics.Mode );
|
||||
@@ -262,6 +279,13 @@ namespace OpenRA
|
||||
|
||||
Sound.Create(Settings.Sound.Engine);
|
||||
InitializeWithMods(Settings.Game.Mods);
|
||||
|
||||
if (Settings.Server.DiscoverNatDevices)
|
||||
{
|
||||
RunAfterDelay(Settings.Server.NatDiscoveryTimeout, () =>
|
||||
UPnP.TryStoppingNatDiscovery()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static void InitializeWithMods(string[] mods)
|
||||
@@ -289,10 +313,9 @@ namespace OpenRA
|
||||
Sound.StopVideo();
|
||||
Sound.Initialize();
|
||||
|
||||
modData = new ModData( mm );
|
||||
modData = new ModData(mm);
|
||||
Renderer.InitializeFonts(modData.Manifest);
|
||||
modData.LoadInitialAssets();
|
||||
|
||||
modData.InitializeLoaders();
|
||||
|
||||
PerfHistory.items["render"].hasNormalTick = false;
|
||||
PerfHistory.items["batches"].hasNormalTick = false;
|
||||
@@ -309,11 +332,12 @@ namespace OpenRA
|
||||
Game.Settings.Server.Map = WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map);
|
||||
Game.Settings.Save();
|
||||
Game.CreateServer(new ServerSettings(Game.Settings.Server));
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
|
||||
if((server.GameStarted)&&(server.conns.Count<=1))
|
||||
if ((server.State == Server.ServerState.GameStarted)
|
||||
&& (server.conns.Count<=1))
|
||||
{
|
||||
Console.WriteLine("No one is playing, shutting down...");
|
||||
server.Shutdown();
|
||||
@@ -403,13 +427,13 @@ namespace OpenRA
|
||||
|
||||
public static T CreateObject<T>( string name )
|
||||
{
|
||||
return modData.ObjectCreator.CreateObject<T>( name );
|
||||
return modData.ObjectCreator.CreateObject<T>(name);
|
||||
}
|
||||
|
||||
public static void CreateServer(ServerSettings settings)
|
||||
{
|
||||
server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort),
|
||||
Game.Settings.Game.Mods, settings, modData);
|
||||
Game.Settings.Game.Mods, settings, modData);
|
||||
}
|
||||
|
||||
public static int CreateLocalServer(string map)
|
||||
@@ -423,10 +447,10 @@ namespace OpenRA
|
||||
// Work around a miscompile in mono 2.6.7:
|
||||
// booleans that default to true cannot be set false by an initializer
|
||||
settings.AdvertiseOnline = false;
|
||||
settings.AllowUPnP = false;
|
||||
settings.AllowPortForward = false;
|
||||
|
||||
server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0),
|
||||
Game.Settings.Game.Mods, settings, modData);
|
||||
Game.Settings.Game.Mods, settings, modData);
|
||||
|
||||
return server.Port;
|
||||
}
|
||||
@@ -436,21 +460,28 @@ namespace OpenRA
|
||||
return orderManager != null && orderManager.world == world;
|
||||
}
|
||||
|
||||
public static void JoinExternalGame()
|
||||
public static bool DownloadMap(string mapHash)
|
||||
{
|
||||
var addressParts = Game.Settings.Game.ConnectTo.Split(
|
||||
new [] { ':' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (addressParts.Length < 1 || addressParts.Length > 2)
|
||||
return;
|
||||
|
||||
var host = addressParts[0];
|
||||
var port = Exts.WithDefault(1234, () => int.Parse(addressParts[1]));
|
||||
|
||||
Game.Settings.Game.ConnectTo = "";
|
||||
Game.Settings.Save();
|
||||
|
||||
Game.JoinServer(host, port);
|
||||
try
|
||||
{
|
||||
var mod = Game.CurrentMods.FirstOrDefault().Value.Id;
|
||||
var dirPath = "{1}maps{0}{2}".F(Path.DirectorySeparatorChar, Platform.SupportDir, mod);
|
||||
if(!Directory.Exists(dirPath))
|
||||
Directory.CreateDirectory(dirPath);
|
||||
var mapPath = "{1}{0}{2}".F(Path.DirectorySeparatorChar, dirPath, mapHash+".oramap");
|
||||
Console.Write("Trying to download map to {0} ... ".F(mapPath));
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile(Game.Settings.Game.MapRepository + mapHash, mapPath);
|
||||
Game.modData.AvailableMaps.Add(mapHash, new Map(mapPath));
|
||||
Console.WriteLine("done");
|
||||
return true;
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
Log.Write("debug", "Could not download map '{0}'", mapHash);
|
||||
Log.Write("debug", e.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,15 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
//TODO: This is not exported into the documentation yet.
|
||||
[Desc("A unit/building inside the game. Every rules starts with one and adds trait to it.",
|
||||
"Special actors like world or player are usually defined in system.yaml and affect everything.")]
|
||||
public class ActorInfo
|
||||
{
|
||||
[Desc("The actor name can be anything, but the sprites used in the Render*: traits default to this one.",
|
||||
"If you add an ^ in front of the name, the engine will recognize this as a collection of traits",
|
||||
"that can be inherited by others (using Inherits:) and not a real unit.",
|
||||
"You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait.")]
|
||||
public readonly string Name;
|
||||
public readonly TypeDictionary Traits = new TypeDictionary();
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ namespace OpenRA
|
||||
|
||||
static Dictionary<string, T> LoadYamlRules<T>(string[] files, List<MiniYamlNode> dict, Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> f)
|
||||
{
|
||||
var y = files.Select(a => MiniYaml.FromFile(a)).Aggregate(dict,MiniYaml.MergeLiberal);
|
||||
var yy = y.ToDictionary( x => x.Key, x => x.Value );
|
||||
return y.ToDictionary(kv => kv.Key.ToLowerInvariant(), kv => f(kv, yy));
|
||||
var y = files.Select(MiniYaml.FromFile).Aggregate(dict, MiniYaml.MergeLiberal);
|
||||
var yy = y.ToDictionary(x => x.Key, x => x.Value);
|
||||
return y.ToDictionaryWithConflictLog(kv => kv.Key.ToLowerInvariant(), kv => f(kv, yy), "LoadYamlRules", null, null);
|
||||
}
|
||||
|
||||
public static IEnumerable<KeyValuePair<string,MusicInfo>> InstalledMusic { get { return Music.Where( m => m.Value.Exists ); } }
|
||||
public static IEnumerable<KeyValuePair<string, MusicInfo>> InstalledMusic { get { return Music.Where(m => m.Value.Exists); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -29,14 +29,19 @@ namespace OpenRA.GameRules
|
||||
public int ExternalPort = 1234;
|
||||
public bool AdvertiseOnline = true;
|
||||
public string MasterServer = "http://master.open-ra.org/";
|
||||
public bool AllowUPnP = false;
|
||||
public bool DiscoverNatDevices = false; // Allow users to disable NAT discovery if problems occur
|
||||
public bool AllowPortForward = true; // let the user disable it even if compatible devices are found
|
||||
public bool NatDeviceAvailable = false; // internal check if discovery succeeded
|
||||
public int NatDiscoveryTimeout = 1000; // ms to search for UPnP enabled NATs
|
||||
public bool VerboseNatDiscovery = false; // print very detailed logs for debugging
|
||||
public bool AllowCheats = false;
|
||||
public string Map = null;
|
||||
public string[] Ban = null;
|
||||
public string[] Ban = { };
|
||||
public int TimeOut = 0;
|
||||
public bool Dedicated = false;
|
||||
public bool DedicatedLoop = true;
|
||||
public string DedicatedMOTD = null;
|
||||
public bool LockBots = false;
|
||||
public bool AllowVersionMismatch = false;
|
||||
|
||||
public ServerSettings() { }
|
||||
|
||||
@@ -47,14 +52,19 @@ namespace OpenRA.GameRules
|
||||
ExternalPort = other.ExternalPort;
|
||||
AdvertiseOnline = other.AdvertiseOnline;
|
||||
MasterServer = other.MasterServer;
|
||||
AllowUPnP = other.AllowUPnP;
|
||||
DiscoverNatDevices = other.DiscoverNatDevices;
|
||||
AllowPortForward = other.AllowPortForward;
|
||||
NatDeviceAvailable = other.NatDeviceAvailable;
|
||||
NatDiscoveryTimeout = other.NatDiscoveryTimeout;
|
||||
VerboseNatDiscovery = other.VerboseNatDiscovery;
|
||||
AllowCheats = other.AllowCheats;
|
||||
Map = other.Map;
|
||||
Ban = other.Ban;
|
||||
TimeOut = other.TimeOut;
|
||||
Dedicated = other.Dedicated;
|
||||
DedicatedLoop = other.DedicatedLoop;
|
||||
DedicatedMOTD = other.DedicatedMOTD;
|
||||
LockBots = other.LockBots;
|
||||
AllowVersionMismatch = other.AllowVersionMismatch;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +76,11 @@ namespace OpenRA.GameRules
|
||||
public float LongTickThreshold = 0.001f;
|
||||
public bool SanityCheckUnsyncedCode = false;
|
||||
public int Samples = 25;
|
||||
public bool IgnoreVersionMismatch = false;
|
||||
public bool DeveloperMenu = false;
|
||||
|
||||
public bool ShowFatalErrorDialog = true;
|
||||
public string FatalErrorDialogFaq = "http://github.com/OpenRA/OpenRA/wiki/FAQ";
|
||||
}
|
||||
|
||||
public class GraphicSettings
|
||||
@@ -88,18 +103,21 @@ namespace OpenRA.GameRules
|
||||
public float SoundVolume = 0.5f;
|
||||
public float MusicVolume = 0.5f;
|
||||
public float VideoVolume = 0.5f;
|
||||
|
||||
public bool Shuffle = false;
|
||||
public bool Repeat = false;
|
||||
public bool ShellmapMusic = true;
|
||||
public bool MapMusic = true;
|
||||
|
||||
public string Engine = "AL";
|
||||
|
||||
public string Device = null;
|
||||
|
||||
public SoundCashTicks SoundCashTickType = SoundCashTicks.Extreme;
|
||||
}
|
||||
|
||||
public class PlayerSettings
|
||||
{
|
||||
public string Name = "Newbie";
|
||||
public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25);
|
||||
public HSLColor Color = new HSLColor(75, 255, 180);
|
||||
public string LastServer = "localhost:1234";
|
||||
}
|
||||
|
||||
@@ -114,12 +132,37 @@ namespace OpenRA.GameRules
|
||||
public MouseScrollType MouseScroll = MouseScrollType.Standard;
|
||||
public float ViewportEdgeScrollStep = 10f;
|
||||
|
||||
public bool UseClassicMouseStyle = false;
|
||||
|
||||
// Internal game settings
|
||||
public int Timestep = 40;
|
||||
|
||||
public string ConnectTo = "";
|
||||
public bool AllowDownloading = true;
|
||||
public string MapRepository = "http://content.open-ra.org/map/";
|
||||
}
|
||||
|
||||
public class KeySettings
|
||||
{
|
||||
public string CycleBaseKey = "backspace";
|
||||
public string ToLastEventKey = "space";
|
||||
public string ToSelectionKey = "home";
|
||||
|
||||
public string PauseKey = "f9";
|
||||
public string SellKey = "f10";
|
||||
public string PowerDownKey = "f11";
|
||||
public string RepairKey = "f12";
|
||||
|
||||
public string AttackMoveKey = "a";
|
||||
public string StopKey = "s";
|
||||
public string ScatterKey = "x";
|
||||
public string DeployKey = "f";
|
||||
public string StanceCycleKey = "z";
|
||||
public string GuardKey = "d";
|
||||
|
||||
public string CycleTabsKey = "tab";
|
||||
}
|
||||
|
||||
|
||||
public class Settings
|
||||
{
|
||||
string SettingsFile;
|
||||
@@ -130,6 +173,7 @@ namespace OpenRA.GameRules
|
||||
public GraphicSettings Graphics = new GraphicSettings();
|
||||
public ServerSettings Server = new ServerSettings();
|
||||
public DebugSettings Debug = new DebugSettings();
|
||||
public KeySettings Keys = new KeySettings();
|
||||
|
||||
public Dictionary<string, object> Sections;
|
||||
|
||||
@@ -144,6 +188,7 @@ namespace OpenRA.GameRules
|
||||
{"Graphics", Graphics},
|
||||
{"Server", Server},
|
||||
{"Debug", Debug},
|
||||
{"Keys", Keys},
|
||||
};
|
||||
|
||||
// Override fieldloader to ignore invalid entries
|
||||
|
||||
@@ -18,28 +18,45 @@ namespace OpenRA.GameRules
|
||||
{
|
||||
public class WarheadInfo
|
||||
{
|
||||
public readonly int Spread = 1; // distance (in pixels) from the explosion center at which damage is 1/2.
|
||||
[Desc("Distance (in pixels) from the explosion center at which damage is 1/2.")]
|
||||
public readonly int Spread = 1;
|
||||
[FieldLoader.LoadUsing( "LoadVersus" )]
|
||||
public readonly Dictionary<string, float> Versus; // damage vs each armortype
|
||||
public readonly bool Ore = false; // can this damage ore?
|
||||
public readonly string Explosion = null; // explosion effect to use
|
||||
public readonly string WaterExplosion = null; // explosion effect on hitting water (usually a splash)
|
||||
public readonly string[] SmudgeType = { }; // type of smudge to apply
|
||||
public readonly int[] Size = { 0, 0 }; // size of the explosion. provide 2 values for a ring effect (outer/inner)
|
||||
public readonly int InfDeath = 1; // infantry death animation to use
|
||||
public readonly string ImpactSound = null; // sound to play on impact
|
||||
public readonly string WaterImpactSound = null; // sound to play on impact with water
|
||||
public readonly int Damage = 0; // how much (raw) damage to deal
|
||||
public readonly int Delay = 0; // delay in ticks before dealing the damage. 0=instant (old model)
|
||||
public readonly DamageModel DamageModel = DamageModel.Normal; // which damage model to use
|
||||
public readonly bool PreventProne = false; // whether we should prevent prone response in infantry.
|
||||
[Desc("Damage vs each armortype. 0% = can't target.")]
|
||||
public readonly Dictionary<string, float> Versus;
|
||||
[Desc("Can this damage ore?")]
|
||||
public readonly bool Ore = false;
|
||||
[Desc("Explosion effect to use.")]
|
||||
public readonly string Explosion = null;
|
||||
[Desc("Explosion effect on hitting water (usually a splash).")]
|
||||
public readonly string WaterExplosion = null;
|
||||
[Desc("Type of smudge to apply to terrain.")]
|
||||
public readonly string[] SmudgeType = { };
|
||||
[Desc("Size of the explosion. provide 2 values for a ring effect (outer/inner).")]
|
||||
public readonly int[] Size = { 0, 0 };
|
||||
[Desc("Infantry death animation to use")]
|
||||
public readonly int InfDeath = 1;
|
||||
[Desc("Sound to play on impact.")]
|
||||
public readonly string ImpactSound = null;
|
||||
[Desc("Sound to play on impact with water")]
|
||||
public readonly string WaterImpactSound = null;
|
||||
[Desc("How much (raw) damage to deal")]
|
||||
public readonly int Damage = 0;
|
||||
[Desc("Delay in ticks before dealing the damage, 0 = instant (old model).")]
|
||||
public readonly int Delay = 0;
|
||||
[Desc("Which damage model to use.")]
|
||||
public readonly DamageModel DamageModel = DamageModel.Normal;
|
||||
[Desc("Whether we should prevent prone response for infantry.")]
|
||||
public readonly bool PreventProne = false;
|
||||
|
||||
public float EffectivenessAgainst(Actor self)
|
||||
public float EffectivenessAgainst(ActorInfo ai)
|
||||
{
|
||||
var health = self.Info.Traits.GetOrDefault<HealthInfo>();
|
||||
if (health == null) return 0f;
|
||||
var armor = self.Info.Traits.GetOrDefault<ArmorInfo>();
|
||||
if (armor == null || armor.Type == null) return 1;
|
||||
var health = ai.Traits.GetOrDefault<HealthInfo>();
|
||||
if (health == null)
|
||||
return 0f;
|
||||
|
||||
var armor = ai.Traits.GetOrDefault<ArmorInfo>();
|
||||
if (armor == null || armor.Type == null)
|
||||
return 1;
|
||||
|
||||
float versus;
|
||||
return Versus.TryGetValue(armor.Type, out versus) ? versus : 1;
|
||||
@@ -60,8 +77,6 @@ namespace OpenRA.GameRules
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum DamageModel
|
||||
{
|
||||
Normal, // classic RA damage model: point actors, distance-based falloff
|
||||
@@ -71,14 +86,12 @@ namespace OpenRA.GameRules
|
||||
public class ProjectileArgs
|
||||
{
|
||||
public WeaponInfo weapon;
|
||||
public Actor firedBy;
|
||||
public PPos src;
|
||||
public int srcAltitude;
|
||||
public int facing;
|
||||
public Target target;
|
||||
public PPos dest;
|
||||
public int destAltitude;
|
||||
public float firepowerModifier = 1.0f;
|
||||
public int facing;
|
||||
public WPos source;
|
||||
public Actor sourceActor;
|
||||
public WPos passiveTarget;
|
||||
public Target guidedTarget;
|
||||
}
|
||||
|
||||
public interface IProjectileInfo { IEffect Create(ProjectileArgs args); }
|
||||
@@ -86,7 +99,8 @@ namespace OpenRA.GameRules
|
||||
public class WeaponInfo
|
||||
{
|
||||
public readonly float Range = 0;
|
||||
public readonly string Report = null;
|
||||
public readonly string[] Report = null;
|
||||
[Desc("Rate of Fire")]
|
||||
public readonly int ROF = 1;
|
||||
public readonly int Burst = 1;
|
||||
public readonly bool Charges = false;
|
||||
@@ -122,5 +136,53 @@ namespace OpenRA.GameRules
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool IsValidAgainst(Actor a)
|
||||
{
|
||||
var targetable = a.TraitOrDefault<ITargetable>();
|
||||
if (targetable == null || !ValidTargets.Intersect(targetable.TargetTypes).Any())
|
||||
return false;
|
||||
|
||||
if (Warheads.All(w => w.EffectivenessAgainst(a.Info) <= 0))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsValidAgainst(FrozenActor a)
|
||||
{
|
||||
var targetable = a.Info.Traits.GetOrDefault<ITargetableInfo>();
|
||||
if (targetable == null || !ValidTargets.Intersect(targetable.GetTargetTypes()).Any())
|
||||
return false;
|
||||
|
||||
if (Warheads.All(w => w.EffectivenessAgainst(a.Info) <= 0))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public bool IsValidAgainst(Target target, World world)
|
||||
{
|
||||
if (target.Type == TargetType.Actor)
|
||||
return IsValidAgainst(target.Actor);
|
||||
|
||||
if (target.Type == TargetType.FrozenActor)
|
||||
return IsValidAgainst(target.FrozenActor);
|
||||
|
||||
if (target.Type == TargetType.Terrain)
|
||||
{
|
||||
var cell = target.CenterPosition.ToCPos();
|
||||
if (ValidTargets.Contains("Ground") && world.GetTerrainType(cell) != "Water")
|
||||
return true;
|
||||
|
||||
if (ValidTargets.Contains("Water") && world.GetTerrainType(cell) == "Water")
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user