mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d3e1bbfc6 | ||
|
|
738225d2a2 | ||
|
|
4be9b106f4 | ||
|
|
af4eeb09f4 | ||
|
|
15821498a3 | ||
|
|
54bdce6c46 | ||
|
|
433de0e67b | ||
|
|
30e5d8f91c | ||
|
|
506ea842b8 | ||
|
|
9adc1ad998 | ||
|
|
8d1877d26d | ||
|
|
d03989051a | ||
|
|
5da2ee8bf6 | ||
|
|
aa0aac2bfe | ||
|
|
ee098125e6 | ||
|
|
bada3ef31a | ||
|
|
00a805cc39 | ||
|
|
fd2c74727e | ||
|
|
ba64ed53c6 | ||
|
|
c61f57bd9b | ||
|
|
4d5593ebcb | ||
|
|
601fabf401 | ||
|
|
eb8ecb31f0 | ||
|
|
2801af552e | ||
|
|
ef30192b29 | ||
|
|
392ba66df3 | ||
|
|
d4dd5f07df | ||
|
|
db29feed11 | ||
|
|
1fc5f939bf | ||
|
|
9e0105caec | ||
|
|
0cc7fb4e39 | ||
|
|
db15679ec1 | ||
|
|
6a8a22aba2 | ||
|
|
9b654ff3f1 | ||
|
|
a67f4b8a8f | ||
|
|
673dea01af | ||
|
|
b44b6cebb8 | ||
|
|
8bc3dbd0aa | ||
|
|
b4176bb2d9 | ||
|
|
8b3e417872 | ||
|
|
b949189881 | ||
|
|
cc19490898 | ||
|
|
9fac0a8ecd | ||
|
|
346e5c6293 | ||
|
|
0bea84374e | ||
|
|
3d589bd78e | ||
|
|
e1c8bee1d1 | ||
|
|
ead2932316 | ||
|
|
bb55299ff6 | ||
|
|
2d4f62a5b6 | ||
|
|
03a7b017b6 | ||
|
|
edf8f2f086 | ||
|
|
78ed49c73d | ||
|
|
5697acabb3 | ||
|
|
09197e421c | ||
|
|
46afd90fdc | ||
|
|
80ba0a05d7 | ||
|
|
aab34bff20 | ||
|
|
ef325c1cde | ||
|
|
99a4ff1527 | ||
|
|
f2d1b09fc6 | ||
|
|
31970291bd | ||
|
|
0a758179c2 | ||
|
|
481e95d42d | ||
|
|
8f178a59ab | ||
|
|
a6d96f5f31 | ||
|
|
67f41d4de6 | ||
|
|
1d53b92731 | ||
|
|
42b2cbc7f5 | ||
|
|
04ace5df24 | ||
|
|
323944757d | ||
|
|
7d5a1c2e9e | ||
|
|
dc107f5044 | ||
|
|
f3ce1d5ff9 | ||
|
|
b1c076416c | ||
|
|
cc984b09f6 | ||
|
|
8d00a316c5 | ||
|
|
d51f1e6088 | ||
|
|
1c86d96e9d | ||
|
|
1368962244 | ||
|
|
6f6aadf89c | ||
|
|
96de96e9c6 | ||
|
|
ebcc5449c5 | ||
|
|
6b7bc51a52 | ||
|
|
622cffce82 | ||
|
|
5ed79c3edb | ||
|
|
fe69dba958 | ||
|
|
f8b6ee1672 | ||
|
|
30070035cc | ||
|
|
ff3079ff23 | ||
|
|
aba3688b4b | ||
|
|
d6b30c6f43 | ||
|
|
4fcf03d31a | ||
|
|
03edc532e1 | ||
|
|
1db41f4c36 | ||
|
|
96ede9299f | ||
|
|
b226f2a21d | ||
|
|
6629562b34 | ||
|
|
91d7620c0b | ||
|
|
c341402fe1 | ||
|
|
80b1af930a | ||
|
|
608eb8e4e6 | ||
|
|
ec1c6fc112 | ||
|
|
4fabab680f | ||
|
|
def815988b | ||
|
|
21df179941 | ||
|
|
ff674e79b9 | ||
|
|
9efa5e1108 | ||
|
|
c235345a22 | ||
|
|
97791bfcc3 | ||
|
|
d49185c291 | ||
|
|
41eba8ff3a | ||
|
|
2fd5e2c255 | ||
|
|
a83bb00d52 | ||
|
|
cb27d0cd72 | ||
|
|
020cd270c0 | ||
|
|
a6e1b93af0 | ||
|
|
5dd4043f00 | ||
|
|
61f8efaac0 | ||
|
|
3ee22bdb31 | ||
|
|
032ac8e566 | ||
|
|
1e78fc68bc | ||
|
|
a074dbf3ee | ||
|
|
9cfcfac376 | ||
|
|
fb8feca896 | ||
|
|
be70cd18a2 | ||
|
|
6a1b84e53b | ||
|
|
584e10d14f | ||
|
|
4f0f6f9f23 | ||
|
|
2f13ef79b6 | ||
|
|
f8f9c18cda | ||
|
|
37c081f3db | ||
|
|
e684f61f55 | ||
|
|
c2f4ca5da1 | ||
|
|
5befb47881 | ||
|
|
780831611d | ||
|
|
bb13225778 | ||
|
|
2f62d6fe44 | ||
|
|
6e94ac144b | ||
|
|
6e45ca9825 | ||
|
|
142de9b02e | ||
|
|
7a024aecd7 | ||
|
|
c81d290957 | ||
|
|
3c498abe82 | ||
|
|
fdf494c28a | ||
|
|
b903ead06a | ||
|
|
591a1a63c8 | ||
|
|
e60dcbc3e9 | ||
|
|
d73d56d85a | ||
|
|
d21293d4ad | ||
|
|
297d052670 | ||
|
|
f21508ad15 | ||
|
|
4c53bb70f3 | ||
|
|
6c5f94c0cc | ||
|
|
65e5c1768a | ||
|
|
04f03fb2cc | ||
|
|
a8218462e1 | ||
|
|
00c8bd0aa7 | ||
|
|
d3cd51e7eb | ||
|
|
37795bb73c | ||
|
|
5b4099a828 | ||
|
|
977b7a5b2d | ||
|
|
e6824bf15d | ||
|
|
63a58502d1 | ||
|
|
173f786f55 | ||
|
|
ea1a3a9e9e | ||
|
|
c1b8309753 | ||
|
|
d86dc39f9f | ||
|
|
b580459e57 | ||
|
|
b562b45c00 | ||
|
|
4a43b7704e | ||
|
|
4a813e567a | ||
|
|
ea4cea2231 | ||
|
|
f263c7270f | ||
|
|
4b38f56d1f | ||
|
|
9bf289561b | ||
|
|
10fa5f37d6 | ||
|
|
0d8873d2c0 | ||
|
|
f2b88ef080 | ||
|
|
1e6586f187 | ||
|
|
dbb1c0a929 | ||
|
|
91ae6e1223 | ||
|
|
04bf102614 | ||
|
|
677b320534 | ||
|
|
265a7c0af7 | ||
|
|
04b1937caa | ||
|
|
842009ab3f | ||
|
|
f27164b9dc | ||
|
|
20ee284e42 | ||
|
|
ec6401ee5d | ||
|
|
d8d3db89d2 | ||
|
|
af1ad3885f | ||
|
|
0199084f05 | ||
|
|
1db9af545c | ||
|
|
951a88e947 | ||
|
|
b6e276ac34 | ||
|
|
3a3b415cc5 | ||
|
|
d0b86e69d8 | ||
|
|
10f6a48f50 | ||
|
|
18dfda46f2 | ||
|
|
4e24a6b9ba | ||
|
|
3061237e58 | ||
|
|
d05e9ec916 | ||
|
|
8fe051dc8d | ||
|
|
9c9d6ebb4a | ||
|
|
8bda0aaaf3 | ||
|
|
fc824fb556 | ||
|
|
e3845520f8 | ||
|
|
fa8e3113fe | ||
|
|
62fbf90daa | ||
|
|
10ac8624fe | ||
|
|
4e60877add | ||
|
|
740a1a8851 | ||
|
|
55afb83eb2 | ||
|
|
dfd5cfd42e | ||
|
|
518f7959aa | ||
|
|
f4f1bb25b6 | ||
|
|
731f3a7d99 | ||
|
|
cf048f9629 | ||
|
|
34a369938b | ||
|
|
2979f49e8d | ||
|
|
0dc080b01d | ||
|
|
014b06641e | ||
|
|
56d4499262 | ||
|
|
92c58d9fb6 | ||
|
|
330470353c | ||
|
|
7c274fd87a | ||
|
|
5e28730c2a | ||
|
|
fccb2e15bd | ||
|
|
e354885b16 | ||
|
|
056fc5ea6e | ||
|
|
2c50518b61 | ||
|
|
803ee8d90b | ||
|
|
243e22a8c6 | ||
|
|
d85643b895 | ||
|
|
413eaa08fb | ||
|
|
08c82aa056 | ||
|
|
03e4898061 | ||
|
|
6799d68b3c | ||
|
|
5f6114fed9 | ||
|
|
eace375a3b | ||
|
|
419f9f3bf5 | ||
|
|
9e4b819f69 | ||
|
|
8296bfbf8a | ||
|
|
12250a34ae | ||
|
|
9f7b545528 | ||
|
|
f902b01497 | ||
|
|
0bbb01ae87 | ||
|
|
4cb1ebac88 | ||
|
|
264105071a | ||
|
|
9ce1492651 | ||
|
|
7499daf06a | ||
|
|
1e1eb88864 | ||
|
|
72e586a378 | ||
|
|
07dbf9c848 | ||
|
|
b19efcf1b4 | ||
|
|
332b267ae6 | ||
|
|
584f6b47e6 | ||
|
|
219cc6f88d | ||
|
|
8257f2c9df | ||
|
|
c6fd81d289 | ||
|
|
d98de9e793 | ||
|
|
049981b35f | ||
|
|
1088ffc5b2 | ||
|
|
3d29eff4d8 | ||
|
|
0dd32c4670 | ||
|
|
fee56e37e7 | ||
|
|
d79a445ad1 | ||
|
|
b1ccdf4e38 | ||
|
|
3af3b3fbbc | ||
|
|
86ec94b40a | ||
|
|
395c18c557 | ||
|
|
2eff78a2cf | ||
|
|
3d95c47356 | ||
|
|
0ebcf0fa06 | ||
|
|
d6166000c9 | ||
|
|
08b8d2f04f | ||
|
|
ba2e69d045 | ||
|
|
c9cf34d608 | ||
|
|
be109b71fa | ||
|
|
690d9e1336 | ||
|
|
3c87ae2724 | ||
|
|
f6ae1a96cd | ||
|
|
6c96b80afc | ||
|
|
00b5758af1 | ||
|
|
72ab9b0135 | ||
|
|
92813f5ce1 | ||
|
|
da83c6a557 | ||
|
|
a9dd9d0ca6 | ||
|
|
710941edd3 | ||
|
|
0b0fffa21d | ||
|
|
e1acf181df | ||
|
|
0f8c14e72e | ||
|
|
ecea18f57c | ||
|
|
e63e936715 | ||
|
|
a15ed3aceb | ||
|
|
0cb13650ed | ||
|
|
601ef4dc30 | ||
|
|
8fa2189a66 | ||
|
|
cf6cc2a213 | ||
|
|
fb34eb6776 | ||
|
|
35984f57d0 | ||
|
|
6c42f222e1 | ||
|
|
e8aedb29d5 | ||
|
|
ffe987061e | ||
|
|
1f6e545a39 | ||
|
|
2b9efd3702 | ||
|
|
f5a7c32bff | ||
|
|
e14a337e03 | ||
|
|
d21b487884 | ||
|
|
a161dcc509 | ||
|
|
f3b99edbff | ||
|
|
f47908e033 | ||
|
|
f52ab32952 | ||
|
|
82aca548f5 | ||
|
|
4ec012ce7b | ||
|
|
ac59eba898 | ||
|
|
216cd78b18 | ||
|
|
7d9cd87da8 | ||
|
|
e5d25810f6 | ||
|
|
5d3cc7969f | ||
|
|
272ba56fa1 | ||
|
|
1004ab6c8c | ||
|
|
3c44f133fd | ||
|
|
ed00830202 | ||
|
|
e9b12908f7 | ||
|
|
e8399bb7c8 | ||
|
|
11202d7e7e | ||
|
|
616d9a08e6 | ||
|
|
f3194718e4 | ||
|
|
fd9611ae04 | ||
|
|
c62d767622 | ||
|
|
b7bfd8a2eb | ||
|
|
c78f8faefc | ||
|
|
63f614f957 | ||
|
|
d078a3439f | ||
|
|
9b83d6a3bc | ||
|
|
9ff8476c15 | ||
|
|
6a9df9f22c | ||
|
|
56dc0088b6 | ||
|
|
c3a34a660d | ||
|
|
1074e9c408 | ||
|
|
4537f5d4dc | ||
|
|
4ae331c19e | ||
|
|
b85380c958 | ||
|
|
eb3f62c3d5 | ||
|
|
8644e5f8b9 | ||
|
|
872a356e82 | ||
|
|
7bb7c54317 | ||
|
|
49a56d01ac | ||
|
|
9d1e9e8948 | ||
|
|
b3b3270e1e | ||
|
|
1a8db5d15b | ||
|
|
09ce332721 | ||
|
|
5e2c61ef12 | ||
|
|
4d948fda06 | ||
|
|
2ae110971b | ||
|
|
9a78e7dfa0 | ||
|
|
d95bae2bf6 | ||
|
|
a1bb85ca95 | ||
|
|
d9391de58a | ||
|
|
c02bbc90cb | ||
|
|
efb54202ea | ||
|
|
11caa6529c | ||
|
|
e2f296c42c | ||
|
|
ee2807ae64 | ||
|
|
b23c9ac8b1 | ||
|
|
fa0c5a2862 | ||
|
|
db6da100e1 | ||
|
|
a3e7ce5794 | ||
|
|
5062ae74f2 | ||
|
|
dd58f904f4 | ||
|
|
8dcb431ef2 | ||
|
|
5f45d06852 | ||
|
|
92103e36a6 | ||
|
|
8f98a9b985 | ||
|
|
c2e78d0461 | ||
|
|
36a84ffe59 | ||
|
|
865288e622 | ||
|
|
3e45217a9a | ||
|
|
da3c3bace8 | ||
|
|
ec4dc8b058 | ||
|
|
9df885a264 | ||
|
|
07320ba996 | ||
|
|
5ed70befb4 | ||
|
|
f21cb38647 | ||
|
|
4823ef4929 | ||
|
|
586a46bb78 | ||
|
|
fffb3a45fb | ||
|
|
9c951adfea | ||
|
|
e3a542bf5d | ||
|
|
222daead0e | ||
|
|
ebd2e25e0f | ||
|
|
ff8376d625 | ||
|
|
7aa0e18352 | ||
|
|
1976dee738 | ||
|
|
552951795c | ||
|
|
8897769f0d | ||
|
|
dcf202990f | ||
|
|
db40cd433e | ||
|
|
ac6a1504df | ||
|
|
22e67f66fa | ||
|
|
fd6ffd8d69 | ||
|
|
f471b74f5b | ||
|
|
4a16698cdb | ||
|
|
846abf5f1c | ||
|
|
ed73bd07ae | ||
|
|
b908bcecb9 | ||
|
|
a7b0091a27 | ||
|
|
7aafa7aada | ||
|
|
3e76e9525e | ||
|
|
959c29434e | ||
|
|
e9686c0dca | ||
|
|
10037291f3 | ||
|
|
9ed713f952 | ||
|
|
cccec0ef11 | ||
|
|
4a7625cef0 | ||
|
|
70f09471c2 | ||
|
|
b15c4ef96c | ||
|
|
ecdc8916f2 | ||
|
|
4b563fefc8 | ||
|
|
cf0b4dfc40 | ||
|
|
5fb989a1fc | ||
|
|
33e8c1dc39 | ||
|
|
73f7812165 | ||
|
|
d008d10b31 | ||
|
|
cd69f5f3ae | ||
|
|
bf6de9f342 | ||
|
|
5d19c1fe25 | ||
|
|
4624fe92f0 | ||
|
|
3acd2cea97 | ||
|
|
4d4e039da7 | ||
|
|
3cfde817ba | ||
|
|
dd5cabc6ba | ||
|
|
a83dfbefb0 | ||
|
|
dc72a43a19 | ||
|
|
897f684705 | ||
|
|
0993789430 | ||
|
|
6b9997b9c5 | ||
|
|
4ed7b1fb98 | ||
|
|
5499d1fba2 | ||
|
|
22af6e8ec8 | ||
|
|
a9ab60e5e5 | ||
|
|
c30b1c1b25 | ||
|
|
f4f48f23c7 | ||
|
|
5b966b4df9 | ||
|
|
eb7837bc3e | ||
|
|
c88fbbe749 | ||
|
|
a580052e40 | ||
|
|
7fa8ff930b | ||
|
|
c7d021f5f3 | ||
|
|
bfc78e2ef8 | ||
|
|
0bd932f20f | ||
|
|
28a51e0e7b | ||
|
|
2fcba8b9f7 | ||
|
|
184b44c386 | ||
|
|
86ad401186 | ||
|
|
1d58bda82d | ||
|
|
87f51f0f6e | ||
|
|
98cdffe5fd | ||
|
|
2424066aab | ||
|
|
b89c63058f | ||
|
|
0b21d1d798 | ||
|
|
dcde413b7b | ||
|
|
febb283c3a | ||
|
|
678ef822ca | ||
|
|
1eff9f6aaa | ||
|
|
20a33893d9 | ||
|
|
ffccdfa654 | ||
|
|
11bb0f741f | ||
|
|
abe6877d90 | ||
|
|
d0dbb9afb1 | ||
|
|
1013531a7f | ||
|
|
bfb724eab9 | ||
|
|
e59d915e58 | ||
|
|
4e8c5fa9ab | ||
|
|
de56f653ec | ||
|
|
79b57c326e | ||
|
|
c2b1ac0109 | ||
|
|
2eb16c583c | ||
|
|
5bbbec18bb | ||
|
|
66f5156f03 | ||
|
|
4645a09722 | ||
|
|
d244ef4c91 | ||
|
|
24656f2810 | ||
|
|
d960403514 | ||
|
|
0d97e36c34 | ||
|
|
1ac5d153fb | ||
|
|
d687956cf1 | ||
|
|
94f2e830e0 | ||
|
|
67c8081104 | ||
|
|
0dc2ceabb2 | ||
|
|
1ec2867ced | ||
|
|
a9120ef984 | ||
|
|
a50a6de1b5 | ||
|
|
845d784bff | ||
|
|
99703fa8b6 | ||
|
|
58bfffff55 | ||
|
|
7fffcd295c | ||
|
|
65a8b4fd77 | ||
|
|
9d0ec49e88 | ||
|
|
29354135dc | ||
|
|
63fe0be512 | ||
|
|
3f4c94642e | ||
|
|
8856813768 | ||
|
|
dbc4135974 | ||
|
|
d826491c83 | ||
|
|
bb1c63d4e8 | ||
|
|
8e4307b2fb | ||
|
|
e4fe066da0 | ||
|
|
cabb50a361 | ||
|
|
cebd20f5d0 | ||
|
|
aee7c23aa4 | ||
|
|
c7e654a1d9 | ||
|
|
235ddfa782 | ||
|
|
a670aff29c | ||
|
|
2a52347198 | ||
|
|
648a50f1e8 | ||
|
|
698176e841 | ||
|
|
8b90c84738 | ||
|
|
be5c4b1601 | ||
|
|
534ce662f3 | ||
|
|
ff638a5473 | ||
|
|
5b4be9bcdb | ||
|
|
3f448a62fb | ||
|
|
18673f3a29 | ||
|
|
47824c97a1 | ||
|
|
65c4cdd1d7 | ||
|
|
191af4da49 | ||
|
|
94a5972a85 | ||
|
|
1e16de30d7 | ||
|
|
b718b463c2 | ||
|
|
327046925b | ||
|
|
df01708ac3 | ||
|
|
2387667a23 | ||
|
|
883ceb2f6f | ||
|
|
924ccd8815 | ||
|
|
9bbec030d8 | ||
|
|
bc01bdb56d | ||
|
|
cd83fac928 | ||
|
|
e9e8080077 | ||
|
|
9fb29cf444 | ||
|
|
ca1112313a | ||
|
|
dd2c6f44b2 | ||
|
|
38b710343a | ||
|
|
3ddc4c2bbd | ||
|
|
d2388c76b8 | ||
|
|
07420ce245 | ||
|
|
e62684f0e1 | ||
|
|
c75f57785e | ||
|
|
66bd1e41c2 | ||
|
|
fa56a7ad6d | ||
|
|
f49013307f | ||
|
|
657097aa54 | ||
|
|
b74ccf3ddc | ||
|
|
d149b6ffea | ||
|
|
ef9aa1b027 | ||
|
|
b6e8b0c5ff | ||
|
|
b9641d4c90 | ||
|
|
f50bdf99cc | ||
|
|
9532fbfe2c | ||
|
|
74d752d452 | ||
|
|
06936b71c9 | ||
|
|
e9a13e12d8 | ||
|
|
9acf994952 | ||
|
|
9d62b9a37a | ||
|
|
2e92da4e12 | ||
|
|
f39078357b | ||
|
|
2e147d4bd7 | ||
|
|
274be524e6 | ||
|
|
34f0b40f93 | ||
|
|
f58cf588a6 | ||
|
|
30e6b9008c | ||
|
|
ab94d33bec | ||
|
|
3fe6e4f3d8 | ||
|
|
3e1c87f53c | ||
|
|
cbf53f8848 | ||
|
|
f0be44bb42 | ||
|
|
61c5a41bea | ||
|
|
c475f9e4e6 | ||
|
|
2918801f75 | ||
|
|
42d5ecb923 | ||
|
|
cd720a639a | ||
|
|
d28d46d974 | ||
|
|
edb26a68fe | ||
|
|
1cd94cda23 | ||
|
|
e7fe1d1cda | ||
|
|
3ff4cc0c19 | ||
|
|
98c18495c6 | ||
|
|
41fc407de6 | ||
|
|
23af6b6f3f | ||
|
|
b112d39fe2 | ||
|
|
419b0c794d | ||
|
|
8ef7fb5ae4 | ||
|
|
153d402065 | ||
|
|
75deccbc44 | ||
|
|
566ead5815 | ||
|
|
f823cb9718 | ||
|
|
5de6f77f2e | ||
|
|
1a172427ef | ||
|
|
8346d5bfa1 | ||
|
|
131172e41a | ||
|
|
ee429fd1f4 | ||
|
|
9079f2e0c1 | ||
|
|
ecb29ae9bc | ||
|
|
83b3485e58 | ||
|
|
b98732daa7 | ||
|
|
e9c8124dc2 | ||
|
|
cba88ab2bc | ||
|
|
337cf1804f | ||
|
|
1c631cb85f | ||
|
|
b9deb3cc19 | ||
|
|
d07dcf477a | ||
|
|
0def972901 | ||
|
|
735075869c | ||
|
|
6a0d02e9b9 | ||
|
|
568aa0a0b8 | ||
|
|
1327d186ed | ||
|
|
c04cc4cfcc | ||
|
|
1345d92521 | ||
|
|
0103a871cc | ||
|
|
f5b1447646 | ||
|
|
4d740055da | ||
|
|
aad6ed8297 | ||
|
|
d6370b7463 | ||
|
|
3c2592881f | ||
|
|
6c33009fab | ||
|
|
fcf2b27d1a | ||
|
|
040410b450 | ||
|
|
0089e0a640 | ||
|
|
d9edc9362b | ||
|
|
508310be3e | ||
|
|
5cf0ef4bde | ||
|
|
fdd6859726 | ||
|
|
2b024d63c6 | ||
|
|
a81820d0d7 | ||
|
|
f99065d0c6 | ||
|
|
bc870123bf | ||
|
|
17875978e0 | ||
|
|
4e253d0ec0 | ||
|
|
10250dc035 | ||
|
|
f48fadb802 | ||
|
|
6497a35af9 | ||
|
|
85ad2e5e72 | ||
|
|
8040c5d826 | ||
|
|
93e89798ec | ||
|
|
49a119e6b9 | ||
|
|
ce02a488f0 | ||
|
|
caa02cd6b7 | ||
|
|
3391c6d777 | ||
|
|
2307508a85 | ||
|
|
a26845b608 | ||
|
|
f7f214f347 | ||
|
|
c32d09b88e | ||
|
|
3bab6ef3b7 | ||
|
|
b13bcaac71 | ||
|
|
71667aba27 | ||
|
|
e386a66f03 | ||
|
|
c03bd3ff3a | ||
|
|
6650f70c93 | ||
|
|
cdb267ea17 | ||
|
|
72f01b5379 | ||
|
|
dee2415d4a | ||
|
|
049ec47219 | ||
|
|
d670383f3a | ||
|
|
fad3a27059 | ||
|
|
682dbaa8fc | ||
|
|
42cbf3fdbb | ||
|
|
236eb08b68 | ||
|
|
e6c5f95d73 | ||
|
|
bf01f87cb4 | ||
|
|
9dfbc7d394 | ||
|
|
0616507282 | ||
|
|
65698284c3 | ||
|
|
4338b5b909 | ||
|
|
ef69f9b2e6 | ||
|
|
28a4db0355 | ||
|
|
6ef6303eb1 | ||
|
|
32cae66229 | ||
|
|
b081f2af88 | ||
|
|
8b02dfe66a | ||
|
|
c1e72eaab2 | ||
|
|
ec1f6e651b | ||
|
|
082b42ef73 | ||
|
|
352459910c | ||
|
|
d296789929 | ||
|
|
0910dba472 | ||
|
|
bb63cb9aa3 | ||
|
|
a80fea00e2 | ||
|
|
e93dc3fb6d | ||
|
|
51c3967c42 | ||
|
|
2697a17010 | ||
|
|
5a74323d1f | ||
|
|
7546a23d0d | ||
|
|
c7bd75b60d | ||
|
|
6840394610 | ||
|
|
57bf3d9fa7 | ||
|
|
fd4b531d53 | ||
|
|
4d09bea13e | ||
|
|
62dd0914fc | ||
|
|
3d5294003a | ||
|
|
668a4e96ad | ||
|
|
f11393728c | ||
|
|
ae55496e39 | ||
|
|
5d3118ea75 | ||
|
|
381ab936eb | ||
|
|
f88b07b99b | ||
|
|
3f7b35c1a1 | ||
|
|
153eb5fb10 | ||
|
|
f5f3bb94de | ||
|
|
58a682db89 | ||
|
|
2849590ef2 | ||
|
|
5b635784cd | ||
|
|
d43a597423 | ||
|
|
5a7ef1930f | ||
|
|
1483f15832 | ||
|
|
db0787b5a3 | ||
|
|
b7f974f41b | ||
|
|
c07f3f460b | ||
|
|
eff1ccfe63 | ||
|
|
62b8d272e6 | ||
|
|
6c0b62cb42 | ||
|
|
02f733ce2f | ||
|
|
8f454e2aab | ||
|
|
a47ed9ed55 | ||
|
|
8080b06be4 | ||
|
|
e6f1f40aea | ||
|
|
5ec08231a3 | ||
|
|
7483829c65 | ||
|
|
d6a3a27b58 | ||
|
|
f00214d00d | ||
|
|
029af63eb8 | ||
|
|
d3b4874af0 | ||
|
|
8525d3f869 | ||
|
|
48722f26d6 | ||
|
|
5a922e3a42 | ||
|
|
f11534e792 | ||
|
|
f5e0d0bbd8 | ||
|
|
74a25a2069 | ||
|
|
0b5f14a3ad | ||
|
|
4b1de56b01 | ||
|
|
56a55f1bc4 | ||
|
|
eca4086d30 | ||
|
|
b8a870df02 | ||
|
|
b68f206969 | ||
|
|
8d49e74df4 | ||
|
|
14ec138fc7 | ||
|
|
a3be3ecd7e | ||
|
|
9033e1097a | ||
|
|
4ebae982dd | ||
|
|
8a241d277d | ||
|
|
5bfd19e5a8 | ||
|
|
07591e50f5 | ||
|
|
556641377c | ||
|
|
985dace82e | ||
|
|
bb73a458ee | ||
|
|
f8637e5972 | ||
|
|
4c861e441a | ||
|
|
3fa6a4bd45 | ||
|
|
fc5573f73d | ||
|
|
23ceb0fa4c | ||
|
|
1c11c88598 | ||
|
|
28aa73a859 | ||
|
|
cd186a2b1c | ||
|
|
019b9c4907 | ||
|
|
0962319a43 | ||
|
|
5740a0af08 | ||
|
|
9a46abe394 | ||
|
|
7910be0ab7 | ||
|
|
ee3d2472e7 | ||
|
|
7edecd6849 | ||
|
|
d56288e313 | ||
|
|
3ddacf1a44 | ||
|
|
8ec02b2d40 | ||
|
|
6bae48658e | ||
|
|
28a5c76775 | ||
|
|
1289c399ce | ||
|
|
1e1d456fd2 | ||
|
|
2060022e94 | ||
|
|
8f08eb15d2 | ||
|
|
5400fb019d | ||
|
|
b91871b518 | ||
|
|
aaeea9aac8 | ||
|
|
43c6943399 | ||
|
|
52ccc7cc3c | ||
|
|
200ac73f7a | ||
|
|
1bb8a214c9 | ||
|
|
f78d91f3a3 | ||
|
|
32e49784a0 | ||
|
|
8824d32da9 | ||
|
|
2345dd0ae6 | ||
|
|
cc6adb70f6 | ||
|
|
f16f137f2b | ||
|
|
06918d7585 | ||
|
|
57cc888cd7 | ||
|
|
9ac53cac32 | ||
|
|
9fb4ef8607 | ||
|
|
03482ffc3d | ||
|
|
7383d6b3f6 | ||
|
|
2e5aabe615 | ||
|
|
0ac6c3eb2d | ||
|
|
700734db10 | ||
|
|
7a198acdec | ||
|
|
62029a8ea9 | ||
|
|
5c13170424 | ||
|
|
1f0a8f46e8 |
+193
-78
@@ -9,11 +9,6 @@ on:
|
|||||||
# allows to manually trigger a build
|
# allows to manually trigger a build
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
build_all_languages:
|
|
||||||
description: build all languages
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
assemble_release:
|
assemble_release:
|
||||||
description: create release
|
description: create release
|
||||||
required: false
|
required: false
|
||||||
@@ -27,7 +22,6 @@ jobs:
|
|||||||
workflow_setup:
|
workflow_setup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
languages_json_array: ${{ steps.global_vars.outputs.languages_json_array }}
|
|
||||||
assemble_release: ${{ steps.global_vars.outputs.assemble_release }}
|
assemble_release: ${{ steps.global_vars.outputs.assemble_release }}
|
||||||
steps:
|
steps:
|
||||||
- id: global_vars
|
- id: global_vars
|
||||||
@@ -37,15 +31,6 @@ jobs:
|
|||||||
|
|
||||||
full_release='${{ ( github.repository == '1dot13/source' && github.ref_name == 'master' ) || startsWith(github.ref, 'refs/tags/v') }}'
|
full_release='${{ ( github.repository == '1dot13/source' && github.ref_name == 'master' ) || startsWith(github.ref, 'refs/tags/v') }}'
|
||||||
|
|
||||||
if [[ '${{ inputs.build_all_languages }}' == 'true' || ( '${{ inputs.build_all_languages }}' == '' && "$full_release" == 'true' ) ]]
|
|
||||||
then
|
|
||||||
languages_json_array='["Chinese", "German", "English", "French", "Polish", "Italian", "Dutch", "Russian"]';
|
|
||||||
else
|
|
||||||
# English + some other language for compilation testing
|
|
||||||
languages_json_array='["German", "English"]'
|
|
||||||
fi
|
|
||||||
echo "languages_json_array=$languages_json_array" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
if [[ '${{ inputs.assemble_release }}' == 'true' || ( '${{ inputs.assemble_release }}' == '' && "$full_release" == 'true' ) ]]
|
if [[ '${{ inputs.assemble_release }}' == 'true' || ( '${{ inputs.assemble_release }}' == '' && "$full_release" == 'true' ) ]]
|
||||||
then
|
then
|
||||||
assemble_release='true'
|
assemble_release='true'
|
||||||
@@ -154,89 +139,219 @@ jobs:
|
|||||||
cat dist/versions.env
|
cat dist/versions.env
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: versions.env
|
name: versions.env
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
build:
|
# every executable contains all languages and picks one at runtime, so one build serves every package
|
||||||
|
compile:
|
||||||
needs: [ workflow_setup ]
|
needs: [ workflow_setup ]
|
||||||
|
runs-on: windows-latest # required for the MSVC toolchain
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: ${{ fromJson(needs.workflow_setup.outputs.languages_json_array) }}
|
application: [ja2, ja2mapeditor, ja2ub, ja2ubmapeditor]
|
||||||
uses: ./.github/workflows/build_language.yml
|
|
||||||
with:
|
steps:
|
||||||
language: ${{ matrix.language }}
|
- name: Checkout source
|
||||||
assemble: ${{ needs.workflow_setup.outputs.assemble_release == 'true' }}
|
uses: actions/checkout@v7
|
||||||
# at least English and some other lang have to work
|
|
||||||
continue-on-error: ${{ matrix.language != 'English' && matrix.language != 'German' }}
|
- name: Download versions.env
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: versions.env
|
||||||
|
path: artifacts
|
||||||
|
- name: Restore versions.env
|
||||||
|
shell: bash
|
||||||
|
run: cat artifacts/versions.env >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# TODO: Move this into CMake, just taking the GitHub Actions parameters as -D variables
|
||||||
|
- name: Update GameVersion.cpp
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
|
||||||
|
GAME_BUILD=$(echo "$GAME_BUILD_INFORMATION" | tr -cd '[:print:]' | tr -d '"\\')
|
||||||
|
sed -i "s|@Version@|${GAME_VERSION:0:15}|" Ja2/GameVersion.cpp
|
||||||
|
sed -i "s|@Build@|${GAME_BUILD:0:255}|" Ja2/GameVersion.cpp
|
||||||
|
cat Ja2/GameVersion.cpp
|
||||||
|
|
||||||
|
- name: Prepare build properties
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
touch CMakePresets.json
|
||||||
|
|
||||||
|
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
|
||||||
|
|
||||||
|
echo "
|
||||||
|
JA2Application=$JA2Application
|
||||||
|
" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: egor-tensin/vs-shell@v2
|
||||||
|
with:
|
||||||
|
arch: x86
|
||||||
|
- name: Prepare build
|
||||||
|
run: |
|
||||||
|
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DApplications="$Env:JA2Application"
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cmake --build build/ -- -v
|
||||||
|
- name: List build artifacts
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
find build/
|
||||||
|
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.application }}
|
||||||
|
path: build/*.exe
|
||||||
|
|
||||||
|
# only the game data differs per language, every package gets the same executables
|
||||||
|
assemble:
|
||||||
|
needs: [ workflow_setup, compile ]
|
||||||
|
if: needs.workflow_setup.outputs.assemble_release == 'true'
|
||||||
|
runs-on: windows-latest # required for case-insensitive filesystem handling
|
||||||
|
# at least English has to work
|
||||||
|
continue-on-error: ${{ matrix.language != 'English' }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [Chinese, German, English, French, Polish, Italian, Dutch, Russian]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download versions.env
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: versions.env
|
||||||
|
path: artifacts
|
||||||
|
- name: Restore versions.env
|
||||||
|
shell: bash
|
||||||
|
run: cat artifacts/versions.env >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout gamedir
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
repository: ${{ env.GAMEDIR_REPOSITORY }}
|
||||||
|
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
|
||||||
|
path: gamedir
|
||||||
|
|
||||||
|
- name: Checkout gamedir-languages
|
||||||
|
if: matrix.language != 'English'
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
|
||||||
|
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
|
||||||
|
path: gamedir-languages
|
||||||
|
|
||||||
|
- name: Copy gamedir-languages files to gamedir
|
||||||
|
if: matrix.language != 'English'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
cp -a gamedir-languages/${{ matrix.language }}_Version/* gamedir/
|
||||||
|
|
||||||
|
- name: Download applications
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
pattern: ja2*
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
|
- name: Copy application files to gamedir
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
for APP in ja2 ja2mapeditor ja2ub ja2ubmapeditor
|
||||||
|
do
|
||||||
|
mv artifacts/${APP}/*.exe gamedir/${APP}.exe
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Create version information file
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# "-" separates words, "_" combines words, see double-click behavior
|
||||||
|
DIST_PREFIX='JA2_113'
|
||||||
|
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-G${GAMEDIR_COMMIT_SHA:0:4}L${GAMEDIR_LANGUAGES_COMMIT_SHA:0:4}-${{ matrix.language }}"
|
||||||
|
echo "DIST_NAME=$DIST_NAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
echo "If you encounter problems during gameplay, please provide the following version information:
|
||||||
|
Distribution Name: $DIST_NAME
|
||||||
|
Game Version: $GAME_VERSION
|
||||||
|
Language: ${{ matrix.language }}
|
||||||
|
Build Information: $GAME_BUILD_INFORMATION
|
||||||
|
Source Repository: $GITHUB_REPOSITORY
|
||||||
|
Source Commit SHA: $GITHUB_SHA
|
||||||
|
Source Commit Date: $SOURCE_COMMIT_DATETIME
|
||||||
|
Gamedir Repository: $GAMEDIR_REPOSITORY
|
||||||
|
Gamedir Commit SHA: $GAMEDIR_COMMIT_SHA
|
||||||
|
Gamedir Commit Date: $GAMEDIR_COMMIT_DATETIME
|
||||||
|
Gamedir Languages Repository: $GAMEDIR_LANGUAGES_REPOSITORY
|
||||||
|
Gamedir Languages Commit SHA: $GAMEDIR_LANGUAGES_COMMIT_SHA
|
||||||
|
Gamedir Languages Commit Date: $GAMEDIR_LANGUAGES_COMMIT_DATETIME
|
||||||
|
" > "gamedir/${DIST_PREFIX}-Version.txt"
|
||||||
|
cat "gamedir/${DIST_PREFIX}-Version.txt"
|
||||||
|
|
||||||
|
- name: Create release archive
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
mkdir dist/
|
||||||
|
cd gamedir/
|
||||||
|
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
|
||||||
|
|
||||||
|
- name: Upload
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.language }}_release
|
||||||
|
path: dist/
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [ workflow_setup, build ]
|
needs: [ workflow_setup, assemble ]
|
||||||
if: needs.workflow_setup.outputs.assemble_release == 'true'
|
if: needs.workflow_setup.outputs.assemble_release == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: dist
|
||||||
|
pattern: '*_release'
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Move release archives to dist/
|
- name: Checkout Repo
|
||||||
shell: bash
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
path: source
|
||||||
|
fetch-depth: 1
|
||||||
|
sparse-checkout: 'README.md'
|
||||||
|
- name: Create latest pre-release
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
working-directory: source
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
gh release delete latest --cleanup-tag || true
|
||||||
mkdir dist/
|
git tag -d latest || true
|
||||||
mv artifacts/*_release/* dist/
|
git push --delete origin refs/tags/latest || true
|
||||||
|
git tag latest
|
||||||
- name: Delete Latest
|
git push --force origin refs/tags/latest
|
||||||
if: startsWith(github.ref, 'refs/tags/v') == false
|
sleep 15 # make sure github can find the tag for gh release
|
||||||
uses: dev-drprasad/delete-tag-and-release@v1.0
|
gh release create latest ../dist/* \
|
||||||
with:
|
--generate-notes \
|
||||||
tag_name: "latest"
|
--title "Latest (unstable)" \
|
||||||
|
--verify-tag \
|
||||||
|
--prerelease
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- id: release_latest
|
|
||||||
name: Release Latest
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v') == false
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
allowUpdates: false
|
|
||||||
artifactErrorsFailBuild: true
|
|
||||||
artifacts: dist/*
|
|
||||||
draft: false
|
|
||||||
generateReleaseNotes: true
|
|
||||||
makeLatest: true
|
|
||||||
name: "Latest (unstable)"
|
|
||||||
prerelease: true
|
|
||||||
tag: "latest"
|
|
||||||
|
|
||||||
- id: release_tag
|
- name: Upload to tagged release
|
||||||
name: Release Tag
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
with:
|
working-directory: source
|
||||||
allowUpdates: true
|
|
||||||
artifactErrorsFailBuild: true
|
|
||||||
artifacts: dist/*
|
|
||||||
draft: false
|
|
||||||
generateReleaseNotes: true
|
|
||||||
makeLatest: true
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitDraftDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
|
|
||||||
- name: Show release outputs
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo 'id: '
|
gh release upload "$GITHUB_REF_NAME" ../dist/* --clobber
|
||||||
echo -n '${{ steps.release_tag.outputs.id }}'
|
env:
|
||||||
echo -n '${{ steps.release_latest.outputs.id }}'
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
echo ''
|
|
||||||
echo ''
|
|
||||||
echo 'url:'
|
|
||||||
echo -n '${{ steps.release_tag.outputs.html_url }}'
|
|
||||||
echo -n '${{ steps.release_latest.outputs.html_url }}'
|
|
||||||
echo ''
|
|
||||||
|
|||||||
@@ -1,204 +0,0 @@
|
|||||||
name: build language
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
language:
|
|
||||||
description: 'any of Chinese German English French Polish Italian Dutch Russian'
|
|
||||||
required: true
|
|
||||||
default: 'English'
|
|
||||||
type: string
|
|
||||||
assemble:
|
|
||||||
description: 'assemble full package'
|
|
||||||
required: true
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
continue-on-error:
|
|
||||||
description: 'allows a language to fail, used when building all languages'
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
compile:
|
|
||||||
runs-on: windows-latest # required for msbuild
|
|
||||||
continue-on-error: ${{ inputs.continue-on-error }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
application: [ja2, ja2mapeditor, ja2ub, ja2ubmapeditor]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout source
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Download versions.env
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: versions.env
|
|
||||||
path: artifacts
|
|
||||||
- name: Restore versions.env
|
|
||||||
shell: bash
|
|
||||||
run: cat artifacts/versions.env >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Update GameVersion.cpp
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
INPUTS_LANGUAGE=${{ inputs.language }}
|
|
||||||
GAME_VERSION=$(echo "$GAME_VERSION" | tr -cd '[:print:]' | tr -d '"\\')
|
|
||||||
GAME_BUILD="${INPUTS_LANGUAGE:0:2} $GAME_BUILD_INFORMATION"
|
|
||||||
GAME_BUILD=$(echo "$GAME_BUILD" | tr -cd '[:print:]' | tr -d '"\\')
|
|
||||||
sed -i "s|@Version@|${GAME_VERSION:0:15}|" GameVersion.cpp
|
|
||||||
sed -i "s|@Build@|${GAME_BUILD:0:255}|" GameVersion.cpp
|
|
||||||
cat GameVersion.cpp
|
|
||||||
|
|
||||||
- name: Prepare build properties
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
touch CMakeUserPresets.json
|
|
||||||
|
|
||||||
JA2Language=$(echo '${{ inputs.language }}' | tr '[:lower:]' '[:upper:]')
|
|
||||||
JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')
|
|
||||||
|
|
||||||
echo "
|
|
||||||
JA2Language=$JA2Language
|
|
||||||
JA2Application=$JA2Application
|
|
||||||
" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: microsoft/setup-msbuild@v1.1
|
|
||||||
with:
|
|
||||||
msbuild-architecture: x86
|
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
with:
|
|
||||||
arch: x86
|
|
||||||
- name: Prepare build
|
|
||||||
run: |
|
|
||||||
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLanguages="$Env:JA2Language" -DApplications="$Env:JA2Application"
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cmake --build build/ -- -v
|
|
||||||
- name: List build artifacts
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
find build/
|
|
||||||
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_${{ matrix.application }}
|
|
||||||
path: build/*.exe
|
|
||||||
|
|
||||||
assemble:
|
|
||||||
needs: [ compile ]
|
|
||||||
if: inputs.assemble
|
|
||||||
runs-on: windows-latest # required for case-insensitive filesystem handling
|
|
||||||
continue-on-error: ${{ inputs.continue-on-error }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download versions.env
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: versions.env
|
|
||||||
path: artifacts
|
|
||||||
- name: Restore versions.env
|
|
||||||
shell: bash
|
|
||||||
run: cat artifacts/versions.env >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Checkout gamedir
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: ${{ env.GAMEDIR_REPOSITORY }}
|
|
||||||
ref: ${{ env.GAMEDIR_COMMIT_SHA }}
|
|
||||||
path: gamedir
|
|
||||||
|
|
||||||
- name: Checkout gamedir-languages
|
|
||||||
if: inputs.language != 'English'
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: ${{ env.GAMEDIR_LANGUAGES_REPOSITORY }}
|
|
||||||
ref: ${{ env.GAMEDIR_LANGUAGES_COMMIT_SHA }}
|
|
||||||
path: gamedir-languages
|
|
||||||
|
|
||||||
- name: Copy gamedir-languages files to gamedir
|
|
||||||
if: inputs.language != 'English'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
cp -a gamedir-languages/${{ inputs.language }}_Version/* gamedir/
|
|
||||||
|
|
||||||
- name: Download ja2
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_ja2
|
|
||||||
path: artifacts/ja2
|
|
||||||
|
|
||||||
- name: Download ja2mapeditor
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_ja2mapeditor
|
|
||||||
path: artifacts/ja2mapeditor
|
|
||||||
|
|
||||||
- name: Download ja2ub
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_ja2ub
|
|
||||||
path: artifacts/ja2ub
|
|
||||||
|
|
||||||
- name: Download ja2ubmapeditor
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_ja2ubmapeditor
|
|
||||||
path: artifacts/ja2ubmapeditor
|
|
||||||
|
|
||||||
- name: Copy application files to gamedir
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
for APP in ja2 ja2mapeditor ja2ub ja2ubmapeditor
|
|
||||||
do
|
|
||||||
mv artifacts/${APP}/*.exe gamedir/${APP}.exe
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Create version information file
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
# "-" separates words, "_" combines words, see double-click behavior
|
|
||||||
DIST_PREFIX='JA2_113'
|
|
||||||
DIST_NAME="${DIST_PREFIX}-${GAME_VERSION}-G${GAMEDIR_COMMIT_SHA:0:4}L${GAMEDIR_LANGUAGES_COMMIT_SHA:0:4}-${{ inputs.language }}"
|
|
||||||
echo "DIST_NAME=$DIST_NAME" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
echo "If you encounter problems during gameplay, please provide the following version information:
|
|
||||||
Distribution Name: $DIST_NAME
|
|
||||||
Game Version: $GAME_VERSION
|
|
||||||
Language: ${{ inputs.language }}
|
|
||||||
Build Information: $GAME_BUILD_INFORMATION
|
|
||||||
Source Repository: $GITHUB_REPOSITORY
|
|
||||||
Source Commit SHA: $GITHUB_SHA
|
|
||||||
Source Commit Date: $SOURCE_COMMIT_DATETIME
|
|
||||||
Gamedir Repository: $GAMEDIR_REPOSITORY
|
|
||||||
Gamedir Commit SHA: $GAMEDIR_COMMIT_SHA
|
|
||||||
Gamedir Commit Date: $GAMEDIR_COMMIT_DATETIME
|
|
||||||
Gamedir Languages Repository: $GAMEDIR_LANGUAGES_REPOSITORY
|
|
||||||
Gamedir Languages Commit SHA: $GAMEDIR_LANGUAGES_COMMIT_SHA
|
|
||||||
Gamedir Languages Commit Date: $GAMEDIR_LANGUAGES_COMMIT_DATETIME
|
|
||||||
" > "gamedir/${DIST_PREFIX}-Version.txt"
|
|
||||||
cat "gamedir/${DIST_PREFIX}-Version.txt"
|
|
||||||
|
|
||||||
- name: Create release archive
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
mkdir dist/
|
|
||||||
cd gamedir/
|
|
||||||
7z a -bb -xr'!.*' "../dist/${DIST_NAME}.7z" .
|
|
||||||
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.language }}_release
|
|
||||||
path: dist/
|
|
||||||
+1
-1
@@ -6,6 +6,6 @@
|
|||||||
/.vs/
|
/.vs/
|
||||||
/build/
|
/build/
|
||||||
/out/
|
/out/
|
||||||
|
/CMakePresets.json
|
||||||
/CMakeSettings.json
|
/CMakeSettings.json
|
||||||
/CMakeUserPresets.json
|
|
||||||
/lib/
|
/lib/
|
||||||
|
|||||||
+115
-128
@@ -9,10 +9,29 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
option(LTO_OPTION "Enable link-time optimization if supported by compiler" OFF)
|
||||||
|
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT LinkTimeOptimization OUTPUT IpoError LANGUAGES C CXX)
|
||||||
|
if(LinkTimeOptimization AND LTO_OPTION)
|
||||||
|
message(STATUS "Configuring WITH link-time optimization")
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
|
else()
|
||||||
|
message(STATUS "Configuring WITHOUT link-time optimization ${IpoError}")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(ADDRESS_SANITIZER OFF)
|
option(ADDRESS_SANITIZER OFF)
|
||||||
if(ADDRESS_SANITIZER)
|
if(ADDRESS_SANITIZER)
|
||||||
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
|
message(STATUS "AddressSanitizer ENABLED for non-Release builds")
|
||||||
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
|
add_compile_options($<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,-fsanitize=address,>)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
# TODO: fix the warnings here and turn them on
|
||||||
|
# https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199
|
||||||
|
add_compile_options("/wd4838") # silence implicit narrowing conversion warnings
|
||||||
|
# add_compile_options("/w14061")
|
||||||
|
# add_compile_options("/w14062")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# whether we are using MSBuild as a generator
|
# whether we are using MSBuild as a generator
|
||||||
@@ -22,8 +41,24 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
|
|||||||
# TODO: build our own Lua 5.1.2 from source so we can use whichever
|
# TODO: build our own Lua 5.1.2 from source so we can use whichever
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
|
||||||
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP USE_VFS _CRT_SECURE_NO_DEPRECATE)
|
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
|
||||||
include_directories(${CMAKE_SOURCE_DIR} "ext/VFS/include" Utils TileEngine TacticalAI ModularizedTacticalAI Tactical Strategic "Standard Gaming Platform" Res Lua Laptop Multiplayer "Multiplayer/raknet" Editor Console)
|
include_directories(
|
||||||
|
"${CMAKE_SOURCE_DIR}/Ja2"
|
||||||
|
"${CMAKE_SOURCE_DIR}/ext/VFS/include"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Utils"
|
||||||
|
"${CMAKE_SOURCE_DIR}/TileEngine"
|
||||||
|
"${CMAKE_SOURCE_DIR}/TacticalAI"
|
||||||
|
"${CMAKE_SOURCE_DIR}/ModularizedTacticalAI/include"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Tactical"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Strategic"
|
||||||
|
"${CMAKE_SOURCE_DIR}/sgp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Ja2/Res"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Laptop"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Multiplayer"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Editor"
|
||||||
|
"${CMAKE_SOURCE_DIR}/i18n/include"
|
||||||
|
)
|
||||||
|
|
||||||
# external libraries
|
# external libraries
|
||||||
add_subdirectory("ext/libpng")
|
add_subdirectory("ext/libpng")
|
||||||
@@ -34,100 +69,49 @@ target_link_libraries(bfVFS PRIVATE 7z)
|
|||||||
# ja2export utility
|
# ja2export utility
|
||||||
add_subdirectory("ext/export/src")
|
add_subdirectory("ext/export/src")
|
||||||
|
|
||||||
# static libraries whose source files, header files or header files included
|
# static libraries whose translation units don't rely on Application preprocessor definitions.
|
||||||
# by header files do not rely on Applications or Languages preprocessor definitions,
|
add_subdirectory(lua)
|
||||||
# and therefore only need to be compiled once. Good.
|
add_subdirectory(Multiplayer)
|
||||||
add_subdirectory(Lua)
|
add_subdirectory(wine)
|
||||||
|
|
||||||
# static libraries whose source files, header files or header files included
|
|
||||||
# by header files rely on Application and Language preprocessor definitions, and
|
|
||||||
# therefore need to be compiled multiple times. Very Bad.
|
|
||||||
add_subdirectory(TileEngine)
|
|
||||||
add_subdirectory(TacticalAI)
|
|
||||||
add_subdirectory(Utils)
|
|
||||||
add_subdirectory(Strategic)
|
|
||||||
add_subdirectory("Standard Gaming Platform")
|
|
||||||
add_subdirectory(Laptop)
|
|
||||||
add_subdirectory(Editor)
|
|
||||||
add_subdirectory(Console)
|
|
||||||
add_subdirectory(Tactical)
|
|
||||||
add_subdirectory(ModularizedTacticalAI)
|
|
||||||
# TODO: Rename 'Standard Gaming Platform' directory to 'SGP' so this can be refactored away
|
|
||||||
set(Ja2_Libs
|
|
||||||
TileEngine
|
|
||||||
TacticalAI
|
|
||||||
Utils
|
|
||||||
Strategic
|
|
||||||
SGP
|
|
||||||
Laptop
|
|
||||||
Editor
|
|
||||||
Console
|
|
||||||
Tactical
|
|
||||||
ModularizedTacticalAI
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: Move these units into their own directory to declutter the root dir and CMakeLists.txt file
|
|
||||||
set(Ja2Src
|
|
||||||
"aniviewscreen.cpp"
|
|
||||||
"Credits.cpp"
|
|
||||||
"Fade Screen.cpp"
|
|
||||||
"FeaturesScreen.cpp"
|
|
||||||
"GameInitOptionsScreen.cpp"
|
|
||||||
"gameloop.cpp"
|
|
||||||
"gamescreen.cpp"
|
|
||||||
"GameSettings.cpp"
|
|
||||||
"GameVersion.cpp"
|
|
||||||
"HelpScreen.cpp"
|
|
||||||
"Init.cpp"
|
|
||||||
"Intro.cpp"
|
|
||||||
"JA2 Splash.cpp"
|
|
||||||
"Ja25Update.cpp"
|
|
||||||
"jascreens.cpp"
|
|
||||||
"Language Defines.cpp"
|
|
||||||
"Loading Screen.cpp"
|
|
||||||
"MainMenuScreen.cpp"
|
|
||||||
"MessageBoxScreen.cpp"
|
|
||||||
"MPChatScreen.cpp"
|
|
||||||
"MPConnectScreen.cpp"
|
|
||||||
"MPHostScreen.cpp"
|
|
||||||
"MPJoinScreen.cpp"
|
|
||||||
"MPScoreScreen.cpp"
|
|
||||||
"MPXmlTeams.cpp"
|
|
||||||
"Multiplayer/client.cpp"
|
|
||||||
"Multiplayer/server.cpp"
|
|
||||||
"Multiplayer/transfer_rules.cpp"
|
|
||||||
"Options Screen.cpp"
|
|
||||||
"profiler.cpp"
|
|
||||||
"SaveLoadGame.cpp"
|
|
||||||
"SaveLoadScreen.cpp"
|
|
||||||
"SCREENS.cpp"
|
|
||||||
"Sys Globals.cpp"
|
|
||||||
"ub_config.cpp"
|
|
||||||
"XML_DifficultySettings.cpp"
|
|
||||||
"XML_IntroFiles.cpp"
|
|
||||||
"XML_Layout_MainMenu.cpp"
|
|
||||||
Res/ja2.rc
|
|
||||||
)
|
|
||||||
|
|
||||||
set(Ja2_Libraries
|
set(Ja2_Libraries
|
||||||
"${PROJECT_SOURCE_DIR}/libexpatMT.lib"
|
"${CMAKE_SOURCE_DIR}/binkw32.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/libexpatMT.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/lua51.vc9.lib"
|
||||||
|
"${CMAKE_SOURCE_DIR}/SMACKW32.LIB"
|
||||||
"Dbghelp.lib"
|
"Dbghelp.lib"
|
||||||
Lua
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.lib"
|
|
||||||
"${PROJECT_SOURCE_DIR}/lua51.vc9.lib"
|
|
||||||
"Winmm.lib"
|
"Winmm.lib"
|
||||||
"${PROJECT_SOURCE_DIR}/SMACKW32.LIB"
|
|
||||||
"${PROJECT_SOURCE_DIR}/binkw32.lib"
|
|
||||||
bfVFS
|
|
||||||
"${PROJECT_SOURCE_DIR}/Multiplayer/raknet/RakNetLibStatic.lib"
|
|
||||||
"ws2_32.lib"
|
"ws2_32.lib"
|
||||||
|
bfVFS
|
||||||
|
Lua
|
||||||
|
Multiplayer
|
||||||
|
wine
|
||||||
)
|
)
|
||||||
|
|
||||||
# simple function to validate Languages and Application choices
|
# static libraries whose translation units rely on Application preprocessor definitions.
|
||||||
include(cmake/ValidateOptions.cmake)
|
set(Ja2_Libs
|
||||||
|
Editor
|
||||||
|
Ja2
|
||||||
|
Laptop
|
||||||
|
ModularizedTacticalAI
|
||||||
|
sgp
|
||||||
|
Strategic
|
||||||
|
Tactical
|
||||||
|
TacticalAI
|
||||||
|
TileEngine
|
||||||
|
Utils
|
||||||
|
)
|
||||||
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
|
add_subdirectory(${lib})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
set(ValidLanguages CHINESE DUTCH ENGLISH FRENCH GERMAN ITALIAN POLISH RUSSIAN)
|
# language library relies on Application preprocessor definition; compiled once per app
|
||||||
ValidateOptions("${ValidLanguages}" "Languages" "${Languages}" "LangTargets")
|
# with all 8 languages built in and selected at runtime (docs/plans/language-design.md).
|
||||||
|
add_subdirectory(i18n)
|
||||||
|
|
||||||
|
# simple function to validate the Application choice
|
||||||
|
include(cmake/ValidateOptions.cmake)
|
||||||
|
|
||||||
set(ValidApplications JA2 JA2MAPEDITOR JA2UB JA2UBMAPEDITOR)
|
set(ValidApplications JA2 JA2MAPEDITOR JA2UB JA2UBMAPEDITOR)
|
||||||
ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "ApplicationTargets")
|
ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "ApplicationTargets")
|
||||||
@@ -136,47 +120,50 @@ ValidateOptions("${ValidApplications}" "Applications" "${Applications}" "Applica
|
|||||||
# preprocessor definitions for Debug build, per the legacy MSBuild
|
# preprocessor definitions for Debug build, per the legacy MSBuild
|
||||||
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
|
set(debugFlags $<IF:$<CONFIG:Debug>,JA2BETAVERSION;JA2TESTVERSION;DEBUG_ATTACKBUSY,>)
|
||||||
|
|
||||||
# Due to widespread preprocessor definition abuse in the codebase, practically
|
foreach(app IN LISTS ApplicationTargets)
|
||||||
# every library-language-executable combination is its own compilation target
|
set(isEditor $<STREQUAL:${app},JA2MAPEDITOR>)
|
||||||
# TODO: refactor preprocessor usage onto, ideally, a single translation unit
|
set(isUb $<STREQUAL:${app},JA2UB>)
|
||||||
foreach(lang IN LISTS LangTargets)
|
set(isUbEditor $<STREQUAL:${app},JA2UBMAPEDITOR>)
|
||||||
foreach(exe IN LISTS ApplicationTargets)
|
set(compilationFlags
|
||||||
set(Executable ${exe}_${lang})
|
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
|
||||||
|
$<IF:${isUb},JA2UB;JA2UBMAPS,>
|
||||||
|
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
|
||||||
|
)
|
||||||
|
|
||||||
# executable for an application/language combination, e.g. JA2_ENGLISH.exe
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
add_executable(${Executable} WIN32)
|
# library for an application, e.g. JA2UB_sgp
|
||||||
target_sources(${Executable} PRIVATE ${Ja2Src})
|
set(game_library ${app}_${lib})
|
||||||
|
add_library(${game_library})
|
||||||
|
target_sources(${game_library} PRIVATE ${${lib}Src})
|
||||||
|
target_compile_definitions(${game_library} PRIVATE ${compilationFlags} ${debugFlags})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Good libraries have already been built, can be simply linked here
|
# executable for the application, e.g. JA2.exe
|
||||||
target_link_libraries(${Executable} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
|
set(exe ${app})
|
||||||
target_link_options(${Executable} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
|
add_executable(${exe} WIN32
|
||||||
|
sgp/sgp.cpp
|
||||||
|
Ja2/Res/ja2.rc
|
||||||
|
)
|
||||||
|
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
|
||||||
|
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
|
||||||
|
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
|
||||||
|
|
||||||
# for each app/lang combination, the Very Bad libraries need to be built,
|
# language library for the application, e.g. JA2MAPEDITOR_i18n — one per app, all 8
|
||||||
# with the appropriate preprocessor definitions
|
# languages compiled in, selected at runtime by BindLanguageStrings
|
||||||
foreach(lib IN LISTS Ja2_Libs)
|
set(language_library ${exe}_i18n)
|
||||||
# syntactic sugar to hopefully make this more readable
|
add_library(${language_library})
|
||||||
set(VeryBadLib ${Executable}_${lib})
|
target_sources(${language_library} PRIVATE ${i18nSrc})
|
||||||
set(isEditor $<STREQUAL:${exe},JA2MAPEDITOR>)
|
target_compile_definitions(${language_library} PRIVATE ${compilationFlags} ${debugFlags})
|
||||||
set(isUb $<STREQUAL:${exe},JA2UB>)
|
target_compile_options(${language_library} PRIVATE /w14062)
|
||||||
set(isUbEditor $<STREQUAL:${exe},JA2UBMAPEDITOR>)
|
target_link_libraries(${exe} PRIVATE ${language_library})
|
||||||
|
|
||||||
# static library for an app/lang combination, e.g. JA2_ENGLISH_SGP.lib
|
# go through all game libraries again and link them to the app executable
|
||||||
add_library(${VeryBadLib})
|
foreach(lib IN LISTS Ja2_Libs)
|
||||||
target_sources(${VeryBadLib} PRIVATE ${${lib}Src})
|
target_link_libraries(${exe} PRIVATE ${app}_${lib})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
target_compile_definitions(${VeryBadLib} PUBLIC
|
# for SGP only
|
||||||
$<IF:${isEditor},JA2EDITOR;JA2BETAVERSION,>
|
target_link_libraries(${app}_sgp PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
||||||
$<IF:${isUb},JA2UB;JA2UBMAPS,>
|
target_link_libraries(${app}_sgp PRIVATE libpng)
|
||||||
$<IF:${isUbEditor},JA2UB;JA2UBMAPS;JA2EDITOR;JA2BETAVERSION,>
|
target_compile_definitions(${app}_sgp PRIVATE ${compilationFlags} ${debugFlags} NO_ZLIB_COMPRESSION)
|
||||||
${debugFlags}
|
|
||||||
${lang}
|
|
||||||
)
|
|
||||||
target_link_libraries(${Executable} PUBLIC ${VeryBadLib})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# for SGP only
|
|
||||||
target_link_libraries(${Executable}_SGP PRIVATE "ddraw.lib" "${PROJECT_SOURCE_DIR}/fmodvc.lib")
|
|
||||||
target_link_libraries(${Executable}_SGP PUBLIC libpng)
|
|
||||||
target_compile_definitions(${Executable}_SGP PRIVATE NO_ZLIB_COMPRESSION)
|
|
||||||
endforeach()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
set(ConsoleSrc
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Console.cpp"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Cursors.cpp"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Dialogs.cpp"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/FileStream.cpp"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef _COMBSTROUT_H_
|
|
||||||
#define _COMBSTROUT_H_
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// CComBSTROut - a class that inherits from CComBSTR and adds Out() method
|
|
||||||
// that should be used instead of & operator for 'out'
|
|
||||||
// function parameters
|
|
||||||
|
|
||||||
class CComBSTROut : public CComBSTR
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
CComBSTROut()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/*explicit*/ CComBSTROut(int nSize) : CComBSTR(nSize)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/*explicit*/ CComBSTROut(int nSize, LPCOLESTR sz) : CComBSTR(nSize, sz)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/*explicit*/ CComBSTROut(LPCOLESTR pSrc) : CComBSTR(pSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/*explicit*/ CComBSTROut(const CComBSTROut& src) : CComBSTR(src)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/*explicit*/ CComBSTROut(REFGUID src) : CComBSTR(src)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef OLE2ANSI
|
|
||||||
CComBSTROut(LPCSTR pSrc) : CComBSTR(pSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CComBSTROut(int nSize, LPCSTR sz) : CComBSTR(nSize, sz)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
~CComBSTROut()
|
|
||||||
{
|
|
||||||
CComBSTR::~CComBSTR();
|
|
||||||
}
|
|
||||||
|
|
||||||
BSTR* Out()
|
|
||||||
{
|
|
||||||
Empty();
|
|
||||||
return &m_str;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _COMBSTROUT_H_
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef _COMVARIANTOUT_H_
|
|
||||||
#define _COMVARIANTOUT_H_
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// CComVariantOut - a class that inherits from CComVariant and adds Out()
|
|
||||||
// method that should be used instead of & operator for
|
|
||||||
// 'out' function parameters
|
|
||||||
|
|
||||||
class CComVariantOut : public CComVariant
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
CComVariantOut()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~CComVariantOut()
|
|
||||||
{
|
|
||||||
CComVariant::~CComVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
CComVariantOut(const VARIANT& varSrc) : CComVariant(varSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CComVariantOut(const CComVariant& varSrc) : CComVariant(varSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CComVariantOut(BSTR bstrSrc) : CComVariant(bstrSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(LPCOLESTR lpszSrc) : CComVariant(lpszSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef OLE2ANSI
|
|
||||||
CComVariantOut(LPCSTR lpszSrc) : CComVariant(lpszSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CComVariantOut(bool bSrc) : CComVariant(bSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CComVariantOut(int nSrc) : CComVariant(nSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(BYTE nSrc) : CComVariant(nSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(short nSrc) : CComVariant(nSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(long nSrc, VARTYPE m_varSrc = VT_I4) : CComVariant(nSrc, m_varSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(float fltSrc) : CComVariant(fltSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(double dblSrc) : CComVariant(dblSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(CY cySrc) : CComVariant(cySrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(IDispatch* pSrc) : CComVariant(pSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CComVariantOut(IUnknown* pSrc) : CComVariant(pSrc)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
VARIANT* Out()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _COMVARIANTOUT_H_
|
|
||||||
-2876
File diff suppressed because it is too large
Load Diff
@@ -1,746 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Console.h - console class declaration
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//#include "include/FreeImagePlus.h"
|
|
||||||
|
|
||||||
typedef basic_string<TCHAR> tstring;
|
|
||||||
|
|
||||||
#define WM_INPUTREADY WM_USER + 1
|
|
||||||
|
|
||||||
// tray icon message
|
|
||||||
#define WM_TRAY_NOTIFY WM_USER + 0x123
|
|
||||||
|
|
||||||
#define TRAY_ICON_ID 1
|
|
||||||
|
|
||||||
// timer #defines
|
|
||||||
#define TIMER_REPAINT_CHANGE 42 // timer that is started after there
|
|
||||||
// were some changes in the console
|
|
||||||
|
|
||||||
#define TIMER_REPAINT_MASTER 43 // master timer (needed to repaint
|
|
||||||
// for some DOS programs, can be
|
|
||||||
// disabled for lower CPU usage)
|
|
||||||
|
|
||||||
#define TIMER_SHOW_HIDE_CONSOLE 100 // used to hide console window when
|
|
||||||
// starting shell process after a
|
|
||||||
// defined period of time (some
|
|
||||||
// shells, like 4NT need console
|
|
||||||
// window visible during startup for
|
|
||||||
// all init options to work properly
|
|
||||||
|
|
||||||
// transparency #defines
|
|
||||||
#define TRANSPARENCY_NONE 0
|
|
||||||
#define TRANSPARENCY_ALPHA 1
|
|
||||||
#define TRANSPARENCY_COLORKEY 2
|
|
||||||
#define TRANSPARENCY_FAKE 3
|
|
||||||
|
|
||||||
// cusror style #defines
|
|
||||||
#define CURSOR_STYLE_NONE 0
|
|
||||||
#define CURSOR_STYLE_XTERM 1
|
|
||||||
#define CURSOR_STYLE_BLOCK 2
|
|
||||||
#define CURSOR_STYLE_NBBLOCK 3
|
|
||||||
#define CURSOR_STYLE_PULSEBLOCK 4
|
|
||||||
#define CURSOR_STYLE_BAR 5
|
|
||||||
#define CURSOR_STYLE_CONSOLE 6
|
|
||||||
#define CURSOR_STYLE_NBHLINE 7
|
|
||||||
#define CURSOR_STYLE_HLINE 8
|
|
||||||
#define CURSOR_STYLE_VLINE 9
|
|
||||||
#define CURSOR_STYLE_RECT 10
|
|
||||||
#define CURSOR_STYLE_NBRECT 11
|
|
||||||
#define CURSOR_STYLE_PULSERECT 12
|
|
||||||
#define CURSOR_STYLE_FADEBLOCK 13
|
|
||||||
|
|
||||||
// docking #defines
|
|
||||||
#define DOCK_NONE 0
|
|
||||||
#define DOCK_TOP_LEFT 1
|
|
||||||
#define DOCK_TOP_RIGHT 2
|
|
||||||
#define DOCK_BOTTOM_RIGHT 3
|
|
||||||
#define DOCK_BOTTOM_LEFT 4
|
|
||||||
|
|
||||||
// Z-order #defines
|
|
||||||
#define Z_ORDER_REGULAR 0
|
|
||||||
#define Z_ORDER_ONTOP 1
|
|
||||||
#define Z_ORDER_ONBOTTOM 2
|
|
||||||
|
|
||||||
// window border defines
|
|
||||||
#define BORDER_NONE 0
|
|
||||||
#define BORDER_REGULAR 1
|
|
||||||
#define BORDER_THIN 2
|
|
||||||
|
|
||||||
// window background style
|
|
||||||
#define BACKGROUND_STYLE_RESIZE 0
|
|
||||||
#define BACKGROUND_STYLE_CENTER 1
|
|
||||||
#define BACKGROUND_STYLE_TILE 2
|
|
||||||
|
|
||||||
// taskbar button defines
|
|
||||||
#define TASKBAR_BUTTON_NORMAL 0
|
|
||||||
#define TASKBAR_BUTTON_HIDE 1
|
|
||||||
#define TASKBAR_BUTTON_TRAY 2
|
|
||||||
|
|
||||||
// new configuration auto-reload defines
|
|
||||||
#define RELOAD_NEW_CONFIG_PROMPT 0
|
|
||||||
#define RELOAD_NEW_CONFIG_YES 1
|
|
||||||
#define RELOAD_NEW_CONFIG_NO 2
|
|
||||||
|
|
||||||
#define TEXT_SELECTION_NONE 0
|
|
||||||
#define TEXT_SELECTION_SELECTING 1
|
|
||||||
#define TEXT_SELECTION_SELECTED 2
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Console class
|
|
||||||
|
|
||||||
class Console {
|
|
||||||
public: // ctor/dtor
|
|
||||||
|
|
||||||
Console(LPCTSTR szConfigFile, LPCTSTR szShellCmdLine, LPCTSTR szConsoleTitle, LPCTSTR pszReloadNewConfig);
|
|
||||||
~Console();
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// creates and shows Console window
|
|
||||||
BOOL Create(HWND notify);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
////////////////////
|
|
||||||
// message handlers
|
|
||||||
////////////////////
|
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
// windows destruction messages
|
|
||||||
|
|
||||||
// destroys GDI stuff and posts a quit message
|
|
||||||
void OnDestroy();
|
|
||||||
// deletes Console object
|
|
||||||
void OnNcDestroy();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////
|
|
||||||
// painting messages
|
|
||||||
|
|
||||||
// handles painting from off-screen buffers
|
|
||||||
void OnPaint();
|
|
||||||
|
|
||||||
// handles master and 'change' timers
|
|
||||||
void OnPaintTimer();
|
|
||||||
|
|
||||||
// handles cursor timer (for animated cursors)
|
|
||||||
void OnCursorTimer();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////
|
|
||||||
// window state messages
|
|
||||||
|
|
||||||
// handles window position changes (for snapping to desktop edges)
|
|
||||||
void OnWindowPosChanging(WINDOWPOS* lpWndPos);
|
|
||||||
|
|
||||||
// handles activation message (used for setting alpha transparency and cursor states)
|
|
||||||
void OnActivateApp(BOOL bActivate, DWORD dwFlags);
|
|
||||||
|
|
||||||
// handles vertical scrolling
|
|
||||||
void OnVScroll(WPARAM wParam);
|
|
||||||
|
|
||||||
// handles keyboard layout change, posts the same message to the windows console window
|
|
||||||
void OnInputLangChangeRequest(WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////
|
|
||||||
// mouse messages
|
|
||||||
|
|
||||||
// handles text selection start and window mouse drag start
|
|
||||||
void OnLButtonDown(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// handles text selection end, window mouse drag end and text copy
|
|
||||||
void OnLButtonUp(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// toggles always on top flag
|
|
||||||
void OnLButtonDblClick(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// pops up the Console menu
|
|
||||||
void OnRButtonUp(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// pastes text from clipboard
|
|
||||||
void OnMButtonDown(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// handles mouse movement for text selection and window mouse drag
|
|
||||||
void OnMouseMove(UINT uiFlags, POINTS points);
|
|
||||||
|
|
||||||
// handles start/stop mouse drag for window border
|
|
||||||
void OnSetCursor(WORD wHitTest, WORD wMouseMessage);
|
|
||||||
|
|
||||||
// handles text input
|
|
||||||
void OnChar(WORD mychar);
|
|
||||||
|
|
||||||
wstring Input;
|
|
||||||
|
|
||||||
//////////////////
|
|
||||||
// other messages
|
|
||||||
|
|
||||||
// called before the Console menu or system menu pops up
|
|
||||||
// (populates config files submenu with filenames)
|
|
||||||
void OnInitMenuPopup(HMENU hMenu, UINT uiPos, BOOL bSysMenu);
|
|
||||||
|
|
||||||
// handles drag-n-dropped filenames
|
|
||||||
void OnDropFiles(HDROP hDrop);
|
|
||||||
|
|
||||||
// handles commands from the Console popup menu
|
|
||||||
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
// handles commands from the system popup menu
|
|
||||||
BOOL OnSysCommand(WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
// handles tray icon messages
|
|
||||||
void OnTrayNotify(WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
// handles WM_SETTINGCHANGE (we handle only wallpaper changes here)
|
|
||||||
// void OnWallpaperChanged(const TCHAR* pszFilename);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
///////////////////////////////////////////
|
|
||||||
// Console window creation/setup functions
|
|
||||||
///////////////////////////////////////////
|
|
||||||
|
|
||||||
// gets Console options
|
|
||||||
BOOL GetOptions();
|
|
||||||
|
|
||||||
// registers Console window classes
|
|
||||||
BOOL RegisterWindowClasses();
|
|
||||||
|
|
||||||
// adds stuff to system and popup menus
|
|
||||||
BOOL SetupMenus();
|
|
||||||
|
|
||||||
// creates Console window
|
|
||||||
BOOL CreateConsoleWindow();
|
|
||||||
|
|
||||||
// creates new Console font
|
|
||||||
void CreateNewFont();
|
|
||||||
|
|
||||||
// creates new background brush
|
|
||||||
void CreateNewBrush();
|
|
||||||
|
|
||||||
// creates the cursor
|
|
||||||
void CreateCursor();
|
|
||||||
|
|
||||||
// creates offscreen painting buffers
|
|
||||||
void CreateOffscreenBuffers();
|
|
||||||
|
|
||||||
// creates background bitmap
|
|
||||||
void CreateBackgroundBitmap();
|
|
||||||
|
|
||||||
// called by the ::EnumDisplayMonitors to create background for each display
|
|
||||||
// static BOOL CALLBACK BackgroundEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData);
|
|
||||||
|
|
||||||
// gets character width and height
|
|
||||||
void GetTextSize();
|
|
||||||
|
|
||||||
// gets window borders (X, Y and caption sizes)
|
|
||||||
void GetBordersDimensions();
|
|
||||||
|
|
||||||
// calculates window and client area sizes
|
|
||||||
void CalcWindowSize();
|
|
||||||
|
|
||||||
// sets up window transparency (alpha, color key, fake)
|
|
||||||
// void SetWindowTransparency();
|
|
||||||
|
|
||||||
// sets scrollbar stuff
|
|
||||||
void SetScrollbarStuff();
|
|
||||||
|
|
||||||
// sets default console colors
|
|
||||||
void SetDefaultConsoleColors();
|
|
||||||
|
|
||||||
// sets window size and position
|
|
||||||
void SetWindowSizeAndPosition();
|
|
||||||
|
|
||||||
// sets Console's big, small and tray icons
|
|
||||||
void SetWindowIcons();
|
|
||||||
|
|
||||||
// sets up traybar icon
|
|
||||||
BOOL SetTrayIcon(DWORD dwMessage);
|
|
||||||
|
|
||||||
// destroys Console cursor
|
|
||||||
void DestroyCursor();
|
|
||||||
|
|
||||||
// opens the configuration file in a text editor
|
|
||||||
void EditConfigFile();
|
|
||||||
|
|
||||||
// reloads Console settings
|
|
||||||
void ReloadSettings();
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////
|
|
||||||
// windows console functions
|
|
||||||
/////////////////////////////
|
|
||||||
|
|
||||||
// allocates the console and starts the command shell
|
|
||||||
BOOL StartShellProcess();
|
|
||||||
|
|
||||||
// refreshes m_hStdOutFresh handle
|
|
||||||
void RefreshStdOut();
|
|
||||||
|
|
||||||
// gets a fresh console output
|
|
||||||
void RefreshScreenBuffer();
|
|
||||||
|
|
||||||
// sets initial windows console size
|
|
||||||
void InitConsoleWndSize(DWORD dwColumns);
|
|
||||||
|
|
||||||
// resizes the windows console
|
|
||||||
void ResizeConsoleWindow();
|
|
||||||
|
|
||||||
// Allocates the screen buffer
|
|
||||||
void AllocateBuffer();
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
// painting functions
|
|
||||||
//////////////////////
|
|
||||||
|
|
||||||
// repaints the memory hdc
|
|
||||||
void RepaintWindow();
|
|
||||||
|
|
||||||
// repaints the memory hdc (paint only changes)
|
|
||||||
void RepaintWindowChanges();
|
|
||||||
|
|
||||||
// draws the cursor
|
|
||||||
void DrawCursor(BOOL bOnlyCursor = FALSE);
|
|
||||||
|
|
||||||
// two helper functions for DrawCursor method
|
|
||||||
|
|
||||||
// returns cursor rectangle
|
|
||||||
inline void GetCursorRect(RECT& rectCursor);
|
|
||||||
// draws cursor background and returns the cursor rectangle
|
|
||||||
inline void DrawCursorBackground(RECT& rectCursor);
|
|
||||||
|
|
||||||
// clears text selection
|
|
||||||
void ClearSelection();
|
|
||||||
|
|
||||||
// returns the console text change rate since the last painting
|
|
||||||
// (using this value we decide whether to repaint entire window
|
|
||||||
// or just the changes)
|
|
||||||
DWORD GetChangeRate();
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////
|
|
||||||
// window state functions
|
|
||||||
//////////////////////////
|
|
||||||
|
|
||||||
// shows/hides Console window
|
|
||||||
void ShowHideWindow();
|
|
||||||
|
|
||||||
// shows/hides windows console window
|
|
||||||
void ShowHideConsole();
|
|
||||||
|
|
||||||
// shows/hides windows console window after a timeout (used during
|
|
||||||
// shell startup)
|
|
||||||
void ShowHideConsoleTimeout();
|
|
||||||
|
|
||||||
// toggles 'always on top' status
|
|
||||||
void ToggleWindowOnTop();
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////
|
|
||||||
// menu functions
|
|
||||||
//////////////////
|
|
||||||
|
|
||||||
// called by OnCommand and OnSysCommand to handle menu commands
|
|
||||||
BOOL HandleMenuCommand(DWORD dwID);
|
|
||||||
|
|
||||||
// updates popup and system menus for 'always on top' status
|
|
||||||
void UpdateOnTopMenuItem();
|
|
||||||
|
|
||||||
// updates popup and system menus for 'hide console' status
|
|
||||||
void UpdateHideConsoleMenuItem();
|
|
||||||
|
|
||||||
// updates configuration files submenu
|
|
||||||
void UpdateConfigFilesSubmenu();
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////
|
|
||||||
// clipboard functions
|
|
||||||
///////////////////////
|
|
||||||
|
|
||||||
// copies selected text to the clipboard
|
|
||||||
void CopyTextToClipboard();
|
|
||||||
|
|
||||||
// pastes text from the clipboard
|
|
||||||
void PasteClipoardText();
|
|
||||||
|
|
||||||
//////////////////
|
|
||||||
// misc functions
|
|
||||||
//////////////////
|
|
||||||
|
|
||||||
// shows Readme.txt file
|
|
||||||
void ShowReadmeFile();
|
|
||||||
|
|
||||||
// shows about dialog
|
|
||||||
void About();
|
|
||||||
|
|
||||||
// sends text to the windows console
|
|
||||||
void SendTextToConsole(const wchar_t *pszText);
|
|
||||||
|
|
||||||
// returns the full filename
|
|
||||||
tstring GetFullFilename(const tstring& strFilename);
|
|
||||||
|
|
||||||
// gets a desktop rectangle
|
|
||||||
void GetDesktopRect(RECT& rectDesktop);
|
|
||||||
|
|
||||||
// Pulls the text from the stdout or stderr handle (both are the same) and sends it to the console
|
|
||||||
void AddOutput();
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////
|
|
||||||
// 'gearbox' functions
|
|
||||||
///////////////////////
|
|
||||||
|
|
||||||
// Console window procedure
|
|
||||||
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
// shell activities monitor
|
|
||||||
static DWORD WINAPI MonitorThreadStatic(LPVOID lpParam);
|
|
||||||
DWORD MonitorThread();
|
|
||||||
|
|
||||||
// CTRL+C, CTRL+BREAK handler
|
|
||||||
static BOOL WINAPI CtrlHandler(DWORD dwCtrlType);
|
|
||||||
|
|
||||||
|
|
||||||
public: // public data
|
|
||||||
|
|
||||||
// Console window handle
|
|
||||||
HWND m_hWnd;
|
|
||||||
|
|
||||||
HWND m_notifyhWnd;
|
|
||||||
|
|
||||||
// console colors
|
|
||||||
COLORREF m_arrConsoleColors[16];
|
|
||||||
|
|
||||||
private: // private data
|
|
||||||
|
|
||||||
// readem filename
|
|
||||||
tstring m_strReadmeFile;
|
|
||||||
|
|
||||||
BOOL m_bInitializing;
|
|
||||||
BOOL m_bReloading;
|
|
||||||
|
|
||||||
tstring m_strConfigFile;
|
|
||||||
tstring m_strConfigEditor;
|
|
||||||
tstring m_strConfigEditorParams;
|
|
||||||
|
|
||||||
// one of the RELOAD_NEW_CONFIG_* constants
|
|
||||||
// - specifies relaod behaviour when a new configuration is selected
|
|
||||||
// (auto reload, don't reload, ask user)
|
|
||||||
DWORD m_dwReloadNewConfigDefault;
|
|
||||||
DWORD m_dwReloadNewConfig;
|
|
||||||
|
|
||||||
tstring m_strShell;
|
|
||||||
tstring m_strShellCmdLine;
|
|
||||||
|
|
||||||
// handle to invisible window - used for hiding the taskbar button in tray and 'hidden' modes
|
|
||||||
HWND m_hwndInvisParent;
|
|
||||||
|
|
||||||
// memory device context that holds console output image
|
|
||||||
HDC m_hdcConsole;
|
|
||||||
// memory device context for an off-screen window buffer (used to
|
|
||||||
// compose an image from m_hdcConsole and m_hdcSelection if text
|
|
||||||
// selection is active)
|
|
||||||
HDC m_hdcWindow;
|
|
||||||
|
|
||||||
// a bitmap used for drawing in the console memory DC
|
|
||||||
HBITMAP m_hbmpConsole;
|
|
||||||
HBITMAP m_hbmpConsoleOld;
|
|
||||||
|
|
||||||
// a bitmap used for drawing in the window memory DC
|
|
||||||
HBITMAP m_hbmpWindow;
|
|
||||||
HBITMAP m_hbmpWindowOld;
|
|
||||||
|
|
||||||
// brush for painting background
|
|
||||||
HBRUSH m_hBkBrush;
|
|
||||||
|
|
||||||
// master repaint timer interval (runs independent of changes in the
|
|
||||||
// console)
|
|
||||||
DWORD m_dwMasterRepaintInt;
|
|
||||||
|
|
||||||
// change repaint timer interval (when a change occurs, repainting
|
|
||||||
// will be postponed for this interval)
|
|
||||||
DWORD m_dwChangeRepaintInt;
|
|
||||||
|
|
||||||
// icon filename
|
|
||||||
tstring m_strIconFilename;
|
|
||||||
// program icons
|
|
||||||
HICON m_hSmallIcon;
|
|
||||||
HICON m_hBigIcon;
|
|
||||||
|
|
||||||
// popup menu
|
|
||||||
HMENU m_hPopupMenu;
|
|
||||||
|
|
||||||
// system (taskbar button) menu
|
|
||||||
HMENU m_hSysMenu;
|
|
||||||
|
|
||||||
// submenu for the XML (config) files
|
|
||||||
HMENU m_hConfigFilesMenu;
|
|
||||||
|
|
||||||
// set to TRUE if the popup menu is disabled
|
|
||||||
BOOL m_bPopupMenuDisabled;
|
|
||||||
|
|
||||||
// Console window title variables
|
|
||||||
// holds the default console title ("console" or the one passed in the cmdline param)
|
|
||||||
tstring m_strWindowTitleDefault;
|
|
||||||
// holds the window title (default title, or the one from the config file)
|
|
||||||
tstring m_strWindowTitle;
|
|
||||||
// holds the current window title
|
|
||||||
tstring m_strWindowTitleCurrent;
|
|
||||||
|
|
||||||
// font data
|
|
||||||
tstring m_strFontName;
|
|
||||||
DWORD m_dwFontSize;
|
|
||||||
BOOL m_bBold;
|
|
||||||
BOOL m_bItalic;
|
|
||||||
BOOL m_bUseFontColor;
|
|
||||||
COLORREF m_crFontColor;
|
|
||||||
HFONT m_hFont;
|
|
||||||
HFONT m_hFontOld;
|
|
||||||
|
|
||||||
// window X and Y positions
|
|
||||||
int m_nX;
|
|
||||||
int m_nY;
|
|
||||||
|
|
||||||
// client area inside border (gives a more 'relaxed' look to windows)
|
|
||||||
int m_nInsideBorder;
|
|
||||||
|
|
||||||
// window width and height
|
|
||||||
int m_nWindowWidth;
|
|
||||||
int m_nWindowHeight;
|
|
||||||
|
|
||||||
// window border sizes
|
|
||||||
int m_nXBorderSize;
|
|
||||||
int m_nYBorderSize;
|
|
||||||
int m_nCaptionSize;
|
|
||||||
|
|
||||||
// client area widht/height
|
|
||||||
int m_nClientWidth;
|
|
||||||
int m_nClientHeight;
|
|
||||||
|
|
||||||
// char height and width (used in window repainting)
|
|
||||||
// Note: width is used only for fixed-pitch fonts to speed up
|
|
||||||
// repainting
|
|
||||||
int m_nCharHeight;
|
|
||||||
int m_nCharWidth;
|
|
||||||
|
|
||||||
// window border type
|
|
||||||
// 0 - none
|
|
||||||
// 1 - regular window
|
|
||||||
// 2 - 1-pixel thin border
|
|
||||||
DWORD m_dwWindowBorder;
|
|
||||||
|
|
||||||
// scrollbar stuff
|
|
||||||
BOOL m_bShowScrollbar;
|
|
||||||
int m_nScrollbarStyle;
|
|
||||||
COLORREF m_crScrollbarColor;
|
|
||||||
int m_nScrollbarWidth;
|
|
||||||
int m_nScrollbarButtonHeight;
|
|
||||||
int m_nScrollbarThunmbHeight;
|
|
||||||
|
|
||||||
// what to do with the taskbar button
|
|
||||||
// if the taskbar button is hidden, or placed in the traybar, you
|
|
||||||
// can't ALT-TAB to console (take care when using with color key
|
|
||||||
// transparency :-)
|
|
||||||
// 0 - nothing
|
|
||||||
// 1 - hide it
|
|
||||||
// 2 - put icon to traybar
|
|
||||||
DWORD m_dwTaskbarButton;
|
|
||||||
|
|
||||||
// set to TRUE if the window can be dragged by left-click hold
|
|
||||||
BOOL m_bMouseDragable;
|
|
||||||
|
|
||||||
// snap distance
|
|
||||||
int m_nSnapDst;
|
|
||||||
|
|
||||||
// window docking position
|
|
||||||
// 0 - no dock
|
|
||||||
// 1 - top left
|
|
||||||
// 2 - top right
|
|
||||||
// 3 - bottom right
|
|
||||||
// 4 - bottom left
|
|
||||||
DWORD m_dwDocked;
|
|
||||||
|
|
||||||
// window Z-ordering
|
|
||||||
// 0 - regular
|
|
||||||
// 1 - always on top
|
|
||||||
// 2 - always on bottom
|
|
||||||
DWORD m_dwOriginalZOrder;
|
|
||||||
DWORD m_dwCurrentZOrder;
|
|
||||||
|
|
||||||
// Win2000/XP transparency
|
|
||||||
// 0 - none
|
|
||||||
// 1 - alpha blending
|
|
||||||
// 2 - colorkey
|
|
||||||
// 3 - fake transparency
|
|
||||||
DWORD m_dwTransparency;
|
|
||||||
|
|
||||||
// alpha value for alpha blending (Win2000 and later only!)
|
|
||||||
BYTE m_byAlpha;
|
|
||||||
|
|
||||||
// alpha value for inactive window
|
|
||||||
BYTE m_byInactiveAlpha;
|
|
||||||
|
|
||||||
COLORREF m_crBackground;
|
|
||||||
COLORREF m_crConsoleBackground;
|
|
||||||
|
|
||||||
// this is used for tinting background images and fake transparencies
|
|
||||||
BOOL m_bTintSet;
|
|
||||||
BYTE m_byTintOpacity;
|
|
||||||
BYTE m_byTintR;
|
|
||||||
BYTE m_byTintG;
|
|
||||||
BYTE m_byTintB;
|
|
||||||
|
|
||||||
// used when background is an image
|
|
||||||
BOOL m_bBitmapBackground;
|
|
||||||
tstring m_strBackgroundFile;
|
|
||||||
HDC m_hdcBackground;
|
|
||||||
HBITMAP m_hbmpBackground;
|
|
||||||
HBITMAP m_hbmpBackgroundOld;
|
|
||||||
|
|
||||||
// background attributes
|
|
||||||
|
|
||||||
// one of BACKGROUND_STYLE_ #defines
|
|
||||||
DWORD m_dwBackgroundStyle;
|
|
||||||
// set to true for relative background
|
|
||||||
BOOL m_bRelativeBackground;
|
|
||||||
// set to true to extend the background to all monitors
|
|
||||||
BOOL m_bExtendBackground;
|
|
||||||
|
|
||||||
// offsets used for multiple monitors and relative backgrounds (fake transparency, too)
|
|
||||||
int m_nBackgroundOffsetX;
|
|
||||||
int m_nBackgroundOffsetY;
|
|
||||||
|
|
||||||
// used for showing/hiding main window
|
|
||||||
BOOL m_bHideWindow;
|
|
||||||
// set to TRUE when the real console is hidden
|
|
||||||
BOOL m_bHideConsole;
|
|
||||||
|
|
||||||
// timeout used when hiding console window for the first time (some
|
|
||||||
// shells need console window visible during startup)
|
|
||||||
DWORD m_dwHideConsoleTimeout;
|
|
||||||
|
|
||||||
// if set to TRUE, Console will be started minimized
|
|
||||||
BOOL m_bStartMinimized;
|
|
||||||
|
|
||||||
|
|
||||||
// cursor style
|
|
||||||
// 0 - none
|
|
||||||
// 1 - XTerm
|
|
||||||
// 2 - block cursor
|
|
||||||
// 3 - bar cursor
|
|
||||||
// 4 - console cursor
|
|
||||||
// 5 - horizontal line
|
|
||||||
// 6 - vertical line
|
|
||||||
// 7 - pulse rect
|
|
||||||
// 8 - fading block
|
|
||||||
DWORD m_dwCursorStyle;
|
|
||||||
|
|
||||||
COLORREF m_crCursorColor;
|
|
||||||
|
|
||||||
// console screen buffer info for cursor
|
|
||||||
CONSOLE_SCREEN_BUFFER_INFO m_csbiCursor;
|
|
||||||
|
|
||||||
// wether console cursor is visible or not
|
|
||||||
BOOL m_bCursorVisible;
|
|
||||||
|
|
||||||
class Cursor* m_pCursor;
|
|
||||||
|
|
||||||
// mouse cursor offset within the window (used for moving the window)
|
|
||||||
POINT m_mouseCursorOffset;
|
|
||||||
|
|
||||||
/////////////////////
|
|
||||||
// console stuff
|
|
||||||
|
|
||||||
// console window handle
|
|
||||||
HWND m_hWndConsole;
|
|
||||||
|
|
||||||
// console screen buffer info for console repainting
|
|
||||||
CONSOLE_SCREEN_BUFFER_INFO m_csbiConsole;
|
|
||||||
|
|
||||||
// console stdouts
|
|
||||||
HANDLE m_hStdOut;
|
|
||||||
HANDLE m_hStdOutFresh;
|
|
||||||
|
|
||||||
// set when quitting the application
|
|
||||||
HANDLE m_hQuitEvent;
|
|
||||||
|
|
||||||
// set by monitor thread when detects console process exit
|
|
||||||
HANDLE m_hConsoleProcess;
|
|
||||||
|
|
||||||
// handle to monitor thread
|
|
||||||
HANDLE m_hMonitorThread;
|
|
||||||
|
|
||||||
// console rows & columns
|
|
||||||
DWORD m_dwRows;
|
|
||||||
DWORD m_dwColumns;
|
|
||||||
DWORD m_dwBufferRows;
|
|
||||||
BOOL m_bUseTextBuffer;
|
|
||||||
|
|
||||||
// set to one of TEXT_SELECTION_ #defines
|
|
||||||
int m_nTextSelection;
|
|
||||||
|
|
||||||
// X Windows style copy-on-select
|
|
||||||
BOOL m_bCopyOnSelect;
|
|
||||||
|
|
||||||
// Inverse the shift behaviour for selecting and dragging
|
|
||||||
BOOL m_bInverseShift;
|
|
||||||
|
|
||||||
COORD m_coordSelOrigin;
|
|
||||||
RECT m_rectSelection;
|
|
||||||
HDC m_hdcSelection;
|
|
||||||
HBITMAP m_hbmpSelection;
|
|
||||||
HBITMAP m_hbmpSelectionOld;
|
|
||||||
HBRUSH m_hbrushSelection;
|
|
||||||
|
|
||||||
CHAR_INFO* m_pScreenBuffer;
|
|
||||||
CHAR_INFO* m_pScreenBufferNew;
|
|
||||||
|
|
||||||
DWORD m_nTextColor;
|
|
||||||
DWORD m_nTextBgColor;
|
|
||||||
|
|
||||||
// Console window class names
|
|
||||||
static const TCHAR m_szConsoleClass[];
|
|
||||||
static const TCHAR m_szHiddenParentClass[];
|
|
||||||
|
|
||||||
// win console window title
|
|
||||||
static const tstring m_strWinConsoleTitle;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
//Microsoft Developer Studio generated resource script.
|
|
||||||
//
|
|
||||||
#include "res\resource.h"
|
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
|
||||||
#define IDC_STATIC 00
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
|
||||||
//
|
|
||||||
#include "windows.h"
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Neutral resources
|
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|
||||||
#pragma code_page(1250)
|
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Dialog
|
|
||||||
//
|
|
||||||
|
|
||||||
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 146, 87
|
|
||||||
STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND | DS_CENTER | WS_POPUP |
|
|
||||||
WS_CAPTION | WS_SYSMENU
|
|
||||||
CAPTION "About Console"
|
|
||||||
FONT 8, "MS Sans Serif"
|
|
||||||
BEGIN
|
|
||||||
DEFPUSHBUTTON "OK",IDOK,48,66,50,14
|
|
||||||
LTEXT "Console v1.5",IDC_STATIC,51,11,42,8
|
|
||||||
LTEXT "Copyright© 2001-2005 Marko Bozikovic",IDC_STATIC,9,30,
|
|
||||||
127,8
|
|
||||||
LTEXT "bozho@kset.org",IDC_STATIC,46,45,53,8
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// DESIGNINFO
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
GUIDELINES DESIGNINFO DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
IDD_ABOUT, DIALOG
|
|
||||||
BEGIN
|
|
||||||
LEFTMARGIN, 7
|
|
||||||
RIGHTMARGIN, 139
|
|
||||||
TOPMARGIN, 7
|
|
||||||
BOTTOMMARGIN, 80
|
|
||||||
END
|
|
||||||
END
|
|
||||||
#endif // APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
#endif // Neutral resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Neutral (Default) resources
|
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
|
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
|
|
||||||
#pragma code_page(1250)
|
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Icon
|
|
||||||
//
|
|
||||||
|
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
|
||||||
// remains consistent on all systems.
|
|
||||||
//IDI_ICON2 ICON DISCARDABLE "Console.ico"
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Menu
|
|
||||||
//
|
|
||||||
|
|
||||||
IDR_POPUP_MENU MENU DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
POPUP " "
|
|
||||||
BEGIN
|
|
||||||
// MENUITEM "Read&me", ID_SHOW_README_FILE
|
|
||||||
MENUITEM "&About Console", ID_ABOUT
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
MENUITEM "&Copy", ID_COPY
|
|
||||||
MENUITEM "&Paste", ID_PASTE
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
// MENUITEM "Always on &top", ID_TOGGLE_ONTOP
|
|
||||||
// MENUITEM "&Hide console", ID_HIDE_CONSOLE
|
|
||||||
// MENUITEM SEPARATOR
|
|
||||||
// MENUITEM "&Select configuration file", ID_SEL_CONFIG_FILE
|
|
||||||
// MENUITEM "&Edit configuration file", ID_EDIT_CONFIG_FILE
|
|
||||||
// MENUITEM "&Reload settings", ID_RELOAD_SETTINGS
|
|
||||||
// MENUITEM SEPARATOR
|
|
||||||
MENUITEM "E&xit", ID_EXIT_CONSOLE
|
|
||||||
END
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // Neutral (Default) resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Croatian resources
|
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HRV)
|
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_CROATIAN, SUBLANG_DEFAULT
|
|
||||||
#pragma code_page(1250)
|
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// TEXTINCLUDE
|
|
||||||
//
|
|
||||||
|
|
||||||
1 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"resource.h\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
2 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"#include ""afxres.h""\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
3 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _MAC
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Version
|
|
||||||
//
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION 1,5,0,351
|
|
||||||
PRODUCTVERSION 1,5,0,351
|
|
||||||
FILEFLAGSMASK 0x3fL
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS 0x1L
|
|
||||||
#else
|
|
||||||
FILEFLAGS 0x0L
|
|
||||||
#endif
|
|
||||||
FILEOS 0x40004L
|
|
||||||
FILETYPE 0x1L
|
|
||||||
FILESUBTYPE 0x0L
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "000004b0"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Comments", "A cool console window :-)\0"
|
|
||||||
VALUE "CompanyName", "Ingenuity Unlimited Ltd.\0"
|
|
||||||
VALUE "FileDescription", "Console\0"
|
|
||||||
VALUE "FileVersion", "1.5, Build 351 2005.09.22\0"
|
|
||||||
VALUE "InternalName", "Console\0"
|
|
||||||
VALUE "LegalCopyright", "Copyright © 2001-2004 Marko Bozikovic\0"
|
|
||||||
VALUE "LegalTrademarks", "Copyright © 2001-2004 Marko Bozikovic\0"
|
|
||||||
VALUE "OriginalFilename", "Console.exe\0"
|
|
||||||
VALUE "PrivateBuild", "\0"
|
|
||||||
VALUE "ProductName", "Console\0"
|
|
||||||
VALUE "ProductVersion", "1.5.00.351\0"
|
|
||||||
VALUE "SpecialBuild", "\0"
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x0, 1200
|
|
||||||
END
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // !_MAC
|
|
||||||
|
|
||||||
#endif // Croatian resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#endif // not APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
@@ -1,769 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Cursors.h - cursor classes
|
|
||||||
|
|
||||||
//#include "stdafx.h"
|
|
||||||
#include <Windows.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
#include "Cursors.h"
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
#define new DEBUG_NEW
|
|
||||||
#undef THIS_FILE
|
|
||||||
static char THIS_FILE[] = __FILE__;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// XTermCursor
|
|
||||||
|
|
||||||
XTermCursor::XTermCursor(HWND hwndConsole, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndConsole, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_hInactiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
XTermCursor::~XTermCursor() {
|
|
||||||
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
::DeleteObject(m_hInactiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void XTermCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
if (m_bActive) {
|
|
||||||
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
|
|
||||||
} else {
|
|
||||||
::FrameRect(m_hdcWindow, pRect, m_hInactiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void XTermCursor::PrepareNext() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// BlockCursor
|
|
||||||
|
|
||||||
BlockCursor::BlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_bVisible(TRUE)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockCursor::~BlockCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void BlockCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
if (m_bActive && m_bVisible) {
|
|
||||||
|
|
||||||
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void BlockCursor::PrepareNext() {
|
|
||||||
|
|
||||||
m_bVisible = !m_bVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBBlockCursor
|
|
||||||
|
|
||||||
NBBlockCursor::NBBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NBBlockCursor::~NBBlockCursor() {
|
|
||||||
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBBlockCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
::FillRect(m_hdcWindow, pRect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBBlockCursor::PrepareNext() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// PulseBlockCursor
|
|
||||||
|
|
||||||
PulseBlockCursor::PulseBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_nSize(0)
|
|
||||||
, m_nMaxSize(0)
|
|
||||||
, m_nStep(0)
|
|
||||||
{
|
|
||||||
::ZeroMemory(&m_rect, sizeof(RECT));
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
PulseBlockCursor::~PulseBlockCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void PulseBlockCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
// this is called only once, to set the size of the cursor
|
|
||||||
if (m_nMaxSize == 0) {
|
|
||||||
if ((pRect->right - pRect->left) < (pRect->bottom - pRect->top)) {
|
|
||||||
m_nMaxSize = (pRect->right - pRect->left) >> 1;
|
|
||||||
} else {
|
|
||||||
m_nMaxSize = (pRect->bottom - pRect->top) >> 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bActive) {
|
|
||||||
RECT rect;
|
|
||||||
::CopyMemory(&rect, pRect, sizeof(RECT));
|
|
||||||
rect.left += m_nSize;
|
|
||||||
rect.top += m_nSize;
|
|
||||||
rect.right -= m_nSize;
|
|
||||||
rect.bottom -= m_nSize;
|
|
||||||
::FillRect(m_hdcWindow, &rect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void PulseBlockCursor::PrepareNext() {
|
|
||||||
|
|
||||||
if (m_nSize == 0) {
|
|
||||||
m_nStep = 1;
|
|
||||||
} else if (m_nSize == m_nMaxSize) {
|
|
||||||
m_nStep = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_nSize += m_nStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// BarCursor
|
|
||||||
|
|
||||||
BarCursor::BarCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
|
|
||||||
, m_bVisible(TRUE)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
BarCursor::~BarCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
|
|
||||||
::DeleteObject(m_hPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void BarCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
if (m_bActive && m_bVisible) {
|
|
||||||
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
|
|
||||||
::MoveToEx(m_hdcWindow, pRect->left, pRect->top, NULL);
|
|
||||||
::LineTo(m_hdcWindow, pRect->left, pRect->bottom);
|
|
||||||
::SelectObject(m_hdcWindow, hOldPen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void BarCursor::PrepareNext() {
|
|
||||||
|
|
||||||
m_bVisible = !m_bVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// ConsoleCursor
|
|
||||||
|
|
||||||
ConsoleCursor::ConsoleCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hStdOut(::CreateFile(_T("CONOUT$"), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0))
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_bVisible(TRUE)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleCursor::~ConsoleCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
::CloseHandle(m_hStdOut);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void ConsoleCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
|
|
||||||
::CopyMemory(&rect, pRect, sizeof(RECT));
|
|
||||||
|
|
||||||
if (m_bActive && m_bVisible) {
|
|
||||||
|
|
||||||
rect.top += (rect.bottom - rect.top) * 80 / 100;
|
|
||||||
|
|
||||||
::FillRect(m_hdcWindow, &rect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void ConsoleCursor::PrepareNext() {
|
|
||||||
|
|
||||||
m_bVisible = !m_bVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBHLineCursor
|
|
||||||
|
|
||||||
NBHLineCursor::NBHLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NBHLineCursor::~NBHLineCursor() {
|
|
||||||
|
|
||||||
::DeleteObject(m_hPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBHLineCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
|
|
||||||
::MoveToEx(m_hdcWindow, pRect->left, pRect->bottom-1, NULL);
|
|
||||||
::LineTo(m_hdcWindow, pRect->right, pRect->bottom-1);
|
|
||||||
::SelectObject(m_hdcWindow, hOldPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBHLineCursor::PrepareNext() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// HLineCursor
|
|
||||||
|
|
||||||
HLineCursor::HLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
|
|
||||||
, m_nSize(0)
|
|
||||||
, m_nPosition(0)
|
|
||||||
, m_nStep(0)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
HLineCursor::~HLineCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
|
|
||||||
::DeleteObject(m_hPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void HLineCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
// this is called only once, to set the size of the cursor
|
|
||||||
if (m_nSize != (pRect->bottom - pRect->top - 1)) {
|
|
||||||
m_nSize = pRect->bottom - pRect->top - 1;
|
|
||||||
m_nPosition = 0;
|
|
||||||
m_nStep = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bActive) {
|
|
||||||
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
|
|
||||||
::MoveToEx(m_hdcWindow, pRect->left, pRect->top + m_nPosition, NULL);
|
|
||||||
::LineTo(m_hdcWindow, pRect->right, pRect->top + m_nPosition);
|
|
||||||
::SelectObject(m_hdcWindow, hOldPen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void HLineCursor::PrepareNext() {
|
|
||||||
|
|
||||||
if (m_nPosition == 0) {
|
|
||||||
m_nStep = 1;
|
|
||||||
} else if (m_nPosition == m_nSize) {
|
|
||||||
m_nStep = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_nPosition += m_nStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// VLineCursor
|
|
||||||
|
|
||||||
VLineCursor::VLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hPen(::CreatePen(PS_SOLID, 1, crCursorColor))
|
|
||||||
, m_nSize(0)
|
|
||||||
, m_nPosition(0)
|
|
||||||
, m_nStep(0)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
VLineCursor::~VLineCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
|
|
||||||
::DeleteObject(m_hPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void VLineCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
// this is called only once, to set the size of the cursor
|
|
||||||
if (m_nSize != (pRect->right - pRect->left - 1)) {
|
|
||||||
m_nSize = pRect->right - pRect->left - 1;
|
|
||||||
m_nPosition = 0;
|
|
||||||
m_nStep = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bActive) {
|
|
||||||
HPEN hOldPen = (HPEN)::SelectObject(m_hdcWindow, m_hPen);
|
|
||||||
::MoveToEx(m_hdcWindow, pRect->left + m_nPosition, pRect->top, NULL);
|
|
||||||
::LineTo(m_hdcWindow, pRect->left + m_nPosition, pRect->bottom);
|
|
||||||
::SelectObject(m_hdcWindow, hOldPen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void VLineCursor::PrepareNext() {
|
|
||||||
|
|
||||||
if (m_nPosition == 0) {
|
|
||||||
m_nStep = 1;
|
|
||||||
} else if (m_nPosition == m_nSize) {
|
|
||||||
m_nStep = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_nPosition += m_nStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// RectCursor
|
|
||||||
|
|
||||||
RectCursor::RectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_bVisible(TRUE)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 750, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
RectCursor::~RectCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void RectCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
if (m_bActive && m_bVisible) {
|
|
||||||
|
|
||||||
::FrameRect(m_hdcWindow, pRect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void RectCursor::PrepareNext() {
|
|
||||||
|
|
||||||
m_bVisible = !m_bVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBRectCursor
|
|
||||||
|
|
||||||
NBRectCursor::NBRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NBRectCursor::~NBRectCursor() {
|
|
||||||
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBRectCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
::FrameRect(m_hdcWindow, pRect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void NBRectCursor::PrepareNext() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// PulseRectCursor
|
|
||||||
|
|
||||||
PulseRectCursor::PulseRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_hActiveBrush(::CreateSolidBrush(crCursorColor))
|
|
||||||
, m_nSize(0)
|
|
||||||
, m_nMaxSize(0)
|
|
||||||
, m_nStep(0)
|
|
||||||
{
|
|
||||||
::ZeroMemory(&m_rect, sizeof(RECT));
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 100, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
PulseRectCursor::~PulseRectCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
::DeleteObject(m_hActiveBrush);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void PulseRectCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
// this is called only once, to set the size of the cursor
|
|
||||||
if (m_nMaxSize == 0) {
|
|
||||||
if ((pRect->right - pRect->left) < (pRect->bottom - pRect->top)) {
|
|
||||||
m_nMaxSize = (pRect->right - pRect->left) >> 1;
|
|
||||||
} else {
|
|
||||||
m_nMaxSize = (pRect->bottom - pRect->top) >> 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bActive) {
|
|
||||||
RECT rect;
|
|
||||||
::CopyMemory(&rect, pRect, sizeof(RECT));
|
|
||||||
rect.left += m_nSize;
|
|
||||||
rect.top += m_nSize;
|
|
||||||
rect.right -= m_nSize;
|
|
||||||
rect.bottom -= m_nSize;
|
|
||||||
::FrameRect(m_hdcWindow, &rect, m_hActiveBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void PulseRectCursor::PrepareNext() {
|
|
||||||
|
|
||||||
if (m_nSize == 0) {
|
|
||||||
m_nStep = 1;
|
|
||||||
} else if (m_nSize == m_nMaxSize) {
|
|
||||||
m_nStep = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_nSize += m_nStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FadeBlockCursor
|
|
||||||
|
|
||||||
FadeBlockCursor::FadeBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor, COLORREF crBkColor)
|
|
||||||
: Cursor(hwndParent, hdcWindow, crCursorColor)
|
|
||||||
, m_crCursorColor(crCursorColor)
|
|
||||||
, m_nStep(1)
|
|
||||||
, m_crBkColor(crBkColor)
|
|
||||||
, m_nIndex(0)
|
|
||||||
, m_hUser32(NULL)
|
|
||||||
, m_hMemDC(NULL)
|
|
||||||
{
|
|
||||||
m_uiTimer = ::SetTimer(hwndParent, CURSOR_TIMER, 35, NULL);
|
|
||||||
|
|
||||||
FakeBlend();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
FadeBlockCursor::~FadeBlockCursor() {
|
|
||||||
|
|
||||||
if (m_uiTimer) ::KillTimer(m_hwndParent, m_uiTimer);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void FadeBlockCursor::Draw(LPRECT pRect) {
|
|
||||||
|
|
||||||
|
|
||||||
HBRUSH hBrush = ::CreateSolidBrush(m_arrColors[m_nIndex]);
|
|
||||||
::FillRect(m_hdcWindow, pRect, hBrush);
|
|
||||||
::DeleteObject(hBrush);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void FadeBlockCursor::PrepareNext() {
|
|
||||||
if (m_nIndex == 0) {
|
|
||||||
m_nStep = 1;
|
|
||||||
} else if (m_nIndex == (FADE_STEPS)) {
|
|
||||||
m_nStep = -1;
|
|
||||||
}
|
|
||||||
m_nIndex += m_nStep;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// This function is used to create a fake blending for WinNT (uuseful only
|
|
||||||
// for solid background, though)
|
|
||||||
|
|
||||||
void FadeBlockCursor::FakeBlend() {
|
|
||||||
|
|
||||||
int nDeltaR = ((GetRValue(m_crCursorColor) - GetRValue(m_crBkColor)) << 8) / FADE_STEPS;
|
|
||||||
int nDeltaG = ((GetGValue(m_crCursorColor) - GetGValue(m_crBkColor)) << 8) / FADE_STEPS;
|
|
||||||
int nDeltaB = ((GetBValue(m_crCursorColor) - GetBValue(m_crBkColor)) << 8) / FADE_STEPS;
|
|
||||||
|
|
||||||
for (int i = 0; i < FADE_STEPS; ++i) {
|
|
||||||
m_arrColors[i] = RGB(GetRValue(m_crCursorColor) - (nDeltaR*i >> 8), GetGValue(m_crCursorColor) - (nDeltaG*i >> 8), GetBValue(m_crCursorColor) - (nDeltaB*i >> 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_arrColors[FADE_STEPS] = m_crBkColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,342 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Cursors.h - cursor classes
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define CURSOR_TIMER 45
|
|
||||||
|
|
||||||
extern BOOL g_bWin2000;
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// A base class for all the cursors
|
|
||||||
|
|
||||||
class Cursor {
|
|
||||||
public:
|
|
||||||
Cursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor)
|
|
||||||
: m_hwndParent(hwndParent)
|
|
||||||
, m_hdcWindow(hdcWindow)
|
|
||||||
, m_crCursorColor(crCursorColor)
|
|
||||||
, m_bActive(TRUE)
|
|
||||||
, m_uiTimer(0)
|
|
||||||
{};
|
|
||||||
|
|
||||||
virtual ~Cursor(){};
|
|
||||||
|
|
||||||
void SetState(BOOL bActive) {m_bActive = bActive;};
|
|
||||||
BOOL GetState() { return m_bActive; }
|
|
||||||
|
|
||||||
// used to draw current frame of the cursor
|
|
||||||
virtual void Draw(LPRECT pRect) = 0;
|
|
||||||
// used to prepare the next frame of cursor animation
|
|
||||||
virtual void PrepareNext() = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
HWND m_hwndParent;
|
|
||||||
HDC m_hdcWindow;
|
|
||||||
COLORREF m_crCursorColor;
|
|
||||||
|
|
||||||
BOOL m_bActive;
|
|
||||||
UINT m_uiTimer;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// XTermCursor
|
|
||||||
|
|
||||||
class XTermCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
XTermCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~XTermCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
HBRUSH m_hInactiveBrush;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// BlockCursor
|
|
||||||
|
|
||||||
class BlockCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
BlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~BlockCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
BOOL m_bVisible;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBBlockCursor
|
|
||||||
|
|
||||||
class NBBlockCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
NBBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~NBBlockCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// PulseBlockCursor
|
|
||||||
|
|
||||||
class PulseBlockCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
PulseBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~PulseBlockCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
RECT m_rect;
|
|
||||||
int m_nSize;
|
|
||||||
int m_nMaxSize;
|
|
||||||
int m_nStep;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// BarCursor
|
|
||||||
|
|
||||||
class BarCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
BarCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~BarCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HPEN m_hPen;
|
|
||||||
BOOL m_bVisible;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// ConsoleCursor
|
|
||||||
|
|
||||||
class ConsoleCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
ConsoleCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~ConsoleCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HANDLE m_hStdOut;
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
BOOL m_bVisible;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBHLineCursor
|
|
||||||
|
|
||||||
class NBHLineCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
NBHLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~NBHLineCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HPEN m_hPen;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// HLineCursor
|
|
||||||
|
|
||||||
class HLineCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
HLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~HLineCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HPEN m_hPen;
|
|
||||||
int m_nSize;
|
|
||||||
int m_nPosition;
|
|
||||||
int m_nStep;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// VLineCursor
|
|
||||||
|
|
||||||
class VLineCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
VLineCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~VLineCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HPEN m_hPen;
|
|
||||||
int m_nSize;
|
|
||||||
int m_nPosition;
|
|
||||||
int m_nStep;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// RectCursor
|
|
||||||
|
|
||||||
class RectCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
RectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~RectCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
BOOL m_bVisible;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NBRectCursor
|
|
||||||
|
|
||||||
class NBRectCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
NBRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~NBRectCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// PulseRectCursor
|
|
||||||
|
|
||||||
class PulseRectCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
PulseRectCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor);
|
|
||||||
~PulseRectCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
HBRUSH m_hActiveBrush;
|
|
||||||
RECT m_rect;
|
|
||||||
int m_nSize;
|
|
||||||
int m_nMaxSize;
|
|
||||||
int m_nStep;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FadeBlockCursor
|
|
||||||
|
|
||||||
#define FADE_STEPS 20
|
|
||||||
#define ALPHA_STEP 12
|
|
||||||
|
|
||||||
#define BLEND_BMP_WIDTH 10
|
|
||||||
#define BLEND_BMP_HEIGHT 20
|
|
||||||
|
|
||||||
class FadeBlockCursor : public Cursor {
|
|
||||||
public:
|
|
||||||
FadeBlockCursor(HWND hwndParent, HDC hdcWindow, COLORREF crCursorColor, COLORREF crBkColor);
|
|
||||||
~FadeBlockCursor();
|
|
||||||
|
|
||||||
void Draw(LPRECT pRect);
|
|
||||||
void PrepareNext();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void FakeBlend();
|
|
||||||
|
|
||||||
COLORREF m_crCursorColor;
|
|
||||||
int m_nStep;
|
|
||||||
|
|
||||||
// used under WinNT 4.0
|
|
||||||
COLORREF m_crBkColor;
|
|
||||||
COLORREF m_arrColors[FADE_STEPS+1];
|
|
||||||
int m_nIndex;
|
|
||||||
|
|
||||||
// these are used under Win2000 only
|
|
||||||
HMODULE m_hUser32;
|
|
||||||
BLENDFUNCTION m_bfn;
|
|
||||||
HDC m_hMemDC;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Dialogs.h - dialog classes
|
|
||||||
//
|
|
||||||
// About dialog class, etc...
|
|
||||||
|
|
||||||
//#include "stdafx.h"
|
|
||||||
#include <Windows.h>
|
|
||||||
|
|
||||||
#include "resource.h"
|
|
||||||
#include "Console.h"
|
|
||||||
#include "Dialogs.h"
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
#define new DEBUG_NEW
|
|
||||||
#undef THIS_FILE
|
|
||||||
static char THIS_FILE[] = __FILE__;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern HINSTANCE ghInstance;
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// About dialog class
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Ctor/Dtor
|
|
||||||
|
|
||||||
CAboutDlg::CAboutDlg(HWND hwndParent)
|
|
||||||
: m_hWndParent(hwndParent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CAboutDlg::~CAboutDlg()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// public methods
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// DoModal - shows About dialog
|
|
||||||
|
|
||||||
BOOL CAboutDlg::DoModal()
|
|
||||||
{
|
|
||||||
::DialogBox(
|
|
||||||
ghInstance,
|
|
||||||
MAKEINTRESOURCE(IDD_ABOUT),
|
|
||||||
m_hWndParent,
|
|
||||||
CAboutDlg::DialogProc);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// message handlers
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// DialogProc - dialog window procedure
|
|
||||||
|
|
||||||
int CALLBACK CAboutDlg::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
switch (uMsg) {
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
switch (LOWORD(wParam)) {
|
|
||||||
case IDOK:
|
|
||||||
case IDCANCEL:
|
|
||||||
if (HIWORD(wParam) == BN_CLICKED) {
|
|
||||||
::EndDialog(hwndDlg, MB_OK);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Dialogs.h - dialog classes
|
|
||||||
//
|
|
||||||
// About dialog class, etc...
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// About dialog class
|
|
||||||
|
|
||||||
class CAboutDlg {
|
|
||||||
public:
|
|
||||||
CAboutDlg(HWND hwndParent);
|
|
||||||
~CAboutDlg();
|
|
||||||
|
|
||||||
// public methods
|
|
||||||
public:
|
|
||||||
|
|
||||||
// shows About dialog
|
|
||||||
BOOL DoModal();
|
|
||||||
|
|
||||||
// public data
|
|
||||||
public:
|
|
||||||
// parent window handle
|
|
||||||
HWND m_hWndParent;
|
|
||||||
|
|
||||||
// private methods
|
|
||||||
private:
|
|
||||||
/////////////////////////
|
|
||||||
// message handlers
|
|
||||||
|
|
||||||
// dialog window procedure
|
|
||||||
static int CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
|
||||||
|
|
||||||
// private data
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FileStream.cpp - implementation of IStream interface on any file
|
|
||||||
// (not strictly COM, I'm faking it here a bit :-)
|
|
||||||
//
|
|
||||||
|
|
||||||
#undef CINTERFACE
|
|
||||||
#include "builddefines.h"
|
|
||||||
|
|
||||||
//#include "stdafx.h"
|
|
||||||
//#include <atlbase.h>
|
|
||||||
#include <Windows.h>
|
|
||||||
#include <objidl.h>
|
|
||||||
#include "FileStream.h"
|
|
||||||
|
|
||||||
//#ifdef _DEBUG
|
|
||||||
//#define new DEBUG_NEW
|
|
||||||
#undef THIS_FILE
|
|
||||||
static char THIS_FILE[] = __FILE__;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// CreateFileStream - opens/creates a file and returns an IStream interface
|
|
||||||
|
|
||||||
HRESULT CreateFileStream(
|
|
||||||
LPCTSTR lpFileName, // file name
|
|
||||||
DWORD dwDesiredAccess, // access mode
|
|
||||||
DWORD dwShareMode, // share mode
|
|
||||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // SD
|
|
||||||
DWORD dwCreationDisposition, // how to create
|
|
||||||
DWORD dwFlagsAndAttributes, // file attributes
|
|
||||||
HANDLE hTemplateFile, // handle to template file
|
|
||||||
IStream** ppStream // pointer to IStream interface
|
|
||||||
)
|
|
||||||
{
|
|
||||||
|
|
||||||
HANDLE hFile = ::CreateFile(
|
|
||||||
lpFileName,
|
|
||||||
dwDesiredAccess,
|
|
||||||
dwShareMode,
|
|
||||||
lpSecurityAttributes,
|
|
||||||
dwCreationDisposition,
|
|
||||||
dwFlagsAndAttributes,
|
|
||||||
hTemplateFile);
|
|
||||||
|
|
||||||
if (hFile == INVALID_HANDLE_VALUE) {
|
|
||||||
// DWORD a = ::GetLastError();
|
|
||||||
ppStream = NULL;
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
FileStream* pFileStream = new FileStream(hFile);
|
|
||||||
|
|
||||||
return pFileStream->QueryInterface(IID_IStream, (void**)ppStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FileStream class
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// ctor/dtor
|
|
||||||
|
|
||||||
FileStream::FileStream(HANDLE hFile)
|
|
||||||
: m_lRefCount(0)
|
|
||||||
, m_hFile(hFile)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
FileStream::~FileStream()
|
|
||||||
{
|
|
||||||
if (m_hFile) ::CloseHandle(m_hFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// IStream methods
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Read - reads a specified number of bytes from the stream object into memory
|
|
||||||
// starting at the current seek pointer
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Read(void *pv, ULONG cb, ULONG *pcbRead)
|
|
||||||
{
|
|
||||||
if (!::ReadFile(m_hFile, pv, cb, pcbRead, NULL)) return S_FALSE;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Write - writes a specified number of bytes into the stream object starting
|
|
||||||
// at the current seek pointer
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Write(void const *pv, ULONG cb, ULONG *pcbWritten)
|
|
||||||
{
|
|
||||||
if (!::WriteFile(m_hFile, pv, cb, pcbWritten, NULL)) return S_FALSE;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Seek - changes the seek pointer to a new location relative to the beginning
|
|
||||||
// of the stream, to the end of the stream, or to the current seek pointer
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
|
||||||
{
|
|
||||||
DWORD dwFileOrigin;
|
|
||||||
|
|
||||||
DWORD dwMoveLow = dlibMove.LowPart;
|
|
||||||
LONG lMoveHigh = dlibMove.HighPart;
|
|
||||||
|
|
||||||
switch (dwOrigin) {
|
|
||||||
case STREAM_SEEK_SET : dwFileOrigin = FILE_BEGIN; break;
|
|
||||||
case STREAM_SEEK_CUR : dwFileOrigin = FILE_CURRENT; break;
|
|
||||||
case STREAM_SEEK_END : dwFileOrigin = FILE_END; break;
|
|
||||||
default:dwFileOrigin = FILE_BEGIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD dwRet = ::SetFilePointer(m_hFile, dwMoveLow, &lMoveHigh, dwFileOrigin);
|
|
||||||
|
|
||||||
if (::GetLastError() != NO_ERROR) return STG_E_INVALIDPOINTER;
|
|
||||||
|
|
||||||
plibNewPosition->LowPart = dwRet;
|
|
||||||
plibNewPosition->HighPart = lMoveHigh;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// SetSize - not really doing anything here
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::SetSize(ULARGE_INTEGER libNewSize)
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// CopyTo - copies a specified number of bytes from the current seek pointer
|
|
||||||
// in the stream to the current seek pointer in another stream
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
|
|
||||||
{
|
|
||||||
// later...
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Commit - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Commit(DWORD grfCommitFlags)
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Revert - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Revert(void)
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// LockRegion - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
|
||||||
{
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UnlockRegion - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
|
||||||
{
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Stat - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Stat(STATSTG *pstatstg, DWORD grfStatFlag)
|
|
||||||
{
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Clone - no work here...
|
|
||||||
|
|
||||||
STDMETHODIMP FileStream::Clone(IStream **ppstm)
|
|
||||||
{
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Copyright (C) 2001-2004 by Marko Bozikovic
|
|
||||||
// All rights reserved
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation; either version 2 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program 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 General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
//
|
|
||||||
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
|
|
||||||
// I'll try to keep a version up to date. I can be reached as follows:
|
|
||||||
// marko.bozikovic@alterbox.net
|
|
||||||
// bozho@kset.org
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FileStream.h - implementation of IStream interface on any file
|
|
||||||
// (not really COM, I'm faking it here a bit :-)
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// CreateFileStream - opens/creates a file and returns an IStream interface
|
|
||||||
|
|
||||||
HRESULT CreateFileStream(
|
|
||||||
LPCTSTR lpFileName, // file name
|
|
||||||
DWORD dwDesiredAccess, // access mode
|
|
||||||
DWORD dwShareMode, // share mode
|
|
||||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // SD
|
|
||||||
DWORD dwCreationDisposition, // how to create
|
|
||||||
DWORD dwFlagsAndAttributes, // file attributes
|
|
||||||
HANDLE hTemplateFile, // handle to template file
|
|
||||||
IStream** ppStream // pointer to IStream interface
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// FileStream class
|
|
||||||
|
|
||||||
class FileStream : public IStream {
|
|
||||||
public:
|
|
||||||
FileStream(HANDLE hFile);
|
|
||||||
~FileStream();
|
|
||||||
|
|
||||||
// IUnknown methods
|
|
||||||
STDMETHOD(QueryInterface)(REFIID riid, void ** ppv) {
|
|
||||||
if (riid == IID_IUnknown) {
|
|
||||||
*ppv = static_cast<IStream*>(this);
|
|
||||||
} else if (riid == IID_IStream) {
|
|
||||||
*ppv = static_cast<IStream*>(this);
|
|
||||||
} else {
|
|
||||||
*ppv = NULL;
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static_cast<IUnknown*>(*ppv)->AddRef();
|
|
||||||
return S_OK;
|
|
||||||
};
|
|
||||||
|
|
||||||
STDMETHOD_(ULONG, AddRef)(void) {
|
|
||||||
return ::InterlockedIncrement(&m_lRefCount);
|
|
||||||
};
|
|
||||||
|
|
||||||
STDMETHOD_(ULONG, Release)(void) {
|
|
||||||
long l = ::InterlockedDecrement(&m_lRefCount);
|
|
||||||
if (l == 0) delete this;
|
|
||||||
return l;
|
|
||||||
};
|
|
||||||
|
|
||||||
// IStream methods
|
|
||||||
STDMETHOD(Read)(void *pv, ULONG cb, ULONG *pcbRead);
|
|
||||||
STDMETHOD(Write)(void const *pv, ULONG cb, ULONG *pcbWritten);
|
|
||||||
STDMETHOD(Seek)(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
|
|
||||||
STDMETHOD(SetSize)(ULARGE_INTEGER libNewSize);
|
|
||||||
STDMETHOD(CopyTo)(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
|
|
||||||
STDMETHOD(Commit)(DWORD grfCommitFlags);
|
|
||||||
STDMETHOD(Revert)(void);
|
|
||||||
STDMETHOD(LockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
|
|
||||||
STDMETHOD(UnlockRegion)(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
|
|
||||||
STDMETHOD(Stat)(STATSTG *pstatstg, DWORD grfStatFlag);
|
|
||||||
STDMETHOD(Clone)(IStream **ppstm);
|
|
||||||
|
|
||||||
private: // private data
|
|
||||||
|
|
||||||
// reference count
|
|
||||||
long m_lRefCount;
|
|
||||||
|
|
||||||
// file handle
|
|
||||||
HANDLE m_hFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
-1200
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __BUTTON_DEFINES_H
|
#ifndef __BUTTON_DEFINES_H
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "interface.h"
|
#include "Interface.h"
|
||||||
#include "Isometric Utils.h"
|
#include "Isometric Utils.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __CURSOR_MODES_H
|
#ifndef __CURSOR_MODES_H
|
||||||
@@ -29,7 +29,7 @@ void IncreaseSelectionDensity();
|
|||||||
void DecreaseSelectionDensity();
|
void DecreaseSelectionDensity();
|
||||||
void RemoveCursors();
|
void RemoveCursors();
|
||||||
|
|
||||||
extern STR16 wszSelType[6];
|
extern STR16 *wszSelType;
|
||||||
|
|
||||||
extern BOOLEAN gfCurrentSelectionWithRightButton;
|
extern BOOLEAN gfCurrentSelectionWithRightButton;
|
||||||
|
|
||||||
@@ -40,4 +40,4 @@ extern BOOLEAN gfCurrentSelectionWithRightButton;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITOR_CALLBACK_PROTOTYPES_H
|
#ifndef __EDITOR_CALLBACK_PROTOTYPES_H
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "worlddef.h"
|
#include "worlddef.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
#include "Worldman.h"
|
#include "worldman.h"
|
||||||
|
|
||||||
BOOLEAN gfShowExitGrids = FALSE;
|
BOOLEAN gfShowExitGrids = FALSE;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITOR_MODES_H
|
#ifndef __EDITOR_MODES_H
|
||||||
@@ -14,4 +14,4 @@ void ShowExitGrids();
|
|||||||
void HideExitGrids();
|
void HideExitGrids();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//sgp
|
//sgp
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "debug.h"
|
#include "DEBUG.H"
|
||||||
//editor
|
//editor
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "Editor Callback Prototypes.h"
|
#include "Editor Callback Prototypes.h"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "EditorMapInfo.h"
|
#include "EditorMapInfo.h"
|
||||||
//tactical
|
//tactical
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "overhead types.h"
|
#include "Overhead Types.h"
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITOR_TASKBAR_CREATION_H
|
#ifndef __EDITOR_TASKBAR_CREATION_H
|
||||||
@@ -7,4 +7,4 @@
|
|||||||
void CreateEditorTaskbarInternal();
|
void CreateEditorTaskbarInternal();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
#include "WorldDat.h"
|
#include "WorldDat.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "wordwrap.h"
|
#include "WordWrap.h"
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "Interface Items.h"
|
#include "Interface Items.h"
|
||||||
#include "Soldier Find.h"
|
#include "Soldier Find.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Overhead map.h"
|
#include "overhead map.h"
|
||||||
#include "Cursor Modes.h"
|
#include "Cursor Modes.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "EditorTerrain.h"
|
#include "EditorTerrain.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITOR_TASKBAR_UTILS_H
|
#ifndef __EDITOR_TASKBAR_UTILS_H
|
||||||
@@ -67,4 +67,4 @@ extern UINT32 guiMercTempBuffer;
|
|||||||
extern INT32 giEditMercImage[2];
|
extern INT32 giEditMercImage[2];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "smooth.h"
|
#include "smooth.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "debug.h"
|
#include "DEBUG.H"
|
||||||
#include "Isometric Utils.h"
|
#include "Isometric Utils.h"
|
||||||
|
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "Cursor Modes.h"
|
#include "Cursor Modes.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
//dnl ch86 110214
|
//dnl ch86 110214
|
||||||
#include "keys.h"
|
#include "Keys.h"
|
||||||
#include "EditorItems.h"
|
#include "EditorItems.h"
|
||||||
#include "EditorMapInfo.h"
|
#include "EditorMapInfo.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITOR_UNDO_H
|
#ifndef __EDITOR_UNDO_H
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include "Editor Modes.h"
|
#include "Editor Modes.h"
|
||||||
#include "Smoothing Utils.h"
|
#include "Smoothing Utils.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "keys.h"
|
#include "Keys.h"
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "Simple Render Utils.h"
|
#include "Simple Render Utils.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITORBUILDINGS_H
|
#ifndef __EDITORBUILDINGS_H
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITORDEFINES_H
|
#ifndef __EDITORDEFINES_H
|
||||||
#define __EDITORDEFINES_H
|
#define __EDITORDEFINES_H
|
||||||
|
|
||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "Button Defines.h"
|
#include "Button Defines.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -9,34 +9,34 @@
|
|||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "wcheck.h"
|
#include "WCheck.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "interface panels.h"
|
#include "Interface Panels.h"
|
||||||
#include "interface items.h"
|
#include "Interface Items.h"
|
||||||
#include "text.h"
|
#include "Text.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "Action Items.h"
|
#include "Action Items.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "EditorItems.h"
|
#include "EditorItems.h"
|
||||||
#include "EditorMercs.h"
|
#include "EditorMercs.h"
|
||||||
#include "weapons.h"
|
#include "Weapons.h"
|
||||||
#include "Editor Taskbar Utils.h"
|
#include "Editor Taskbar Utils.h"
|
||||||
#include "wordwrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Item Statistics.h"
|
#include "Item Statistics.h"
|
||||||
#include "Simple Render Utils.h"
|
#include "Simple Render Utils.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "Pits.h"
|
#include "pits.h"
|
||||||
#include "keys.h"
|
#include "Keys.h"
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
#include "Editor Undo.h"//dnl ch86 220214
|
#include "Editor Undo.h"//dnl ch86 220214
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
|
|||||||
item = &Item[i];
|
item = &Item[i];
|
||||||
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
|
||||||
// continue;
|
// continue;
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(i))
|
||||||
continue;
|
continue;
|
||||||
if( i == SWITCH || i == ACTION_ITEM )
|
if( i == SWITCH || i == ACTION_ITEM )
|
||||||
{
|
{
|
||||||
@@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item = &Item[usCounter];
|
item = &Item[usCounter];
|
||||||
if(item->notineditor)
|
if(ItemIsNotInEditor(usCounter))
|
||||||
{
|
{
|
||||||
usCounter++;
|
usCounter++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITORITEMS_H
|
#ifndef __EDITORITEMS_H
|
||||||
|
|||||||
@@ -9,23 +9,23 @@
|
|||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "wcheck.h"
|
#include "WCheck.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "interface panels.h"
|
#include "Interface Panels.h"
|
||||||
#include "interface items.h"
|
#include "Interface Items.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "overhead.h" //GetSoldier
|
#include "Overhead.h" //GetSoldier
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "Animation Data.h"
|
#include "Animation Data.h"
|
||||||
#include "Animation Control.h"
|
#include "Animation Control.h"
|
||||||
@@ -37,11 +37,11 @@
|
|||||||
#include "Soldier Init List.h"
|
#include "Soldier Init List.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Soldier Add.h"
|
#include "Soldier Add.h"
|
||||||
#include "Soldier Profile Type.h"
|
#include "soldier profile type.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
#include "wordwrap.h"
|
#include "WordWrap.h"
|
||||||
#include "EditorItems.h"
|
#include "EditorItems.h"
|
||||||
#include "Editor Taskbar Utils.h"
|
#include "Editor Taskbar Utils.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITORMAPINFO_H
|
#ifndef __EDITORMAPINFO_H
|
||||||
|
|||||||
+15
-15
@@ -9,24 +9,24 @@
|
|||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "wcheck.h"
|
#include "WCheck.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "interface panels.h"
|
#include "Interface Panels.h"
|
||||||
#include "interface items.h"
|
#include "Interface Items.h"
|
||||||
#include "text.h"
|
#include "Text.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "overhead.h" //GetSoldier
|
#include "Overhead.h" //GetSoldier
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "Animation Data.h"
|
#include "Animation Data.h"
|
||||||
#include "Animation Control.h"
|
#include "Animation Control.h"
|
||||||
@@ -39,11 +39,11 @@
|
|||||||
#include "Soldier Init List.h"
|
#include "Soldier Init List.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Soldier Add.h"
|
#include "Soldier Add.h"
|
||||||
#include "Soldier Profile Type.h"
|
#include "soldier profile type.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
#include "wordwrap.h"
|
#include "WordWrap.h"
|
||||||
#include "EditorItems.h"
|
#include "EditorItems.h"
|
||||||
#include "Editor Taskbar Utils.h"
|
#include "Editor Taskbar Utils.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
@@ -162,7 +162,7 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate );
|
|||||||
void RenderMercInventoryPanel();
|
void RenderMercInventoryPanel();
|
||||||
void SetDroppableCheckboxesBasedOnMercsInventory();
|
void SetDroppableCheckboxesBasedOnMercsInventory();
|
||||||
|
|
||||||
extern BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
|
extern BOOLEAN InternalAddSoldierToSector( SoldierID ubID, BOOLEAN fCalculateDirection, BOOLEAN fUseAnimation, UINT16 usAnimState, UINT16 usAnimCode );
|
||||||
|
|
||||||
//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
|
//array which keeps track of which item is in which slot. This is dependant on the selected merc, so
|
||||||
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
|
//these temp values must be updated when different mercs are selected, and reset when a merc detailed
|
||||||
@@ -559,7 +559,7 @@ void AddMercToWorld( INT32 iMapIndex )
|
|||||||
|
|
||||||
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
SOLDIERINITNODE *pNode;
|
SOLDIERINITNODE *pNode;
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ void HandleRightClickOnMerc( INT32 iMapIndex )
|
|||||||
if ( gsSelectedMercID != sThisMercID )
|
if ( gsSelectedMercID != sThisMercID )
|
||||||
{ // We want to edit a new merc (or different merc)
|
{ // We want to edit a new merc (or different merc)
|
||||||
//We need to avoid the editing of player mercs.
|
//We need to avoid the editing of player mercs.
|
||||||
pNode = FindSoldierInitNodeWithID( (UINT8)sThisMercID );
|
pNode = FindSoldierInitNodeWithID( sThisMercID );
|
||||||
if( !pNode )
|
if( !pNode )
|
||||||
return; //this is a player merc (which isn't in the list), or an error in logic.
|
return; //this is a player merc (which isn't in the list), or an error in logic.
|
||||||
IndicateSelectedMerc( sThisMercID );
|
IndicateSelectedMerc( sThisMercID );
|
||||||
@@ -1634,7 +1634,7 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//search for the merc with the specific ID.
|
//search for the merc with the specific ID.
|
||||||
gpSelected = FindSoldierInitNodeWithID( (UINT8)sID );
|
gpSelected = FindSoldierInitNodeWithID( sID );
|
||||||
if( !gpSelected )
|
if( !gpSelected )
|
||||||
{
|
{
|
||||||
gsSelectedMercID = -1;
|
gsSelectedMercID = -1;
|
||||||
@@ -3783,7 +3783,7 @@ void PasteMercPlacement( INT32 iMapIndex )
|
|||||||
|
|
||||||
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
if( IsLocationSittable( iMapIndex, gfRoofPlacement ) )
|
||||||
{
|
{
|
||||||
UINT8 ubID;
|
SoldierID ubID;
|
||||||
INT16 sSectorX, sSectorY;
|
INT16 sSectorX, sSectorY;
|
||||||
SOLDIERINITNODE *pNode;
|
SOLDIERINITNODE *pNode;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -325,7 +325,7 @@ extern UINT8 gubCurrMercMode, gubPrevMercMode;
|
|||||||
|
|
||||||
#define NUM_DIFF_LVLS 5
|
#define NUM_DIFF_LVLS 5
|
||||||
|
|
||||||
extern STR16 zDiffNames[NUM_DIFF_LVLS];
|
extern STR16 *zDiffNames;
|
||||||
extern INT16 sCurBaseDiff;
|
extern INT16 sCurBaseDiff;
|
||||||
extern INT16 gsSelectedMercID;
|
extern INT16 gsSelectedMercID;
|
||||||
extern INT32 gsSelectedMercGridNo;
|
extern INT32 gsSelectedMercGridNo;
|
||||||
|
|||||||
@@ -9,18 +9,18 @@
|
|||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "wcheck.h"
|
#include "WCheck.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "interface panels.h"
|
#include "Interface Panels.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "EditorTerrain.h"
|
#include "EditorTerrain.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDITORTERRAIN_H
|
#ifndef __EDITORTERRAIN_H
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "font control.h"
|
#include "Font Control.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "Editor Taskbar Utils.h"
|
#include "Editor Taskbar Utils.h"
|
||||||
#include "EditorMercs.h"
|
#include "EditorMercs.h"
|
||||||
@@ -20,10 +20,10 @@
|
|||||||
#include "Weapons.h"
|
#include "Weapons.h"
|
||||||
#include "Items.h"
|
#include "Items.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
#include "Handle Items.h"
|
#include "Handle Items.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "PopupMenu.h"
|
#include "popupmenu.h"
|
||||||
#include "pits.h"
|
#include "pits.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifndef __ITEM_STATISTICS_H
|
#ifndef __ITEM_STATISTICS_H
|
||||||
#define __ITEM_STATISTICS_H
|
#define __ITEM_STATISTICS_H
|
||||||
|
|||||||
+13
-44
@@ -5,8 +5,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "render dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "loadscreen.h"
|
#include "LoadScreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "messagebox.h"
|
#include "messagebox.h"
|
||||||
@@ -83,9 +83,7 @@ INT32 iCurrFileShown;
|
|||||||
INT32 iLastFileClicked;
|
INT32 iLastFileClicked;
|
||||||
INT32 iLastClickTime;
|
INT32 iLastClickTime;
|
||||||
|
|
||||||
#ifdef USE_VFS
|
|
||||||
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
|
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
|
||||||
#endif
|
|
||||||
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
|
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
|
||||||
extern INT16 gsSelSectorX;
|
extern INT16 gsSelSectorX;
|
||||||
extern INT16 gsSelSectorY;
|
extern INT16 gsSelSectorY;
|
||||||
@@ -165,7 +163,6 @@ void LoadSaveScreenEntry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
iTopFileShown = iTotalFiles = 0;
|
iTopFileShown = iTotalFiles = 0;
|
||||||
#ifdef USE_VFS//dnl ch37 300909
|
|
||||||
gzProfileName[0] = 0;//dnl ch81 021213
|
gzProfileName[0] = 0;//dnl ch81 021213
|
||||||
FDLG_LIST* TempFileList = NULL;
|
FDLG_LIST* TempFileList = NULL;
|
||||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||||
@@ -176,7 +173,15 @@ void LoadSaveScreenEntry()
|
|||||||
vfs::CVirtualProfile* prof = it.value();
|
vfs::CVirtualProfile* prof = it.value();
|
||||||
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
||||||
strcpy(FileInfo.zFileName, "< ");
|
strcpy(FileInfo.zFileName, "< ");
|
||||||
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
// Cut filename off if it's too long for the buffer
|
||||||
|
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
|
||||||
|
{
|
||||||
|
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
||||||
|
}
|
||||||
strcat(FileInfo.zFileName, " >");
|
strcat(FileInfo.zFileName, " >");
|
||||||
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
||||||
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
||||||
@@ -220,25 +225,6 @@ void LoadSaveScreenEntry()
|
|||||||
}
|
}
|
||||||
while(FileList->pPrev)
|
while(FileList->pPrev)
|
||||||
FileList = FileList->pPrev;
|
FileList = FileList->pPrev;
|
||||||
#else
|
|
||||||
if(GetFileFirst("MAPS\\*.dat", &FileInfo))
|
|
||||||
{
|
|
||||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
|
||||||
{
|
|
||||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
|
||||||
iTotalFiles++;
|
|
||||||
}
|
|
||||||
while(GetFileNext(&FileInfo))
|
|
||||||
{
|
|
||||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
|
||||||
{
|
|
||||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
|
||||||
iTotalFiles++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GetFileClose(&FileInfo);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
|
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
|
||||||
|
|
||||||
swprintf( gzFilename, L"%S", gubFilename );
|
swprintf( gzFilename, L"%S", gubFilename );
|
||||||
@@ -283,7 +269,8 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
|
|||||||
{
|
{
|
||||||
if( gfReadOnly )
|
if( gfReadOnly )
|
||||||
{
|
{
|
||||||
FileClearAttributes( gszCurrFilename );
|
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here?
|
||||||
|
//FileClearAttributes( gszCurrFilename );
|
||||||
gfReadOnly = FALSE;
|
gfReadOnly = FALSE;
|
||||||
}
|
}
|
||||||
FileDelete( gszCurrFilename );
|
FileDelete( gszCurrFilename );
|
||||||
@@ -468,19 +455,6 @@ UINT32 LoadSaveScreenHandle(void)
|
|||||||
}
|
}
|
||||||
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
|
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
|
||||||
gfFileExists = FALSE;
|
gfFileExists = FALSE;
|
||||||
#ifndef USE_VFS
|
|
||||||
gfReadOnly = FALSE;
|
|
||||||
if(FileExists(gszCurrFilename))
|
|
||||||
{
|
|
||||||
gfFileExists = TRUE;
|
|
||||||
if(GetFileFirst(gszCurrFilename, &FileInfo))
|
|
||||||
{
|
|
||||||
if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY))
|
|
||||||
gfReadOnly = TRUE;
|
|
||||||
GetFileClose(&FileInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
gfReadOnly = TRUE;
|
gfReadOnly = TRUE;
|
||||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||||
vfs::CProfileStack::Iterator it = st->begin();
|
vfs::CProfileStack::Iterator it = st->begin();
|
||||||
@@ -502,7 +476,6 @@ UINT32 LoadSaveScreenHandle(void)
|
|||||||
}
|
}
|
||||||
it.next();
|
it.next();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if(gfReadOnly)
|
if(gfReadOnly)
|
||||||
{
|
{
|
||||||
CreateMessageBox(L" File is read only! Choose a different name? ");
|
CreateMessageBox(L" File is read only! Choose a different name? ");
|
||||||
@@ -726,7 +699,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
|
|||||||
iLastClickTime = iCurrClickTime;
|
iLastClickTime = iCurrClickTime;
|
||||||
iLastFileClicked = x;
|
iLastFileClicked = x;
|
||||||
//dnl ch81 021213
|
//dnl ch81 021213
|
||||||
#ifdef USE_VFS
|
|
||||||
gzProfileName[0] = 0;
|
gzProfileName[0] = 0;
|
||||||
while(FListNode = FListNode->pPrev)
|
while(FListNode = FListNode->pPrev)
|
||||||
{
|
{
|
||||||
@@ -737,7 +709,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
FListNode = FListNode->pNext;
|
FListNode = FListNode->pNext;
|
||||||
@@ -950,7 +921,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
SetInputFieldStringWith16BitString(0, L"");
|
SetInputFieldStringWith16BitString(0, L"");
|
||||||
wcscpy(gzFilename, L"");
|
wcscpy(gzFilename, L"");
|
||||||
}
|
}
|
||||||
#ifdef USE_VFS
|
|
||||||
gzProfileName[0] = 0;
|
gzProfileName[0] = 0;
|
||||||
while(curr = curr->pPrev)
|
while(curr = curr->pPrev)
|
||||||
{
|
{
|
||||||
@@ -961,7 +931,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -1,7 +1,7 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
#include "Fileman.h"
|
#include "FileMan.h"
|
||||||
|
|
||||||
#define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
|
#define FILENAME_BUFLEN (30 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0' //dnl ch81 021213
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
@@ -51,9 +51,7 @@ extern CHAR16 gzErrorCatchString[ 256 ];
|
|||||||
|
|
||||||
//dnl ch81 031213
|
//dnl ch81 031213
|
||||||
extern CHAR16 gzFilename[FILENAME_BUFLEN];
|
extern CHAR16 gzFilename[FILENAME_BUFLEN];
|
||||||
#ifdef USE_VFS
|
|
||||||
extern CHAR8 gzProfileName[FILENAME_BUFLEN];
|
extern CHAR8 gzProfileName[FILENAME_BUFLEN];
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Road Smoothing.h"
|
#include "Road Smoothing.h"
|
||||||
#include "tiledat.h"
|
#include "TileDat.h"
|
||||||
#include "worlddef.h"
|
#include "worlddef.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "Editor Undo.h"
|
#include "Editor Undo.h"
|
||||||
@@ -403,14 +403,42 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
|
|||||||
while( gRoadMacros[ i ].sMacroID == iMacroID )
|
while( gRoadMacros[ i ].sMacroID == iMacroID )
|
||||||
{
|
{
|
||||||
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
|
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
|
||||||
INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
|
INT32 sdY = gRoadMacros[ i ].sOffset / (OLD_WORLD_COLS);
|
||||||
INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
|
INT32 sdX = gRoadMacros[ i ].sOffset - (sdY*OLD_WORLD_COLS);
|
||||||
INT32 sOffset = sdY*WORLD_COLS + sdX;
|
|
||||||
|
// Take into account the dfference between old and new row size for tiles that are shifted
|
||||||
|
// by one row due to X offset
|
||||||
|
// For example:
|
||||||
|
// {RBR, 159},
|
||||||
|
//{ RBR, -159 },
|
||||||
|
//
|
||||||
|
// Offsets for 160x160 map
|
||||||
|
// [] [] [-159]
|
||||||
|
// [] [0] []
|
||||||
|
// [159] [] []
|
||||||
//
|
//
|
||||||
AddToUndoList( iMapIndex + sOffset );
|
// Converted to 200x200 map
|
||||||
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
|
// [] [] [-199]
|
||||||
|
// [] [0] []
|
||||||
|
// [199] [] []
|
||||||
|
//
|
||||||
|
// Without this the original conversion would output 159 and -159 for X coordinate
|
||||||
|
if (sdX < -OLD_WORLD_COLS/2)
|
||||||
|
{
|
||||||
|
sdX -= WORLD_COLS - OLD_WORLD_COLS;
|
||||||
|
}
|
||||||
|
else if (sdX > OLD_WORLD_COLS / 2)
|
||||||
|
{
|
||||||
|
sdX += WORLD_COLS - OLD_WORLD_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 sOffset = sdY*WORLD_COLS + sdX;
|
||||||
|
INT32 newGridNo = iMapIndex + sOffset;
|
||||||
|
|
||||||
|
AddToUndoList( newGridNo );
|
||||||
|
RemoveAllObjectsOfTypeRange( newGridNo, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
|
||||||
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
|
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
|
||||||
AddObjectToHead( iMapIndex + sOffset, usTileIndex );
|
AddObjectToHead( newGridNo, usTileIndex );
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
@@ -61,4 +61,4 @@ void InitializeRoadMacros();
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+6
-181
@@ -15,22 +15,22 @@
|
|||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "loadscreen.h"
|
#include "LoadScreen.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Fileman.h"
|
#include "FileMan.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "Summary Info.h"
|
#include "Summary Info.h"
|
||||||
#include "Animated ProgressBar.h"
|
#include "Animated ProgressBar.h"
|
||||||
#include "worlddef.h"
|
#include "worlddef.h"
|
||||||
#include "worlddat.h"
|
#include "WorldDat.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
#include "text.h"
|
#include "Text.h"
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "GameVersion.h"
|
#include "GameVersion.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
@@ -1923,40 +1923,14 @@ BOOLEAN HandleSummaryInput( InputAtom *pEvent )
|
|||||||
|
|
||||||
void CreateGlobalSummary()
|
void CreateGlobalSummary()
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
FILE *fp;
|
|
||||||
STRING512 Dir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
#endif
|
|
||||||
OutputDebugString( "Generating GlobalSummary Information...\n" );
|
OutputDebugString( "Generating GlobalSummary Information...\n" );
|
||||||
|
|
||||||
gfGlobalSummaryExists = FALSE;
|
gfGlobalSummaryExists = FALSE;
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
//Set current directory to JA2\DevInfo which contains all of the summary data
|
||||||
#ifndef USE_VFS
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( Dir, "%s\\DevInfo", ExecDir );
|
|
||||||
|
|
||||||
// Snap: save current directory
|
|
||||||
//GetFileManCurrentDirectory( DataDir );
|
|
||||||
|
|
||||||
//Directory doesn't exist, so create it, and continue.
|
|
||||||
if( !MakeFileManDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
|
|
||||||
|
|
||||||
//Generate a simple readme file.
|
|
||||||
fp = fopen( "readme.txt", "w" );
|
|
||||||
Assert( fp );
|
|
||||||
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
|
|
||||||
"This directory or it's contents shouldn't be included with final release." );
|
|
||||||
fclose( fp );
|
|
||||||
#else
|
|
||||||
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
|
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
|
||||||
std::string str = "This information is used in conjunction with the editor.\n";
|
std::string str = "This information is used in conjunction with the editor.\n";
|
||||||
str += "This directory or it's contents shouldn't be included with final release.\n";
|
str += "This directory or it's contents shouldn't be included with final release.\n";
|
||||||
SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" );
|
SGP_TRYCATCH_RETHROW( wfile->write(str.c_str(), str.length()), L"" );
|
||||||
#endif
|
|
||||||
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
// Snap: Restore the data directory once we are finished.
|
||||||
//SetFileManCurrentDirectory( DataDir );
|
//SetFileManCurrentDirectory( DataDir );
|
||||||
@@ -2203,7 +2177,8 @@ void SummarySaveMapCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
{
|
{
|
||||||
CHAR8 filename[40];
|
CHAR8 filename[40];
|
||||||
sprintf( filename, "MAPS\\%S", gszDisplayName );
|
sprintf( filename, "MAPS\\%S", gszDisplayName );
|
||||||
FileClearAttributes( filename );
|
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here?
|
||||||
|
//FileClearAttributes( filename );
|
||||||
}
|
}
|
||||||
if( ExternalSaveMap( gszDisplayName ) )
|
if( ExternalSaveMap( gszDisplayName ) )
|
||||||
{
|
{
|
||||||
@@ -2281,12 +2256,6 @@ void CalculateOverrideStatus()
|
|||||||
void LoadGlobalSummary()
|
void LoadGlobalSummary()
|
||||||
{
|
{
|
||||||
HWFILE hfile;
|
HWFILE hfile;
|
||||||
#ifndef USE_VFS
|
|
||||||
STRING512 DataDir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
STRING512 DevInfoDir;
|
|
||||||
STRING512 MapsDir;
|
|
||||||
#endif
|
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
FLOAT dMajorVersion;
|
FLOAT dMajorVersion;
|
||||||
INT32 x,y;
|
INT32 x,y;
|
||||||
@@ -2295,34 +2264,16 @@ void LoadGlobalSummary()
|
|||||||
|
|
||||||
OutputDebugString( "Executing LoadGlobalSummary()...\n" );
|
OutputDebugString( "Executing LoadGlobalSummary()...\n" );
|
||||||
// Snap: save current directory
|
// Snap: save current directory
|
||||||
#ifndef USE_VFS
|
|
||||||
GetFileManCurrentDirectory( DataDir );
|
|
||||||
#endif
|
|
||||||
gfMustForceUpdateAllMaps = FALSE;
|
gfMustForceUpdateAllMaps = FALSE;
|
||||||
gusNumberOfMapsToBeForceUpdated = 0;
|
gusNumberOfMapsToBeForceUpdated = 0;
|
||||||
gfGlobalSummaryExists = FALSE;
|
gfGlobalSummaryExists = FALSE;
|
||||||
|
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
//Set current directory to JA2\DevInfo which contains all of the summary data
|
||||||
#ifndef USE_VFS
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( DevInfoDir, "%s\\DevInfo", ExecDir );
|
|
||||||
sprintf( MapsDir, "%s\\Maps", DataDir );
|
|
||||||
//Check to make sure we have a DevInfo directory. If we don't create one!
|
|
||||||
if( !SetFileManCurrentDirectory( DevInfoDir ) )
|
|
||||||
{
|
|
||||||
OutputDebugString( "LoadGlobalSummary() aborted -- doesn't exist on this local computer.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//TEMP
|
//TEMP
|
||||||
#ifndef USE_VFS
|
|
||||||
FileDelete( "_global.sum" );
|
|
||||||
#else
|
|
||||||
if(FileExists("DevInfo\\_global.sum"))
|
if(FileExists("DevInfo\\_global.sum"))
|
||||||
{
|
{
|
||||||
FileDelete( "DevInfo\\_global.sum" );
|
FileDelete( "DevInfo\\_global.sum" );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
gfGlobalSummaryExists = TRUE;
|
gfGlobalSummaryExists = TRUE;
|
||||||
|
|
||||||
//Analyse all sectors to see if matching maps exist. For any maps found, the information
|
//Analyse all sectors to see if matching maps exist. For any maps found, the information
|
||||||
@@ -2337,19 +2288,12 @@ void LoadGlobalSummary()
|
|||||||
sprintf( szSector, "%c%d", 'A' + y, x + 1 );
|
sprintf( szSector, "%c%d", 'A' + y, x + 1 );
|
||||||
|
|
||||||
//main ground level
|
//main ground level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= GROUND_LEVEL_MASK;
|
gbSectorLevels[x][y] |= GROUND_LEVEL_MASK;
|
||||||
@@ -2359,27 +2303,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B1 level
|
//main B1 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b1.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT1_LEVEL_MASK;
|
||||||
@@ -2389,27 +2322,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b1.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b1.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B2 level
|
//main B2 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b2.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT2_LEVEL_MASK;
|
||||||
@@ -2419,27 +2341,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b2.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b2.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//main B3 level
|
//main B3 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b3.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK;
|
gbSectorLevels[x][y] |= BASEMENT3_LEVEL_MASK;
|
||||||
@@ -2449,27 +2360,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b3.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b3.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate ground level
|
//alternate ground level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_GROUND_MASK;
|
||||||
@@ -2479,27 +2379,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B1 level
|
//alternate B1 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b1_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;
|
||||||
@@ -2509,27 +2398,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b1_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b1_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B2 level
|
//alternate B2 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b2_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B2_MASK;
|
gbSectorLevels[x][y] |= ALTERNATE_B2_MASK;
|
||||||
@@ -2539,27 +2417,16 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b2_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b2_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
//alternate B3 level
|
//alternate B3 level
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%c%d_b3_a.dat", 'A' + y, x + 1 );
|
|
||||||
SetFileManCurrentDirectory( MapsDir );
|
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
|
||||||
SetFileManCurrentDirectory( DevInfoDir );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
|
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
|
||||||
hfile = NULL;
|
hfile = NULL;
|
||||||
if(FileExists(szFilename))
|
if(FileExists(szFilename))
|
||||||
{
|
{
|
||||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if( hfile )
|
if( hfile )
|
||||||
{
|
{
|
||||||
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;;
|
gbSectorLevels[x][y] |= ALTERNATE_B1_MASK;;
|
||||||
@@ -2569,20 +2436,12 @@ void LoadGlobalSummary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
sprintf( szFilename, "%s_b3_a.sum", szSector );
|
|
||||||
#else
|
|
||||||
sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector );
|
sprintf( szFilename, "DevInfo\\%s_b3_a.sum", szSector );
|
||||||
#endif
|
|
||||||
FileDelete( szFilename );
|
FileDelete( szFilename );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') );
|
OutputDebugString( (LPCSTR)String("Sector Row %c complete... \n", y + 'A') );
|
||||||
}
|
}
|
||||||
#ifndef USE_VFS
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
|
||||||
SetFileManCurrentDirectory( DataDir );
|
|
||||||
#endif
|
|
||||||
//sprintf( MapsDir, "%s\\Data", ExecDir );
|
//sprintf( MapsDir, "%s\\Data", ExecDir );
|
||||||
//SetFileManCurrentDirectory( MapsDir );
|
//SetFileManCurrentDirectory( MapsDir );
|
||||||
|
|
||||||
@@ -2599,39 +2458,6 @@ void LoadGlobalSummary()
|
|||||||
|
|
||||||
void GenerateSummaryList()
|
void GenerateSummaryList()
|
||||||
{
|
{
|
||||||
#ifndef USE_VFS
|
|
||||||
FILE *fp;
|
|
||||||
STRING512 DataDir;
|
|
||||||
STRING512 ExecDir;
|
|
||||||
STRING512 Dir;
|
|
||||||
|
|
||||||
// Snap: save current directory
|
|
||||||
GetFileManCurrentDirectory( DataDir );
|
|
||||||
|
|
||||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
|
||||||
GetExecutableDirectory( ExecDir );
|
|
||||||
sprintf( Dir, "%s\\DevInfo", ExecDir );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
{
|
|
||||||
//Directory doesn't exist, so create it, and continue.
|
|
||||||
if( !MakeFileManDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information." );
|
|
||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
|
||||||
AssertMsg( 0, "Can't set to new directory, JA2\\DevInfo for summary information." );
|
|
||||||
//Generate a simple readme file.
|
|
||||||
fp = fopen( "readme.txt", "w" );
|
|
||||||
Assert( fp );
|
|
||||||
fprintf( fp, "%s\n%s\n", "This information is used in conjunction with the editor.",
|
|
||||||
"This directory or it's contents shouldn't be included with final release." );
|
|
||||||
fclose( fp );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Snap: Restore the data directory once we are finished.
|
|
||||||
SetFileManCurrentDirectory( DataDir );
|
|
||||||
//Set current directory back to data directory!
|
|
||||||
//sprintf( Dir, "%s\\Data", ExecDir );
|
|
||||||
//SetFileManCurrentDirectory( Dir );
|
|
||||||
#else
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
|
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
|
||||||
@@ -2643,7 +2469,6 @@ void GenerateSummaryList()
|
|||||||
{
|
{
|
||||||
SGP_RETHROW(L"Could not create readme.txt", ex);
|
SGP_RETHROW(L"Could not create readme.txt", ex);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//dnl ch28 260909
|
//dnl ch28 260909
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __SECTOR_SUMMARY_H
|
#ifndef __SECTOR_SUMMARY_H
|
||||||
@@ -35,4 +35,4 @@ void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, I
|
|||||||
void ResetCustomFileSectorSummary(void);//dnl ch30 150909
|
void ResetCustomFileSectorSummary(void);//dnl ch30 150909
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __SMARTMETHOD_H
|
#ifndef __SMARTMETHOD_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __SMOOTHING_UTILS_H
|
#ifndef __SMOOTHING_UTILS_H
|
||||||
@@ -62,4 +62,4 @@ UINT16 GetHorizontalWallClass( INT32 iMapIndex );
|
|||||||
BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
|
BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __SUMMARY_INFO_H
|
#ifndef __SUMMARY_INFO_H
|
||||||
#define __SUMMARY_INFO_H
|
#define __SUMMARY_INFO_H
|
||||||
|
|
||||||
#include "Types.h"
|
#include "types.h"
|
||||||
|
|
||||||
//dnl ch28
|
//dnl ch28
|
||||||
#define GLOBAL_SUMMARY_VERSION 15
|
#define GLOBAL_SUMMARY_VERSION 15
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __EDIT_SYS_H
|
#ifndef __EDIT_SYS_H
|
||||||
|
|||||||
+47
-23
@@ -1,4 +1,4 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
|
|
||||||
@@ -12,22 +12,22 @@
|
|||||||
#include "edit_sys.h"
|
#include "edit_sys.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "sys globals.h"
|
#include "Sys Globals.h"
|
||||||
#include "SmartMethod.h"
|
#include "SmartMethod.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "lighting.h"
|
#include "lighting.h"
|
||||||
#include "Interactive Tiles.h"
|
#include "Interactive Tiles.h"
|
||||||
#include "overhead types.h"
|
#include "Overhead Types.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "Handle UI.h"
|
#include "Handle UI.h"
|
||||||
#include "Event Pump.h"
|
#include "Event Pump.h"
|
||||||
#include "world items.h"
|
#include "world items.h"
|
||||||
#include "loadscreen.h"
|
#include "LoadScreen.h"
|
||||||
#include "render dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "isometric utils.h"
|
#include "Isometric Utils.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "render fun.h"
|
#include "Render Fun.h"
|
||||||
#include "popupmenu.h"
|
#include "popupmenu.h"
|
||||||
#include "overhead map.h"
|
#include "overhead map.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "newsmooth.h"
|
#include "newsmooth.h"
|
||||||
#include "Smoothing Utils.h"
|
#include "Smoothing Utils.h"
|
||||||
#include "messagebox.h"
|
#include "messagebox.h"
|
||||||
#include "messageboxscreen.h"
|
#include "MessageBoxScreen.h"
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "Soldier Init List.h"
|
#include "Soldier Init List.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "scheduling.h"
|
#include "Scheduling.h"
|
||||||
#include "Road Smoothing.h"
|
#include "Road Smoothing.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Summary Info.h"
|
#include "Summary Info.h"
|
||||||
#include "connect.h"//dnl
|
#include "connect.h"//dnl
|
||||||
#include "cursors.h"//dnl ch2 210909
|
#include "Cursors.h"//dnl ch2 210909
|
||||||
#include "Cursor Control.h"//dnl ch2 210909
|
#include "Cursor Control.h"//dnl ch2 210909
|
||||||
#include "maputility.h"//dnl ch49 061009
|
#include "maputility.h"//dnl ch49 061009
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
@@ -79,8 +79,6 @@
|
|||||||
class OBJECTTYPE;
|
class OBJECTTYPE;
|
||||||
class SOLDIERTYPE;
|
class SOLDIERTYPE;
|
||||||
|
|
||||||
extern CHAR8 *szMusicList[NUM_MUSIC];
|
|
||||||
|
|
||||||
BOOLEAN gfCorruptMap = FALSE;
|
BOOLEAN gfCorruptMap = FALSE;
|
||||||
BOOLEAN gfCorruptSchedules = FALSE;
|
BOOLEAN gfCorruptSchedules = FALSE;
|
||||||
BOOLEAN gfProfileDataLoaded = FALSE;
|
BOOLEAN gfProfileDataLoaded = FALSE;
|
||||||
@@ -169,6 +167,7 @@ LEVELNODE *gCursorNode = NULL;
|
|||||||
INT32 gsCursorGridNo;
|
INT32 gsCursorGridNo;
|
||||||
|
|
||||||
INT32 giMusicID = 0;
|
INT32 giMusicID = 0;
|
||||||
|
NewMusicList gMusicMode = MUSICLIST_MAIN_MENU;
|
||||||
|
|
||||||
void EraseWorldData( );
|
void EraseWorldData( );
|
||||||
|
|
||||||
@@ -1070,10 +1069,7 @@ void ShowCurrentDrawingMode( void )
|
|||||||
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
|
// Set the color for the window's border. Blueish color = Normal, Red = Fake lighting is turned on
|
||||||
usFillColor = GenericButtonFillColors[0];
|
usFillColor = GenericButtonFillColors[0];
|
||||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||||
if(gbPixelDepth==16)
|
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
||||||
RectangleDraw( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
|
||||||
else if(gbPixelDepth==8)
|
|
||||||
RectangleDraw8( FALSE, iScreenWidthOffset + 0, 2 * iScreenHeightOffset + 400, iScreenWidthOffset + 99, 2 * iScreenHeightOffset + 458, usFillColor, pDestBuf );
|
|
||||||
|
|
||||||
UnLockVideoSurface( FRAME_BUFFER );
|
UnLockVideoSurface( FRAME_BUFFER );
|
||||||
|
|
||||||
@@ -1616,16 +1612,27 @@ void HandleKeyboardShortcuts( )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case F4:
|
case F4:
|
||||||
#ifdef NEWMUSIC
|
MusicPlay(gMusicMode, giMusicID);
|
||||||
MusicPlay( giMusicID, MUSIC_OLD_TYPE, FALSE );
|
ScreenMsg( FONT_YELLOW, MSG_INTERFACE, L"%S", MusicLists[gMusicMode][giMusicID] );
|
||||||
#else
|
|
||||||
MusicPlay( giMusicID );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ScreenMsg( FONT_YELLOW, MSG_DEBUG, L"%S", szMusicList[giMusicID] );
|
// Select next track
|
||||||
giMusicID++;
|
giMusicID++;
|
||||||
if( giMusicID >= NUM_MUSIC )
|
if (giMusicID >= MusicLists[gMusicMode].size())
|
||||||
|
{
|
||||||
giMusicID = 0;
|
giMusicID = 0;
|
||||||
|
for (size_t i = 0; i < MAX_MUSIC; i++)
|
||||||
|
{
|
||||||
|
if (gMusicMode == i)
|
||||||
|
{
|
||||||
|
gMusicMode = static_cast<NewMusicList>(i + 1);
|
||||||
|
if (gMusicMode == MAX_MUSIC)
|
||||||
|
{
|
||||||
|
gMusicMode = MUSICLIST_MAIN_MENU;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F5:
|
case F5:
|
||||||
@@ -2944,6 +2951,23 @@ UINT32 WaitForSelectionWindowResponse( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mousewheel scroll
|
||||||
|
if (_WheelValue > 0)
|
||||||
|
{
|
||||||
|
while (_WheelValue--)
|
||||||
|
{
|
||||||
|
ScrollSelWinUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (_WheelValue++)
|
||||||
|
{
|
||||||
|
ScrollSelWinDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_WheelValue = 0;
|
||||||
|
|
||||||
if ( DoWindowSelection( ) )
|
if ( DoWindowSelection( ) )
|
||||||
{
|
{
|
||||||
fSelectionWindow = FALSE;
|
fSelectionWindow = FALSE;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef EDITSCREEN_H
|
#ifndef EDITSCREEN_H
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "messagebox.h"
|
#include "messagebox.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __MESSAGEBOX_H
|
#ifndef __MESSAGEBOX_H
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "Editor Undo.h"
|
#include "Editor Undo.h"
|
||||||
#include "Structure Internals.h"
|
#include "Structure Internals.h"
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
#include "Render Fun.h"
|
#include "Render Fun.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __NEWSMOOTH_H
|
#ifndef __NEWSMOOTH_H
|
||||||
|
|||||||
@@ -16,18 +16,18 @@
|
|||||||
|
|
||||||
#include "tiledef.h"
|
#include "tiledef.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "worlddat.h"
|
#include "WorldDat.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "popupmenu.h"
|
#include "popupmenu.h"
|
||||||
#include "EditorDefines.h"
|
#include "EditorDefines.h"
|
||||||
#include "render dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "debug.h"
|
#include "DEBUG.H"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "overhead types.h"
|
#include "Overhead Types.h"
|
||||||
#include "EditorMercs.h"
|
#include "EditorMercs.h"
|
||||||
#include "Scheduling.h"
|
#include "Scheduling.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
@@ -40,7 +40,7 @@ MOUSE_REGION popupRegion;
|
|||||||
UINT16 gusEntryHeight;
|
UINT16 gusEntryHeight;
|
||||||
BOOLEAN fWaitingForLButtonRelease = FALSE;
|
BOOLEAN fWaitingForLButtonRelease = FALSE;
|
||||||
|
|
||||||
extern CHAR16 gszScheduleActions[ NUM_SCHEDULE_ACTIONS ][20];
|
extern CHAR16 (*gszScheduleActions)[20]; // NUM_SCHEDULE_ACTIONS entries
|
||||||
|
|
||||||
//Finds the string for any popup menu in JA2 -- the strings are stored
|
//Finds the string for any popup menu in JA2 -- the strings are stored
|
||||||
//in different ways in each instance.
|
//in different ways in each instance.
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
//popupmenu.h
|
//popupmenu.h
|
||||||
|
|||||||
+61
-37
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "tiledef.h"
|
#include "tiledef.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "worlddat.h"
|
#include "WorldDat.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
@@ -29,6 +29,16 @@ extern BOOLEAN fDontUseRandom;
|
|||||||
|
|
||||||
extern UINT16 GenericButtonFillColors[40];
|
extern UINT16 GenericButtonFillColors[40];
|
||||||
|
|
||||||
|
struct SelectionWindow
|
||||||
|
{
|
||||||
|
SGPRect window;
|
||||||
|
SGPPoint displayAreaStart; // Area where selectable items are drawn
|
||||||
|
SGPPoint displayAreaEnd;
|
||||||
|
SGPPoint spacing; // For displayed items
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectionWindow gSelection;
|
||||||
|
|
||||||
BOOLEAN gfRenderSquareArea = FALSE;
|
BOOLEAN gfRenderSquareArea = FALSE;
|
||||||
INT16 iStartClickX,iStartClickY;
|
INT16 iStartClickX,iStartClickY;
|
||||||
INT16 iEndClickX,iEndClickY;
|
INT16 iEndClickX,iEndClickY;
|
||||||
@@ -40,7 +50,6 @@ INT32 iSelectWin,iCancelWin,iScrollUp,iScrollDown,iOkWin;
|
|||||||
BOOLEAN fAllDone=FALSE;
|
BOOLEAN fAllDone=FALSE;
|
||||||
BOOLEAN fButtonsPresent=FALSE;
|
BOOLEAN fButtonsPresent=FALSE;
|
||||||
|
|
||||||
SGPPoint SelWinSpacing, SelWinStartPoint, SelWinEndPoint;
|
|
||||||
|
|
||||||
//These definitions help define the start and end of the various wall indices.
|
//These definitions help define the start and end of the various wall indices.
|
||||||
//This needs to be maintained if the walls change.
|
//This needs to be maintained if the walls change.
|
||||||
@@ -172,6 +181,30 @@ UINT16 SelWinHilightFillColor = 0x23BA; //blue, formerly 0x000d a kind of mediu
|
|||||||
//
|
//
|
||||||
void CreateJA2SelectionWindow( INT16 sWhat )
|
void CreateJA2SelectionWindow( INT16 sWhat )
|
||||||
{
|
{
|
||||||
|
auto selectWinWidth = 600;
|
||||||
|
const auto selectWinHeight = SCREEN_HEIGHT - 120; // From top edge to taskbar
|
||||||
|
if (iResolution > _800x600)
|
||||||
|
{
|
||||||
|
selectWinWidth = 900;
|
||||||
|
}
|
||||||
|
auto tlX = 0;
|
||||||
|
auto tlY = 0;
|
||||||
|
auto brX = tlX + selectWinWidth;
|
||||||
|
auto brY = tlY + selectWinHeight;
|
||||||
|
gSelection.window.iLeft = tlX;
|
||||||
|
gSelection.window.iTop = tlY;
|
||||||
|
gSelection.window.iRight = brX;
|
||||||
|
gSelection.window.iBottom = brY;
|
||||||
|
gSelection.displayAreaStart.iX = tlX + 1;
|
||||||
|
gSelection.displayAreaStart.iY = tlY + 15;
|
||||||
|
gSelection.displayAreaEnd.iX = brX - 1;
|
||||||
|
gSelection.displayAreaEnd.iY= brY - 1;
|
||||||
|
gSelection.spacing.iX = 2;
|
||||||
|
gSelection.spacing.iY = 2;
|
||||||
|
|
||||||
|
iTopWinCutOff = gSelection.displayAreaStart.iY;
|
||||||
|
iBotWinCutOff = gSelection.displayAreaEnd.iY;
|
||||||
|
|
||||||
DisplaySpec *pDSpec;
|
DisplaySpec *pDSpec;
|
||||||
UINT16 usNSpecs;
|
UINT16 usNSpecs;
|
||||||
|
|
||||||
@@ -185,32 +218,33 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
|
iButtonIcons[ SEL_WIN_DOWN_ICON ] = LoadGenericButtonIcon( "EDITOR//lgDownArrow.sti" );
|
||||||
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
|
iButtonIcons[ SEL_WIN_OK_ICON ] = LoadGenericButtonIcon( "EDITOR//checkmark.sti" );
|
||||||
|
|
||||||
iSelectWin = CreateHotSpot(0, 0, 600, 360, MSYS_PRIORITY_HIGH,
|
|
||||||
|
iSelectWin = CreateHotSpot(0, 0, selectWinWidth, selectWinHeight, MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
|
DEFAULT_MOVE_CALLBACK, SelWinClkCallback);
|
||||||
|
|
||||||
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
|
iOkWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_OK_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 0,
|
BUTTON_USE_DEFAULT, selectWinWidth, 0,
|
||||||
40, 40, BUTTON_TOGGLE,
|
40, 40, BUTTON_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, OkClkCallback);
|
DEFAULT_MOVE_CALLBACK, OkClkCallback);
|
||||||
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
|
SetButtonFastHelpText(iOkWin,pDisplaySelectionWindowButtonText[0]);
|
||||||
|
|
||||||
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
|
iCancelWin = CreateIconButton((INT16)iButtonIcons[SEL_WIN_CANCEL_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 40,
|
BUTTON_USE_DEFAULT, selectWinWidth, 40,
|
||||||
40, 40, BUTTON_TOGGLE,
|
40, 40, BUTTON_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, CnclClkCallback);
|
DEFAULT_MOVE_CALLBACK, CnclClkCallback);
|
||||||
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
|
SetButtonFastHelpText(iCancelWin,pDisplaySelectionWindowButtonText[1]);
|
||||||
|
|
||||||
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
|
iScrollUp = CreateIconButton((INT16)iButtonIcons[SEL_WIN_UP_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 80,
|
BUTTON_USE_DEFAULT, selectWinWidth, 80,
|
||||||
40, 160, BUTTON_NO_TOGGLE,
|
40, 160, BUTTON_NO_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, UpClkCallback);
|
DEFAULT_MOVE_CALLBACK, UpClkCallback);
|
||||||
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
|
SetButtonFastHelpText(iScrollUp,pDisplaySelectionWindowButtonText[2]);
|
||||||
|
|
||||||
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
|
iScrollDown = CreateIconButton((INT16)iButtonIcons[SEL_WIN_DOWN_ICON], 0,
|
||||||
BUTTON_USE_DEFAULT, 600, 240,
|
BUTTON_USE_DEFAULT, selectWinWidth, 240,
|
||||||
40, 160, BUTTON_NO_TOGGLE,
|
40, 160, BUTTON_NO_TOGGLE,
|
||||||
MSYS_PRIORITY_HIGH,
|
MSYS_PRIORITY_HIGH,
|
||||||
DEFAULT_MOVE_CALLBACK, DwnClkCallback);
|
DEFAULT_MOVE_CALLBACK, DwnClkCallback);
|
||||||
@@ -218,18 +252,6 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
|
|
||||||
fButtonsPresent = TRUE;
|
fButtonsPresent = TRUE;
|
||||||
|
|
||||||
SelWinSpacing.iX = 2;
|
|
||||||
SelWinSpacing.iY = 2;
|
|
||||||
|
|
||||||
SelWinStartPoint.iX = 1;
|
|
||||||
SelWinStartPoint.iY = 15;
|
|
||||||
|
|
||||||
iTopWinCutOff = 15;
|
|
||||||
|
|
||||||
SelWinEndPoint.iX = 599;
|
|
||||||
SelWinEndPoint.iY = 359;
|
|
||||||
|
|
||||||
iBotWinCutOff = 359;
|
|
||||||
|
|
||||||
switch( sWhat )
|
switch( sWhat )
|
||||||
{
|
{
|
||||||
@@ -347,8 +369,8 @@ void CreateJA2SelectionWindow( INT16 sWhat )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &SelWinStartPoint, &SelWinEndPoint,
|
BuildDisplayWindow( pDSpec, usNSpecs, &pDispList, &gSelection.displayAreaStart , &gSelection.displayAreaEnd,
|
||||||
&SelWinSpacing, CLEAR_BACKGROUND);
|
&gSelection.spacing, CLEAR_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -849,12 +871,14 @@ void RenderSelectionWindow( void )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ColorFillVideoSurfaceArea(FRAME_BUFFER,
|
ColorFillVideoSurfaceArea(FRAME_BUFFER,
|
||||||
0, 0, 600, 400,
|
gSelection.window.iLeft, gSelection.window.iTop, gSelection.window.iRight, gSelection.window.iBottom,
|
||||||
GenericButtonFillColors[0]);
|
GenericButtonFillColors[0]
|
||||||
|
);
|
||||||
DrawSelections( );
|
DrawSelections( );
|
||||||
MarkButtonsDirty();
|
MarkButtonsDirty();
|
||||||
RenderButtons( );
|
RenderButtons( );
|
||||||
|
|
||||||
|
// Draw selection rectangle
|
||||||
if ( gfRenderSquareArea )
|
if ( gfRenderSquareArea )
|
||||||
{
|
{
|
||||||
button = ButtonList[iSelectWin];
|
button = ButtonList[iSelectWin];
|
||||||
@@ -862,7 +886,7 @@ void RenderSelectionWindow( void )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
|
if ( (abs( iStartClickX - button->Area.MouseXPos ) > 9) ||
|
||||||
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY)) > 9) )
|
(abs( iStartClickY - (button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY)) > 9) )
|
||||||
{
|
{
|
||||||
// iSX = (INT32)iStartClickX;
|
// iSX = (INT32)iStartClickX;
|
||||||
// iEX = (INT32)button->Area.MouseXPos;
|
// iEX = (INT32)button->Area.MouseXPos;
|
||||||
@@ -870,7 +894,7 @@ void RenderSelectionWindow( void )
|
|||||||
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
|
// iEY = (INT32)(button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY);
|
||||||
|
|
||||||
iSX = iStartClickX;
|
iSX = iStartClickX;
|
||||||
iSY = iStartClickY - iTopWinCutOff + SelWinStartPoint.iY;
|
iSY = iStartClickY - iTopWinCutOff + gSelection.displayAreaStart.iY;
|
||||||
iEX = gusMouseXPos;
|
iEX = gusMouseXPos;
|
||||||
iEY = gusMouseYPos;
|
iEY = gusMouseYPos;
|
||||||
|
|
||||||
@@ -889,10 +913,10 @@ void RenderSelectionWindow( void )
|
|||||||
iEY ^= iSY;
|
iEY ^= iSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
iEX = min( iEX, 600 );
|
iEX = min( gSelection.displayAreaEnd.iX, iEX);
|
||||||
iSY = max( SelWinStartPoint.iY, iSY );
|
iSY = max( gSelection.displayAreaStart.iY, iSY );
|
||||||
iEY = min( 359, iEY );
|
iEY = min( gSelection.displayAreaEnd.iY, iEY );
|
||||||
iEY = max( SelWinStartPoint.iY, iEY );
|
iEY = max( gSelection.displayAreaStart.iY, iEY );
|
||||||
|
|
||||||
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
|
usFillColor = Get16BPPColor(FROMRGB(255, usFillGreen, 0));
|
||||||
usFillGreen += usDir;
|
usFillGreen += usDir;
|
||||||
@@ -928,7 +952,7 @@ void SelWinClkCallback( GUI_BUTTON *button, INT32 reason )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
iClickX = button->Area.MouseXPos;
|
iClickX = button->Area.MouseXPos;
|
||||||
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
|
iClickY = button->Area.MouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
|
||||||
|
|
||||||
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
|
if (reason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
|
||||||
{
|
{
|
||||||
@@ -1035,9 +1059,9 @@ void DisplaySelectionWindowGraphicalInformation()
|
|||||||
UINT16 y;
|
UINT16 y;
|
||||||
//Determine if there is a valid picture at cursor position.
|
//Determine if there is a valid picture at cursor position.
|
||||||
//iRelX = gusMouseXPos;
|
//iRelX = gusMouseXPos;
|
||||||
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)SelWinStartPoint.iY;
|
//iRelY = gusMouseYPos + iTopWinCutOff - (INT16)gSelection.displayAreaStart.iY;
|
||||||
|
|
||||||
y = gusMouseYPos + iTopWinCutOff - (UINT16)SelWinStartPoint.iY;
|
y = gusMouseYPos + iTopWinCutOff - (UINT16)gSelection.displayAreaStart.iY;
|
||||||
pNode = pDispList;
|
pNode = pDispList;
|
||||||
fDone = FALSE;
|
fDone = FALSE;
|
||||||
while( (pNode != NULL) && !fDone )
|
while( (pNode != NULL) && !fDone )
|
||||||
@@ -1470,10 +1494,10 @@ void DrawSelections( void )
|
|||||||
{
|
{
|
||||||
SGPRect ClipRect, NewRect;
|
SGPRect ClipRect, NewRect;
|
||||||
|
|
||||||
NewRect.iLeft = SelWinStartPoint.iX;
|
NewRect.iLeft = gSelection.displayAreaStart.iX;
|
||||||
NewRect.iTop = SelWinStartPoint.iY;
|
NewRect.iTop = gSelection.displayAreaStart.iY;
|
||||||
NewRect.iRight = SelWinEndPoint.iX;
|
NewRect.iRight = gSelection.displayAreaEnd.iX;
|
||||||
NewRect.iBottom = SelWinEndPoint.iY;
|
NewRect.iBottom = gSelection.displayAreaEnd.iY;
|
||||||
|
|
||||||
GetClippingRect(&ClipRect);
|
GetClippingRect(&ClipRect);
|
||||||
SetClippingRect(&NewRect);
|
SetClippingRect(&NewRect);
|
||||||
@@ -1483,7 +1507,7 @@ void DrawSelections( void )
|
|||||||
SetObjectShade( gvoLargeFontType1, 0 );
|
SetObjectShade( gvoLargeFontType1, 0 );
|
||||||
// SetObjectShade( gvoLargeFont, 0 );
|
// SetObjectShade( gvoLargeFont, 0 );
|
||||||
|
|
||||||
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &SelWinStartPoint, CLEAR_BACKGROUND );
|
DisplayWindowFunc( pDispList, iTopWinCutOff, iBotWinCutOff, &gSelection.displayAreaStart, CLEAR_BACKGROUND );
|
||||||
|
|
||||||
SetObjectShade( gvoLargeFontType1, 4 );
|
SetObjectShade( gvoLargeFontType1, 4 );
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef _SELECTION_WIN_H_
|
#ifndef _SELECTION_WIN_H_
|
||||||
#define _SELECTION_WIN_H_
|
#define _SELECTION_WIN_H_
|
||||||
|
|
||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
|
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
|
|||||||
+3
-3
@@ -5,15 +5,15 @@
|
|||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "FileMan.h"
|
#include "FileMan.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "debug.h"
|
#include "DEBUG.H"
|
||||||
#include "tiledef.h"
|
#include "tiledef.h"
|
||||||
#include "worlddef.h"
|
#include "worlddef.h"
|
||||||
#include "worldman.h"
|
#include "worldman.h"
|
||||||
#include "smooth.h"
|
#include "smooth.h"
|
||||||
#include "editscreen.h"
|
#include "editscreen.h"
|
||||||
#include "selectwin.h"
|
#include "selectwin.h"
|
||||||
#include "isometric utils.h"
|
#include "Isometric Utils.h"
|
||||||
#include "structure wrap.h"
|
#include "Structure Wrap.h"
|
||||||
#include "Exit Grids.h"
|
#include "Exit Grids.h"
|
||||||
#include "Editor Undo.h"
|
#include "Editor Undo.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "BuildDefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#ifdef JA2EDITOR
|
#ifdef JA2EDITOR
|
||||||
#ifndef __SMOOTH_H
|
#ifndef __SMOOTH_H
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef _JA2_DEMO_ADS_H
|
|
||||||
#define _JA2_DEMO_ADS_H
|
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef _JA2PROTOTYPES_H
|
|
||||||
#define _JA2PROTOTYPES_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This header does not define any structures. It simply provides a way for all code that only needs a pointer
|
|
||||||
* reference to structures, to have it without getting locked into mutual includes and other
|
|
||||||
* hard-to-trace-and-fix behavior. More class and struct defs can be added as necessary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class SOLDIERTYPE;
|
|
||||||
struct AnimationSurfaceType;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
set(Ja2Src
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/aniviewscreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Credits.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Fade Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/FeaturesScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameInitOptionsScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/gameloop.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/gamescreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameSettings.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GameVersion.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/HelpScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Init.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Intro.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/JA2 Splash.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Ja25Update.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/jascreens.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Loading Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MainMenuScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MessageBoxScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPChatScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPConnectScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPHostScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPJoinScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPScoreScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/MPXmlTeams.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Options Screen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/profiler.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadGame.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/SaveLoadScreen.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Screens.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Sys Globals.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/TimeLogging.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/ub_config.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp"
|
||||||
|
PARENT_SCOPE)
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef _CHEATS__H_
|
#ifndef _CHEATS__H_
|
||||||
#define _CHEATS__H_
|
#define _CHEATS__H_
|
||||||
|
|
||||||
#include "Language Defines.h"
|
|
||||||
|
|
||||||
extern UINT8 gubCheatLevel;
|
extern UINT8 gubCheatLevel;
|
||||||
|
|
||||||
@@ -22,4 +21,4 @@ extern UINT8 gubCheatLevel;
|
|||||||
#define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 )
|
#define RESET_CHEAT_LEVEL( ) ( gubCheatLevel = 0 )
|
||||||
#define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 )
|
#define ACTIVATE_CHEAT_LEVEL() ( gubCheatLevel = 6 )
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "Credits.h"
|
#include "Credits.h"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "wordwrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Video.h"
|
#include "video.h"
|
||||||
#include "render dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "wordwrap.h"
|
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Input.h"
|
#include "input.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "encrypted file.h"
|
#include "Encrypted File.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
|
|
||||||
//externals
|
//externals
|
||||||
extern HVSURFACE ghFrameBuffer;
|
extern HVSURFACE ghFrameBuffer;
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "sys globals.h"
|
#include "Sys Globals.h"
|
||||||
#include "fade screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "cursor control.h"
|
#include "Cursor Control.h"
|
||||||
#include "music control.h"
|
#include "Music Control.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
|
|
||||||
@@ -681,13 +681,9 @@ BOOLEAN UpdateSaveBufferWithBackbuffer(void)
|
|||||||
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
|
pSrcBuf = LockVideoSurface(FRAME_BUFFER, &uiSrcPitchBYTES);
|
||||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||||
|
|
||||||
if(gbPixelDepth==16)
|
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||||
{
|
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||||
// BLIT HERE
|
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
|
||||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
|
||||||
0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
|
||||||
}
|
|
||||||
|
|
||||||
UnLockVideoSurface(FRAME_BUFFER);
|
UnLockVideoSurface(FRAME_BUFFER);
|
||||||
UnLockVideoSurface(guiSAVEBUFFER);
|
UnLockVideoSurface(guiSAVEBUFFER);
|
||||||
@@ -37,4 +37,4 @@ BOOLEAN HandleFadeInCallback( );
|
|||||||
void FadeInNextFrame( );
|
void FadeInNextFrame( );
|
||||||
void FadeOutNextFrame( );
|
void FadeOutNextFrame( );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,41 +1,27 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "FeaturesScreen.h"
|
#include "FeaturesScreen.h"
|
||||||
#include "Video.h"
|
#include "video.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "SaveLoadScreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "WordWrap.h"
|
#include "WCheck.h"
|
||||||
#include "WCheck.h"
|
#include "Utilities.h"
|
||||||
#include "Utilities.h"
|
#include "Sound Control.h"
|
||||||
#include "Debug.h"
|
#include "Ambient Control.h"
|
||||||
#include "Sound Control.h"
|
#include "GameSettings.h"
|
||||||
#include "Ambient Control.h"
|
#include "Game Init.h"
|
||||||
#include "Worlddat.h"
|
#include "english.h"
|
||||||
#include "Worlddef.h"
|
#include "Cursors.h"
|
||||||
#include "GameSettings.h"
|
#include "sysutil.h"
|
||||||
#include "Game Init.h"
|
#include "Text.h"
|
||||||
#include "English.h"
|
#include "Interface Control.h"
|
||||||
#include "Overhead.h"
|
#include "message.h"
|
||||||
#include "Gap.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include "Cursors.h"
|
#include "connect.h"
|
||||||
#include "SysUtil.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Exit Grids.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "Interface Control.h"
|
|
||||||
#include "Message.h"
|
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "Multi Language Graphic Utils.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "Sys Globals.h"
|
|
||||||
#include "insurance.h"
|
|
||||||
|
|
||||||
#include "connect.h"
|
|
||||||
#include "WorldMan.h"
|
|
||||||
#include "Init.h"
|
|
||||||
#include "Game Events.h"
|
|
||||||
|
|
||||||
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
|
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
|
||||||
|
|
||||||
@@ -1,38 +1,30 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "wCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Input.h"
|
#include "input.h"
|
||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "English.h"
|
#include "english.h"
|
||||||
#include "Sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "Music Control.h"
|
#include "Music Control.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Intro.h"
|
#include "Intro.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "_Ja25EnglishText.h"
|
#include "_Ja25EnglishText.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
|
#include "SaveLoadScreen.h"
|
||||||
#include "gameloop.h"
|
|
||||||
#include "connect.h"
|
|
||||||
#include "saveloadscreen.h"
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "ub_config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vfs/Core/vfs.h>
|
#include <vfs/Core/vfs.h>
|
||||||
#include <vfs/Core/vfs_init.h>
|
|
||||||
#include <vfs/Tools/vfs_property_container.h>
|
#include <vfs/Tools/vfs_property_container.h>
|
||||||
#include <vfs/Core/vfs_os_functions.h>
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
#include "ub_config.h"
|
||||||
|
|
||||||
// *********************************
|
// *********************************
|
||||||
// Unfinished Business: Initial Game Screen
|
// Unfinished Business: Initial Game Screen
|
||||||
@@ -1830,7 +1822,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
||||||
{
|
{
|
||||||
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
||||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
if (iResolution >= _800x600 && iResolution < _1280x720)
|
||||||
maxSquadSize = GIO_SQUAD_SIZE_8;
|
maxSquadSize = GIO_SQUAD_SIZE_8;
|
||||||
|
|
||||||
if ( iCurrentSquadSize < maxSquadSize )
|
if ( iCurrentSquadSize < maxSquadSize )
|
||||||
@@ -1850,7 +1842,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||||
|
|
||||||
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
||||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
if (iResolution >= _800x600 && iResolution < _1280x720 )
|
||||||
maxSquadSize = GIO_SQUAD_SIZE_8;
|
maxSquadSize = GIO_SQUAD_SIZE_8;
|
||||||
|
|
||||||
if ( iCurrentSquadSize < maxSquadSize )
|
if ( iCurrentSquadSize < maxSquadSize )
|
||||||
@@ -85,7 +85,7 @@ typedef struct
|
|||||||
UINT8 usLevelModifierLowLimit;
|
UINT8 usLevelModifierLowLimit;
|
||||||
UINT8 usLevelModifierHighLimit;
|
UINT8 usLevelModifierHighLimit;
|
||||||
BOOLEAN bAllowUnrestrictedXPLevels;
|
BOOLEAN bAllowUnrestrictedXPLevels;
|
||||||
BOOLEAN bQueenLosingControlOfSector;
|
UINT8 bQueenLosingControlOfSector;
|
||||||
BOOLEAN bBloodcatAmbush;
|
BOOLEAN bBloodcatAmbush;
|
||||||
BOOLEAN bAirRaidLookForDive;
|
BOOLEAN bAirRaidLookForDive;
|
||||||
UINT32 iGetNumberOfTurnsPowerGenFanWillBeStoppedFor; //UB
|
UINT32 iGetNumberOfTurnsPowerGenFanWillBeStoppedFor; //UB
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "FileMan.h"
|
#include "FileMan.h"
|
||||||
#include "String.h"
|
#include "string.h"
|
||||||
#include "Sound Control.h"
|
#include "Sound Control.h"
|
||||||
#include "SaveLoadScreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
#include "Music Control.h"
|
#include "Music Control.h"
|
||||||
@@ -9,20 +9,18 @@
|
|||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "GameVersion.h"
|
#include "GameVersion.h"
|
||||||
#include "LibraryDataBase.h"
|
#include "LibraryDataBase.h"
|
||||||
#include "Debug.h"
|
#include "DEBUG.H"
|
||||||
#include "Language Defines.h"
|
|
||||||
#include "HelpScreen.h"
|
#include "HelpScreen.h"
|
||||||
#include "INIReader.h"
|
#include "INIReader.h"
|
||||||
#include "Shade Table Util.h"
|
#include "Shade Table Util.h"
|
||||||
#include "soldier profile type.h"
|
#include "random.h"
|
||||||
#include "Random.h"
|
|
||||||
#include "SaveLoadGame.h"
|
#include "SaveLoadGame.h"
|
||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Campaign.h"
|
#include "Campaign.h"
|
||||||
#include "meanwhile.h"
|
#include "Meanwhile.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
@@ -37,7 +35,6 @@
|
|||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "sgp_logger.h"
|
#include "sgp_logger.h"
|
||||||
|
|
||||||
#include "Map Information.h"
|
|
||||||
|
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
|
|
||||||
@@ -45,7 +42,7 @@
|
|||||||
#include <vfs/Core/vfs_file_raii.h>
|
#include <vfs/Core/vfs_file_raii.h>
|
||||||
#include <vfs/Core/File/vfs_file.h>
|
#include <vfs/Core/File/vfs_file.h>
|
||||||
|
|
||||||
#define GAME_SETTINGS_FILE "Ja2_Settings.INI"
|
#define GAME_SETTINGS_FILE "Ja2_Settings.ini"
|
||||||
|
|
||||||
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
|
#define FEATURE_FLAGS_FILE "Ja2_Features.ini"
|
||||||
|
|
||||||
@@ -157,7 +154,7 @@ BOOLEAN UsingInventoryCostsAPSystem()
|
|||||||
return ( gGameExternalOptions.fInventoryCostsAP );
|
return ( gGameExternalOptions.fInventoryCostsAP );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StringToLower(std::string strToConvert)
|
static std::string StringToLower(std::string strToConvert)
|
||||||
{//change each element of the string to lower case
|
{//change each element of the string to lower case
|
||||||
for(unsigned int i=0;i<strToConvert.length();i++)
|
for(unsigned int i=0;i<strToConvert.length();i++)
|
||||||
{
|
{
|
||||||
@@ -186,7 +183,7 @@ BOOLEAN IsNIVModeValid(bool checkRes)
|
|||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateFeatureFlags()
|
static void UpdateFeatureFlags()
|
||||||
{
|
{
|
||||||
// do we need to override some ini settings?
|
// do we need to override some ini settings?
|
||||||
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
|
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
|
||||||
@@ -280,23 +277,23 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
|
gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_BLOOD_N_GORE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
|
gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DONT_MOVE_MOUSE" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
|
gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_OLD_SELECTION_METHOD" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , FALSE );
|
gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALWAYS_SHOW_MOVEMENT_PATH" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
|
gGameSettings.fOptions[TOPTION_SHOW_MISSES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MISSES" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
|
gGameSettings.fOptions[TOPTION_RTCONFIRM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RTCONFIRM" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , TRUE );
|
gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SLEEPWAKE_NOTIFICATION" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
|
gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_METRIC_SYSTEM" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
|
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_MERC_CASTS_LIGHT" , FALSE);
|
||||||
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
|
gGameSettings.fOptions[TOPTION_SMART_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SMART_CURSOR" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SNAP_CURSOR_TO_DOOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
|
gGameSettings.fOptions[TOPTION_GLOW_ITEMS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GLOW_ITEMS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
|
gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_TREE_TOPS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , FALSE );
|
gGameSettings.fOptions[TOPTION_SMART_TREE_TOPS] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_SMART_TREE_TOPS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
|
gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TOGGLE_WIREFRAME" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
|
gGameSettings.fOptions[TOPTION_3D_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_3D_CURSOR" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_CTH_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CTH_CURSOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
|
gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_BURST_CURSOR" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
|
gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_TAUNTS" , TRUE ); // changed from drop all - SANDRO
|
||||||
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , FALSE );
|
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_GL_HIGH_ANGLE" , TRUE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
|
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALLOW_REAL_TIME_SNEAK" , FALSE ); // Changed from aim levels restriction - SANDRO
|
||||||
@@ -306,7 +303,7 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
|
gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SPACE_SELECTS_NEXT_SQUAD" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
|
gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ITEM_SHADOW" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
|
gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_WEAPON_RANGE_IN_TILES" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , FALSE );
|
gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACERS_FOR_SINGLE_FIRE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
|
gGameSettings.fOptions[TOPTION_RAIN_SOUND] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_RAIN_SOUND" , TRUE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
@@ -333,12 +330,12 @@ BOOLEAN LoadGameSettings()
|
|||||||
else
|
else
|
||||||
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
|
gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] = FALSE;
|
||||||
|
|
||||||
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , FALSE); // Start at max aiming level instead of default no aiming
|
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_START_AIM" , TRUE); // Start at max aiming level instead of default no aiming
|
||||||
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
|
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_ALT_PATHFINDING" , FALSE); // A* pathfinding
|
||||||
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , TRUE ); // Flugente: mercenary formations
|
gGameSettings.fOptions[TOPTION_MERCENARY_FORMATIONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_MERCENARY_FORMATIONS" , FALSE ); // Flugente: mercenary formations
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
|
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_ENEMY_LOCATION" , FALSE); // sevenfm: show locations of known enemies
|
||||||
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
|
gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_REPORT_MISS_MARGIN" , FALSE ); // HEADROCK HAM 4: Shot offset report
|
||||||
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , FALSE );
|
gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_LOGICAL_BODYTYPES" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
|
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
|
||||||
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
|
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
|
gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
|
||||||
@@ -358,13 +355,13 @@ BOOLEAN LoadGameSettings()
|
|||||||
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
|
gGameSettings.fOptions[NUM_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_GAME_OPTIONS" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
|
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
|
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
|
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , TRUE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_TRAINING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_TRAINING" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
|
||||||
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
|
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
|
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , TRUE );
|
||||||
else
|
else
|
||||||
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
|
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
|
||||||
|
|
||||||
@@ -777,17 +774,17 @@ void InitGameSettings()
|
|||||||
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_OLD_SELECTION_METHOD ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_ALWAYS_SHOW_MOVEMENT_PATH ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SHOW_MISSES ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_RTCONFIRM ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SLEEPWAKE_NOTIFICATION ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] = TRUE;
|
||||||
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
|
gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SMART_CURSOR ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SNAP_CURSOR_TO_DOOR ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_GLOW_ITEMS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_TOGGLE_TREE_TOPS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_SMART_TREE_TOPS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_TOGGLE_WIREFRAME ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_3D_CURSOR ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_CTH_CURSOR ] = TRUE;
|
||||||
@@ -795,14 +792,14 @@ void InitGameSettings()
|
|||||||
//Madd:
|
//Madd:
|
||||||
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_GL_BURST_CURSOR ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
|
gGameSettings.fOptions[ TOPTION_ALLOW_TAUNTS ] = TRUE; // changed - SANDRO
|
||||||
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_GL_HIGH_ANGLE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
|
gGameSettings.fOptions[ TOPTION_ALLOW_REAL_TIME_SNEAK ] = FALSE; // changed - SANDRO
|
||||||
|
|
||||||
//lalien
|
//lalien
|
||||||
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SPACE_SELECTS_NEXT_SQUAD ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SHOW_ITEM_SHADOW ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_TRACERS_FOR_SINGLE_FIRE ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
|
gGameSettings.fOptions[ TOPTION_ALLOW_SOLDIER_TOOLTIPS ] = TRUE;
|
||||||
@@ -828,14 +825,14 @@ void InitGameSettings()
|
|||||||
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
|
||||||
|
|
||||||
// BIO
|
// BIO
|
||||||
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_USE_LOGICAL_BODYTYPES ] = TRUE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = TRUE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
|
||||||
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = TRUE;
|
||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
|
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies
|
||||||
|
|
||||||
@@ -847,7 +844,7 @@ void InitGameSettings()
|
|||||||
|
|
||||||
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
|
gGameSettings.fOptions[ TOPTION_MERCENARY_FORMATIONS ] = FALSE; // Flugente: mercenary formations
|
||||||
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
|
gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] = FALSE; // sevenfm: show locations of known enemies
|
||||||
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = FALSE;
|
gGameSettings.fOptions[TOPTION_ALT_START_AIM] = TRUE;
|
||||||
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
|
gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] = FALSE;
|
||||||
|
|
||||||
// arynn: Cheat/Debug Menu
|
// arynn: Cheat/Debug Menu
|
||||||
@@ -992,9 +989,17 @@ void LoadGameExternalOptions()
|
|||||||
//Madd: set number of pItem files to be used
|
//Madd: set number of pItem files to be used
|
||||||
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
|
gGameExternalOptions.ubNumPItems = iniReader.ReadInteger("Data File Settings","NUM_P_ITEMS", 3, 3, MAX_PITEMS);
|
||||||
|
|
||||||
|
//################# Backgrounds #################
|
||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Data File Settings", "BACKGROUNDS", TRUE );
|
gGameExternalOptions.fBackGround = iniReader.ReadBoolean("Backgrounds", "ENABLE_BACKGROUNDS", TRUE );
|
||||||
|
|
||||||
|
// Kitty: show additional IMP backgrounds and determine which IMP backgrounds are available at selection based on choices for skills, chararcter traits and disabilities
|
||||||
|
gGameExternalOptions.fAltIMPCreation = iniReader.ReadBoolean("Backgrounds", "ALTERNATIVE_IMP_CREATION", FALSE);
|
||||||
|
|
||||||
|
// Kitty: only show additional IMP backgrounds enabled by AlternativeImpCreation (same rules which are shown as with AlternativeImpCreation)
|
||||||
|
gGameExternalOptions.fReducedIMPCreation = iniReader.ReadBoolean("Backgrounds", "REDUCED_IMP_CREATION", FALSE);
|
||||||
|
|
||||||
//################# Merc Recruitment Settings #################
|
//################# Merc Recruitment Settings #################
|
||||||
|
|
||||||
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
||||||
@@ -1079,6 +1084,9 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.ubMercRandomExpRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_EXP_RANGE", 1, 0, 4);
|
gGameExternalOptions.ubMercRandomExpRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_EXP_RANGE", 1, 0, 4);
|
||||||
gGameExternalOptions.fMercRandomStartSalary = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_START_SALARY", FALSE);
|
gGameExternalOptions.fMercRandomStartSalary = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_START_SALARY", FALSE);
|
||||||
gGameExternalOptions.ubMercRandomStartSalaryPercentMod = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_START_SALARY_PERCENTAGE_MAX_MODIFIER", 30, 0, 100);
|
gGameExternalOptions.ubMercRandomStartSalaryPercentMod = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_START_SALARY_PERCENTAGE_MAX_MODIFIER", 30, 0, 100);
|
||||||
|
gGameExternalOptions.fMercGrowthModifiersEnabled = iniReader.ReadBoolean("Recruitment Settings", "MERCS_GROWTH_MODIFIERS_ENABLED", FALSE);
|
||||||
|
gGameExternalOptions.fMercRandomGrowthModifiers = iniReader.ReadBoolean("Recruitment Settings", "MERCS_RANDOM_GROWTH_MODIFIERS", FALSE);
|
||||||
|
gGameExternalOptions.iMercRandomGrowthModifiersRange = iniReader.ReadInteger("Recruitment Settings", "MERCS_RANDOM_GROWTH_MODIFIERS_RANGE", 5, -50, 50);
|
||||||
|
|
||||||
//################# Financial Settings #################
|
//################# Financial Settings #################
|
||||||
|
|
||||||
@@ -1147,7 +1155,9 @@ void LoadGameExternalOptions()
|
|||||||
giTimerIntervals[ NEXTSCROLL ] = (INT16)(giTimerIntervals[ NEXTSCROLL ] / gGameExternalOptions.fScrollSpeedFactor);
|
giTimerIntervals[ NEXTSCROLL ] = (INT16)(giTimerIntervals[ NEXTSCROLL ] / gGameExternalOptions.fScrollSpeedFactor);
|
||||||
|
|
||||||
gGameExternalOptions.gfUseExternalLoadscreens = iniReader.ReadBoolean("Graphics Settings","USE_EXTERNALIZED_LOADSCREENS", FALSE);
|
gGameExternalOptions.gfUseExternalLoadscreens = iniReader.ReadBoolean("Graphics Settings","USE_EXTERNALIZED_LOADSCREENS", FALSE);
|
||||||
|
|
||||||
|
gGameExternalOptions.ubLoadscreenStretchMode = iniReader.ReadInteger("Graphics Settings", "LOADSCREEN_STRETCH_MODE", 0, 0, 2);
|
||||||
|
|
||||||
if (!is_networked)
|
if (!is_networked)
|
||||||
gGameExternalOptions.gfUseLoadScreenHints = iniReader.ReadBoolean("Graphics Settings","USE_LOADSCREENHINTS", TRUE);
|
gGameExternalOptions.gfUseLoadScreenHints = iniReader.ReadBoolean("Graphics Settings","USE_LOADSCREENHINTS", TRUE);
|
||||||
else
|
else
|
||||||
@@ -1180,6 +1190,12 @@ void LoadGameExternalOptions()
|
|||||||
// Flugente: additional decals on objects (cracked walls, blood spatters etc.)
|
// Flugente: additional decals on objects (cracked walls, blood spatters etc.)
|
||||||
gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE );
|
gGameExternalOptions.fAdditionalDecals = iniReader.ReadBoolean( "Graphics Settings", "ADDITIONAL_DECALS", FALSE );
|
||||||
|
|
||||||
|
// anv: map color variants
|
||||||
|
gGameExternalOptions.ubRadarMapModeDay = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_DAY", 0, 0, 2);
|
||||||
|
gGameExternalOptions.ubRadarMapModeNight = iniReader.ReadInteger("Graphics Settings", "RADAR_MAP_MODE_NIGHT", 3, 0, 3);
|
||||||
|
gGameExternalOptions.ubOverheadMapModeDay = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_DAY", 0, 0, 2);
|
||||||
|
gGameExternalOptions.ubOverheadMapModeNight = iniReader.ReadInteger("Graphics Settings", "OVERHEAD_MAP_MODE_NIGHT", 0, 0, 3);
|
||||||
|
|
||||||
//################# Sound Settings #################
|
//################# Sound Settings #################
|
||||||
|
|
||||||
gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/);
|
gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/);
|
||||||
@@ -1661,6 +1677,9 @@ void LoadGameExternalOptions()
|
|||||||
//JMich.BackpackClimb
|
//JMich.BackpackClimb
|
||||||
gGameExternalOptions.sBackpackWeightToClimb = iniReader.ReadInteger("Tactical Gameplay Settings", "MAX_BACKPACK_WEIGHT_TO_CLIMB", -1);
|
gGameExternalOptions.sBackpackWeightToClimb = iniReader.ReadInteger("Tactical Gameplay Settings", "MAX_BACKPACK_WEIGHT_TO_CLIMB", -1);
|
||||||
gGameExternalOptions.fUseGlobalBackpackSettings = iniReader.ReadBoolean("Tactical Gameplay Settings", "USE_GLOBAL_BACKPACK_SETTINGS", TRUE);
|
gGameExternalOptions.fUseGlobalBackpackSettings = iniReader.ReadBoolean("Tactical Gameplay Settings", "USE_GLOBAL_BACKPACK_SETTINGS", TRUE);
|
||||||
|
|
||||||
|
// Buscher
|
||||||
|
gGameExternalOptions.ubBackPackWeightFactorForAPPenalty = iniReader.ReadInteger("Tactical Gameplay Settings", "BACKPACK_WEIGHT_FACTOR", 50, 1, 250);
|
||||||
|
|
||||||
// sevenfm
|
// sevenfm
|
||||||
gGameExternalOptions.fShowEnemyWeapon = iniReader.ReadBoolean("Tactical Gameplay Settings","SHOW_ENEMY_WEAPON", FALSE);
|
gGameExternalOptions.fShowEnemyWeapon = iniReader.ReadBoolean("Tactical Gameplay Settings","SHOW_ENEMY_WEAPON", FALSE);
|
||||||
@@ -1980,6 +1999,7 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
||||||
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
||||||
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
|
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
|
||||||
|
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
|
||||||
|
|
||||||
//################# Disease Settings ##################
|
//################# Disease Settings ##################
|
||||||
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
|
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
|
||||||
@@ -2079,9 +2099,6 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
//################# Strategic Gameplay Settings ##################
|
//################# Strategic Gameplay Settings ##################
|
||||||
|
|
||||||
// Allow enemy and militia Strategic Groups to reinforce one another for battles?
|
|
||||||
// silversurfer: Obsolete. This is now in DifficultySettings.xml and will be set during InitNewGame().
|
|
||||||
gGameExternalOptions.gfAllowReinforcements = TRUE;
|
|
||||||
// Allow reinforcements only between City sectors?
|
// Allow reinforcements only between City sectors?
|
||||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
|
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
|
||||||
|
|
||||||
@@ -2480,8 +2497,6 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.ubTeachBonusToTrain = iniReader.ReadInteger("Strategic Assignment Settings","TEACHER_TRAIT_BONUS_TO_TRAINING_EFFICIENCY",30, 0, 100);
|
gGameExternalOptions.ubTeachBonusToTrain = iniReader.ReadInteger("Strategic Assignment Settings","TEACHER_TRAIT_BONUS_TO_TRAINING_EFFICIENCY",30, 0, 100);
|
||||||
gGameExternalOptions.ubMinSkillToTeach = iniReader.ReadInteger("Strategic Assignment Settings","MIN_SKILL_REQUIRED_TO_TEACH_OTHER",25, 0, 100);
|
gGameExternalOptions.ubMinSkillToTeach = iniReader.ReadInteger("Strategic Assignment Settings","MIN_SKILL_REQUIRED_TO_TEACH_OTHER",25, 0, 100);
|
||||||
|
|
||||||
gGameExternalOptions.bDisableEvolution = iniReader.ReadBoolean("Strategic Assignment Settings", "DISABLE_EVOLUTION", TRUE );
|
|
||||||
|
|
||||||
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainees will go to sleep when their trainer goes to sleep. 3 = Trainer will go to sleep if all trainees are asleep. 1 = Both. 0 = Neither.
|
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainees will go to sleep when their trainer goes to sleep. 3 = Trainer will go to sleep if all trainees are asleep. 1 = Both. 0 = Neither.
|
||||||
gGameExternalOptions.ubSmartTrainingSleep = iniReader.ReadInteger("Strategic Assignment Settings","SYNCHRONIZED_SLEEPING_HOURS_WHEN_TRAINING_TOGETHER", 0, 0, 3);
|
gGameExternalOptions.ubSmartTrainingSleep = iniReader.ReadInteger("Strategic Assignment Settings","SYNCHRONIZED_SLEEPING_HOURS_WHEN_TRAINING_TOGETHER", 0, 0, 3);
|
||||||
|
|
||||||
@@ -2585,7 +2600,7 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.ubNumberOfMajorTraitsAllowed = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED", 3, 2, gSkillTraitValues.ubMaxNumberOfTraits - 1);
|
gSkillTraitValues.ubNumberOfMajorTraitsAllowed = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED", 3, 2, gSkillTraitValues.ubMaxNumberOfTraits - 1);
|
||||||
|
|
||||||
gSkillTraitValues.ubMaxNumberOfTraitsForIMP = iniReader.ReadInteger("Generic Traits Settings","MAX_NUMBER_OF_TRAITS_FOR_IMP", 3, 2, 30);
|
gSkillTraitValues.ubMaxNumberOfTraitsForIMP = iniReader.ReadInteger("Generic Traits Settings","MAX_NUMBER_OF_TRAITS_FOR_IMP", 3, 2, 30);
|
||||||
gSkillTraitValues.ubNumberOfMajorTraitsAllowedForIMP = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED_FOR_IMP", 2, 2, min( gSkillTraitValues.ubNumberOfMajorTraitsAllowed, gSkillTraitValues.ubMaxNumberOfTraitsForIMP - 1 ) );
|
gSkillTraitValues.ubNumberOfMajorTraitsAllowedForIMP = iniReader.ReadInteger( "Generic Traits Settings", "NUMBER_OF_MAJOR_TRAITS_ALLOWED_FOR_IMP", 2, 2, min( gSkillTraitValues.ubNumberOfMajorTraitsAllowed, gSkillTraitValues.ubMaxNumberOfTraitsForIMP ) );
|
||||||
|
|
||||||
// Allow an exception in number of traits for Special Merc?
|
// Allow an exception in number of traits for Special Merc?
|
||||||
//gSkillTraitValues.fAllowSpecialMercTraitsException = iniReader.ReadBoolean("Generic Traits Settings","ALLOW_EXCEPTION_FOR_SPECIAL_MERC", TRUE);
|
//gSkillTraitValues.fAllowSpecialMercTraitsException = iniReader.ReadBoolean("Generic Traits Settings","ALLOW_EXCEPTION_FOR_SPECIAL_MERC", TRUE);
|
||||||
@@ -2734,6 +2749,7 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.ubTERepairRobotPenaltyReduction = iniReader.ReadInteger("Technician","REPAIR_SPEED_ROBOT_PENALTY_REDUCTION", 30, 0, 100);
|
gSkillTraitValues.ubTERepairRobotPenaltyReduction = iniReader.ReadInteger("Technician","REPAIR_SPEED_ROBOT_PENALTY_REDUCTION", 30, 0, 100);
|
||||||
if (gSkillTraitValues.ubTETraitsNumToRepairRobot == 2) {gSkillTraitValues.ubTERepairRobotPenaltyReduction /= 2; }
|
if (gSkillTraitValues.ubTETraitsNumToRepairRobot == 2) {gSkillTraitValues.ubTERepairRobotPenaltyReduction /= 2; }
|
||||||
gSkillTraitValues.fTETraitsCanRestoreItemThreshold = iniReader.ReadBoolean( "Technician", "MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE );
|
gSkillTraitValues.fTETraitsCanRestoreItemThreshold = iniReader.ReadBoolean( "Technician", "MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE );
|
||||||
|
gSkillTraitValues.ubTechLevelNeededForAdvancedRepair = iniReader.ReadInteger("Technician", "TECH_LEVEL_NEEDED_FOR_ADVANCED_REPAIR", 2, 1, 2);
|
||||||
|
|
||||||
// DOCTOR
|
// DOCTOR
|
||||||
gSkillTraitValues.ubDONumberTraitsNeededForSurgery = iniReader.ReadInteger("Doctor","NUMBER_OF_TRAITS_NEEDED_FOR_SURGERY", 1, 0, 2);
|
gSkillTraitValues.ubDONumberTraitsNeededForSurgery = iniReader.ReadInteger("Doctor","NUMBER_OF_TRAITS_NEEDED_FOR_SURGERY", 1, 0, 2);
|
||||||
@@ -2784,6 +2800,9 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.ubTHBladesSilentCriticalHitChance = iniReader.ReadInteger("Throwing","TH_BLADES_SILENT_CRITICAL_HIT_CHANCE", 20, 0, 100);
|
gSkillTraitValues.ubTHBladesSilentCriticalHitChance = iniReader.ReadInteger("Throwing","TH_BLADES_SILENT_CRITICAL_HIT_CHANCE", 20, 0, 100);
|
||||||
gSkillTraitValues.ubTHBladesCriticalHitMultiplierBonus = iniReader.ReadInteger("Throwing","SILENT_CRITICAL_HIT_MULTIPLIER_BONUS", 1, 0, 50);
|
gSkillTraitValues.ubTHBladesCriticalHitMultiplierBonus = iniReader.ReadInteger("Throwing","SILENT_CRITICAL_HIT_MULTIPLIER_BONUS", 1, 0, 50);
|
||||||
gSkillTraitValues.ubTHBladesAimClicksAdded = iniReader.ReadInteger("Throwing","POSSIBLE_AIM_CLICK_ADDED_TH_KNIVES", 1, 0, 5);
|
gSkillTraitValues.ubTHBladesAimClicksAdded = iniReader.ReadInteger("Throwing","POSSIBLE_AIM_CLICK_ADDED_TH_KNIVES", 1, 0, 5);
|
||||||
|
gSkillTraitValues.ubTHAPsNeededToThrowGrenadesReduction = iniReader.ReadInteger("Throwing","APS_NEEDED_TO_THROW_GRENADES_REDUCTION", 25, 0, 90);
|
||||||
|
gSkillTraitValues.ubTHMaxRangeToThrowGrenades = iniReader.ReadInteger("Throwing","MAX_RANGE_TO_THROW_GRENADES", 20, 0, 250);
|
||||||
|
gSkillTraitValues.ubTHCtHWhenThrowingGrenades = iniReader.ReadInteger("Throwing","CTH_WHEN_THROWING_GRENADES", 30, 0, 100);
|
||||||
|
|
||||||
// NIGHT OPS
|
// NIGHT OPS
|
||||||
gSkillTraitValues.ubNOeSightRangeBonusInDark = iniReader.ReadInteger("Night Ops","SIGHT_RANGE_BONUS_IN_DARK", 1, 0, 100);
|
gSkillTraitValues.ubNOeSightRangeBonusInDark = iniReader.ReadInteger("Night Ops","SIGHT_RANGE_BONUS_IN_DARK", 1, 0, 100);
|
||||||
@@ -2810,9 +2829,6 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.usBBIncreasedNeededDamageToFallDown = iniReader.ReadInteger("Bodybuilding","INCREASE_DAMAGE_NEEDED_TO_FALL_DOWN_IF_HIT_TO_LEGS", 100, 0, 500);
|
gSkillTraitValues.usBBIncreasedNeededDamageToFallDown = iniReader.ReadInteger("Bodybuilding","INCREASE_DAMAGE_NEEDED_TO_FALL_DOWN_IF_HIT_TO_LEGS", 100, 0, 500);
|
||||||
|
|
||||||
// DEMOLITIONS
|
// DEMOLITIONS
|
||||||
gSkillTraitValues.ubDEAPsNeededToThrowGrenadesReduction = iniReader.ReadInteger("Demolitions","APS_NEEDED_TO_THROW_GRENADES_REDUCTION", 25, 0, 90);
|
|
||||||
gSkillTraitValues.ubDEMaxRangeToThrowGrenades = iniReader.ReadInteger("Demolitions","MAX_RANGE_TO_THROW_GRENADES", 20, 0, 250);
|
|
||||||
gSkillTraitValues.ubDECtHWhenThrowingGrenades = iniReader.ReadInteger("Demolitions","CTH_WHEN_THROWING_GRENADES", 30, 0, 100);
|
|
||||||
gSkillTraitValues.ubDEDamageOfBombsAndMines = iniReader.ReadInteger("Demolitions","DAMAGE_OF_PLACED_BOMBS_AND_MINES", 25, 0, 250);
|
gSkillTraitValues.ubDEDamageOfBombsAndMines = iniReader.ReadInteger("Demolitions","DAMAGE_OF_PLACED_BOMBS_AND_MINES", 25, 0, 250);
|
||||||
gSkillTraitValues.ubDEAttachDetonatorCheckBonus = iniReader.ReadInteger("Demolitions","ATTACH_DETONATOR_CHECK_BONUS", 50, 0, 250);
|
gSkillTraitValues.ubDEAttachDetonatorCheckBonus = iniReader.ReadInteger("Demolitions","ATTACH_DETONATOR_CHECK_BONUS", 50, 0, 250);
|
||||||
gSkillTraitValues.ubDEPlantAndRemoveBombCheckBonus = iniReader.ReadInteger("Demolitions","PLANT_AND_REMOVE_BOMBS_AND_MINES_BONUS", 50, 0, 250);
|
gSkillTraitValues.ubDEPlantAndRemoveBombCheckBonus = iniReader.ReadInteger("Demolitions","PLANT_AND_REMOVE_BOMBS_AND_MINES_BONUS", 50, 0, 250);
|
||||||
@@ -2878,7 +2894,7 @@ void LoadSkillTraitsExternalSettings()
|
|||||||
gSkillTraitValues.fSNTSnitchLeadershipBonusModifer = iniReader.ReadFloat("Snitch","SNITCH_LEADERSHIP_BONUS_MODIFIER", 0.5, 0.0, 10.0);
|
gSkillTraitValues.fSNTSnitchLeadershipBonusModifer = iniReader.ReadFloat("Snitch","SNITCH_LEADERSHIP_BONUS_MODIFIER", 0.5, 0.0, 10.0);
|
||||||
gSkillTraitValues.bSNTSociableMercBonus = iniReader.ReadInteger("Snitch","SOCIABLE_MERC_BONUS", 10, -100, 100);
|
gSkillTraitValues.bSNTSociableMercBonus = iniReader.ReadInteger("Snitch","SOCIABLE_MERC_BONUS", 10, -100, 100);
|
||||||
gSkillTraitValues.bSNTLonerMercBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -10, -100, 100);
|
gSkillTraitValues.bSNTLonerMercBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -10, -100, 100);
|
||||||
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","LONER_MERC_BONUS", -20, -100, 100);
|
gSkillTraitValues.bSNTSameAssignmentBonus = iniReader.ReadInteger("Snitch","SAME_ASSIGNMENT_BONUS", -20, -100, 100);
|
||||||
gSkillTraitValues.bSNTMercOpinionAboutMercTreshold = iniReader.ReadInteger("Snitch","MERC_OPINION_ABOUT_MERC_TRESHOLD", -10, -25, 25);
|
gSkillTraitValues.bSNTMercOpinionAboutMercTreshold = iniReader.ReadInteger("Snitch","MERC_OPINION_ABOUT_MERC_TRESHOLD", -10, -25, 25);
|
||||||
|
|
||||||
gSkillTraitValues.ubSNTPassiveReputationGain = iniReader.ReadInteger("Snitch","PASSIVE_REPUTATION_GAIN", 3, 0, 100);
|
gSkillTraitValues.ubSNTPassiveReputationGain = iniReader.ReadInteger("Snitch","PASSIVE_REPUTATION_GAIN", 3, 0, 100);
|
||||||
@@ -3594,10 +3610,10 @@ void LoadGameAPBPConstants()
|
|||||||
APBPConstants[BP_CRAWL_ENERGYCOSTFACTOR] = iniReader.ReadInteger("BPConstants","BP_CRAWL_ENERGYCOSTFACTOR",4);
|
APBPConstants[BP_CRAWL_ENERGYCOSTFACTOR] = iniReader.ReadInteger("BPConstants","BP_CRAWL_ENERGYCOSTFACTOR",4);
|
||||||
APBPConstants[BP_RADIO] = iniReader.ReadInteger("BPConstants","BP_RADIO",0);
|
APBPConstants[BP_RADIO] = iniReader.ReadInteger("BPConstants","BP_RADIO",0);
|
||||||
APBPConstants[BP_USE_DETONATOR] = iniReader.ReadInteger("BPConstants","BP_USE_DETONATOR",0);
|
APBPConstants[BP_USE_DETONATOR] = iniReader.ReadInteger("BPConstants","BP_USE_DETONATOR",0);
|
||||||
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
|
APBPConstants[BP_PER_AP_NO_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_NO_EFFORT",-50),-50, TRUE);
|
||||||
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
|
APBPConstants[BP_PER_AP_MIN_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MIN_EFFORT",-25),-25, TRUE);
|
||||||
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
|
APBPConstants[BP_PER_AP_LT_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_LT_EFFORT",-12),-12, TRUE);
|
||||||
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
|
APBPConstants[BP_PER_AP_MOD_EFFORT] = DynamicAdjustAPConstants(iniReader.ReadInteger("BPConstants","BP_PER_AP_MOD_EFFORT",0),0, TRUE);
|
||||||
APBPConstants[BP_MOVEMENT_FLAT] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_FLAT",5);
|
APBPConstants[BP_MOVEMENT_FLAT] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_FLAT",5);
|
||||||
APBPConstants[BP_MOVEMENT_GRASS] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_GRASS",10);
|
APBPConstants[BP_MOVEMENT_GRASS] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_GRASS",10);
|
||||||
APBPConstants[BP_MOVEMENT_BUSH] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_BUSH",20);
|
APBPConstants[BP_MOVEMENT_BUSH] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_BUSH",20);
|
||||||
@@ -3777,7 +3793,7 @@ void LoadCTHConstants()
|
|||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_WIS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_WIS",1.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AGI = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AGI",1.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_EXP_LEVEL = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_EXP_LEVEL",2.0, 0.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_AUTO_WEAPONS_DIVISOR = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_AUTO_WEAPONS_DIVISOR",2.0, 1.0, 100.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_TRACER_BONUS = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_TRACER_BONUS",10.0, -1000.0, 1000.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_ANTICIPATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_ANTICIPATION",25.0, -1000.0, 1000.0);
|
||||||
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
|
gGameCTHConstants.RECOIL_COUNTER_ACCURACY_COMPENSATION = iniReader.ReadFloat("Shooting Mechanism","RECOIL_COUNTER_ACCURACY_COMPENSATION",2.0, 0.0, 5.0);
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
#ifndef _GAME_SETTINGS__H_
|
#ifndef _GAME_SETTINGS__H_
|
||||||
#define _GAME_SETTINGS__H_
|
#define _GAME_SETTINGS__H_
|
||||||
|
|
||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "Morale.h"
|
#include "Morale.h"
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
|
|
||||||
|
#include <string_view>
|
||||||
#define GAME_INI_FILE "Ja2.ini"
|
#define GAME_INI_FILE "Ja2.ini"
|
||||||
|
|
||||||
|
constexpr std::string_view LANGUAGE_INI_FILE{"Language.ini"};
|
||||||
//If you add any options, MAKE sure you add the corresponding string to the Options Screen string array.
|
//If you add any options, MAKE sure you add the corresponding string to the Options Screen string array.
|
||||||
// look up : zOptionsScreenHelpText , zOptionsToggleText
|
// look up : zOptionsScreenHelpText , zOptionsToggleText
|
||||||
//Also, define its initialization and add its load/save to INI lines in : InitGameSettings() , SaveGameSettings() , LoadGameSettings()
|
//Also, define its initialization and add its load/save to INI lines in : InitGameSettings() , SaveGameSettings() , LoadGameSettings()
|
||||||
@@ -337,6 +339,7 @@ BOOLEAN UsingBackGroundSystem();
|
|||||||
BOOLEAN UsingImprovedInterruptSystem();
|
BOOLEAN UsingImprovedInterruptSystem();
|
||||||
BOOLEAN UsingInventoryCostsAPSystem();
|
BOOLEAN UsingInventoryCostsAPSystem();
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN IsNIVModeValid(bool checkRes = true);
|
BOOLEAN IsNIVModeValid(bool checkRes = true);
|
||||||
|
|
||||||
// Snap: Options read from an INI file in the default of custom Data directory
|
// Snap: Options read from an INI file in the default of custom Data directory
|
||||||
@@ -505,6 +508,7 @@ typedef struct
|
|||||||
FLOAT sFoodDecayModificator;
|
FLOAT sFoodDecayModificator;
|
||||||
|
|
||||||
BOOLEAN fFoodEatingSounds;
|
BOOLEAN fFoodEatingSounds;
|
||||||
|
BOOLEAN fAlwaysFood;
|
||||||
|
|
||||||
// Flugente: disease settings
|
// Flugente: disease settings
|
||||||
BOOLEAN fDisease;
|
BOOLEAN fDisease;
|
||||||
@@ -781,6 +785,7 @@ typedef struct
|
|||||||
INT32 ubEnemiesItemDrop;
|
INT32 ubEnemiesItemDrop;
|
||||||
|
|
||||||
BOOLEAN gfUseExternalLoadscreens;
|
BOOLEAN gfUseExternalLoadscreens;
|
||||||
|
UINT32 ubLoadscreenStretchMode; // added by anv
|
||||||
BOOLEAN gfUseLoadScreenHints; // added by Flugente
|
BOOLEAN gfUseLoadScreenHints; // added by Flugente
|
||||||
UINT32 ubAdditionalDelayUntilLoadScreenDisposal; // added by WANNE to have time to read the load screen hints
|
UINT32 ubAdditionalDelayUntilLoadScreenDisposal; // added by WANNE to have time to read the load screen hints
|
||||||
|
|
||||||
@@ -816,9 +821,6 @@ typedef struct
|
|||||||
INT32 ubRpcBonusToTrainMilitia;
|
INT32 ubRpcBonusToTrainMilitia;
|
||||||
INT32 ubMinSkillToTeach;
|
INT32 ubMinSkillToTeach;
|
||||||
|
|
||||||
// Flugente: disable evolution setting in MercProfiles.xml
|
|
||||||
BOOLEAN bDisableEvolution;
|
|
||||||
|
|
||||||
INT32 ubLowActivityLevel;
|
INT32 ubLowActivityLevel;
|
||||||
INT32 ubMediumActivityLevel;
|
INT32 ubMediumActivityLevel;
|
||||||
INT32 ubHighActivityLevel;
|
INT32 ubHighActivityLevel;
|
||||||
@@ -954,6 +956,12 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.)
|
BOOLEAN fAdditionalDecals; // Flugente: show additional decals on objects (cracked walls, blood spatters etc.)
|
||||||
|
|
||||||
|
// anv: map color variants
|
||||||
|
UINT8 ubRadarMapModeDay;
|
||||||
|
UINT8 ubRadarMapModeNight;
|
||||||
|
UINT8 ubOverheadMapModeDay;
|
||||||
|
UINT8 ubOverheadMapModeNight;
|
||||||
|
|
||||||
//enable ext mouse key
|
//enable ext mouse key
|
||||||
BOOLEAN bAltAimEnabled;
|
BOOLEAN bAltAimEnabled;
|
||||||
BOOLEAN bAimedBurstEnabled;
|
BOOLEAN bAimedBurstEnabled;
|
||||||
@@ -1355,6 +1363,9 @@ typedef struct
|
|||||||
INT16 sBackpackWeightToClimb;
|
INT16 sBackpackWeightToClimb;
|
||||||
BOOLEAN fUseGlobalBackpackSettings;
|
BOOLEAN fUseGlobalBackpackSettings;
|
||||||
|
|
||||||
|
// Buscher
|
||||||
|
UINT8 ubBackPackWeightFactorForAPPenalty;
|
||||||
|
|
||||||
// sevenfm: show enemy weapon above soldier in tactical
|
// sevenfm: show enemy weapon above soldier in tactical
|
||||||
BOOLEAN fShowEnemyWeapon;
|
BOOLEAN fShowEnemyWeapon;
|
||||||
BOOLEAN fShowEnemyExtendedInfo;
|
BOOLEAN fShowEnemyExtendedInfo;
|
||||||
@@ -1440,6 +1451,10 @@ typedef struct
|
|||||||
|
|
||||||
UINT8 ubMercRandomStartSalaryPercentMod;
|
UINT8 ubMercRandomStartSalaryPercentMod;
|
||||||
|
|
||||||
|
BOOLEAN fMercGrowthModifiersEnabled;
|
||||||
|
BOOLEAN fMercRandomGrowthModifiers;
|
||||||
|
INT16 iMercRandomGrowthModifiersRange;
|
||||||
|
|
||||||
BOOLEAN fBobbyRayFastShipments;
|
BOOLEAN fBobbyRayFastShipments;
|
||||||
|
|
||||||
BOOLEAN fGridExitInTurnBased;
|
BOOLEAN fGridExitInTurnBased;
|
||||||
@@ -1550,6 +1565,12 @@ typedef struct
|
|||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
BOOLEAN fBackGround;
|
BOOLEAN fBackGround;
|
||||||
|
|
||||||
|
// Kitty: Alternative IMP Creation (choices in skills/char-traits/disabilities determine available backgrounds, plus additional available backgrounds)
|
||||||
|
BOOLEAN fAltIMPCreation;
|
||||||
|
|
||||||
|
// Kitty: Reduced IMP Backgrounds (same as fAltIMPCreation, but for this only the additional backgrounds)
|
||||||
|
BOOLEAN fReducedIMPCreation;
|
||||||
|
|
||||||
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
|
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
|
||||||
UINT8 ubAllowAlternativeWeaponHolding;
|
UINT8 ubAllowAlternativeWeaponHolding;
|
||||||
@@ -2126,6 +2147,7 @@ typedef struct
|
|||||||
UINT8 ubTERepairRobotPenaltyReduction;
|
UINT8 ubTERepairRobotPenaltyReduction;
|
||||||
UINT8 ubTETraitsNumToRepairRobot;
|
UINT8 ubTETraitsNumToRepairRobot;
|
||||||
BOOLEAN fTETraitsCanRestoreItemThreshold;
|
BOOLEAN fTETraitsCanRestoreItemThreshold;
|
||||||
|
UINT8 ubTechLevelNeededForAdvancedRepair; // if we have a high enough technician level, we can repair items above the normal threshold (1 for technician, 2 for engineer)
|
||||||
|
|
||||||
// DOCTOR
|
// DOCTOR
|
||||||
UINT8 ubDONumberTraitsNeededForSurgery;
|
UINT8 ubDONumberTraitsNeededForSurgery;
|
||||||
@@ -2176,6 +2198,9 @@ typedef struct
|
|||||||
UINT8 ubTHBladesSilentCriticalHitChance;
|
UINT8 ubTHBladesSilentCriticalHitChance;
|
||||||
UINT8 ubTHBladesCriticalHitMultiplierBonus;
|
UINT8 ubTHBladesCriticalHitMultiplierBonus;
|
||||||
UINT8 ubTHBladesAimClicksAdded;
|
UINT8 ubTHBladesAimClicksAdded;
|
||||||
|
UINT8 ubTHAPsNeededToThrowGrenadesReduction;
|
||||||
|
UINT8 ubTHMaxRangeToThrowGrenades;
|
||||||
|
UINT8 ubTHCtHWhenThrowingGrenades;
|
||||||
|
|
||||||
// NIGHT OPS
|
// NIGHT OPS
|
||||||
UINT8 ubNOeSightRangeBonusInDark;
|
UINT8 ubNOeSightRangeBonusInDark;
|
||||||
@@ -2202,9 +2227,6 @@ typedef struct
|
|||||||
UINT16 usBBIncreasedNeededDamageToFallDown;
|
UINT16 usBBIncreasedNeededDamageToFallDown;
|
||||||
|
|
||||||
// DEMOLITIONS
|
// DEMOLITIONS
|
||||||
UINT8 ubDEAPsNeededToThrowGrenadesReduction;
|
|
||||||
UINT8 ubDEMaxRangeToThrowGrenades;
|
|
||||||
UINT8 ubDECtHWhenThrowingGrenades;
|
|
||||||
UINT8 ubDEDamageOfBombsAndMines;
|
UINT8 ubDEDamageOfBombsAndMines;
|
||||||
UINT8 ubDEAttachDetonatorCheckBonus;
|
UINT8 ubDEAttachDetonatorCheckBonus;
|
||||||
UINT8 ubDEPlantAndRemoveBombCheckBonus;
|
UINT8 ubDEPlantAndRemoveBombCheckBonus;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "GameVersion.h"
|
#include "GameVersion.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -23,6 +23,9 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||||
// you will invalidate the saved game file
|
// you will invalidate the saved game file
|
||||||
|
|
||||||
|
#define INCREASED_TEAMSIZES 186 // Asdow: SOLDIERTYPE ubID changed from UINT8 -> UINT16
|
||||||
|
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
|
||||||
|
#define GROWTH_MODIFIERS 184
|
||||||
#define REBELCOMMAND 183
|
#define REBELCOMMAND 183
|
||||||
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
||||||
#define DISABILITYFLAGMASK 181 // Flugente: disabilities get a flagmask
|
#define DISABILITYFLAGMASK 181 // Flugente: disabilities get a flagmask
|
||||||
@@ -104,7 +107,7 @@ extern CHAR16 zBuildInformation[256];
|
|||||||
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
||||||
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
||||||
|
|
||||||
#define SAVE_GAME_VERSION REBELCOMMAND
|
#define SAVE_GAME_VERSION INCREASED_TEAMSIZES
|
||||||
|
|
||||||
//#define RUSSIANGOLD
|
//#define RUSSIANGOLD
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -1,27 +1,23 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "WCheck.h"
|
||||||
#include "wcheck.h"
|
#include "Cursors.h"
|
||||||
#include "cursors.h"
|
#include "Font Control.h"
|
||||||
#include "font control.h"
|
#include "Render Dirty.h"
|
||||||
#include "cursor control.h"
|
#include "Text.h"
|
||||||
#include "render dirty.h"
|
#include "Utilities.h"
|
||||||
#include "Text.h"
|
#include "WordWrap.h"
|
||||||
#include "Utilities.h"
|
#include "HelpScreen.h"
|
||||||
#include "WordWrap.h"
|
#include "HelpScreenText.h"
|
||||||
#include "Font Control.h"
|
#include "line.h"
|
||||||
#include "text.h"
|
#include "Game Clock.h"
|
||||||
#include "HelpScreen.h"
|
#include "GameSettings.h"
|
||||||
#include "HelpScreenText.h"
|
#include "laptop.h"
|
||||||
#include "Line.h"
|
#include "Text Input.h"
|
||||||
#include "Game Clock.h"
|
#include "english.h"
|
||||||
#include "GameSettings.h"
|
#include "renderworld.h"
|
||||||
#include "laptop.h"
|
#include "Game Init.h"
|
||||||
#include "Text Input.h"
|
#include "Overhead.h"
|
||||||
#include "english.h"
|
|
||||||
#include "renderworld.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
|
|
||||||
extern INT16 gsVIEWPORT_END_Y;
|
extern INT16 gsVIEWPORT_END_Y;
|
||||||
extern void PrintDate( void );
|
extern void PrintDate( void );
|
||||||
@@ -308,7 +304,6 @@ void SelectHelpScrollAreaCallBack( MOUSE_REGION * pRegion, INT32 iReason );
|
|||||||
|
|
||||||
// region to mask the background
|
// region to mask the background
|
||||||
MOUSE_REGION gHelpScreenScrollAreaArrows;
|
MOUSE_REGION gHelpScreenScrollAreaArrows;
|
||||||
void SelectHelpScrollAreaArrowsCallBack( MOUSE_REGION * pRegion, INT32 iReason );
|
|
||||||
|
|
||||||
|
|
||||||
//checkbox to toggle show help again toggle
|
//checkbox to toggle show help again toggle
|
||||||
@@ -72,4 +72,4 @@ void NewScreenSoResetHelpScreen( );
|
|||||||
INT8 HelpScreenDetermineWhichMapScreenHelpToShow();
|
INT8 HelpScreenDetermineWhichMapScreenHelpToShow();
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+180
-284
@@ -1,64 +1,54 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "Gameloop.h"
|
#include "Screens.h"
|
||||||
#include "Screens.h"
|
#include "vobject_blitters.h"
|
||||||
#include "INIReader.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "worlddef.h"
|
||||||
#include "renderworld.h"
|
#include "Animation Data.h"
|
||||||
#include "mousesystem.h"
|
#include "Overhead.h"
|
||||||
#include "sysutil.h"
|
#include "Font Control.h"
|
||||||
#include "worlddef.h"
|
#include <himage.h>
|
||||||
#include "Animation Data.h"
|
#include <vobject.h>
|
||||||
#include "overhead.h"
|
#include "Timer Control.h"
|
||||||
#include "Font Control.h"
|
#include "Utilities.h"
|
||||||
#include "Button System.h"
|
#include "Render Dirty.h"
|
||||||
#include "Timer Control.h"
|
#include "Sound Control.h"
|
||||||
#include "Utilities.h"
|
#include "lighting.h"
|
||||||
#include "Radar Screen.h"
|
#include "Cursor Control.h"
|
||||||
#include "Render Dirty.h"
|
#include "Music Control.h"
|
||||||
#include "Sound Control.h"
|
#include "video.h"
|
||||||
#include "Event Pump.h"
|
#include "maputility.h"
|
||||||
#include "lighting.h"
|
#include "strategic.h"
|
||||||
#include "Cursor Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "music control.h"
|
#include "Text.h"
|
||||||
#include "video.h"
|
#include "laptop.h"
|
||||||
#include "mapscreen.h"
|
#include "MercTextBox.h"
|
||||||
#include "interface items.h"
|
#include "Tile Cache.h"
|
||||||
#include "Maputility.h"
|
#include "strategicmap.h"
|
||||||
#include "strategic.h"
|
#include "Map Information.h"
|
||||||
#include "dialogue control.h"
|
#include "Shade Table Util.h"
|
||||||
#include "Text.h"
|
#include "Exit Grids.h"
|
||||||
#include "laptop.h"
|
#include "Summary Info.h"
|
||||||
#include "NPC.h"
|
#include "GameSettings.h"
|
||||||
#include "MercTextBox.h"
|
#include "Game Init.h"
|
||||||
#include "tile cache.h"
|
#include "Init.h"
|
||||||
#include "strategicmap.h"
|
#include "jascreens.h"
|
||||||
#include "Map Information.h"
|
#include "XML.h"
|
||||||
#include "laptop.h"
|
#include "SaveLoadGame.h"
|
||||||
#include "Shade Table Util.h"
|
#include "Weapons.h"
|
||||||
#include "Exit Grids.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Summary Info.h"
|
#include "Vehicles.h"
|
||||||
#include "GameSettings.h"
|
#include "Multilingual Text Code Generator.h"
|
||||||
#include "Game Init.h"
|
#include "editscreen.h"
|
||||||
#include "Init.h"
|
#include "Arms Dealer Init.h"
|
||||||
#include "jascreens.h"
|
#include "Map Screen Interface Bottom.h"
|
||||||
#include "XML.h"
|
|
||||||
#include "SaveLoadGame.h"
|
|
||||||
#include "weapons.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Vehicles.h"
|
|
||||||
#include "Multilingual Text Code Generator.h"
|
|
||||||
#include "editscreen.h"
|
|
||||||
#include "Arms Dealer Init.h"
|
|
||||||
#include "MPXmlTeams.hpp"
|
#include "MPXmlTeams.hpp"
|
||||||
#include "Strategic Mines LUA.h"
|
#include "Strategic Mines LUA.h"
|
||||||
#include "UndergroundInit.h"
|
#include "UndergroundInit.h"
|
||||||
#include "lua_state.h"
|
#include "lua_state.h"
|
||||||
|
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "aim.h"
|
#include "aim.h"
|
||||||
#include "mainmenuscreen.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
@@ -70,13 +60,13 @@
|
|||||||
#include "ub_config.h"
|
#include "ub_config.h"
|
||||||
|
|
||||||
|
|
||||||
#include "Civ Quotes.h"
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "BriefingRoom_Data.h"
|
#include "BriefingRoom_Data.h"
|
||||||
#include "AimArchives.h"
|
#include "AimArchives.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
|
#include "DynamicDialogueWidget.h" // added by Flugente for InitMyBoxes()
|
||||||
#include "Animation Data.h" // added by Flugente
|
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
|
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
|
||||||
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
|
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
|
||||||
@@ -95,20 +85,6 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString );
|
|||||||
extern BOOLEAN gfUseConsecutiveQuickSaveSlots;
|
extern BOOLEAN gfUseConsecutiveQuickSaveSlots;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( GERMAN ) && !defined( _DEBUG )
|
|
||||||
//#define LASERLOCK_ENABLED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
int LASERLOK_Init( HINSTANCE hInstance );
|
|
||||||
int LASERLOK_Run();
|
|
||||||
int LASERLOK_Check();
|
|
||||||
|
|
||||||
BOOLEAN PrepareLaserLockSystem();
|
|
||||||
void HandleLaserLockResult( BOOLEAN fSuccess );
|
|
||||||
// int TestCall( int n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern HINSTANCE ghInstance;
|
extern HINSTANCE ghInstance;
|
||||||
|
|
||||||
@@ -134,40 +110,12 @@ static void AddLanguagePrefix(STR fileName, const STR language)
|
|||||||
memmove( fileComponent, language, strlen( language) );
|
memmove( fileComponent, language, strlen( language) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static const STR GetLanguagePrefix()
|
|
||||||
{
|
|
||||||
#ifdef ENGLISH
|
|
||||||
return "";
|
|
||||||
#endif
|
|
||||||
#ifdef GERMAN
|
|
||||||
return GERMAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef RUSSIAN
|
|
||||||
return RUSSIAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef DUTCH
|
|
||||||
return DUTCH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef POLISH
|
|
||||||
return POLISH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef FRENCH
|
|
||||||
return FRENCH_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef ITALIAN
|
|
||||||
return ITALIAN_PREFIX;
|
|
||||||
#endif
|
|
||||||
#ifdef CHINESE
|
|
||||||
return CHINESE_PREFIX;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void AddLanguagePrefix(STR fileName)
|
static void AddLanguagePrefix(STR fileName)
|
||||||
{
|
{
|
||||||
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetEmptyRPCFaceSlots()
|
static void ResetEmptyRPCFaceSlots()
|
||||||
{
|
{
|
||||||
//legion by jazz (load small faces from rpcs)
|
//legion by jazz (load small faces from rpcs)
|
||||||
// reset empty slots with "-1"
|
// reset empty slots with "-1"
|
||||||
@@ -254,7 +202,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, AMMOFILENAME);
|
strcat(fileName, AMMOFILENAME);
|
||||||
|
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
|
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
@@ -268,9 +216,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, AMMOFILENAME);
|
strcat(fileName, AMMOFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
SGP_THROW_IFFALSE(ReadInAmmoStats(fileName),AMMOFILENAME);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Lesh: added this, begin
|
// Lesh: added this, begin
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -294,14 +242,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
|
// the uiIndex (for reference), szItemName, szLongItemName, szItemDesc, szBRName, and szBRDesc tags
|
||||||
|
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInItemStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
//if(!WriteItemStats())
|
//if(!WriteItemStats())
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
@@ -366,14 +314,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat( fileName, DISEASEFILENAME );
|
strcat( fileName, DISEASEFILENAME );
|
||||||
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
|
SGP_THROW_IFFALSE( ReadInDiseaseStats( fileName,FALSE ), DISEASEFILENAME );
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
|
SGP_THROW_IFFALSE(ReadInDiseaseStats(fileName,TRUE), DISEASEFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
|
strcat(fileName, STRUCTUREDECONSTRUCTFILENAME);
|
||||||
@@ -411,14 +359,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LOADSCREENHINTSFILENAME);
|
strcat(fileName, LOADSCREENHINTSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, ARMOURSFILENAME);
|
strcat(fileName, ARMOURSFILENAME);
|
||||||
@@ -438,22 +386,24 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if (isMultiplayer == false)
|
if (isMultiplayer == false)
|
||||||
{
|
{
|
||||||
using namespace LogicalBodyTypes;
|
using namespace LogicalBodyTypes;
|
||||||
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME), LBT_LAYERSFILENAME);
|
CHAR8 errorBuf[512]{"Failed loading LogicalBodyTypes external data!"};
|
||||||
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME), LBT_PALETTESFILENAME);
|
|
||||||
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME), LBT_ANIMSURFACESFILENAME);
|
SGP_THROW_IFFALSE(Layers::Instance().LoadFromFile(directoryName, LBT_LAYERSFILENAME, errorBuf), errorBuf);
|
||||||
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME), LBT_FILTERSFILENAME);
|
SGP_THROW_IFFALSE(PaletteDB::Instance().LoadFromFile(directoryName, LBT_PALETTESFILENAME, errorBuf), errorBuf);
|
||||||
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME), LBT_BODYTYPESFILENAME);
|
SGP_THROW_IFFALSE(SurfaceDB::Instance().LoadFromFile(directoryName, LBT_ANIMSURFACESFILENAME, errorBuf), errorBuf);
|
||||||
|
SGP_THROW_IFFALSE(FilterDB::Instance().LoadFromFile(directoryName, LBT_FILTERSFILENAME, errorBuf), errorBuf);
|
||||||
|
SGP_THROW_IFFALSE(BodyTypeDB::Instance().LoadFromFile(directoryName, LBT_BODYTYPESFILENAME, errorBuf), errorBuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInLBEPocketStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// THE_BOB : added for pocket popup definitions
|
// THE_BOB : added for pocket popup definitions
|
||||||
LBEPocketPopup.clear();
|
LBEPocketPopup.clear();
|
||||||
@@ -461,7 +411,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
|
|
||||||
if (FileExists(fileName))
|
if (FileExists(fileName))
|
||||||
@@ -476,10 +426,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
strcat(fileName, LBEPOCKETPOPUPFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
}
|
}
|
||||||
#else
|
} else {
|
||||||
// WANNE: Load english file
|
// WANNE: Load english file
|
||||||
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
SGP_THROW_IFFALSE(ReadInLBEPocketPopups(fileName),LBEPOCKETPOPUPFILENAME);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -495,14 +445,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, MERCSTARTINGGEARFILENAME);
|
strcat(fileName, MERCSTARTINGGEARFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
|
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName, FALSE), MERCSTARTINGGEARFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -519,14 +469,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName, FALSE),ATTACHMENTSLOTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
|
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -700,14 +650,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, CITYTABLEFILENAME);
|
strcat(fileName, CITYTABLEFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
|
SGP_THROW_IFFALSE(ReadInMapStructure(fileName, FALSE),CITYTABLEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInStrategicMapSectorTownNames(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
|
// Lesh: Strategic movement costs will be read in Strategic\Strategic Movement Costs.cpp,
|
||||||
// function BOOLEAN InitStrategicMovementCosts();
|
// function BOOLEAN InitStrategicMovementCosts();
|
||||||
@@ -758,14 +708,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
|
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, FALSE),SHIPPINGDESTINATIONSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
|
SGP_THROW_IFFALSE(ReadInShippingDestinations(fileName, TRUE),fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, DELIVERYMETHODSFILENAME);
|
strcat(fileName, DELIVERYMETHODSFILENAME);
|
||||||
@@ -778,14 +728,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
|
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,FALSE), FACILITYTYPESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInFacilityTypes(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 3.4: Read in facility locations
|
// HEADROCK HAM 3.4: Read in facility locations
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -799,14 +749,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,FALSE,0), SECTORNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
|
SGP_THROW_IFFALSE(ReadInSectorNames(fileName,TRUE, 0), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 5: Read in Coolness by Sector
|
// HEADROCK HAM 5: Read in Coolness by Sector
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -828,7 +778,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -836,7 +786,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if(!ReadInMercProfiles(fileName,TRUE))
|
if(!ReadInMercProfiles(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -854,14 +804,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercProfiles(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
|
// HEADROCK PROFEX: Read in Merc Opinion data to replace PROF.DAT data
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -924,14 +874,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,FALSE), ENEMYNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInEnemyNames(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -943,14 +893,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
|
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,FALSE), CIVGROUPNAMESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInCivGroupNamesStats(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -960,14 +910,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
|
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (gGameExternalOptions.fEnemyRank == TRUE)
|
if (gGameExternalOptions.fEnemyRank == TRUE)
|
||||||
{
|
{
|
||||||
@@ -977,14 +927,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
|
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,FALSE), ENEMYRANKFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInEnemyRank(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
@@ -993,14 +943,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
|
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,FALSE), BACKGROUNDSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
|
SGP_THROW_IFFALSE(ReadInBackgrounds(fileName,TRUE), BACKGROUNDSFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Flugente: individual militia
|
// Flugente: individual militia
|
||||||
strcpy( fileName, directoryName );
|
strcpy( fileName, directoryName );
|
||||||
@@ -1014,14 +964,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,FALSE), CAMPAIGNSTATSEVENTSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInCampaignStatsEvents(fileName,TRUE), CAMPAIGNSTATSEVENTSFILENAME);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// WANNE: Only in a singleplayer game...
|
// WANNE: Only in a singleplayer game...
|
||||||
// Externalised taunts
|
// Externalised taunts
|
||||||
@@ -1042,14 +992,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, FileInfo.zFileName);
|
strcat(fileName, FileInfo.zFileName);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
while( GetFileNext(&FileInfo) )
|
while( GetFileNext(&FileInfo) )
|
||||||
{
|
{
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1057,14 +1007,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
strcat(fileName, FileInfo.zFileName);
|
strcat(fileName, FileInfo.zFileName);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,FALSE), fileName);
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInTaunts(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
GetFileClose(&FileInfo);
|
GetFileClose(&FileInfo);
|
||||||
}
|
}
|
||||||
@@ -1076,14 +1026,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
|
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// IMP Portraits List by Jazz
|
// IMP Portraits List by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1091,14 +1041,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
|
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,FALSE), IMPPORTRAITS);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInIMPPortraits(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
LoadIMPPortraitsTEMP( );
|
LoadIMPPortraitsTEMP( );
|
||||||
|
|
||||||
@@ -1183,14 +1133,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
|
SGP_THROW_IFFALSE(ReadInFaceGear(zNewFaceGear, fileName), FACEGEARFILENAME);
|
||||||
//WriteFaceGear();
|
//WriteFaceGear();
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMercAvailability(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
for(i=0; i<NUM_PROFILES; i++)
|
for(i=0; i<NUM_PROFILES; i++)
|
||||||
{
|
{
|
||||||
@@ -1204,14 +1154,14 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
|
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,FALSE), AIMAVAILABILITY);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAimAvailability(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
//Main Menu by Jazz
|
//Main Menu by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1224,7 +1174,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
|
SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1232,42 +1182,63 @@ BOOLEAN LoadExternalGameplayData(STR directoryName, BOOLEAN isMultiplayer)
|
|||||||
if(!ReadInActionItems(fileName,TRUE))
|
if(!ReadInActionItems(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
if ( ReadXMLEmail == TRUE )
|
||||||
|
{
|
||||||
|
// Externalized emails
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, EMAILSFILENAME);
|
||||||
|
// Only load external emails if we find the file
|
||||||
|
if ( FileExists(fileName) )
|
||||||
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
SGP_THROW_IFFALSE(ReadInExternalizedEmails(fileName, FALSE), EMAILSFILENAME);
|
||||||
|
|
||||||
|
if ( g_lang != i18n::Lang::en )
|
||||||
|
{
|
||||||
|
AddLanguagePrefix(fileName);
|
||||||
|
if ( FileExists(fileName) )
|
||||||
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
if ( !ReadInExternalizedEmails(fileName, TRUE) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( ReadXMLEmail == TRUE )
|
|
||||||
{
|
|
||||||
// EMAIL MERC AVAILABLE by Jazz
|
// EMAIL MERC AVAILABLE by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, EMAILMERCAVAILABLE);
|
strcat(fileName, EMAILMERCAVAILABLE);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
|
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName, FALSE), EMAILMERCAVAILABLE);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if ( g_lang != i18n::Lang::en )
|
||||||
AddLanguagePrefix(fileName);
|
|
||||||
if ( FileExists(fileName) )
|
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
AddLanguagePrefix(fileName);
|
||||||
if(!ReadInEmailMercAvailable(fileName,TRUE))
|
if ( FileExists(fileName) )
|
||||||
return FALSE;
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
if ( !ReadInEmailMercAvailable(fileName, TRUE) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// EMAIL MERC LEVEL UP by Jazz
|
// EMAIL MERC LEVEL UP by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, EMAILMERCLEVELUP);
|
strcat(fileName, EMAILMERCLEVELUP);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
|
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName, FALSE), EMAILMERCLEVELUP);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if ( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
if(!ReadInEmailMercLevelUp(fileName,TRUE))
|
if ( !ReadInEmailMercLevelUp(fileName, TRUE) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
// EMAIL OTHER by Jazz
|
// EMAIL OTHER by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1275,16 +1246,18 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
if(!ReadInEmailOther(fileName,TRUE))
|
if(!ReadInEmailOther(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
//new vehicles by Jazz
|
//new vehicles by Jazz
|
||||||
|
|
||||||
InitNewVehicles ();
|
InitNewVehicles ();
|
||||||
@@ -1294,7 +1267,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
|
SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1302,9 +1275,9 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInNewVehicles(fileName,TRUE))
|
if(!ReadInNewVehicles(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
@@ -1312,7 +1285,7 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
|
if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_BRIEFINGROOM
|
#ifdef ENABLE_BRIEFINGROOM
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1320,14 +1293,14 @@ if ( ReadXMLEmail == TRUE )
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
|
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
|
SGP_THROW_IFFALSE(ReadInBriefingRoom(fileName,TRUE,gBriefingRoomData, 4), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
||||||
|
|
||||||
@@ -1339,14 +1312,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
|
SGP_THROW_IFFALSE(ReadInMinerals(fileName,FALSE), MINERALSFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInMinerals(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Old AIM Archive
|
// Old AIM Archive
|
||||||
UINT8 p;
|
UINT8 p;
|
||||||
@@ -1360,14 +1333,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
|
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,FALSE), OLDAIMARCHIVEFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInAimOldArchive(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
UINT8 emptyslotsinarchives = 0;
|
UINT8 emptyslotsinarchives = 0;
|
||||||
for (p=0;p<NUM_PROFILES;p++)
|
for (p=0;p<NUM_PROFILES;p++)
|
||||||
{
|
{
|
||||||
@@ -1417,14 +1390,14 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
|
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,FALSE), DIFFICULTYFILENAME);
|
||||||
|
|
||||||
#ifndef ENGLISH
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
|
SGP_THROW_IFFALSE(ReadInDifficultySettings(fileName,TRUE), fileName);
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
|
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
|
||||||
g_luaUnderground.LoadScript(GetLanguagePrefix());
|
g_luaUnderground.LoadScript(GetLanguagePrefix());
|
||||||
@@ -1437,11 +1410,6 @@ BackupBRandEncyclopedia ( gBriefingRoomData, gBriefingRoomDataBackup, 0);
|
|||||||
|
|
||||||
UINT32 InitializeJA2(void)
|
UINT32 InitializeJA2(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
HandleLaserLockResult( PrepareLaserLockSystem() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HandleJA2CDCheck( );
|
HandleJA2CDCheck( );
|
||||||
|
|
||||||
gfWorldLoaded = FALSE;
|
gfWorldLoaded = FALSE;
|
||||||
@@ -1498,6 +1466,10 @@ UINT32 InitializeJA2(void)
|
|||||||
return( ERROR_SCREEN );
|
return( ERROR_SCREEN );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InitRadarScreenCoords() depend on Mapscreen Interface Bottom coordinates -> need to initiate them first
|
||||||
|
// before calling InitTacticalEngine()
|
||||||
|
InitMapScreenInterfaceBottomCoords();
|
||||||
|
|
||||||
// Init tactical engine
|
// Init tactical engine
|
||||||
if ( !InitTacticalEngine( ) )
|
if ( !InitTacticalEngine( ) )
|
||||||
{
|
{
|
||||||
@@ -1514,12 +1486,6 @@ UINT32 InitializeJA2(void)
|
|||||||
// INit intensity tables
|
// INit intensity tables
|
||||||
BuildIntensityTable( );
|
BuildIntensityTable( );
|
||||||
|
|
||||||
// Init Event Manager
|
|
||||||
if ( !InitializeEventManager( ) )
|
|
||||||
{
|
|
||||||
return( ERROR_SCREEN );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initailize World
|
// Initailize World
|
||||||
if ( !InitializeWorld( ) )
|
if ( !InitializeWorld( ) )
|
||||||
{
|
{
|
||||||
@@ -1698,8 +1664,6 @@ void ShutdownJA2(void)
|
|||||||
|
|
||||||
ShutdownJA2Sound( );
|
ShutdownJA2Sound( );
|
||||||
|
|
||||||
ShutdownEventManager( );
|
|
||||||
|
|
||||||
ShutdownBaseDirtyRectQueue( );
|
ShutdownBaseDirtyRectQueue( );
|
||||||
|
|
||||||
// Unload any text box images!
|
// Unload any text box images!
|
||||||
@@ -1709,74 +1673,6 @@ void ShutdownJA2(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
|
|
||||||
BOOLEAN PrepareLaserLockSystem()
|
|
||||||
{
|
|
||||||
INT32 iInitRetVal=0;
|
|
||||||
INT32 iRunRetVal=0;
|
|
||||||
INT32 iCheckRetVal=0;
|
|
||||||
CHAR8 zDirectory[512];
|
|
||||||
|
|
||||||
CHAR8 zCdLocation[ SGPFILENAME_LEN ];
|
|
||||||
CHAR8 zCdFile[ SGPFILENAME_LEN ];
|
|
||||||
|
|
||||||
//Get the "current" file directory
|
|
||||||
GetFileManCurrentDirectory( zDirectory );
|
|
||||||
|
|
||||||
if( GetCDromDriveLetter( zCdLocation ) )
|
|
||||||
{
|
|
||||||
// OK, build filename
|
|
||||||
sprintf( zCdFile, "%s%s", zCdLocation, "Data" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Go back to the root directory
|
|
||||||
SetFileManCurrentDirectory( zCdFile );
|
|
||||||
//Init the laser lock system
|
|
||||||
iInitRetVal = LASERLOK_Init( ghInstance );
|
|
||||||
if( iInitRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//makes the verification of the laserlok system
|
|
||||||
iRunRetVal = LASERLOK_Run();
|
|
||||||
if( iRunRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//checks the result of the laserlok run function
|
|
||||||
iCheckRetVal = LASERLOK_Check();
|
|
||||||
if( iCheckRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//Restore back to the proper directory
|
|
||||||
SetFileManCurrentDirectory( zDirectory );
|
|
||||||
return( TRUE );
|
|
||||||
|
|
||||||
FAILED_LASERLOK:
|
|
||||||
//Restore back to the proper directory
|
|
||||||
SetFileManCurrentDirectory( zDirectory );
|
|
||||||
return( FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleLaserLockResult( BOOLEAN fSuccess )
|
|
||||||
{
|
|
||||||
if( !fSuccess )
|
|
||||||
{
|
|
||||||
CHAR8 zString[512];
|
|
||||||
|
|
||||||
sprintf( zString, "%S", gzLateLocalizedString[56] );
|
|
||||||
|
|
||||||
// ShowCursor(TRUE);
|
|
||||||
// ShowCursor(TRUE);
|
|
||||||
ShutdownWithErrorBox( zString );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void SetupMaxActionPointsAnimation()
|
void SetupMaxActionPointsAnimation()
|
||||||
{
|
{
|
||||||
gubMaxActionPoints[REGMALE] = APBPConstants[AP_MAXIMUM];
|
gubMaxActionPoints[REGMALE] = APBPConstants[AP_MAXIMUM];
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "LogicalBodyTypes/SurfaceDB.h"
|
#include "LogicalBodyTypes/SurfaceDB.h"
|
||||||
#include "LogicalBodyTypes/FilterDB.h"
|
#include "LogicalBodyTypes/FilterDB.h"
|
||||||
#include "LogicalBodyTypes/EnumeratorDB.h"
|
#include "LogicalBodyTypes/EnumeratorDB.h"
|
||||||
#include "LogicalBodyTypes/BodyTypeDB.h"
|
|
||||||
#include "LogicalBodyTypes/PaletteDB.h"
|
#include "LogicalBodyTypes/PaletteDB.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
+18
-40
@@ -1,41 +1,19 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "Cursor Control.h"
|
||||||
#include "font control.h"
|
#include "Render Dirty.h"
|
||||||
#include "cursor control.h"
|
#include "Utilities.h"
|
||||||
#include "render dirty.h"
|
#include "Intro.h"
|
||||||
#include "Text.h"
|
#include "Cinematics.h"
|
||||||
#include "Utilities.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "text.h"
|
|
||||||
#include "Line.h"
|
|
||||||
#include "Intro.h"
|
|
||||||
#include "Cinematics.h"
|
|
||||||
#include "Cinematics Bink.h"
|
|
||||||
#include "mainmenuscreen.h"
|
|
||||||
#include "Music Control.h"
|
|
||||||
#include "LibraryDataBase.h"
|
|
||||||
#include "english.h"
|
|
||||||
#include "soldier profile type.h"
|
|
||||||
#include "MessageBoxScreen.h"
|
|
||||||
#include "sgp_logger.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "INIReader.h"
|
|
||||||
|
|
||||||
#include <vfs/Core/vfs.h>
|
|
||||||
|
|
||||||
#include "Luaglobal.h"
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "Map Screen Interface Map.h"
|
|
||||||
#include "Map Screen Interface.h"
|
|
||||||
#include "End Game.h"
|
|
||||||
#include "Cinematics Bink.h"
|
#include "Cinematics Bink.h"
|
||||||
#endif
|
#include "mainmenuscreen.h"
|
||||||
|
#include "Music Control.h"
|
||||||
|
#include "english.h"
|
||||||
|
#include "sgp_logger.h"
|
||||||
|
#include "INIReader.h"
|
||||||
|
#include "Luaglobal.h"
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "XML.h"
|
#include <language.hpp>
|
||||||
|
|
||||||
BOOLEAN Style_JA = TRUE;
|
BOOLEAN Style_JA = TRUE;
|
||||||
extern INT8 Test = 0;
|
extern INT8 Test = 0;
|
||||||
@@ -196,7 +174,7 @@ private:
|
|||||||
|
|
||||||
static VideoPlayer s_VP(VideoPlayer::VT_SMK | VideoPlayer::VT_BINK);
|
static VideoPlayer s_VP(VideoPlayer::VT_SMK | VideoPlayer::VT_BINK);
|
||||||
|
|
||||||
extern STR16 gzIntroScreen[];
|
extern STR16* gzIntroScreen;
|
||||||
extern HVSURFACE ghFrameBuffer;
|
extern HVSURFACE ghFrameBuffer;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -726,11 +704,11 @@ void DisplaySirtechSplashScreen()
|
|||||||
* (2006-10-10, Sergeant_Kolja)
|
* (2006-10-10, Sergeant_Kolja)
|
||||||
*/
|
*/
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
# if defined(ENGLISH)
|
if( g_lang == i18n::Lang::en ) {
|
||||||
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
|
AssertMsg( 0, String( "Wheter English nor German works. May be You built English - but have only German or other foreign Disk?" ) );
|
||||||
# elif defined(GERMAN)
|
} else if( g_lang == i18n::Lang::de ) {
|
||||||
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
|
AssertMsg( 0, String( "Weder Englisch noch Deutsch geht. Deutsche Version kompiliert und mit englischer CDs gestartet? Das geht nicht!" ) );
|
||||||
# endif
|
}
|
||||||
#endif
|
#endif
|
||||||
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
|
AssertMsg( 0, String( "Failed to load %s", VObjectDesc.ImageFile ) );
|
||||||
return;
|
return;
|
||||||
@@ -12,13 +12,11 @@ void StopIntroVideo();
|
|||||||
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
|
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
|
||||||
enum EIntroType
|
enum EIntroType
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
|
||||||
INTRO_HELI_CRASH,
|
|
||||||
#endif
|
|
||||||
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
|
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
|
||||||
INTRO_ENDING, //set when viewing the end game video.
|
INTRO_ENDING, //set when viewing the end game video.
|
||||||
|
|
||||||
INTRO_SPLASH,
|
INTRO_SPLASH,
|
||||||
|
// Unfinished Business
|
||||||
|
INTRO_HELI_CRASH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -42,4 +40,4 @@ typedef struct
|
|||||||
|
|
||||||
extern INTRO_NAMES_VALUES zVideoFile[255];
|
extern INTRO_NAMES_VALUES zVideoFile[255];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "mainmenuscreen.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Video.h"
|
#include "video.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "Multi Language Graphic Utils.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <language.hpp>
|
||||||
|
|
||||||
UINT32 guiSplashFrameFade = 10;
|
UINT32 guiSplashFrameFade = 10;
|
||||||
UINT32 guiSplashStartTime = 0;
|
UINT32 guiSplashStartTime = 0;
|
||||||
@@ -13,10 +14,10 @@ extern HVSURFACE ghFrameBuffer;
|
|||||||
//Simply create videosurface, load image, and draw it to the screen.
|
//Simply create videosurface, load image, and draw it to the screen.
|
||||||
void InitJA2SplashScreen()
|
void InitJA2SplashScreen()
|
||||||
{
|
{
|
||||||
#ifdef ENGLISH
|
if( g_lang == i18n::Lang::en ) {
|
||||||
ClearMainMenu();
|
ClearMainMenu();
|
||||||
|
|
||||||
#else
|
} else {
|
||||||
UINT32 uiLogoID = 0;
|
UINT32 uiLogoID = 0;
|
||||||
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
||||||
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
||||||
@@ -69,7 +70,7 @@ void InitJA2SplashScreen()
|
|||||||
GetVideoSurface( &hVSurface, uiLogoID );
|
GetVideoSurface( &hVSurface, uiLogoID );
|
||||||
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
||||||
DeleteVideoSurfaceFromIndex( uiLogoID );
|
DeleteVideoSurfaceFromIndex( uiLogoID );
|
||||||
#endif // ENGLISH
|
} // ENGLISH
|
||||||
|
|
||||||
InvalidateScreen();
|
InvalidateScreen();
|
||||||
RefreshScreen( NULL );
|
RefreshScreen( NULL );
|
||||||
@@ -6,4 +6,4 @@ void InitJA2SplashScreen();
|
|||||||
extern UINT32 guiSplashFrameFade;
|
extern UINT32 guiSplashFrameFade;
|
||||||
extern UINT32 guiSplashStartTime;
|
extern UINT32 guiSplashStartTime;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#include <types.h>
|
||||||
|
#ifdef NETWORKED
|
||||||
|
#include "Networking.h"
|
||||||
|
#include "NetworkEvent.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef JA2UB
|
||||||
|
|
||||||
|
|
||||||
|
INT16 JA2_5_START_SECTOR_X;
|
||||||
|
INT16 JA2_5_START_SECTOR_Y;
|
||||||
|
|
||||||
|
//** Defines *******************************************************************
|
||||||
|
|
||||||
|
//Starting money
|
||||||
|
#define JA2_5_STARTING_MONEY_EASY 40000
|
||||||
|
#define JA2_5_STARTING_MONEY_MEDIUM 35000
|
||||||
|
#define JA2_5_STARTING_MONEY_HARD 30000
|
||||||
|
|
||||||
|
|
||||||
|
#define JA2SAVE_CONV_FILENAME "..\\SavedGames\\Ja2.dts"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
INT8 bMercID;
|
||||||
|
INT8 bPercentStatIncrease;
|
||||||
|
} STAT_CHANGE;
|
||||||
|
|
||||||
|
#define NUM_MERCS_TO_USE_IN_PERCENT_STAT_INCREASE 6
|
||||||
|
|
||||||
|
#define MAX_STAT_INCREASE 30
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//******************************************************************************
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
#ifndef JA25UPDATE__C_
|
#ifndef JA25UPDATE__C_
|
||||||
#define JA25UPDATE__C_
|
#define JA25UPDATE__C_
|
||||||
|
|
||||||
#include "Types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
|
||||||
//Used in the editor to compensate for the 2_<map name>
|
|
||||||
#define JA25_EXP_MAP_NAME_PREFIX L""
|
|
||||||
#define JA25_EXP_MAP_NAME_SIZE_OFFSET 0
|
|
||||||
|
|
||||||
|
|
||||||
//The starting sector of the Expanion pack
|
//The starting sector of the Expanion pack
|
||||||
extern INT16 JA2_5_START_SECTOR_X;
|
extern INT16 JA2_5_START_SECTOR_X;
|
||||||
extern INT16 JA2_5_START_SECTOR_Y;
|
extern INT16 JA2_5_START_SECTOR_Y;
|
||||||
@@ -4,12 +4,12 @@
|
|||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Random.h"
|
#include "random.h"
|
||||||
#include "Debug.h"
|
#include "DEBUG.H"
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "font.h"
|
#include "Font.h"
|
||||||
#include "render dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "UndergroundInit.h"
|
#include "UndergroundInit.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -19,10 +19,10 @@ extern HVSURFACE ghFrameBuffer;
|
|||||||
extern BOOLEAN gfSchedulesHosed;
|
extern BOOLEAN gfSchedulesHosed;
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#include "Ja25_Tactical.h"
|
|
||||||
#include "Ja25 Strategic Ai.h"
|
#include "Ja25 Strategic Ai.h"
|
||||||
#endif
|
#endif
|
||||||
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
||||||
|
FLOAT fLoadingScreenAspectRatio;
|
||||||
//BOOLEAN bShowSmallImage = FALSE;
|
//BOOLEAN bShowSmallImage = FALSE;
|
||||||
SECTOR_LOADSCREENS gSectorLoadscreens[MAX_SECTOR_LOADSCREENS];
|
SECTOR_LOADSCREENS gSectorLoadscreens[MAX_SECTOR_LOADSCREENS];
|
||||||
|
|
||||||
@@ -343,6 +343,62 @@ static void BuildLoadscreenFilename(std::string& dst, const char* path, int reso
|
|||||||
dst.append(".sti");
|
dst.append(".sti");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
|
||||||
|
{
|
||||||
|
switch (resolution)
|
||||||
|
{
|
||||||
|
case _960x540: return "_960x540";
|
||||||
|
case _800x600: return "_800x600";
|
||||||
|
case _1024x600: return "_1024x600";
|
||||||
|
case _1280x720: return "_1280x720";
|
||||||
|
case _1024x768: return "_1024x768";
|
||||||
|
case _1280x768: return "_1280x768";
|
||||||
|
case _1360x768: return "_1360x768";
|
||||||
|
case _1366x768: return "_1366x768";
|
||||||
|
case _1280x800: return "_1280x800";
|
||||||
|
case _1440x900: return "_1440x900";
|
||||||
|
case _1600x900: return "_1600x900";
|
||||||
|
case _1280x960: return "_1280x960";
|
||||||
|
case _1440x960: return "_1440x960";
|
||||||
|
case _1770x1000: return "_1770x1000";
|
||||||
|
case _1280x1024: return "_1280x1024";
|
||||||
|
case _1360x1024: return "_1360x1024";
|
||||||
|
case _1600x1024: return "_1600x1024";
|
||||||
|
case _1440x1050: return "_1440x1050";
|
||||||
|
case _1680x1050: return "_1680x1050";
|
||||||
|
case _1920x1080: return "_1920x1080";
|
||||||
|
case _1600x1200: return "_1600x1200";
|
||||||
|
case _1920x1200: return "_1920x1200";
|
||||||
|
case _2560x1440: return "_2560x1440";
|
||||||
|
case _2560x1600: return "_2560x1600";
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
|
||||||
|
{
|
||||||
|
for (SCREEN_RESOLUTION res = resolution; res <= _2560x1600; res = (SCREEN_RESOLUTION)(res + 1))
|
||||||
|
{
|
||||||
|
std::string fileName = baseName + GetResolutionSuffix(res);
|
||||||
|
if (FileExists((CHAR8*)((fileName + ".png").c_str())))
|
||||||
|
{
|
||||||
|
return fileName + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileExists((CHAR8*)((fileName + ".sti").c_str())))
|
||||||
|
{
|
||||||
|
return fileName + ".sti";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FileExists((CHAR8*)((baseName + ".png").c_str())))
|
||||||
|
{
|
||||||
|
return baseName + ".png";
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseName + ".sti";
|
||||||
|
}
|
||||||
|
|
||||||
//sets up the loadscreen with specified ID, and draws it to the FRAME_BUFFER,
|
//sets up the loadscreen with specified ID, and draws it to the FRAME_BUFFER,
|
||||||
//and refreshing the screen with it.
|
//and refreshing the screen with it.
|
||||||
void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
||||||
@@ -420,27 +476,8 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string strImage;
|
std::string strImage = FindBestFittingLoadscreenFilename(imagePath, (SCREEN_RESOLUTION)iResolution);
|
||||||
|
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
||||||
BuildLoadscreenFilename(strImage, imagePath.c_str(), 0, imageFormat.c_str());
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
|
|
||||||
|
|
||||||
|
|
||||||
if ( !FileExists(vs_desc.ImageFile) )
|
|
||||||
{
|
|
||||||
std::string strImage;
|
|
||||||
BuildLoadscreenFilename(strImage, imagePath.c_str(), 0, "png");
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
|
||||||
|
|
||||||
if (!FileExists(vs_desc.ImageFile))
|
|
||||||
{
|
|
||||||
std::string strImage("LOADSCREENS\\");
|
|
||||||
|
|
||||||
BuildLoadscreenFilename(strImage, LoadScreenNames[1], 0, imageFormat.c_str());
|
|
||||||
|
|
||||||
strImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile) - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -475,18 +512,41 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
|||||||
|
|
||||||
//Blit the background image
|
//Blit the background image
|
||||||
GetVideoSurface(&hVSurface, uiLoadScreen);
|
GetVideoSurface(&hVSurface, uiLoadScreen);
|
||||||
|
|
||||||
// Stretch the background image
|
fLoadingScreenAspectRatio = (FLOAT)hVSurface->usWidth / (FLOAT)hVSurface->usHeight;
|
||||||
SrcRect.iLeft = 0;
|
FLOAT fScreenAspectRatio = (FLOAT)SCREEN_WIDTH / (FLOAT)SCREEN_HEIGHT;
|
||||||
SrcRect.iTop = 0;
|
|
||||||
SrcRect.iRight = hVSurface->usWidth;
|
if (gGameExternalOptions.ubLoadscreenStretchMode == 1 ||
|
||||||
SrcRect.iBottom = hVSurface->usHeight;
|
(gGameExternalOptions.ubLoadscreenStretchMode == 2 && fLoadingScreenAspectRatio > fScreenAspectRatio))
|
||||||
|
{
|
||||||
DstRect.iLeft = 0;
|
// match height, preserve aspect ratio
|
||||||
DstRect.iTop = 0;
|
INT32 iCalculatedWidth = (INT32)(SCREEN_HEIGHT * fLoadingScreenAspectRatio + 0.5f);
|
||||||
DstRect.iRight = SCREEN_WIDTH;
|
|
||||||
DstRect.iBottom = SCREEN_HEIGHT;
|
SrcRect.iLeft = 0;
|
||||||
|
SrcRect.iTop = 0;
|
||||||
|
SrcRect.iRight = hVSurface->usWidth;
|
||||||
|
SrcRect.iBottom = hVSurface->usHeight;
|
||||||
|
|
||||||
|
DstRect.iLeft = (SCREEN_WIDTH - iCalculatedWidth) / 2;
|
||||||
|
DstRect.iTop = 0;
|
||||||
|
DstRect.iRight = SCREEN_WIDTH - ((SCREEN_WIDTH - iCalculatedWidth) / 2);
|
||||||
|
DstRect.iBottom = SCREEN_HEIGHT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// vanilla (stretch to fit)
|
||||||
|
// Stretch the background image
|
||||||
|
SrcRect.iLeft = 0;
|
||||||
|
SrcRect.iTop = 0;
|
||||||
|
SrcRect.iRight = hVSurface->usWidth;
|
||||||
|
SrcRect.iBottom = hVSurface->usHeight;
|
||||||
|
|
||||||
|
DstRect.iLeft = 0;
|
||||||
|
DstRect.iTop = 0;
|
||||||
|
DstRect.iRight = SCREEN_WIDTH;
|
||||||
|
DstRect.iBottom = SCREEN_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
BltStretchVideoSurface( FRAME_BUFFER, uiLoadScreen, 0, 0, 0, &SrcRect, &DstRect );
|
BltStretchVideoSurface( FRAME_BUFFER, uiLoadScreen, 0, 0, 0, &SrcRect, &DstRect );
|
||||||
|
|
||||||
DeleteVideoSurfaceFromIndex( uiLoadScreen );
|
DeleteVideoSurfaceFromIndex( uiLoadScreen );
|
||||||
@@ -84,6 +84,8 @@ enum
|
|||||||
//For use by the game loader, before it can possibly know the situation.
|
//For use by the game loader, before it can possibly know the situation.
|
||||||
extern UINT8 gubLastLoadingScreenID;
|
extern UINT8 gubLastLoadingScreenID;
|
||||||
|
|
||||||
|
extern FLOAT fLoadingScreenAspectRatio;
|
||||||
|
|
||||||
//returns the UINT8 ID for the specified sector.
|
//returns the UINT8 ID for the specified sector.
|
||||||
UINT8 GetLoadScreenID( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
UINT8 GetLoadScreenID( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||||
|
|
||||||
@@ -1,26 +1,25 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "fade screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "MercTextBox.h"
|
#include "MercTextBox.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "font control.h"
|
#include "Font Control.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "cursor control.h"
|
#include "Cursor Control.h"
|
||||||
#include "laptop.h"
|
#include "Text.h"
|
||||||
#include "text.h"
|
#include "Text Input.h"
|
||||||
#include "Text Input.h"
|
#include "overhead map.h"
|
||||||
#include "overhead map.h"
|
#include "MPChatScreen.h"
|
||||||
#include "MPChatScreen.h"
|
#include "WordWrap.h"
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "utilities.h"
|
#include "Utilities.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|
||||||
#define CHATBOX_WIDTH 310 // 350 is the max size, the PrepareMercPopupBox will add the X_MARGIN to both sides
|
#define CHATBOX_WIDTH 310 // 350 is the max size, the PrepareMercPopupBox will add the X_MARGIN to both sides
|
||||||
@@ -90,7 +89,7 @@ extern BOOLEAN gfDontOverRideSaveBuffer; //this variable can be unset if u
|
|||||||
|
|
||||||
|
|
||||||
extern void HandleTacticalUILoseCursorFromOtherScreen( );
|
extern void HandleTacticalUILoseCursorFromOtherScreen( );
|
||||||
extern STR16 pUpdatePanelButtons[];
|
extern STR16* pUpdatePanelButtons;
|
||||||
|
|
||||||
|
|
||||||
#define NUM_CHAT_TOGGLES 2
|
#define NUM_CHAT_TOGGLES 2
|
||||||
@@ -26,4 +26,4 @@ extern BOOLEAN gfInChatBox;
|
|||||||
INT32 DoChatBox( bool bIncludeChatLog, const STR16 zString, UINT32 uiExitScreen, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
INT32 DoChatBox( bool bIncludeChatLog, const STR16 zString, UINT32 uiExitScreen, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
||||||
void ChatLogMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...);
|
void ChatLogMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "MPConnectScreen.h"
|
#include "MPConnectScreen.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "wCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Input.h"
|
#include "input.h"
|
||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "English.h"
|
#include "english.h"
|
||||||
#include "Sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "Music Control.h"
|
#include "Music Control.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "network.h" // for client name
|
#include "network.h" // for client name
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "init.h"
|
#include "Init.h"
|
||||||
#include "xml.h"
|
#include "XML.h"
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
@@ -11,4 +11,4 @@ void SetConnectScreenHeadingA( const char* cmsg );
|
|||||||
void SetConnectScreenSubMessageW( STR16 cmsg );
|
void SetConnectScreenSubMessageW( STR16 cmsg );
|
||||||
void SetConnectScreenSubMessageA( const char* cmsg );
|
void SetConnectScreenSubMessageA( const char* cmsg );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
#include "Types.h"
|
#include "types.h"
|
||||||
#include "MPHostScreen.h"
|
#include "MPHostScreen.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "wCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Input.h"
|
#include "input.h"
|
||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "English.h"
|
#include "english.h"
|
||||||
#include "Sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Intro.h"
|
#include "Intro.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "saveloadscreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
|
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@
|
|||||||
#include <vfs/Tools/vfs_property_container.h>
|
#include <vfs/Tools/vfs_property_container.h>
|
||||||
#include <vfs/Core/vfs_os_functions.h>
|
#include <vfs/Core/vfs_os_functions.h>
|
||||||
#include "MPJoinScreen.h"
|
#include "MPJoinScreen.h"
|
||||||
#include "MainMenuScreen.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Init.h"
|
#include "Init.h"
|
||||||
#include "xml.h"
|
#include "XML.h"
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@@ -9,4 +9,4 @@ UINT32 MPHostScreenShutdown( void );
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user