mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Compare commits
606
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4afe186dc4 | ||
|
|
87c5d993dc | ||
|
|
a0666e9591 | ||
|
|
593285a975 | ||
|
|
7096ffbc98 | ||
|
|
490678193a | ||
|
|
3d3c197dc0 | ||
|
|
7ac03c7835 | ||
|
|
887239e1d4 | ||
|
|
ea415cce97 | ||
|
|
409e068104 | ||
|
|
b4ec7e4e34 | ||
|
|
7ad5b133ff | ||
|
|
01bc1043e4 | ||
|
|
dad23b95db | ||
|
|
23a79af4dc | ||
|
|
39bbccebfc | ||
|
|
b32d1c7fa9 | ||
|
|
b318f01819 | ||
|
|
7e8ca9a005 | ||
|
|
6f657470fe | ||
|
|
dfc59ef087 | ||
|
|
b09c3b3491 | ||
|
|
c63f80dbaf | ||
|
|
66556fe514 | ||
|
|
d4d41d8eff | ||
|
|
12d6469ee7 | ||
|
|
d0f604c81a | ||
|
|
f5f347109c | ||
|
|
4195c0e9fa | ||
|
|
f87fbdb857 | ||
|
|
d97912ce37 | ||
|
|
1b725c3ac4 | ||
|
|
ab23820319 | ||
|
|
8c7614ac34 | ||
|
|
63b9d44968 | ||
|
|
8887c8a07e | ||
|
|
8367ed5943 | ||
|
|
6ceeeb7239 | ||
|
|
1e5fe42652 | ||
|
|
b9802a0d6e | ||
|
|
343423adc2 | ||
|
|
961cfbe12e | ||
|
|
1207801f77 | ||
|
|
fd816a1a5b | ||
|
|
e086613047 | ||
|
|
c121c18b4f | ||
|
|
5e0b6a687f | ||
|
|
2ccaf8f927 | ||
|
|
c94d4bea59 | ||
|
|
7528ef0fef | ||
|
|
901e565798 | ||
|
|
7323c9e0da | ||
|
|
054bcf6dec | ||
|
|
79a01657a7 | ||
|
|
ff5ee510a3 | ||
|
|
b4f3e252d0 | ||
|
|
c10a141861 | ||
|
|
a83e3a6223 | ||
|
|
76d820d0f4 | ||
|
|
b0ece8eb3a | ||
|
|
e5f836df4b | ||
|
|
e4256a1cd3 | ||
|
|
06e8db1bf8 | ||
|
|
c84fbacb8b | ||
|
|
cba0190e05 | ||
|
|
39e9479ac8 | ||
|
|
f8f1ef779e | ||
|
|
9fccd4c2d0 | ||
|
|
8dc2c082c3 | ||
|
|
7ec25aa692 | ||
|
|
3835d0758b | ||
|
|
e4ab7f2254 | ||
|
|
abbd2a260e | ||
|
|
892cf38736 | ||
|
|
cc9afc7d3e | ||
|
|
f210455827 | ||
|
|
55f84acd98 | ||
|
|
b6f02b52cb | ||
|
|
b21ab3282d | ||
|
|
1f3318524b | ||
|
|
e2e5a24926 | ||
|
|
1120cdaa03 | ||
|
|
25c7c7c8af | ||
|
|
07a01628a0 | ||
|
|
edae245b0e | ||
|
|
fdde5a6713 | ||
|
|
28508f0be4 | ||
|
|
1502269102 | ||
|
|
d496969846 | ||
|
|
e7ee4f4ef1 | ||
|
|
7f25fcf05f | ||
|
|
4551cda108 | ||
|
|
105e95a991 | ||
|
|
2257b4efde | ||
|
|
d53c6289dc | ||
|
|
d5bc0051fb | ||
|
|
4477777cd4 | ||
|
|
d81cfcbbba | ||
|
|
42e936b6b1 | ||
|
|
f6007413de | ||
|
|
12b3ffb6b9 | ||
|
|
034f987d38 | ||
|
|
d3ca761e30 | ||
|
|
f8dcf11f99 | ||
|
|
a780021f7b | ||
|
|
f43da62c3e | ||
|
|
6487bd1ff4 | ||
|
|
bb870a6926 | ||
|
|
6216fb09da | ||
|
|
a1751c30ab | ||
|
|
98e7e86697 | ||
|
|
c488360abc | ||
|
|
c38d9601c8 | ||
|
|
aa60ef5bcc | ||
|
|
e611d3d74e | ||
|
|
24a9694494 | ||
|
|
55671189f0 | ||
|
|
8e595a903c | ||
|
|
2e49d55faf | ||
|
|
08d8e0799a | ||
|
|
5d54009c21 | ||
|
|
fcc33b856f | ||
|
|
b8d48fac23 | ||
|
|
4c27f96902 | ||
|
|
9fde027411 | ||
|
|
2af460314d | ||
|
|
a639da2973 | ||
|
|
9cbbb6fd03 | ||
|
|
20a083c859 | ||
|
|
685880a7b6 | ||
|
|
9010d21b32 | ||
|
|
841774f69f | ||
|
|
04e34810e0 | ||
|
|
dcfc77364e | ||
|
|
be2d15fc4f | ||
|
|
014e261af1 | ||
|
|
f343c2f7b1 | ||
|
|
30ae2da9cd | ||
|
|
9236bd6d7c | ||
|
|
85f05019b5 | ||
|
|
6509badc36 | ||
|
|
21856a78e5 | ||
|
|
6ee175e65d | ||
|
|
2f067ae8aa | ||
|
|
fcc38162c5 | ||
|
|
771e6b2faa | ||
|
|
28cc2957c8 | ||
|
|
1e99847291 | ||
|
|
2edd420943 | ||
|
|
852ec76549 | ||
|
|
7caf442717 | ||
|
|
e1ca009d9a | ||
|
|
5b591c2c4c | ||
|
|
55c7d0e0fc | ||
|
|
6a2cadb08f | ||
|
|
0ccb8a19dc | ||
|
|
7d87db1939 | ||
|
|
e94733df9c | ||
|
|
a69f3bd271 | ||
|
|
d7905cd06a | ||
|
|
244b9718d5 | ||
|
|
020379cf40 | ||
|
|
183587f8b4 | ||
|
|
a963f3ccc1 | ||
|
|
e540947704 | ||
|
|
b94f8cddde | ||
|
|
6fd1ef440b | ||
|
|
cd2b9d9871 | ||
|
|
eb1b936ff1 | ||
|
|
8bf7c4076b | ||
|
|
9a76ae8d12 | ||
|
|
a9dc8db3bb | ||
|
|
b99a6b6af2 | ||
|
|
397699ec31 | ||
|
|
3529db4d37 | ||
|
|
694d089fe0 | ||
|
|
de560ceb29 | ||
|
|
73c417bf70 | ||
|
|
dfc06acfd3 | ||
|
|
1b0a949dc5 | ||
|
|
4e7667842b | ||
|
|
5129749cb8 | ||
|
|
1fe6fa8b06 | ||
|
|
7034e99aa5 | ||
|
|
47e55fe686 | ||
|
|
668ddde68b | ||
|
|
ea259b8961 | ||
|
|
3428289778 | ||
|
|
12c9238f62 | ||
|
|
360060f59d | ||
|
|
720b16befb | ||
|
|
def739c279 | ||
|
|
0e9af797e5 | ||
|
|
17665a6333 | ||
|
|
58b82fefd8 | ||
|
|
66cb87e18f | ||
|
|
564fb3fd19 | ||
|
|
89fe89775c | ||
|
|
e112deb37a | ||
|
|
a6189c4fdd | ||
|
|
ff7dca2d05 | ||
|
|
d83d4098de | ||
|
|
3c2e1de05e | ||
|
|
492597e3b2 | ||
|
|
9078d2aea6 | ||
|
|
c74f634e79 | ||
|
|
72f0a923e0 | ||
|
|
23be3b5605 | ||
|
|
49491fac75 | ||
|
|
8ebf284993 | ||
|
|
0a072d7403 | ||
|
|
e862231feb | ||
|
|
f7df30b549 | ||
|
|
3f87bea143 | ||
|
|
e1dce56a56 | ||
|
|
9ae52aa90a | ||
|
|
2523a62878 | ||
|
|
1762e4a6be | ||
|
|
e691cbc995 | ||
|
|
f98f7e12be | ||
|
|
7034b6a0f0 | ||
|
|
d240e24ef1 | ||
|
|
8f497bfac7 | ||
|
|
23601fda0d | ||
|
|
278eedf7ad | ||
|
|
efe43d3466 | ||
|
|
e19577e35c | ||
|
|
42568915bd | ||
|
|
6ca2f86255 | ||
|
|
32b0a71369 | ||
|
|
2cf3e96a6b | ||
|
|
cc187b758d | ||
|
|
ea11ea8a63 | ||
|
|
33212b6499 | ||
|
|
ef1880b03a | ||
|
|
077d4b2a54 | ||
|
|
07b00e2fae | ||
|
|
018159b822 | ||
|
|
7f20e9109f | ||
|
|
2cb5a44f3e | ||
|
|
450ac81a1e | ||
|
|
dd840fe227 | ||
|
|
57772da95b | ||
|
|
e672918122 | ||
|
|
6b00a67df0 | ||
|
|
8e68228c86 | ||
|
|
0cae377b72 | ||
|
|
d343e5b73a | ||
|
|
72cb0142b2 | ||
|
|
ffdef38781 | ||
|
|
0578517f3a | ||
|
|
f994cdac45 | ||
|
|
1f16f9dc23 | ||
|
|
dbaf87c202 | ||
|
|
391c18e9e7 | ||
|
|
026e23d8ed | ||
|
|
8a579733c0 | ||
|
|
cfc99c4f23 | ||
|
|
dac33aeb71 | ||
|
|
29af6aefbc | ||
|
|
99e6883251 | ||
|
|
2513b23ad9 | ||
|
|
d64d8ce6e0 | ||
|
|
2f994399e9 | ||
|
|
ad100d79dc | ||
|
|
c11ed4873b | ||
|
|
bbc8d83f37 | ||
|
|
9e0128f705 | ||
|
|
c90c94b39f | ||
|
|
9fc627aee5 | ||
|
|
edbc336888 | ||
|
|
70ed9547a7 | ||
|
|
70ae616b0d | ||
|
|
5801e69441 | ||
|
|
d77dccf068 | ||
|
|
c157da28f6 | ||
|
|
a09b61d39e | ||
|
|
ecfd1a015f | ||
|
|
046e438380 | ||
|
|
0fd9bdff5e | ||
|
|
01e93d672c | ||
|
|
cd417c2158 | ||
|
|
2a522859ad | ||
|
|
1e6803a7fd | ||
|
|
1cf142d5d7 | ||
|
|
f1c749650c | ||
|
|
4356a59467 | ||
|
|
d3374eaabf | ||
|
|
3ce9785fde | ||
|
|
4c6e954a04 | ||
|
|
84cffa91f2 | ||
|
|
59bfbd24b1 | ||
|
|
cf61ab2454 | ||
|
|
9cb8408105 | ||
|
|
82524891f5 | ||
|
|
3b43f42ac8 | ||
|
|
aa3fe0ae83 | ||
|
|
90adfed3f4 | ||
|
|
694cab8b52 | ||
|
|
28d7008b91 | ||
|
|
baad5ab1a1 | ||
|
|
f0a1351b3d | ||
|
|
ea3b09b621 | ||
|
|
0cc2b10c45 | ||
|
|
fc0d71bd72 | ||
|
|
76dd81e73b | ||
|
|
eb1e903fbb | ||
|
|
22f7acf0fb | ||
|
|
9ccd7a9006 | ||
|
|
731f460f7d | ||
|
|
2851362007 | ||
|
|
7fe84d4e7c | ||
|
|
a5729efca3 | ||
|
|
38aa953754 | ||
|
|
ad224416de | ||
|
|
c2e8ed3074 | ||
|
|
f4821c63f2 | ||
|
|
4c0f6ab31f | ||
|
|
bbe7d70bb1 | ||
|
|
112f2cb5c8 | ||
|
|
f6bdec81fe | ||
|
|
6e93c0772a | ||
|
|
eeb0bcc3c6 | ||
|
|
5132c845b0 | ||
|
|
ea32ed86c9 | ||
|
|
2488f81b45 | ||
|
|
c40b01e40e | ||
|
|
9a4d8e46ef | ||
|
|
c9c0b38de5 | ||
|
|
591c5baca0 | ||
|
|
c9c5bdd7bb | ||
|
|
8ab51d480c | ||
|
|
cae9cec74b | ||
|
|
16a51d7bf8 | ||
|
|
a338355f78 | ||
|
|
84cec97f57 | ||
|
|
79f0e02ec2 | ||
|
|
08dd57a3f9 | ||
|
|
e30a7913b7 | ||
|
|
4d337c3fa7 | ||
|
|
5895ef7a46 | ||
|
|
9e870cd2d1 | ||
|
|
f51b8ec8bb | ||
|
|
773556dd2d | ||
|
|
ae39e8614f | ||
|
|
4ffeb7d3db | ||
|
|
f58c06b028 | ||
|
|
d865f3520c | ||
|
|
3c19786ae3 | ||
|
|
25939ab572 | ||
|
|
a5fcf64a5f | ||
|
|
562f5e7f6a | ||
|
|
3106f14f92 | ||
|
|
436276a812 | ||
|
|
1a2be91e2a | ||
|
|
0b87224e39 | ||
|
|
eff6a6efc4 | ||
|
|
edd5287f84 | ||
|
|
71f159840b | ||
|
|
854041749b | ||
|
|
a4a77744d6 | ||
|
|
dac335f3dd | ||
|
|
275ba09a3b | ||
|
|
40ab7fc0f3 | ||
|
|
3b16380936 | ||
|
|
67e18e30a7 | ||
|
|
293e984d60 | ||
|
|
35bf641cb7 | ||
|
|
c86461fd22 | ||
|
|
498edeb86e | ||
|
|
e6c7719bf4 | ||
|
|
e907a052e5 | ||
|
|
6f089c21c5 | ||
|
|
3d8ad87da9 | ||
|
|
92a0ed3c6d | ||
|
|
988b86238f | ||
|
|
f2c019adc3 | ||
|
|
bda256f095 | ||
|
|
77e48b4849 | ||
|
|
0ea85483dc | ||
|
|
54a034da9a | ||
|
|
84d249db18 | ||
|
|
5a1b5233b8 | ||
|
|
3a88ee37ed | ||
|
|
67464a2ad4 | ||
|
|
e1775947ec | ||
|
|
f18771b309 | ||
|
|
1716850f80 | ||
|
|
9ff5945744 | ||
|
|
13d91d590b | ||
|
|
4611c36631 | ||
|
|
0d5eb222a9 | ||
|
|
3508e8d309 | ||
|
|
cafe8965c1 | ||
|
|
5604bced59 | ||
|
|
08e2943edb | ||
|
|
656623be9c | ||
|
|
3ccc1da630 | ||
|
|
01c12c8010 | ||
|
|
dbd2ee4f3c | ||
|
|
84a5ae3268 | ||
|
|
949d8446f1 | ||
|
|
f7e17e90a7 | ||
|
|
f0078cc8fc | ||
|
|
833164823d | ||
|
|
77deede2de | ||
|
|
085a0aa0d4 | ||
|
|
3edcb0a519 | ||
|
|
c6ba1645a1 | ||
|
|
e1d2dfcf9e | ||
|
|
dccaa30202 | ||
|
|
e205ab47a2 | ||
|
|
a2e351779d | ||
|
|
f85ca67666 | ||
|
|
e1261c0340 | ||
|
|
89e4dc4fd5 | ||
|
|
fa480451d1 | ||
|
|
a42cf30bdb | ||
|
|
225bc96739 | ||
|
|
e15beaa7f9 | ||
|
|
fcc1ea98c4 | ||
|
|
afb0e066b0 | ||
|
|
7b5548642a | ||
|
|
5f1898c503 | ||
|
|
7854fb293f | ||
|
|
1e04df322c | ||
|
|
fb12c1df6e | ||
|
|
c4fcafccc5 | ||
|
|
cfbc2ebb46 | ||
|
|
4a85d415e5 | ||
|
|
94c2fab5b0 | ||
|
|
d6b179d3b5 | ||
|
|
32f7fd2c11 | ||
|
|
5a858562cc | ||
|
|
eb800ebbbc | ||
|
|
f3bd46dab2 | ||
|
|
b11a8c02a0 | ||
|
|
7564ecb19f | ||
|
|
65fd9ef338 | ||
|
|
aab49a95db | ||
|
|
f0110fab45 | ||
|
|
3c053feb30 | ||
|
|
68fde7a8ce | ||
|
|
abf067f708 | ||
|
|
0151279a55 | ||
|
|
633c391b4d | ||
|
|
fee9ff59ef | ||
|
|
290da64ffe | ||
|
|
46479ac3a0 | ||
|
|
016e525f62 | ||
|
|
58cb8f4a36 | ||
|
|
240c74da4e | ||
|
|
897d3f8ad5 | ||
|
|
3916653149 | ||
|
|
0baf2f7bc9 | ||
|
|
ef83ecbc05 | ||
|
|
53834ee415 | ||
|
|
7dcc40de8a | ||
|
|
edfd3fdc85 | ||
|
|
39e9cddb5f | ||
|
|
450ea5c63e | ||
|
|
36668ce6a1 | ||
|
|
8cacc9b1a0 | ||
|
|
03dd93b79d | ||
|
|
ee79809edc | ||
|
|
257675bb93 | ||
|
|
d9a01620f6 | ||
|
|
3b15d779d6 | ||
|
|
19796f7538 | ||
|
|
e594563d00 | ||
|
|
15d394edbf | ||
|
|
b07476fc96 | ||
|
|
d3e4c5c30b | ||
|
|
839be403b1 | ||
|
|
5c2c0ab09f | ||
|
|
81f8a9e375 | ||
|
|
4386cab9bc | ||
|
|
00773de340 | ||
|
|
450bd1e213 | ||
|
|
2092c2705f | ||
|
|
e592c64d8f | ||
|
|
0f275acc12 | ||
|
|
af1da198b3 | ||
|
|
e75e4b5640 | ||
|
|
9ed49694bf | ||
|
|
b0088c67ba | ||
|
|
3505a530d0 | ||
|
|
ec87a1f3ad | ||
|
|
0c9c758dbd | ||
|
|
17a9178c8b | ||
|
|
7628e19f26 | ||
|
|
97b506ca15 | ||
|
|
7c1c973917 | ||
|
|
e7340e703b | ||
|
|
1fa5e2bf54 | ||
|
|
dc12e5dd1e | ||
|
|
2c62498b62 | ||
|
|
2eb193101a | ||
|
|
11d8d11b04 | ||
|
|
37b0bd28ce | ||
|
|
13cccac317 | ||
|
|
4fce3b9610 | ||
|
|
fc22d35695 | ||
|
|
091c8b4d7e | ||
|
|
8d4512a612 | ||
|
|
c80bab1fcc | ||
|
|
ca0683ecfa | ||
|
|
31cfd8011f | ||
|
|
371f2e3869 | ||
|
|
cd48667a38 | ||
|
|
45d02246ee | ||
|
|
25e339a4d6 | ||
|
|
155f0f1cce | ||
|
|
807ee34c9d | ||
|
|
123515a33d | ||
|
|
cc741f5029 | ||
|
|
0fc5f831fc | ||
|
|
ecf181a2c7 | ||
|
|
000257bd8e | ||
|
|
30cbbfedf3 | ||
|
|
47cd793262 | ||
|
|
ed6be03aa0 | ||
|
|
afd83a21fb | ||
|
|
4a030dfb73 | ||
|
|
e4b6bc70bc | ||
|
|
fcaa985c2d | ||
|
|
3574628259 | ||
|
|
be71b9f6b5 | ||
|
|
5f5fe2b8cc | ||
|
|
5ff5467673 | ||
|
|
809b0155df | ||
|
|
1e6670c1b7 | ||
|
|
bda9f63f59 | ||
|
|
ea966211b5 | ||
|
|
1771fd2d3b | ||
|
|
7dd22631a9 | ||
|
|
7146c9f90c | ||
|
|
63a90da345 | ||
|
|
29a0e77753 | ||
|
|
1760554305 | ||
|
|
3f391d36b2 | ||
|
|
fee9efe1db | ||
|
|
c8a2551a6e | ||
|
|
9e5a3781b7 | ||
|
|
fa960dc625 | ||
|
|
364767a0b4 | ||
|
|
abdd8a6a79 | ||
|
|
15be002888 | ||
|
|
af9f703302 | ||
|
|
944981b835 | ||
|
|
f7760d69c0 | ||
|
|
b63c14fcb7 | ||
|
|
7ec2608d58 | ||
|
|
881b31f7fa | ||
|
|
6be53b57e1 | ||
|
|
13338a1c76 | ||
|
|
f843302d16 | ||
|
|
f4fe757d5d | ||
|
|
1a410e1f09 | ||
|
|
79fff22d2e | ||
|
|
e6536f612a | ||
|
|
031c50768a | ||
|
|
a805b8e293 | ||
|
|
7145251058 | ||
|
|
5a5e364bee | ||
|
|
6351a06b68 | ||
|
|
4dd27db603 | ||
|
|
d01ed806b9 | ||
|
|
2b6c194af7 | ||
|
|
87409846f0 | ||
|
|
88dca1dbea | ||
|
|
4bf29edec3 | ||
|
|
d1abacf7ae | ||
|
|
9d6126086c | ||
|
|
4c74af0b4a | ||
|
|
fb738a9319 | ||
|
|
c470ecc598 | ||
|
|
47302dd5ad | ||
|
|
431b588cef | ||
|
|
0f931f0275 | ||
|
|
0a3a0c525f | ||
|
|
c818bd61d5 | ||
|
|
3e220d87f0 | ||
|
|
58691c0d15 | ||
|
|
a59a1bbaad | ||
|
|
1d84bd94ea | ||
|
|
e777b3806e | ||
|
|
74afd2522f | ||
|
|
da831bf833 | ||
|
|
d21190d765 | ||
|
|
ae2eefeb92 | ||
|
|
c0968ba348 | ||
|
|
d469a505c4 | ||
|
|
34244e313b | ||
|
|
d77c3feef5 | ||
|
|
0fa9b99445 | ||
|
|
433688cc92 | ||
|
|
790af7d332 | ||
|
|
4fb733df43 | ||
|
|
0794d14a7a | ||
|
|
324747af39 | ||
|
|
5377b50e53 | ||
|
|
b745b8e545 | ||
|
|
cfa65cfe5c | ||
|
|
7d52af37fa |
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
#LockDir=/var/lock/cvs
|
||||
LockDir=/var/lock/cvs
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
# Script to accumulate log messages for an entire tree and send them along
|
||||
# with the diffs; deals correctly with all manner of branching (I hope)
|
||||
#
|
||||
# $Id: new_log_accum,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
# $Id: new_log_accum,v 1.3 2003-09-07 12:46:59 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use MD5;
|
||||
use Digest::MD5;
|
||||
|
||||
# Set this to the full path of a mailer that takes a list
|
||||
# of email addresses as arguments...
|
||||
@@ -328,13 +328,13 @@ sub build_header ($@) {
|
||||
|
||||
# generate a unique boundary by calculating the md5sum of the
|
||||
# current time
|
||||
$digest = new MD5;
|
||||
$digest = new Digest::MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, "From: $user");
|
||||
push(@text, 'From: [email protected]');
|
||||
push(@text, "To: " . join(' ', @mailto));
|
||||
push(@text, "Subject: $subject");
|
||||
push(@text, "MIME-Version: 1.0");
|
||||
|
||||
@@ -6,4 +6,14 @@ penguin:Jh.dOjaiO2jHk:fs2source
|
||||
DTP:f7M92Z/6/uep.:fs2source
|
||||
unknownplayer:f79BgAn.IzJs6:fs2source
|
||||
phreak:f7WQyGiT/jzlM:fs2source
|
||||
randomtiger:f7Way/xL9ic7o:fs2source
|
||||
righteous1:f7fpcXiE0Ubao:fs2source
|
||||
bobboau:f7jChSbXOIdWY:fs2source
|
||||
sesquipedalian:f75AcAOV6TM6Q:fs2source
|
||||
daveb:f7f2mVbMvbe.6:fs2source
|
||||
Goober5000:f7Fc.gHzyrOL2:fs2source
|
||||
dkharrat:f7odljbD5tm5k:fs2source
|
||||
EdrickV:f7cDahmEbbAlg:fs2source
|
||||
OldMan:f7N4NyUG5Ommw:fs2source
|
||||
komet:f7fyoBN5r.m76:fs2source
|
||||
anonymous:oIKtWP1q6GDt6:fs2source
|
||||
@@ -1,4 +1,18 @@
|
||||
drevil
|
||||
inquisitor
|
||||
mysterial
|
||||
DTP
|
||||
randomtiger
|
||||
wmcoolmon
|
||||
unknownplayer
|
||||
phreak
|
||||
bobboau
|
||||
righteous1
|
||||
sesquipedalian
|
||||
Goober5000
|
||||
dkharrat
|
||||
daveb
|
||||
EdrickV
|
||||
OldMan
|
||||
komet
|
||||
penguin
|
||||
@@ -11,3 +11,4 @@ created based on the source."
|
||||
Modifications by members of the FreeSpace Source Code Project are
|
||||
released under whatever terms the individual authors choose, but the
|
||||
above notice continues to apply to all fs2_open code.
|
||||
|
||||
+25
-8
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "_MBCS" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W2 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "USE_OPENGL" /D "HTL" /D "MORE_SPECIES" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
@@ -53,7 +53,16 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"c:\games\freespace2\fs2_open.exe" /libpath:"release"
|
||||
# ADD LINK32 Quartz.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"C:\games\freespace2\fs2_open_r.exe" /libpath:"release" /libpath:"c:\mssdk\lib" /libpath:"c:\dxsdk\lib" /libpath:"c:\speech_api\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Custom Build - Copying $(InputPath) to D:\games\freespace2
|
||||
InputPath=\games\freespace2\fs2_open_r.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"d:\games\freespace2\fs2_open_r.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) d:\games\freespace2\fs2_open_r.exe
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Freespace2 - Win32 Debug"
|
||||
|
||||
@@ -69,7 +78,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "MORE_SPECIES" /U "NDEBUG" /Fr /YX /FD /GZ /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
@@ -79,14 +88,14 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo /o"debug/profile/Freespace2.bsc" "./debug/profile/*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"debug\fs2_open_debug.exe" /libpath:"debug"
|
||||
# ADD LINK32 Quartz.lib d3d8.lib d3dx8.lib DxErr8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"C:\games\freespace2\fs2_open_d.exe" /libpath:"debug" /libpath:"c:\mssdk\lib" /libpath:"c:\dxsdk\lib" /libpath:"c:\speech_api\lib"
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no /map
|
||||
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
|
||||
InputPath=.\debug\fs2_open_debug.exe
|
||||
# Begin Custom Build - Copying $(InputPath) to D:\games\freespace2
|
||||
InputPath=\games\freespace2\fs2_open_d.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"c:\games\freespace2\fs2_open.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) c:\games\freespace2
|
||||
"d:\games\freespace2\fs2_open_d.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) d:\games\freespace2\fs2_open_d.exe
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -138,11 +147,19 @@ SOURCE=.\code\freespace2\goal_ord.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\graphics\grstub.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\network\multiui.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
+44
-44
@@ -1,44 +1,44 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Freespace2"=".\Freespace2.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name code
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "code"=".\code\code.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Freespace2"=".\Freespace2.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name code
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "code"=".\code\code.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -9,13 +9,70 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2004-03-05 09:01:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.6 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.5 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.4 2003/11/29 10:52:08 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.3 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.1.2.2 2002/09/28 22:13:42 randomtiger
|
||||
* Sorted out some bits and pieces. The background nebula blends now which is nice. – RT
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:40 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -66,7 +123,7 @@
|
||||
* 34 4/27/98 3:36p Dave
|
||||
*
|
||||
* 33 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so damn complex when you try and call it.
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 32 2/05/98 9:21p John
|
||||
* Some new Direct3D code. Added code to monitor a ton of stuff in the
|
||||
@@ -187,10 +244,10 @@
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
static color Color_xparent;
|
||||
|
||||
@@ -448,6 +505,7 @@ anim_instance *anim_play(anim_play_struct *aps)
|
||||
// input: instance => pointer to animation instance
|
||||
// frametime => time elapsed since last call, in seconds
|
||||
//
|
||||
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
{
|
||||
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
|
||||
@@ -465,6 +523,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
n_frames = instance->stop_at - instance->start_at + 1;
|
||||
else if(instance->direction == ANIM_DIRECT_REVERSE)
|
||||
n_frames = instance->start_at - instance->stop_at + 1;
|
||||
|
||||
time = n_frames / i2fl(instance->parent->fps);
|
||||
|
||||
percent_through = instance->time_elapsed / time;
|
||||
@@ -612,9 +671,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
int temp_file_offset = 0;
|
||||
|
||||
// if we're using bitmap polys
|
||||
if(Gr_bitmap_poly){
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
}
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
|
||||
if ( anim_instance_is_streamed(instance) ) {
|
||||
if ( instance->xlate_pal ){
|
||||
@@ -693,9 +750,9 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
|
||||
else {
|
||||
g3_rotate_vertex(&image_vertex,instance->world_pos);
|
||||
Assert(instance->radius != 0.0f);
|
||||
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED );
|
||||
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED | TMAP_HTL_2D);
|
||||
}
|
||||
|
||||
|
||||
//bm_release(bitmap_id);
|
||||
instance->last_bitmap = bitmap_id;
|
||||
}
|
||||
@@ -891,7 +948,9 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
int count,idx;
|
||||
char name[_MAX_PATH];
|
||||
|
||||
// file_mapped = 0;
|
||||
if(Cmdline_cache_ani) {
|
||||
file_mapped = PAGE_FROM_MEM;
|
||||
}
|
||||
|
||||
Assert ( real_filename != NULL );
|
||||
|
||||
@@ -962,7 +1021,7 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
|
||||
ptr->cfile_ptr = NULL;
|
||||
|
||||
if ( file_mapped ) {
|
||||
if ( file_mapped == PAGE_FROM_MEM) {
|
||||
// Try mapping the file to memory
|
||||
ptr->flags |= ANF_MEM_MAPPED;
|
||||
ptr->cfile_ptr = cfopen(name, "rb", CFILE_MEMORY_MAPPED);
|
||||
|
||||
@@ -9,13 +9,21 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-12-08 22:30:02 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -41,7 +49,7 @@
|
||||
* 10 4/27/98 3:36p Dave
|
||||
*
|
||||
* 9 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so damn complex when you try and call it.
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 8 12/24/97 8:57p Lawrance
|
||||
* Added anim_ignore_next_frametime()
|
||||
@@ -126,6 +134,13 @@ typedef struct {
|
||||
int ping_pong;
|
||||
} anim_play_struct;
|
||||
|
||||
enum
|
||||
{
|
||||
PAGE_FROM_MEM = 0,
|
||||
PAGE_FROM_DISK = 1,
|
||||
PAGE_FROM_DISK_FORCED = 2,
|
||||
};
|
||||
|
||||
extern int Anim_paused;
|
||||
|
||||
void anim_init();
|
||||
@@ -140,7 +155,7 @@ int anim_stop_playing(anim_instance* anim_instance);
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime);
|
||||
void anim_release_all_instances(int screen_id = 0);
|
||||
void anim_release_render_instance(anim_instance* instance);
|
||||
anim *anim_load(char *name, int file_mapped = 0);
|
||||
anim *anim_load(char *name, int file_mapped = PAGE_FROM_MEM);
|
||||
int anim_free(anim *ptr);
|
||||
int anim_playing(anim_instance *ai);
|
||||
int anim_write_frames_out(char *filename);
|
||||
|
||||
@@ -9,15 +9,52 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-03-05 09:01:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.3 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/11/04 03:02:27 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -152,12 +189,10 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "graphics/grinternal.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "palman/palman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
|
||||
int packer_code = PACKER_CODE;
|
||||
int transparent_code = 254;
|
||||
@@ -260,10 +295,7 @@ int anim_get_next_frame(anim_instance *inst)
|
||||
|
||||
anim_check_for_palette_change(inst);
|
||||
|
||||
// if we're using bitmap polys
|
||||
if(Gr_bitmap_poly){
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
}
|
||||
BM_SELECT_TEX_FORMAT();
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation, aabitmap, bpp);
|
||||
@@ -775,6 +807,15 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
|
||||
return packed_size;
|
||||
}
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void convert_24_to_16(int bit_24, ushort *bit_16)
|
||||
{
|
||||
ubyte *pixel = (ubyte*)&bit_24;
|
||||
ubyte alpha = 1;
|
||||
|
||||
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
|
||||
}
|
||||
|
||||
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
|
||||
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
|
||||
{
|
||||
@@ -809,7 +850,7 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
|
||||
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
|
||||
|
||||
// convert to 16 bit
|
||||
bm_24_to_16(bit_24, &bit_16);
|
||||
convert_24_to_16(bit_24, &bit_16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +904,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count, int
|
||||
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
|
||||
|
||||
// convert to 16 bit
|
||||
bm_24_to_16(bit_24, &bit_16);
|
||||
convert_24_to_16(bit_24, &bit_16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,15 +9,18 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -201,7 +204,7 @@ typedef struct anim {
|
||||
int file_offset; // file offset to start of frame data
|
||||
int cache_file_offset;
|
||||
ubyte *cache;
|
||||
} anim_t;
|
||||
} anim;
|
||||
|
||||
// the direction to play the anim (forwards or backwards)
|
||||
#define ANIM_DIRECT_FORWARD 0
|
||||
@@ -233,7 +236,7 @@ typedef struct anim_instance {
|
||||
int paused; // pause the anim
|
||||
int file_offset; // current offset into frame (like data, put offset into file)
|
||||
int loop_count; // starts at 0, and is incremented each time it loops
|
||||
} anim_instance_t;
|
||||
} anim_instance;
|
||||
|
||||
extern int packer_code;
|
||||
|
||||
|
||||
@@ -9,13 +9,41 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-03-31 05:42:25 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.4 2003/11/17 06:52:51 bobboau
|
||||
* got assert to work again
|
||||
*
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -274,16 +302,22 @@
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "particle/particle.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "hud/hud.h"
|
||||
#include "hud/hudescort.h"
|
||||
#include "hud/hudgauges.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "localization/localize.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "hud/hudtarget.h"
|
||||
#include "weapon/weapon.h"
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "model/model.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multiutil.h"
|
||||
@@ -301,22 +335,47 @@ asteroid_obj Asteroid_obj_list; // head of linked list of asteroid_obj stru
|
||||
// Asteroid editor requires first set of entries to be "None" and then "Asteroid XXX"
|
||||
// Any changes to this will require changes to the asteroid editor
|
||||
debris_struct Field_debris_info[] = {
|
||||
-1, "None",
|
||||
ASTEROID_TYPE_SMALL, "Asteroid Small",
|
||||
-1, "None",
|
||||
ASTEROID_TYPE_SMALL, "Asteroid Small",
|
||||
ASTEROID_TYPE_MEDIUM, "Asteroid Medium",
|
||||
ASTEROID_TYPE_BIG, "Asteroid Large",
|
||||
|
||||
DEBRIS_TERRAN_SMALL, "Terran Small",
|
||||
DEBRIS_TERRAN_SMALL, "Terran Small",
|
||||
DEBRIS_TERRAN_MEDIUM, "Terran Medium",
|
||||
DEBRIS_TERRAN_LARGE, "Terran Large",
|
||||
DEBRIS_TERRAN_LARGE, "Terran Large",
|
||||
|
||||
DEBRIS_VASUDAN_SMALL, "Vasudan Small",
|
||||
DEBRIS_VASUDAN_MEDIUM, "Vasudan Medium",
|
||||
DEBRIS_VASUDAN_LARGE, "Vasudan Large",
|
||||
|
||||
DEBRIS_SHIVAN_SMALL, "Shivan Small",
|
||||
DEBRIS_SHIVAN_SMALL, "Shivan Small",
|
||||
DEBRIS_SHIVAN_MEDIUM, "Shivan Medium",
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large"
|
||||
|
||||
#if !defined(MORE_SPECIES)
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large"
|
||||
#else
|
||||
DEBRIS_SHIVAN_LARGE, "Shivan Large",
|
||||
|
||||
DEBRIS_ANCIENT_SMALL, "Ancient Small",
|
||||
DEBRIS_ANCIENT_MEDIUM, "Ancient Medium",
|
||||
DEBRIS_ANCIENT_LARGE, "Ancient Large",
|
||||
|
||||
DEBRIS_USER1_SMALL, "User1 Small",
|
||||
DEBRIS_USER1_MEDIUM, "User1 Medium",
|
||||
DEBRIS_USER1_LARGE, "User1 Large",
|
||||
|
||||
DEBRIS_USER2_SMALL, "User2 Small",
|
||||
DEBRIS_USER2_MEDIUM, "User2 Medium",
|
||||
DEBRIS_USER2_LARGE, "User2 Large",
|
||||
|
||||
DEBRIS_USER3_SMALL, "User3 Small",
|
||||
DEBRIS_USER3_MEDIUM, "User3 Medium",
|
||||
DEBRIS_USER3_LARGE, "User3 Large",
|
||||
|
||||
DEBRIS_USER4_SMALL, "User4 Small",
|
||||
DEBRIS_USER4_MEDIUM, "User4 Medium",
|
||||
DEBRIS_USER4_LARGE, "User4 Large",
|
||||
#endif
|
||||
};
|
||||
|
||||
// used for randomly generating debris type when there are multiple sizes.
|
||||
@@ -644,7 +703,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
objp->phys_info.I_body_inv.vec.rvec.xyz.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
|
||||
objp->phys_info.I_body_inv.vec.uvec.xyz.y = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->phys_info.I_body_inv.vec.fvec.xyz.z = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->hull_strength = asip->initial_hull_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
|
||||
objp->hull_strength = asip->initial_asteroid_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
|
||||
|
||||
// ensure vel is valid
|
||||
Assert( !vm_is_vec_nan(&objp->phys_info.vel) );
|
||||
@@ -745,6 +804,19 @@ int get_debris_from_same_group(int index) {
|
||||
// the weight is then used to determine the frequencty of different sizes of ship debris
|
||||
int get_debris_weight(int ship_debris_index)
|
||||
{
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (ship_debris_index % 3 == 0)
|
||||
return SMALL_DEBRIS_WEIGHT;
|
||||
|
||||
if (ship_debris_index % 3 == 1)
|
||||
return MEDIUM_DEBRIS_WEIGHT;
|
||||
|
||||
if (ship_debris_index % 3 == 2)
|
||||
return LARGE_DEBRIS_WEIGHT;
|
||||
//Int3();
|
||||
return 1;
|
||||
#else
|
||||
switch (ship_debris_index) {
|
||||
case DEBRIS_TERRAN_SMALL:
|
||||
case DEBRIS_VASUDAN_SMALL:
|
||||
@@ -769,6 +841,7 @@ int get_debris_weight(int ship_debris_index)
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Create all the asteroids for the mission, called from
|
||||
@@ -1153,7 +1226,7 @@ void asteroid_process_pre( object *objp, float frame_time)
|
||||
}
|
||||
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 )
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpos, collision_info_struct *asteroid_hit_info)
|
||||
{
|
||||
if (!Asteroids_enabled) {
|
||||
@@ -1498,6 +1571,18 @@ void asteriod_explode_sound(object *objp, int type, int play_loud)
|
||||
int sound_index = -1;
|
||||
float range_factor = 1.0f; // how many times sound should traver farther than normal
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (type % 3 <= 1)
|
||||
{
|
||||
sound_index = SND_ASTEROID_EXPLODE_SMALL;
|
||||
range_factor = 5.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sound_index = SND_ASTEROID_EXPLODE_BIG;
|
||||
range_factor = 10.0f;
|
||||
}
|
||||
#else
|
||||
switch (type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
case ASTEROID_TYPE_MEDIUM:
|
||||
@@ -1523,7 +1608,7 @@ void asteriod_explode_sound(object *objp, int type, int play_loud)
|
||||
Int3();
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
Assert(sound_index != -1);
|
||||
|
||||
if ( !play_loud ) {
|
||||
@@ -1728,6 +1813,46 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
#ifndef NO_NETWORK
|
||||
if ( !MULTIPLAYER_CLIENT ) {
|
||||
#endif
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
if (asp->type <= ASTEROID_TYPE_BIG) // 3
|
||||
// if this isn't true it's just debris, and debris doesn't break up
|
||||
{
|
||||
switch (asp->type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
break;
|
||||
case ASTEROID_TYPE_MEDIUM:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec);
|
||||
|
||||
break;
|
||||
case ASTEROID_TYPE_BIG:
|
||||
asc_get_relvec(&relvec, asteroid_obj, &asp->death_hit_pos);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &relvec);
|
||||
|
||||
vm_vec_normalized_dir(&vfh, &asteroid_obj->pos, &asp->death_hit_pos);
|
||||
vm_vec_copy_scale(&tvec, &vfh, 2.0f);
|
||||
vm_vec_sub2(&tvec, &relvec);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_MEDIUM, &tvec);
|
||||
|
||||
while (frand() > 0.6f) {
|
||||
vector rvec, tvec2;
|
||||
vm_vec_rand_vec_quick(&rvec);
|
||||
vm_vec_scale_add(&tvec2, &vfh, &rvec, 0.75f);
|
||||
asteroid_sub_create(asteroid_obj, ASTEROID_TYPE_SMALL, &tvec2);
|
||||
}
|
||||
break;
|
||||
|
||||
default: // this isn't going to happen.. really
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
switch (asp->type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
break;
|
||||
@@ -1774,6 +1899,7 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
default:
|
||||
Int3();
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_NETWORK
|
||||
}
|
||||
#endif
|
||||
@@ -2004,7 +2130,7 @@ void asteroid_parse_section()
|
||||
asip->num_detail_levels = 0;
|
||||
|
||||
required_string("$Detail distance:");
|
||||
asip->num_detail_levels = stuff_int_list(asip->detail_distance, MAX_SHIP_DETAIL_LEVELS, RAW_INTEGER_TYPE);
|
||||
asip->num_detail_levels = stuff_int_list(asip->detail_distance, MAX_ASTEROID_DETAIL_LEVELS, RAW_INTEGER_TYPE);
|
||||
|
||||
required_string("$Max Speed:");
|
||||
stuff_float(&asip->max_speed);
|
||||
@@ -2022,9 +2148,9 @@ void asteroid_parse_section()
|
||||
stuff_float(&asip->blast);
|
||||
|
||||
required_string("$Hitpoints:");
|
||||
stuff_float(&asip->initial_hull_strength);
|
||||
stuff_float(&asip->initial_asteroid_strength);
|
||||
}
|
||||
|
||||
extern int True_NumSpecies;
|
||||
// read in data from asteroid.tbl into Asteroid_info[] array
|
||||
void asteroid_parse_tbl()
|
||||
{
|
||||
@@ -2049,7 +2175,11 @@ void asteroid_parse_tbl()
|
||||
required_string("#End");
|
||||
|
||||
// check all read in
|
||||
#if defined(MORE_SPECIES)
|
||||
Assert(Num_asteroid_types == (True_NumSpecies + 1) * 3);//the species + normal asteroids
|
||||
#else
|
||||
Assert(Num_asteroid_types == MAX_DEBRIS_TYPES);
|
||||
#endif
|
||||
|
||||
Asteroid_impact_explosion_ani = -1;
|
||||
required_string("$Impact Explosion:");
|
||||
@@ -2263,14 +2393,8 @@ void asteroid_page_in()
|
||||
for (j=0; j<asip->modelp[k]->n_textures; j++ ) {
|
||||
int bitmap_num = asip->modelp[k]->original_textures[j];
|
||||
|
||||
|
||||
// if we're in Glide (and maybe later with D3D), use nondarkening textures
|
||||
if ( bitmap_num > -1 ) {
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_page_in_nondarkening_texture( bitmap_num );
|
||||
} else {
|
||||
bm_page_in_texture( bitmap_num );
|
||||
}
|
||||
bm_page_in_texture( bitmap_num );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-03-05 09:01:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -125,8 +135,8 @@
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h" // for NAME_LENGTH
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h" // for NAME_LENGTH
|
||||
|
||||
struct object;
|
||||
struct polymodel;
|
||||
@@ -135,23 +145,73 @@ struct collision_info_struct;
|
||||
#define MAX_ASTEROIDS 256
|
||||
|
||||
// DEBRIS TYPES
|
||||
#define MAX_DEBRIS_TYPES 12
|
||||
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
#define DEBRIS_NAME_MASK 0x000f
|
||||
// -----------------------------------
|
||||
// Kazan Extended Species version
|
||||
// -----------------------------------
|
||||
#define MAX_DEBRIS_TYPES 27
|
||||
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
// terran
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
// vasudan
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
// shivan
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// ancient
|
||||
#define DEBRIS_ANCIENT_SMALL 12
|
||||
#define DEBRIS_ANCIENT_MEDIUM 13
|
||||
#define DEBRIS_ANCIENT_LARGE 14
|
||||
// user1
|
||||
#define DEBRIS_USER1_SMALL 15
|
||||
#define DEBRIS_USER1_MEDIUM 16
|
||||
#define DEBRIS_USER1_LARGE 17
|
||||
// user2
|
||||
#define DEBRIS_USER2_SMALL 18
|
||||
#define DEBRIS_USER2_MEDIUM 19
|
||||
#define DEBRIS_USER2_LARGE 20
|
||||
// user3
|
||||
#define DEBRIS_USER3_SMALL 21
|
||||
#define DEBRIS_USER3_MEDIUM 22
|
||||
#define DEBRIS_USER3_LARGE 23
|
||||
// user4
|
||||
#define DEBRIS_USER4_SMALL 24
|
||||
#define DEBRIS_USER4_MEDIUM 25
|
||||
#define DEBRIS_USER4_LARGE 26
|
||||
#else
|
||||
// -----------------------------------
|
||||
// Old Volition Version
|
||||
// -----------------------------------
|
||||
#define MAX_DEBRIS_TYPES 12
|
||||
//
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
//
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
//
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
//
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// END DEBRIS TYPES
|
||||
#endif
|
||||
|
||||
typedef struct debris_struct {
|
||||
int index;
|
||||
@@ -172,17 +232,20 @@ extern debris_struct Field_debris_info[];
|
||||
|
||||
#define AF_USED (1<<0) // Set means used.
|
||||
|
||||
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
|
||||
#define MAX_ASTEROID_DETAIL_LEVELS 5
|
||||
|
||||
typedef struct asteroid_info {
|
||||
char name[NAME_LENGTH]; // name for the asteroid
|
||||
char pof_files[MAX_ASTEROID_POFS][NAME_LENGTH]; // POF files to load/associate with ship
|
||||
int num_detail_levels; // number of detail levels for this ship
|
||||
int detail_distance[MAX_SHIP_DETAIL_LEVELS]; // distance to change detail levels at
|
||||
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
|
||||
float max_speed; // cap on speed for asteroid
|
||||
float inner_rad; // radius within which maximum area effect damage is applied
|
||||
float outer_rad; // radius at which no area effect damage is applied
|
||||
float damage; // maximum damage applied from area effect explosion
|
||||
float blast; // maximum blast impulse from area effect explosion
|
||||
float initial_hull_strength; // starting strength of asteroid
|
||||
float initial_asteroid_strength; // starting strength of asteroid
|
||||
polymodel *modelp[MAX_ASTEROID_POFS];
|
||||
int model_num[MAX_ASTEROID_POFS];
|
||||
} asteroid_info;
|
||||
@@ -203,8 +266,13 @@ typedef struct asteroid {
|
||||
|
||||
// TYPEDEF FOR SPECIES OF DEBRIS - BITFIELD
|
||||
#define DS_TERRAN 0x01
|
||||
#define DS_VASUDAN 0x02
|
||||
#define DS_VASUDAN 0x02
|
||||
#define DS_SHIVAN 0x04
|
||||
#define DS_ANCIENT 0x08
|
||||
#define DS_USER1 0x10
|
||||
#define DS_USER2 0x20
|
||||
#define DS_USER3 0x40
|
||||
#define DS_USER4 0x80
|
||||
|
||||
// TYPEDEF FOR DEBRIS TYPE
|
||||
typedef enum {
|
||||
|
||||
+456
-226
File diff suppressed because it is too large.
Load diff
+227
-33
@@ -9,13 +9,85 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-19 01:07:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2004-05-06 22:35:26 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12 2004/04/01 15:31:20 taylor
|
||||
* don't use interface anis as ship textures
|
||||
*
|
||||
* Revision 2.11 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/12/04 20:39:08 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.9 2003/11/19 20:37:22 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.8 2003/11/07 18:31:01 randomtiger
|
||||
* Fixed a nohtl call to htl funcs (crash with NULL pointer)
|
||||
* Fixed a bug with 32bit PCX code.
|
||||
* Fixed a bug in the d3d_string batch system that was messing up screen shaking.
|
||||
* Added a couple of checks to try and stop timerbar push and pop overloads, check returns missing pops if you use the system.
|
||||
* Put in a higher res icon until we get something better sorted out.
|
||||
*
|
||||
* Revision 2.7 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.6 2003/08/16 03:52:22 bobboau
|
||||
* update for the specmapping code includeing
|
||||
* suport for seperate specular levels on lights and
|
||||
* optional strings for the stars table
|
||||
* code has been made more organised,
|
||||
* though there seems to be a bug in the state selecting code
|
||||
* resulting in the HUD being rendered incorectly
|
||||
* and specmapping failing ocasionaly
|
||||
*
|
||||
* Revision 2.5 2003/08/12 03:18:32 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.3 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.2 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
@@ -24,6 +96,52 @@
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
|
||||
* Fixed debug bitmap compiling bug.
|
||||
* Fixed tga bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
|
||||
* Fixed new TGA code texturing bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
|
||||
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
|
||||
*
|
||||
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
|
||||
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
|
||||
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
|
||||
*
|
||||
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
|
||||
* Bmpmap has been reverted to an old non d3d8 version.
|
||||
* All d3d8 code is now in the proper place.
|
||||
* PCX code is now working to an extent. Problems with alpha though.
|
||||
* Ani's work slowly with alpha problems.
|
||||
* Also I have done a bit of tidying - RT
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -165,17 +283,93 @@
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_BITMAPS 3500
|
||||
#else
|
||||
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
|
||||
// 16 bit pixel formats
|
||||
#define BM_PIXEL_FORMAT_ARGB 0 // for glide - can assume certain things, like 1555 LFB writes, whee!
|
||||
#define BM_PIXEL_FORMAT_D3D 1 // d3d - card dependant. booo!
|
||||
#define BM_PIXEL_FORMAT_ARGB_D3D 2 // this card has nice 1555 textures like Glide - ahhhhh!
|
||||
|
||||
enum
|
||||
{
|
||||
BM_TYPE_NONE,
|
||||
BM_TYPE_PCX, // 16 bit PCX
|
||||
BM_TYPE_USER, // Data created at run time
|
||||
BM_TYPE_ANI, // In-house ANI format
|
||||
// Only list 32 bit formats after this flag please
|
||||
BM_TYPE_32_BIT_FORMATS,
|
||||
BM_TYPE_TGA,
|
||||
BM_TYPE_JPG,
|
||||
BM_TYPE_DDS,
|
||||
};
|
||||
|
||||
/// Moved from cpp file ///////////////////
|
||||
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
|
||||
|
||||
typedef union bm_extra_info {
|
||||
struct {
|
||||
// Stuff needed for animations
|
||||
int first_frame; // used for animations -- points to index of first frame
|
||||
ubyte num_frames; // used for animation -- number of frames in the animation
|
||||
ubyte fps; // used for animation -- frames per second
|
||||
} ani;
|
||||
struct {
|
||||
// Stuff needed for user bitmaps
|
||||
void *data; // For user bitmaps, this is where the data comes from
|
||||
ubyte bpp; // For user bitmaps, this is what format the data is
|
||||
ubyte flags; // Flags passed to bm_create
|
||||
} user;
|
||||
} bm_extra_info;
|
||||
|
||||
typedef struct bitmap_entry {
|
||||
// identification
|
||||
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
|
||||
|
||||
uint signature; // a unique signature identifying the data
|
||||
uint palette_checksum; // checksum used to be sure bitmap is in current palette
|
||||
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; // When this bitmap was last used
|
||||
|
||||
ubyte type; // PCX, USER, ANI, etc
|
||||
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
|
||||
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
|
||||
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; // number of mipmap levels, we need to read all of them
|
||||
|
||||
// Stuff to keep track of usage
|
||||
ubyte preloaded; // If set, then this was loaded from the lst file
|
||||
ubyte used_flags; // What flags it was accessed thru
|
||||
|
||||
// Bitmap info
|
||||
bitmap bm;
|
||||
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
ubyte used_this_frame; // If set, then it was used this frame
|
||||
int data_size; // How much data this bitmap uses
|
||||
int used_count; // How many times it was accessed
|
||||
#endif
|
||||
|
||||
} bitmap_entry;
|
||||
|
||||
void bm_gfx_init();
|
||||
void bm_gfx_close();
|
||||
int bm_gfx_get_cache_slot( int bitmap_id, int separate_ani_frames );
|
||||
|
||||
int bm_gfx_get_next_handle();
|
||||
|
||||
// 16 bit pixel formats
|
||||
extern int Bm_pixel_format;
|
||||
|
||||
@@ -188,12 +382,12 @@ extern int bm_texture_ram;
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number.
|
||||
int bm_load(char * filename);
|
||||
int bm_gfx_load(char * filename);
|
||||
|
||||
// special load function. basically allows you to load a bitmap which already exists (by filename).
|
||||
// this is useful because in some cases we need to have a bitmap which is locked in screen format
|
||||
// _and_ texture format, such as pilot pics and squad logos
|
||||
int bm_load_duplicate(char *filename);
|
||||
int bm_gfx_load_duplicate(char *filename);
|
||||
|
||||
// Creates a bitmap that exists in RAM somewhere, instead
|
||||
// of coming from a disk file. You pass in a pointer to a
|
||||
@@ -203,29 +397,29 @@ int bm_load_duplicate(char *filename);
|
||||
// On success, it returns the bitmap number. You cannot
|
||||
// free that RAM until bm_release is called on that bitmap.
|
||||
// See example at bottom of this file
|
||||
int bm_create( int bpp, int w, int h, void * data, int flags = 0);
|
||||
int bm_gfx_create( int bpp, int w, int h, void * data, int flags = 0);
|
||||
|
||||
// Frees up a bitmap's data, but bitmap number 'n' can
|
||||
// still be used, it will just have to be paged in next
|
||||
// time it is locked.
|
||||
int bm_unload( int n );
|
||||
int bm_gfx_unload( int n );
|
||||
|
||||
// Frees up a bitmap's data, and it's slot, so bitmap
|
||||
// number 'n' cannot be used anymore, and bm_load or
|
||||
// bm_create might reuse the slot.
|
||||
void bm_release(int n);
|
||||
void bm_gfx_release(int n);
|
||||
|
||||
// This loads a bitmap sequence so we can draw with it later.
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number of the first frame and nframes is set.
|
||||
extern int bm_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0 );
|
||||
extern int bm_gfx_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_unlock. Only lock
|
||||
// a bitmap when you need it! This will convert it into the
|
||||
// appropriate format also.
|
||||
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
|
||||
extern bitmap * bm_gfx_lock( int bitmapnum, ubyte bpp, ubyte flags );
|
||||
|
||||
// The signature is a field that gets filled in with
|
||||
// a unique signature for each bitmap. The signature for each bitmap
|
||||
@@ -233,32 +427,32 @@ extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
|
||||
extern uint bm_get_signature( int bitmapnum);
|
||||
|
||||
// Unlocks a bitmap
|
||||
extern void bm_unlock( int bitmapnum );
|
||||
extern void bm_gfx_unlock( int bitmapnum );
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
extern void bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
|
||||
extern void bm_gfx_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
|
||||
|
||||
// get filename
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
|
||||
// resyncs all the bitmap palette
|
||||
extern void bm_update();
|
||||
|
||||
// call to load all data for all bitmaps that have been requested to be loaded
|
||||
extern void bm_load_all();
|
||||
extern void bm_unload_all();
|
||||
extern void bm_gfx_load_all();
|
||||
extern void bm_gfx_unload_all();
|
||||
|
||||
// call to get the palette for a bitmap
|
||||
extern void bm_get_palette(int n, ubyte *pal, char *name);
|
||||
void bm_gfx_get_palette(int n, ubyte *pal, char *name);
|
||||
|
||||
// Hacked function to get a pixel from a bitmap.
|
||||
// Only works good in 8bpp mode.
|
||||
void bm_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
|
||||
// Returns number of bytes of bitmaps locked this frame
|
||||
// ntotal = number of bytes of bitmaps locked this frame
|
||||
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
|
||||
void bm_get_frame_usage(int *ntotal, int *nnew);
|
||||
void bm_gfx_get_frame_usage(int *ntotal, int *nnew);
|
||||
|
||||
/*
|
||||
* Example on using bm_create
|
||||
@@ -305,28 +499,28 @@ void bm_get_frame_usage(int *ntotal, int *nnew);
|
||||
// Paging stuff
|
||||
//============================================================================
|
||||
|
||||
void bm_page_in_start();
|
||||
void bm_page_in_stop();
|
||||
void bm_gfx_page_in_start();
|
||||
void bm_gfx_page_in_stop();
|
||||
|
||||
// Paging code in a library should call these functions
|
||||
// in its page in function.
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_texture( int bitmapnum, int num_frames=1 );
|
||||
void bm_gfx_page_in_texture( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
|
||||
void bm_gfx_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
|
||||
|
||||
// marks a texture as being a transparent textyre used for this level
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
void bm_gfx_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// Marks an aabitmap as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
void bm_gfx_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
@@ -340,9 +534,6 @@ void BM_SELECT_SCREEN_FORMAT();
|
||||
void BM_SELECT_TEX_FORMAT();
|
||||
void BM_SELECT_ALPHA_TEX_FORMAT();
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void bm_24_to_16(int bit_24, ushort *bit_16);
|
||||
|
||||
// set the rgba components of a pixel, any of the parameters can be NULL
|
||||
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
@@ -353,18 +544,21 @@ void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *
|
||||
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
// get the rgba components of a pixel, any of the parameters can be NULL
|
||||
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_gfx_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
//============================================================================
|
||||
// section info stuff
|
||||
//============================================================================
|
||||
|
||||
// given a bitmap and a section, return the size (w, h)
|
||||
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
void bm_gfx_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
|
||||
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_size(int num);
|
||||
int bm_get_num_mipmaps(int num);
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,43 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2002-11-10 16:29:53 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.15 $
|
||||
* $Date: 2004-05-06 22:12:14 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/02/04 09:02:45 Goober5000
|
||||
* got rid of unnecessary double semicolons
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.12 2003/08/27 01:36:22 Goober5000
|
||||
* fixed a strange thing that Bobboau inexplicably put in
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/08/25 04:39:17 Goober5000
|
||||
* fixed unreachable code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/08/22 07:35:07 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.9 2003/08/20 08:12:08 wmcoolmon
|
||||
* Made cfile_delete return 0 on failure, 1 on success
|
||||
*
|
||||
* Revision 2.8 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.7 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.6 2002/11/04 08:32:38 DTP
|
||||
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
|
||||
*
|
||||
@@ -26,6 +56,12 @@
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -219,16 +255,10 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/encrypt.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
|
||||
@@ -244,7 +274,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
// Root must be index 1!!
|
||||
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
|
||||
@@ -263,7 +293,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_MAIN, "data" DIR_SEPARATOR_STR "players", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx", CF_TYPE_PLAYER_MAIN },
|
||||
@@ -624,8 +654,8 @@ char *cf_add_ext(char *filename, char *ext)
|
||||
return path;
|
||||
}
|
||||
|
||||
// Deletes a file.
|
||||
void cf_delete( char *filename, int dir_type )
|
||||
// Deletes a file. Returns 0 if an error occurs, 1 on success
|
||||
int cf_delete( char *filename, int dir_type )
|
||||
{
|
||||
char longname[MAX_PATH_LEN];
|
||||
|
||||
@@ -637,9 +667,21 @@ void cf_delete( char *filename, int dir_type )
|
||||
if (fp) {
|
||||
// delete the file
|
||||
fclose(fp);
|
||||
_unlink(longname);
|
||||
if(_unlink(longname) == -1)
|
||||
{
|
||||
//ERROR - file is probably read only
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ERROR - file doesn't exist
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -667,8 +709,9 @@ int cf_exist( char *filename, int dir_type )
|
||||
|
||||
FILE *fp = fopen(longname, "rb");
|
||||
if (fp) {
|
||||
return 1;
|
||||
// Goober5000 - these were switched, causing the fclose to be unreachable
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -776,18 +819,12 @@ extern int game_cd_changed();
|
||||
|
||||
CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize)
|
||||
{
|
||||
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
|
||||
if( strlen(file_path) > 31 )
|
||||
Error(LOCATION, "file name %s too long, \nmust be less than 31 charicters", file_path);*/
|
||||
|
||||
char longname[_MAX_PATH];
|
||||
|
||||
// nprintf(("CFILE", "CFILE -- trying to open %s\n", file_path ));
|
||||
// #if !defined(MULTIPLAYER_BETA_BUILD) && !defined(FS2_DEMO)
|
||||
|
||||
// we no longer need to do this, and on machines with crappy-ass drivers it can slow things down horribly.
|
||||
#if 0
|
||||
if ( game_cd_changed() ) {
|
||||
cfile_refresh();
|
||||
}
|
||||
#endif
|
||||
|
||||
//================================================
|
||||
// Check that all the parameters make sense
|
||||
Assert(file_path && strlen(file_path));
|
||||
@@ -992,7 +1029,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
CFILE *cfp;
|
||||
Cfile_block *cfbp;
|
||||
cfbp = &Cfile_block_list[cfile_block_index];
|
||||
cfp = &Cfile_list[cfile_block_index];;
|
||||
cfp = &Cfile_list[cfile_block_index];
|
||||
cfp->id = cfile_block_index;
|
||||
cfp->version = 0;
|
||||
cfbp->data = NULL;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-11-10 16:29:53 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2003-08-20 08:12:08 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/11/02 23:06:59 DTP
|
||||
* DOh,uhmm, define error again, this is getting to me.
|
||||
*
|
||||
@@ -479,8 +482,8 @@ int cflush(CFILE *cfile);
|
||||
// open a file. Once set, you can use minimum version numbers with the read functions.
|
||||
void cf_set_version( CFILE * cfile, int version );
|
||||
|
||||
// Deletes a file.
|
||||
void cf_delete( char *filename, int dir_type );
|
||||
// Deletes a file. Returns 0 on error, 1 if successful
|
||||
int cf_delete( char *filename, int dir_type );
|
||||
|
||||
// Same as _access function to read a file's access bits
|
||||
int cf_access( char *filename, int dir_type, int mode );
|
||||
|
||||
@@ -9,14 +9,21 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-03-05 09:01:54 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Low-level code for reading data out of large archive files or normal files. All
|
||||
* reads/seeks come through here.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/03/19 09:05:25 Goober5000
|
||||
* more housecleaning, this time for debug warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:17:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -93,7 +100,6 @@
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
|
||||
@@ -119,7 +125,8 @@ void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
}
|
||||
@@ -151,8 +158,9 @@ int cfeof(CFILE *cfile)
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
if (cb->raw_position >= cb->size ) {
|
||||
@@ -182,8 +190,9 @@ int cftell( CFILE * cfile )
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
return cb->raw_position;
|
||||
@@ -231,7 +240,8 @@ int cfseek( CFILE *cfile, int offset, int where )
|
||||
cb->raw_position = goal_position - cb->lib_offset;
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
@@ -277,7 +287,8 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-11-10 16:28:08 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2004-05-03 21:22:19 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
@@ -20,6 +20,47 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2004/05/01 21:47:43 Kazan
|
||||
* bah! stupid me "NULL" not "null" - i hate when i do that
|
||||
*
|
||||
* Revision 2.15 2004/05/01 21:45:31 Kazan
|
||||
* changed delete[] to free(), checked for null, if null ERROR
|
||||
*
|
||||
* Revision 2.14 2004/05/01 19:49:31 Kazan
|
||||
* delete[] str_temp
|
||||
* A null check on str_temp is not needed - take a close look at the for loop
|
||||
*
|
||||
* Revision 2.13 2004/05/01 19:33:20 taylor
|
||||
* add CF_TYPE_MISSIONS to physical check to avoid network transfer problems
|
||||
*
|
||||
* Revision 2.12 2004/05/01 17:10:37 Kazan
|
||||
* Multiple -mod - "-mod ModA,ModB,ModC" in order of priority
|
||||
* Giving you:
|
||||
* Root: ModA
|
||||
* Root: ModB
|
||||
* Root: ModC
|
||||
* Root: Fs2Default
|
||||
* Root: CDRom
|
||||
*
|
||||
* Revision 2.11 2004/04/26 00:26:37 taylor
|
||||
* use absolute moddir path, faster cfilesystem searching
|
||||
*
|
||||
* Revision 2.10 2004/04/03 18:11:19 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.9 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2003/09/14 18:32:41 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.7 2003/08/20 08:14:50 wmcoolmon
|
||||
* Modified find_file_location to speed up file loading.
|
||||
*
|
||||
* Revision 2.6 2002/11/10 16:28:08 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/10/30 06:29:45 DTP
|
||||
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
|
||||
*
|
||||
@@ -133,7 +174,6 @@
|
||||
#endif
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "localization/localize.h"
|
||||
@@ -447,14 +487,38 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
Num_roots = 0;
|
||||
|
||||
cf_root *root;
|
||||
char str_temp[128], *cur_pos;
|
||||
|
||||
if(Cmdline_mod) {
|
||||
strcat(Cmdline_mod, DIR_SEPARATOR_STR);
|
||||
cf_root *modroot;
|
||||
modroot = cf_create_root();
|
||||
strcpy(modroot->path,Cmdline_mod);
|
||||
modroot->roottype = CF_ROOTTYPE_PATH;
|
||||
cf_build_pack_list(modroot);
|
||||
// stackable Mod support -- Kazan
|
||||
//This for statement is a work of art :D
|
||||
for (cur_pos=Cmdline_mod; strlen(cur_pos) != 0; cur_pos+= (strlen(cur_pos)+1))
|
||||
{
|
||||
|
||||
//strdup was not behaving reliably
|
||||
//str_temp = strdup(cur_pos);
|
||||
|
||||
memset(str_temp, 0, 128);
|
||||
strcpy(str_temp, cur_pos);
|
||||
|
||||
|
||||
|
||||
strcat(str_temp, DIR_SEPARATOR_STR);
|
||||
root = cf_create_root();
|
||||
|
||||
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
|
||||
Error(LOCATION, "Can't get current working directory -- %d", errno );
|
||||
}
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if(strlen(root->path) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR)){
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
strcat(root->path, str_temp);
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
cf_build_pack_list(root);
|
||||
}
|
||||
}
|
||||
|
||||
root = cf_create_root();
|
||||
@@ -619,8 +683,7 @@ void cf_search_root_pack(int root_index)
|
||||
|
||||
//mprintf(( "Searching root pack '%s'\n", root->path ));
|
||||
|
||||
// Open data
|
||||
|
||||
// Open data
|
||||
FILE *fp = fopen( root->path, "rb" );
|
||||
// Read the file header
|
||||
if (!fp) {
|
||||
@@ -700,7 +763,7 @@ void cf_build_file_list()
|
||||
Num_files = 0;
|
||||
|
||||
// For each root, find all files...
|
||||
for (i=1; i<Num_roots; i++ ) {
|
||||
for (i=0; i<Num_roots; i++ ) {
|
||||
cf_root *root = cf_get_root(i);
|
||||
if ( root->roottype == CF_ROOTTYPE_PATH ) {
|
||||
cf_search_root_path(i);
|
||||
@@ -785,6 +848,7 @@ void cf_free_secondary_filelist()
|
||||
int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, int *size, int *offset, bool localize )
|
||||
{
|
||||
int i;
|
||||
int cfs_slow_search = 0;
|
||||
|
||||
Assert(filespec && strlen(filespec));
|
||||
|
||||
@@ -832,67 +896,105 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
}
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
long findhandle;
|
||||
_finddata_t findstruct;
|
||||
#endif
|
||||
|
||||
for (i=0; i<num_search_dirs; i++ ) {
|
||||
char longname[MAX_PATH_LEN];
|
||||
|
||||
cf_create_default_path_string( longname, search_order[i], filespec, localize );
|
||||
|
||||
FILE *fp = fopen(longname, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) {
|
||||
#if defined _WIN32
|
||||
*size = filelength(fileno(fp));
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
*size = statbuf.st_size;
|
||||
#endif
|
||||
}
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, longname );
|
||||
}
|
||||
fclose(fp);
|
||||
return 1;
|
||||
switch (search_order[i]) {
|
||||
case CF_TYPE_ROOT:
|
||||
case CF_TYPE_DATA:
|
||||
case CF_TYPE_SINGLE_PLAYERS:
|
||||
case CF_TYPE_MULTI_PLAYERS:
|
||||
case CF_TYPE_MULTI_CACHE:
|
||||
case CF_TYPE_MISSIONS:
|
||||
cfs_slow_search = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
cfs_slow_search = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cfs_slow_search) {
|
||||
cf_create_default_path_string( longname, search_order[i], filespec, localize );
|
||||
|
||||
#if defined _WIN32
|
||||
if(!Cmdline_safeloading)
|
||||
{
|
||||
findhandle = _findfirst(longname, &findstruct);
|
||||
if (findhandle != -1) {
|
||||
if ( size ) {
|
||||
*size = findstruct.size;
|
||||
}
|
||||
|
||||
_findclose(findhandle);
|
||||
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, longname );
|
||||
};
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FILE *fp = fopen(longname, "rb" );
|
||||
if(fp) {
|
||||
if( size ) {
|
||||
*size = filelength( fileno(fp) );
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(offset) *offset = 0;
|
||||
if( pack_filename ) {
|
||||
strcpy(pack_filename, longname);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#elif defined unix
|
||||
FILE *fp = fopen(longname, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) {
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
*size = statbuf.st_size;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, longname );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Search the pak files and CD-ROM.
|
||||
|
||||
for (i=0; i<Num_files; i++ ) {
|
||||
cf_file * f = cf_get_file(i);
|
||||
for (i=0; i<Num_files; i++ ) {
|
||||
cf_file * f = cf_get_file(i);
|
||||
|
||||
// only search paths we're supposed to...
|
||||
if ( (pathtype != CF_TYPE_ANY) && (pathtype != f->pathtype_index) ) {
|
||||
continue;
|
||||
}
|
||||
// only search paths we're supposed to...
|
||||
if ( (pathtype != CF_TYPE_ANY) && (pathtype != f->pathtype_index) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (localize) {
|
||||
// create localized filespec
|
||||
char temp[MAX_PATH_LEN];
|
||||
strcpy(temp, filespec);
|
||||
lcl_add_dir_to_path_with_filename(filespec);
|
||||
if (localize) {
|
||||
// create localized filespec
|
||||
char temp[MAX_PATH_LEN];
|
||||
strcpy(temp, filespec);
|
||||
lcl_add_dir_to_path_with_filename(filespec);
|
||||
|
||||
if ( !stricmp(filespec, f->name_ext) ) {
|
||||
if ( size ) *size = f->size;
|
||||
if ( offset ) *offset = f->pack_offset;
|
||||
if ( pack_filename ) {
|
||||
cf_root * r = cf_get_root(f->root_index);
|
||||
|
||||
strcpy( pack_filename, r->path );
|
||||
if ( f->pack_offset < 1 ) {
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
// restore original filespec
|
||||
strcpy(filespec, temp);
|
||||
}
|
||||
|
||||
// file either not localized or localized version not found
|
||||
if ( !stricmp(filespec, f->name_ext) ) {
|
||||
if ( size ) *size = f->size;
|
||||
if ( offset ) *offset = f->pack_offset;
|
||||
@@ -901,21 +1003,41 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
|
||||
strcpy( pack_filename, r->path );
|
||||
if ( f->pack_offset < 1 ) {
|
||||
|
||||
if(strlen(Pathtypes[f->pathtype_index].path)){
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
// restore original filespec
|
||||
strcpy(filespec, temp);
|
||||
}
|
||||
|
||||
// file either not localized or localized version not found
|
||||
if ( !stricmp(filespec, f->name_ext) ) {
|
||||
if ( size ) *size = f->size;
|
||||
if ( offset ) *offset = f->pack_offset;
|
||||
if ( pack_filename ) {
|
||||
cf_root * r = cf_get_root(f->root_index);
|
||||
|
||||
strcpy( pack_filename, r->path );
|
||||
if ( f->pack_offset < 1 ) {
|
||||
|
||||
if(strlen(Pathtypes[f->pathtype_index].path)){
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-03-05 09:01:54 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
@@ -20,6 +20,9 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -46,6 +49,8 @@
|
||||
#ifndef _CFILESYSTEM_H
|
||||
#define _CFILESYSTEM_H
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// Builds a list of all the files
|
||||
void cf_build_secondary_filelist( char *cdrom_path );
|
||||
void cf_free_secondary_filelist();
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-11-16 09:42:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Program to create an archive file for use with cfile stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -245,7 +248,7 @@ int main(int argc, char *argv[] )
|
||||
|
||||
fp_out = fopen( archive_dat, "wb" );
|
||||
if ( !fp_out ) {
|
||||
printf( "Couldn't open '%s'!\n", archive_dat );
|
||||
printf( "out1: Couldn't open '%s'!\n", archive_dat );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
@@ -253,7 +256,7 @@ int main(int argc, char *argv[] )
|
||||
|
||||
fp_out_hdr = fopen( archive_hdr, "wb" );
|
||||
if ( !fp_out_hdr ) {
|
||||
printf( "Couldn't open '%s'!\n", archive_hdr );
|
||||
printf( "out2: Couldn't open '%s'!\n", archive_hdr );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -10,11 +10,198 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2003-02-22 04:13:17 $
|
||||
* $Author: wmcoolmon $
|
||||
|
||||
* $Revision: 2.54 $
|
||||
* $Date: 2004-04-26 18:23:47 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.53 2004/04/26 00:23:26 taylor
|
||||
* novbo and snd_preload cmdline options, fix moddir getting appended space
|
||||
*
|
||||
* Revision 2.52 2004/04/18 19:39:12 randomtiger
|
||||
* Added -2d_poof command which allows access to 2D poof rendering
|
||||
* Added -radar_reduce to launcher flag description structure
|
||||
*
|
||||
* Revision 2.51 2004/04/03 18:11:20 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.50 2004/03/20 14:47:12 randomtiger
|
||||
* Added base for a general dynamic batching solution.
|
||||
* Fixed NO_DSHOW_CODE code path bug.
|
||||
*
|
||||
* Revision 2.49 2004/03/19 14:51:54 randomtiger
|
||||
* New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system.
|
||||
*
|
||||
* Revision 2.48 2004/03/19 11:44:04 randomtiger
|
||||
* Removed -d3d_notmanaged param.
|
||||
* Tided D3D texture code. Merged remaining section code into the rest of the system.
|
||||
* Prepared for removal of code causing waste of memory for secondry store of textures.
|
||||
*
|
||||
* Revision 2.47 2004/02/27 04:09:55 bobboau
|
||||
* fixed a Z buffer error in HTL submodel rendering,
|
||||
* and glow points,
|
||||
* and other stuff
|
||||
*
|
||||
* Revision 2.46 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.45 2004/01/29 01:34:00 randomtiger
|
||||
* Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
|
||||
* Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
|
||||
*
|
||||
* Revision 2.44 2004/01/24 14:31:27 randomtiger
|
||||
* Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
|
||||
* Its optional and off by default, use -d3d_particle to activiate.
|
||||
* Also bumped up D3D ambient light setting, it was way too dark.
|
||||
* Its now set to something similar to the original game.
|
||||
*
|
||||
* Revision 2.43 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.42 2003/12/04 20:39:09 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.41 2003/12/03 19:27:00 randomtiger
|
||||
* Changed -t32 flag to -jpgtga
|
||||
* Added -query_flag to identify builds with speech not compiled and other problems
|
||||
* Now loads up launcher if videocard reg entry not found
|
||||
* Now offers to go online to download launcher if its not present
|
||||
* Changed target view not to use lower res texture, hi res one is already chached so might as well use it
|
||||
*
|
||||
* Revision 2.40 2003/11/29 10:52:09 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.39 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.38 2003/11/15 18:09:33 randomtiger
|
||||
* Put TGA and JPG stuff on -t32 flag
|
||||
* Put 32 bit PCX stuff on -pcx32 (still has bugs)
|
||||
* Added multisample checking on device initialisation
|
||||
* Changed unrecognised parameter message (as requested) to be more user friendly
|
||||
* Speech now chooses voice based on reg value set by launcher v3.1
|
||||
*
|
||||
* Revision 2.37 2003/11/09 06:31:38 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 2.36 2003/11/09 04:09:18 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
* Revision 2.34 2003/11/03 18:07:26 randomtiger
|
||||
* Added -d3d_no_vsync command to make turning off vsync optional.
|
||||
* Removed 32bit command, it doesnt do anything.
|
||||
* Made aa multisample reg check safe.
|
||||
*
|
||||
* Revision 2.33 2003/10/27 23:04:20 randomtiger
|
||||
* Added -no_set_gamma flags
|
||||
* Fixed up some more non standard res stuff
|
||||
* Improved selection of device type, this includes using a pure device when allowed which means dev should not use Get* functions in D3D
|
||||
* Made fade in credits work
|
||||
* Stopped a call to gr_reser_lighting() in non htl mode when the pointer was NULL, was causing a crash loading a fogged level
|
||||
* Deleted directx8 directory content, has never been needed.
|
||||
*
|
||||
* Revision 2.32 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.31 2003/10/17 17:18:42 randomtiger
|
||||
* Big restructure for D3D and new modules grd3dlight and grd3dsetup
|
||||
*
|
||||
* Revision 2.30 2003/10/12 03:41:37 Kazan
|
||||
* #Kazan# FS2NetD client code gone multithreaded, some Fred2 Open -mod stuff [obvious code.lib] including a change in cmdline.cpp, changed Stick's "-nohtl" to "-htl" - HTL is _OFF_ by default here (Bobboau and I decided this was a better idea for now)
|
||||
*
|
||||
* Revision 2.29 2003/09/25 21:12:22 Kazan
|
||||
* ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
|
||||
* Also D3D8 Screenshots work now.
|
||||
*
|
||||
* Revision 2.28 2003/09/23 02:42:52 Kazan
|
||||
* ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able]
|
||||
*
|
||||
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
|
||||
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
|
||||
*
|
||||
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.25 2003/09/13 06:02:05 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2003/08/22 07:35:08 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.22 2003/08/21 20:54:37 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.21 2003/08/12 03:18:33 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.20 2003/08/09 06:07:23 bobboau
|
||||
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
|
||||
*
|
||||
* Revision 2.19 2003/03/29 09:42:05 Goober5000
|
||||
* made beams default shield piercing again
|
||||
* also added a beam no pierce command line flag
|
||||
* and fixed something else which I forgot :P
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
|
||||
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
|
||||
*
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
@@ -47,6 +234,32 @@
|
||||
* Revision 2.5 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
|
||||
*
|
||||
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
|
||||
* When on is now less blury. - RT
|
||||
*
|
||||
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
|
||||
*
|
||||
* Added new command line parameter -d3dlauncher which brings up the launcher.
|
||||
* This is needed since FS2 DX8 now stores the last successful details in the registry and
|
||||
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
|
||||
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
|
||||
*
|
||||
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.4 2002/08/18 19:48:28 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.3 2002/08/07 00:44:13 DTP
|
||||
* Implented -GF4FIX commandline switch
|
||||
*
|
||||
@@ -205,6 +418,7 @@ int parse_cmdline(char *cmdline);
|
||||
int parse_cmdline(int argc, char *argv[]);
|
||||
#endif
|
||||
|
||||
int fred2_parse_cmdline(int argc, char *argv[]);
|
||||
// COMMAND LINE SETTINGS
|
||||
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
|
||||
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
|
||||
@@ -231,19 +445,64 @@ extern int Cmdline_multi_log;
|
||||
extern int Cmdline_server_firing;
|
||||
extern int Cmdline_client_dodamage;
|
||||
extern int Cmdline_spew_pof_info;
|
||||
extern int Cmdline_force_32bit;
|
||||
extern int Cmdline_mouse_coords;
|
||||
extern int Cmdline_timeout;
|
||||
extern int Cmdline_SpewMission_CRCs;
|
||||
extern int Cmdline_SpewTable_CRCs;
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern char *Cmdline_almission; //DTP for autoload mission
|
||||
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
|
||||
extern int Cmdline_allslev;
|
||||
extern int Cmdline_phreak;
|
||||
extern int Cmdline_dshowvid; //WMC Toggles movie playing support
|
||||
extern int Cmdline_dnoshowvid; //WMC Toggles movie playing support
|
||||
extern char *Cmdline_mod; //DTP for mod support
|
||||
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
|
||||
extern int Cmdline_show_stats;
|
||||
extern int Cmdline_safeloading;
|
||||
extern int Cmdline_nospec;
|
||||
|
||||
extern int Cmdline_cache_ani;
|
||||
extern int Cmdline_d3dmipmap;
|
||||
|
||||
extern int Cmdline_beams_no_pierce_shields; // Goober5000
|
||||
extern float Cmdline_fov;
|
||||
|
||||
extern float static_light_factor;
|
||||
extern float static_tube_factor;
|
||||
extern float static_point_factor;
|
||||
extern double specular_exponent_value;
|
||||
|
||||
extern int Cmdline_cell;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_dxt;
|
||||
extern int Cmdline_jpgtga;
|
||||
extern int Cmdline_no_set_gamma;
|
||||
extern int Cmdline_d3d_no_vsync;
|
||||
extern int Cmdline_pcx32;
|
||||
|
||||
extern int Cmdline_noglow;
|
||||
extern int Cmdline_timerbar;
|
||||
extern int Cmdline_query_speech;
|
||||
extern int Cmdline_ship_choice_3d;
|
||||
extern int Cmdline_d3d_particle;
|
||||
|
||||
extern int Cmdline_ambient_factor;
|
||||
extern int Cmdline_show_mem_usage;
|
||||
extern int Cmdline_rt;
|
||||
extern char *Cmdline_start_mission;
|
||||
|
||||
extern int Cmdline_d3d_lesstmem;
|
||||
extern int Cmdline_batch_3dunlit;
|
||||
|
||||
extern int Cmdline_2d_poof;
|
||||
|
||||
extern int Cmdline_FRED2_htl;
|
||||
extern int CmdLine_FRED2_NoWarn;
|
||||
|
||||
extern int Cmdline_novbo;
|
||||
extern int Cmdline_snd_preload;
|
||||
extern int Cmdline_NoFPSCap;
|
||||
|
||||
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
|
||||
#endif
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:57 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -208,26 +220,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "model/model.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "ship/ship.h"
|
||||
#include "io/timer.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "sound/sound.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "object/object.h"
|
||||
|
||||
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
|
||||
cmeasure Cmeasures[MAX_CMEASURES];
|
||||
@@ -243,27 +242,9 @@ void cmeasure_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( !Cmeasure_inited ) {
|
||||
if ( !Cmeasure_inited )
|
||||
Cmeasure_inited = 1;
|
||||
|
||||
/* // Do all the processing that happens only once
|
||||
if ( Debris_model < 0 ) {
|
||||
if (Debris_model>-1) {
|
||||
polymodel * pm;
|
||||
pm = model_get(Debris_model);
|
||||
Debris_num_submodels = pm->n_models;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
|
||||
Debris_textures[i] = bm_load( Debris_texture_files[i] );
|
||||
if ( Debris_textures[i] < 0 ) {
|
||||
Warning( LOCATION, "Couldn't load species %d debris\ntexture, '%s'\n", i, Debris_texture_files[i] );
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Reset everything between levels
|
||||
Num_cmeasures = 0;
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:57 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -115,8 +118,10 @@
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
#include "parse/parselo.h"
|
||||
#include "object/object.h"
|
||||
#include "globalincs/globals.h"
|
||||
|
||||
struct object;
|
||||
struct vector;
|
||||
|
||||
#define MAX_CMEASURES 64
|
||||
|
||||
|
||||
+264
-228
@@ -41,7 +41,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "..\Release\Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /D "MORE_SPECIES" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "..\Debug\Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_OPENGL" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W3 /Gm /Gi /GX /ZI /Od /I "." /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "MORE_SPECIES" /D "_REPORT_MEM_LEAKS" /U "NDEBUG" /FR /YX /FD /GZ /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -156,18 +156,6 @@ SOURCE=.\CFile\CfileSystem.cpp
|
||||
SOURCE=.\CFile\CfileSystem.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Cmdline"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Cmdline\cmdline.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Cmdline\cmdline.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "CMeasure"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
@@ -269,22 +257,10 @@ SOURCE=.\DirectX\vasync.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vD3d.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vD3dcaps.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vd3di.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vd3drm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vd3drmdef.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -297,18 +273,10 @@ SOURCE=.\DirectX\vd3drmwin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vD3dtypes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vd3dvec.inl
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDdraw.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDinput.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -341,16 +309,12 @@ SOURCE=.\DirectX\vDsound.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\ddraw.lib
|
||||
SOURCE=.\directx\strmiids.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dxguid.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\strmiids.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Fireball"
|
||||
|
||||
@@ -420,46 +384,6 @@ SOURCE=.\Gamesnd\GameSnd.cpp
|
||||
SOURCE=.\Gamesnd\GameSnd.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Glide"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\3DFX.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\FXDLL.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\FXGLOB.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\FXOS.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\Glide.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\glide.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\glidesys.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\glideutl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Glide\SST1VID.H
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "GlobalIncs"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
@@ -481,6 +405,10 @@ SOURCE=.\GlobalIncs\crypt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\globalincs\globals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GlobalIncs\LinkList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -511,42 +439,9 @@ SOURCE=.\GlobalIncs\WinDebug.cpp
|
||||
# Begin Group "Graphics"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
# Begin Group "SoftwareGr"
|
||||
|
||||
SOURCE=.\Graphics\2d.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\2d.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\aaline.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Bitblt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Bitblt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Circle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Circle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Colors.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Colors.h
|
||||
# End Source File
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Font.cpp
|
||||
@@ -557,78 +452,6 @@ SOURCE=.\Graphics\Font.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Gradient.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Gradient.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3D.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3D.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3DInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3DRender.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3DTexture.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrDirectDraw.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrDirectDraw.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrGlide.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrGlide.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrGlideInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrGlideTexture.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrSoft.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrSoft.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrZbuffer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -637,84 +460,157 @@ SOURCE=.\Graphics\GrZbuffer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Line.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Line.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "D3D8Gr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "Headers"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Pixel.cpp
|
||||
SOURCE=.\Graphics\GrD3D.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Pixel.h
|
||||
SOURCE=.\graphics\grd3dbatch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Rect.cpp
|
||||
SOURCE=.\graphics\GrD3DBmpman.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Rect.h
|
||||
SOURCE=.\Graphics\GrD3DInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Scaler.cpp
|
||||
SOURCE=.\graphics\grd3dlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Scaler.h
|
||||
SOURCE=.\graphics\GrD3DParticle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Shade.cpp
|
||||
SOURCE=.\graphics\grd3dsetup.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3D.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Shade.h
|
||||
SOURCE=.\graphics\grd3dbatch.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapGenericScans.cpp
|
||||
SOURCE=.\graphics\GrD3DBmpman.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Tmapper.cpp
|
||||
SOURCE=.\graphics\GrD3DCalls.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\grd3dlight.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrD3DParticle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3DRender.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrD3Dsetup.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrD3DTexture.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "OpenGLGr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "OpenGL Headers"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenglExtension.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenGLlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenglTexture.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenGLTNL.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "OpenGL CPPs"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenglExtension.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenGLlight.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenglTexture.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrOpenGLTNL.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\2d.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\2d.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\grbatch.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\grbatch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TMAPPER.H
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanline.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanline.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanTiled128x128.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanTiled16x16.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanTiled256x256.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanTiled32x32.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapScanTiled64x64.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Hud"
|
||||
|
||||
@@ -789,6 +685,14 @@ SOURCE=.\Hud\HUDmessage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hud\HUDNavigation.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hud\HUDNavigation.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Hud\HUDObserver.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1895,6 +1799,14 @@ SOURCE=.\Sound\dscap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sound\fsspeech.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sound\fsspeech.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Sound\midifile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1931,6 +1843,14 @@ SOURCE=.\Sound\Sound.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sound\speech.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sound\speech.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Sound\WinMIDI.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2272,6 +2192,14 @@ SOURCE=.\ExceptionHandler\ExceptionHandler.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\network\fs2ox.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\network\fs2ox.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Network\Multi.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2535,5 +2463,113 @@ SOURCE=.\ddsutils\ddsutils.cpp
|
||||
SOURCE=.\ddsutils\ddsutils.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Cmdline"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Cmdline\cmdline.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Cmdline\cmdline.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "fs2open_pxo"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\Client.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\Client.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\protocol.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\TCP_Client.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\TCP_Socket.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\TCP_Socket.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\udpsocket.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fs2open_pxo\udpsocket.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Species_Defs"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\species_defs\species_defs.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\species_defs\species_defs.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "irc"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\irc\irc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\irc\irc.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "openil"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\openil\il_func.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\openil\il_func.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "jpgutils"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\jpgutils\jpgutils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\jpgutils\jpgutils.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Autopilot"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Autopilot\Autopilot.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Autopilot\Autopilot.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -9,13 +9,34 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/04/05 11:09:21 Goober5000
|
||||
* fixed some fiddly bits with scrolling and ui stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -108,7 +129,7 @@
|
||||
*
|
||||
* 51 5/19/98 12:56p Hoffoss
|
||||
* Added some code to help prevent triple-clicking for binding the mouse
|
||||
* button to an action (why the hell people triple click is beyond me,
|
||||
* button to an action (why people triple click is beyond me,
|
||||
* though).
|
||||
*
|
||||
* 50 5/19/98 11:11a Lawrance
|
||||
@@ -306,21 +327,14 @@
|
||||
#include "freespace2/freespace.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "playerman/player.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "hud/hudsquadmsg.h"
|
||||
#include "io/key.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "io/mouse.h"
|
||||
#include "ui/ui.h"
|
||||
#include "io/joy.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "sound/sound.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "graphics/font.h"
|
||||
#include "hud/hud.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "popup/popup.h"
|
||||
@@ -332,6 +346,10 @@
|
||||
#include "network/multiutil.h"
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "hud/hud.h"
|
||||
#endif
|
||||
|
||||
#define NUM_SYSTEM_KEYS 14
|
||||
#define NUM_BUTTONS 19
|
||||
#define NUM_TABS 4
|
||||
@@ -415,7 +433,7 @@ int Conflict_warning_coords[GR_NUM_RESOLUTIONS][2] = {
|
||||
int Conflict_stamp = -1;
|
||||
int Conflict_bright = 0;
|
||||
|
||||
#define LIST_BUTTONS_MAX 40
|
||||
#define LIST_BUTTONS_MAX 42
|
||||
#define JOY_AXIS 0x80000
|
||||
|
||||
static int Num_cc_lines;
|
||||
|
||||
@@ -9,18 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-12-02 23:52:02 $
|
||||
* $Author: Goober5000 $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-05-03 21:22:19 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.5 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2002/12/02 23:52:02 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.3 2002/12/02 20:47:28 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
@@ -322,28 +333,28 @@ typedef struct config_item {
|
||||
|
||||
#define TARGET_NEXT 0
|
||||
#define TARGET_PREV 1
|
||||
#define TARGET_NEXT_CLOSEST_HOSTILE 2
|
||||
#define TARGET_PREV_CLOSEST_HOSTILE 3
|
||||
#define TARGET_NEXT_CLOSEST_HOSTILE 2
|
||||
#define TARGET_PREV_CLOSEST_HOSTILE 3
|
||||
#define TOGGLE_AUTO_TARGETING 4
|
||||
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
|
||||
#define TARGET_PREV_CLOSEST_FRIENDLY 6
|
||||
#define TARGET_SHIP_IN_RETICLE 7
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
|
||||
#define TARGET_LAST_TRANMISSION_SENDER 9
|
||||
#define STOP_TARGETING_SHIP 10
|
||||
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
|
||||
#define TARGET_PREV_CLOSEST_FRIENDLY 6
|
||||
#define TARGET_SHIP_IN_RETICLE 7
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
|
||||
#define TARGET_LAST_TRANMISSION_SENDER 9
|
||||
#define STOP_TARGETING_SHIP 10
|
||||
|
||||
// targeting a ship's subsystem
|
||||
#define TARGET_SUBOBJECT_IN_RETICLE 11
|
||||
#define TARGET_SUBOBJECT_IN_RETICLE 11
|
||||
#define TARGET_NEXT_SUBOBJECT 12
|
||||
#define TARGET_PREV_SUBOBJECT 13
|
||||
#define STOP_TARGETING_SUBSYSTEM 14
|
||||
|
||||
// speed matching
|
||||
#define MATCH_TARGET_SPEED 15
|
||||
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
|
||||
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
|
||||
|
||||
// weapons
|
||||
#define FIRE_PRIMARY 17
|
||||
#define FIRE_PRIMARY 17
|
||||
#define FIRE_SECONDARY 18
|
||||
#define CYCLE_NEXT_PRIMARY 19
|
||||
#define CYCLE_PREV_PRIMARY 20
|
||||
@@ -354,19 +365,19 @@ typedef struct config_item {
|
||||
// controls
|
||||
#define FORWARD_THRUST 24
|
||||
#define REVERSE_THRUST 25
|
||||
#define BANK_LEFT 26
|
||||
#define BANK_LEFT 26
|
||||
#define BANK_RIGHT 27
|
||||
#define PITCH_FORWARD 28
|
||||
#define PITCH_BACK 29
|
||||
#define YAW_LEFT 30
|
||||
#define YAW_RIGHT 31
|
||||
#define YAW_LEFT 30
|
||||
#define YAW_RIGHT 31
|
||||
|
||||
// throttle control
|
||||
#define ZERO_THROTTLE 32
|
||||
#define MAX_THROTTLE 33
|
||||
#define MAX_THROTTLE 33
|
||||
#define ONE_THIRD_THROTTLE 34
|
||||
#define TWO_THIRDS_THROTTLE 35
|
||||
#define PLUS_5_PERCENT_THROTTLE 36
|
||||
#define TWO_THIRDS_THROTTLE 35
|
||||
#define PLUS_5_PERCENT_THROTTLE 36
|
||||
#define MINUS_5_PERCENT_THROTTLE 37
|
||||
|
||||
// squadmate messaging keys
|
||||
@@ -376,27 +387,27 @@ typedef struct config_item {
|
||||
#define ATTACK_SUBSYSTEM_MESSAGE 41
|
||||
#define CAPTURE_MESSAGE 42
|
||||
#define ENGAGE_MESSAGE 43
|
||||
#define FORM_MESSAGE 44
|
||||
#define FORM_MESSAGE 44
|
||||
#define IGNORE_MESSAGE 45
|
||||
#define PROTECT_MESSAGE 46
|
||||
#define COVER_MESSAGE 47
|
||||
#define WARP_MESSAGE 48
|
||||
#define WARP_MESSAGE 48
|
||||
#define REARM_MESSAGE 49
|
||||
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
|
||||
|
||||
// Views
|
||||
#define VIEW_CHASE 51
|
||||
#define VIEW_EXTERNAL 52
|
||||
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
|
||||
#define VIEW_SLEW 54
|
||||
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
|
||||
#define VIEW_SLEW 54
|
||||
#define VIEW_OTHER_SHIP 55
|
||||
#define VIEW_DIST_INCREASE 56
|
||||
#define VIEW_DIST_DECREASE 57
|
||||
#define VIEW_CENTER 58
|
||||
#define PADLOCK_UP 59
|
||||
#define PADLOCK_DOWN 60
|
||||
#define PADLOCK_LEFT 61
|
||||
#define PADLOCK_DOWN 60
|
||||
#define PADLOCK_LEFT 61
|
||||
#define PADLOCK_RIGHT 62
|
||||
|
||||
|
||||
@@ -413,60 +424,69 @@ typedef struct config_item {
|
||||
#define DECREASE_SHIELD 72
|
||||
#define INCREASE_ENGINE 73
|
||||
#define DECREASE_ENGINE 74
|
||||
#define ETS_EQUALIZE 75
|
||||
#define ETS_EQUALIZE 75
|
||||
#define SHIELD_EQUALIZE 76
|
||||
#define SHIELD_XFER_TOP 77
|
||||
#define SHIELD_XFER_BOTTOM 78
|
||||
#define SHIELD_XFER_LEFT 79
|
||||
#define SHIELD_XFER_RIGHT 80
|
||||
|
||||
#define XFER_SHIELD 81
|
||||
#define XFER_SHIELD 81
|
||||
#define XFER_LASER 82
|
||||
#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
|
||||
|
||||
#define BANK_WHEN_PRESSED 84
|
||||
#define SHOW_NAVMAP 85
|
||||
#define ADD_REMOVE_ESCORT 86
|
||||
#define ESCORT_CLEAR 87
|
||||
#define TARGET_NEXT_ESCORT_SHIP 88
|
||||
#define ESCORT_CLEAR 87
|
||||
#define TARGET_NEXT_ESCORT_SHIP 88
|
||||
|
||||
#define TARGET_CLOSEST_REPAIR_SHIP 89
|
||||
#define TARGET_NEXT_UNINSPECTED_CARGO 90
|
||||
#define TARGET_PREV_UNINSPECTED_CARGO 91
|
||||
#define TARGET_CLOSEST_REPAIR_SHIP 89
|
||||
#define TARGET_NEXT_UNINSPECTED_CARGO 90
|
||||
#define TARGET_PREV_UNINSPECTED_CARGO 91
|
||||
#define TARGET_NEWEST_SHIP 92
|
||||
#define TARGET_NEXT_LIVE_TURRET 93
|
||||
#define TARGET_PREV_LIVE_TURRET 94
|
||||
#define TARGET_NEXT_LIVE_TURRET 93
|
||||
#define TARGET_PREV_LIVE_TURRET 94
|
||||
|
||||
#define TARGET_NEXT_BOMB 95
|
||||
#define TARGET_PREV_BOMB 96
|
||||
|
||||
// multiplayer messaging keys
|
||||
#define MULTI_MESSAGE_ALL 97
|
||||
#define MULTI_MESSAGE_FRIENDLY 98
|
||||
#define MULTI_MESSAGE_FRIENDLY 98
|
||||
#define MULTI_MESSAGE_HOSTILE 99
|
||||
#define MULTI_MESSAGE_TARGET 100
|
||||
|
||||
// multiplayer misc keys
|
||||
#define MULTI_OBSERVER_ZOOM_TO 101
|
||||
#define MULTI_OBSERVER_ZOOM_TO 101
|
||||
|
||||
#define TIME_SPEED_UP 102
|
||||
#define TIME_SLOW_DOWN 103
|
||||
|
||||
#define TOGGLE_HUD_CONTRAST 104
|
||||
#define TOGGLE_HUD_CONTRAST 104
|
||||
|
||||
#define MULTI_TOGGLE_NETINFO 105
|
||||
|
||||
#define MULTI_SELF_DESTRUCT 106
|
||||
#define MULTI_SELF_DESTRUCT 106
|
||||
|
||||
#define TOGGLE_HUD 107
|
||||
#define RIGHT_SLIDE_THRUST 108
|
||||
#define LEFT_SLIDE_THRUST 109
|
||||
#define TOGGLE_HUD 107
|
||||
#define RIGHT_SLIDE_THRUST 108
|
||||
#define LEFT_SLIDE_THRUST 109
|
||||
#define UP_SLIDE_THRUST 110
|
||||
#define DOWN_SLIDE_THRUST 111
|
||||
#define DOWN_SLIDE_THRUST 111
|
||||
#define HUD_TARGETBOX_TOGGLE_WIREFRAME 112
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
//AutoPilot - Kazan
|
||||
#define AUTO_PILOT_TOGGLE 113
|
||||
#define NAV_CYCLE 114
|
||||
|
||||
// this should be the total number of control action defines above (or last define + 1)
|
||||
#define CCFG_MAX 112
|
||||
#define CCFG_MAX 115
|
||||
#else
|
||||
#define CCFG_MAX 113
|
||||
|
||||
#endif
|
||||
|
||||
extern int Failed_key_index;
|
||||
extern int Invert_heading;
|
||||
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-10-19 19:29:27 $
|
||||
* $Author: bobboau $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-05-03 21:22:19 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
@@ -37,7 +48,7 @@
|
||||
* minor key name change in german
|
||||
*
|
||||
* 12 10/29/99 6:10p Jefff
|
||||
* squashed the damned y/z german issues once and for all
|
||||
* squashed the y/z german issues once and for all
|
||||
*
|
||||
* 11 10/28/99 11:16p Jefff
|
||||
* Changed some german key names. Made key translations always use the
|
||||
@@ -549,6 +560,13 @@ config_item Control_config[CCFG_MAX + 1] = {
|
||||
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, "Left Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, "Up Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, "Down Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, "Toggle HUD Wireframe Targetbox"},
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
// Auto Navigation Systen
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, "Toggle Auto Pilot"},
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, "Cycle Nav Points"},
|
||||
#endif
|
||||
|
||||
{ -1, -1, -1, "" }
|
||||
};
|
||||
|
||||
@@ -9,13 +9,66 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-08-27 13:38:57 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-04-26 13:11:11 $
|
||||
* $Author: taylor $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-04-26 13:11:11 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.10 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/20 04:29:53 bobboau
|
||||
* pluged memory leaks,
|
||||
* 3D HTL lasers (they work perfictly)
|
||||
* and posably fixed Turnsky's shinemap bug
|
||||
*
|
||||
* Revision 2.8 2004/01/24 15:52:25 randomtiger
|
||||
* I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
|
||||
* In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
|
||||
*
|
||||
* Revision 2.7 2003/08/21 20:54:38 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.6 2003/07/15 02:58:08 phreak
|
||||
* the cutscene section in the techroom does not append *.mve onto a filename
|
||||
*
|
||||
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.4 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
|
||||
* Tiny change to DX branch to keep movie code optional (default off)
|
||||
*
|
||||
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
|
||||
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
|
||||
* The movie and dx8show files have been cleaned up big time.
|
||||
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
|
||||
* Aside from that a few changes to help the movie code work properly.
|
||||
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
|
||||
* Im going to leave this as a bug for now, serves you right for buying voodoo!
|
||||
*
|
||||
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.3 2002/08/18 19:48:29 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -155,17 +208,16 @@
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
// #include "movie.h"
|
||||
#include "movie.h"
|
||||
#include "popup/popup.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage",
|
||||
@@ -182,10 +234,15 @@ int Description_index;
|
||||
cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
|
||||
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
void cutsceen_close(){
|
||||
for(int i = 0; i<MAX_CUTSCENES; i++)
|
||||
if(Cutscenes[i].description)free(Cutscenes[i].description);
|
||||
}
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
void cutscene_init()
|
||||
{
|
||||
atexit(cutsceen_close);
|
||||
char buf[MULTITEXT_LENGTH];
|
||||
int rval;
|
||||
|
||||
@@ -255,9 +312,28 @@ int cutscenes_get_cd_num( char *filename )
|
||||
void cutscene_mark_viewable(char *filename)
|
||||
{
|
||||
int i;
|
||||
char cut_file[MAX_FILENAME_LEN];
|
||||
char file[MAX_FILENAME_LEN];
|
||||
|
||||
Assert(filename);
|
||||
|
||||
// strip off extension
|
||||
strcpy( file, filename );
|
||||
char *p = strchr( file, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
// change to lower case
|
||||
strlwr(file);
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
if ( !stricmp(Cutscenes[i].filename, filename) ) {
|
||||
// change the cutscene file name to lower case
|
||||
strcpy(cut_file, Cutscenes[i].filename);
|
||||
strlwr(cut_file);
|
||||
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
if ( strstr(cut_file, file) != NULL ) {
|
||||
Cutscenes_viewable |= (1<<i);
|
||||
return;
|
||||
}
|
||||
@@ -425,7 +501,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
if ( num_attempts++ > 5 ) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
cd_present = 0;
|
||||
break;
|
||||
@@ -436,30 +512,31 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
return cd_present;
|
||||
#else // !WIN32
|
||||
return 0;
|
||||
#endif // ifdef WIN32
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
void cutscenes_screen_play()
|
||||
{
|
||||
char name[MAX_FILENAME_LEN], *full_name;
|
||||
char name[MAX_FILENAME_LEN]; // *full_name
|
||||
int which_cutscene;
|
||||
|
||||
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
|
||||
which_cutscene = Cutscene_list[Selected_line];
|
||||
|
||||
strcpy(name, Cutscenes[which_cutscene].filename );
|
||||
full_name = cf_add_ext(name, NOX(".mve"));
|
||||
// full_name = cf_add_ext(name, NOX(".mve"));
|
||||
|
||||
main_hall_stop_music();
|
||||
int rval = movie_play(name);
|
||||
main_hall_start_music();
|
||||
|
||||
// no soup for you!
|
||||
/*
|
||||
int rval = movie_play(full_name);
|
||||
if ( !rval ) {
|
||||
char str[256];
|
||||
|
||||
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
|
||||
popup(0, 1, POPUP_OK, str );
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_line_up()
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -53,7 +56,8 @@
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define MAX_CUTSCENES 10
|
||||
|
||||
|
||||
+208
-143
@@ -1,175 +1,240 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
|
||||
* $Revision: 2.20 $
|
||||
* $Date: 2004-04-26 13:09:20 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* movie player code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "movie.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/gropengl.h"
|
||||
|
||||
bool movie_shutdown_fgx = false;
|
||||
|
||||
void movie_set_shutdown_fgx(bool state)
|
||||
{
|
||||
movie_shutdown_fgx = state;
|
||||
}
|
||||
|
||||
bool movie_play(char *name, int unknown_value)
|
||||
{
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
|
||||
#include "freespace2/freespace.h" // for Game_mode, etc.
|
||||
|
||||
// This module links freespace movie calls to the actual API calls the play the movie.
|
||||
// This module handles all the different requires of OS and gfx API and finding the file to play
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup(0);
|
||||
void process_messages()
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
#include "graphics/grd3dinternal.h"
|
||||
|
||||
// filename - file to search for
|
||||
// out_name - output, full path to file
|
||||
// returns non-zero if file is found
|
||||
int movie_find(char *filename, char *out_name)
|
||||
{
|
||||
char full_path[MAX_PATH];
|
||||
char tmp_name[MAX_PATH];
|
||||
char search_name[MAX_PATH];
|
||||
int i, size, offset = 0;
|
||||
const int NUM_EXT = 2;
|
||||
const char *movie_ext[NUM_EXT] = { ".avi", ".mpg" };
|
||||
|
||||
if (out_name == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
os_app_activate_set(false);
|
||||
// remove extension
|
||||
strcpy( tmp_name, filename );
|
||||
char *p = strchr( tmp_name, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<NUM_EXT; i++) {
|
||||
strcpy( search_name, tmp_name );
|
||||
strcat( search_name, movie_ext[i] );
|
||||
|
||||
dx8show_set_hwnd((void *) os_get_window());
|
||||
// try and find the file
|
||||
if ( cf_find_file_location(search_name, CF_TYPE_ANY, full_path, &size, &offset, 0) ) {
|
||||
// if it's not in a packfile then we're done
|
||||
if (offset == 0) {
|
||||
strcpy( out_name, full_path );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// clear old string
|
||||
strcpy( search_name, "" );
|
||||
}
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_HIDE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_MINIMIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dx8show_play_cutscene(name);
|
||||
// Play one movie
|
||||
bool movie_play(char *name)
|
||||
{
|
||||
// mark the movie as viewable to the player when in a campaign
|
||||
// do this before anything else so that we're sure the movie is available
|
||||
// to the player even if it's not going to play right now
|
||||
if (Game_mode & GM_CAMPAIGN_MODE) {
|
||||
cutscene_mark_viewable(name);
|
||||
}
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_RESTORE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_SHOW);
|
||||
// reset the gr_* stuff before trying to play a movie
|
||||
// fixes white flash in OGL and possibly other wierd stuff
|
||||
gr_reset_clip();
|
||||
gr_clear();
|
||||
gr_flip();
|
||||
|
||||
os_app_activate_set(true);
|
||||
extern int Is_standalone;
|
||||
if(Is_standalone) return false;
|
||||
if(Cmdline_dnoshowvid) return false;
|
||||
if(Cmdline_window) return false;
|
||||
|
||||
/*
|
||||
// Comment this back in if the freespace window isnt coming back after the movie ends
|
||||
char full_name[MAX_PATH];
|
||||
int rc = 0;
|
||||
|
||||
if((HWND) os_get_window() != NULL)
|
||||
rc = movie_find(name, full_name);
|
||||
|
||||
if (!rc) {
|
||||
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s", name);
|
||||
return false;
|
||||
} else {
|
||||
DBUGFILE_OUTPUT_1("About to play: %s", full_name);
|
||||
}
|
||||
|
||||
process_messages();
|
||||
|
||||
// This is a bit of a hack but it works nicely
|
||||
if(gr_screen.mode == GR_DIRECT3D)
|
||||
{
|
||||
if(GetForegroundWindow() != (HWND) os_get_window())
|
||||
GlobalD3DVars::D3D_activate = 0;
|
||||
GlobalD3DVars::lpD3DDevice->EndScene();
|
||||
GlobalD3DVars::lpD3DDevice->Present(NULL,NULL,NULL,NULL);
|
||||
d3d_lost_device();
|
||||
}
|
||||
|
||||
// This clears the screen
|
||||
InvalidateRect((HWND) os_get_window(), NULL, TRUE);
|
||||
PAINTSTRUCT paint_info;
|
||||
HDC clear_hdc = BeginPaint((HWND) os_get_window(),&paint_info);
|
||||
|
||||
if(clear_hdc)
|
||||
{
|
||||
|
||||
POINT points[4] = {
|
||||
{0,0},
|
||||
{gr_screen.max_w,0},
|
||||
{gr_screen.max_w, gr_screen.max_h},
|
||||
{0, gr_screen.max_h}};
|
||||
|
||||
HBRUSH hBrush = CreateSolidBrush(0x00000000);
|
||||
HBRUSH hOldBrush = (HBRUSH)SelectObject(clear_hdc, hBrush);
|
||||
SelectObject(clear_hdc, hBrush);
|
||||
|
||||
Polygon(clear_hdc, points, 4);
|
||||
|
||||
SelectObject(clear_hdc, hOldBrush);
|
||||
DeleteObject(hBrush);
|
||||
|
||||
EndPaint((HWND) os_get_window(),&paint_info);
|
||||
}
|
||||
|
||||
process_messages();
|
||||
|
||||
if(OpenClip((HWND) os_get_window(), full_name))
|
||||
{
|
||||
|
||||
do
|
||||
{
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
Sleep(100);
|
||||
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("Using SetForegroundWindow last");
|
||||
SetForegroundWindow((HWND) os_get_window());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
#endif // _WIN32
|
||||
TranslateMessage(&msg);
|
||||
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
if(msg.message == WM_ERASEBKGND)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
PassMsgToVideoWindow((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
|
||||
if(msg.message == WM_PAINT)
|
||||
{
|
||||
}
|
||||
|
||||
if(msg.message != WM_KEYDOWN)
|
||||
{
|
||||
// DefWindowProc((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
DispatchMessage(&msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(msg.wParam )
|
||||
{
|
||||
// Quits movie if escape, space or return is pressed
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
// Terminate movie playback early
|
||||
CloseClip((HWND) os_get_window());
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Stream bit of the movie then handle windows messages
|
||||
while(dx8show_stream_movie() == false);
|
||||
|
||||
}
|
||||
|
||||
// We finished playing the movie
|
||||
CloseClip((HWND) os_get_window());
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value)
|
||||
bool movie_play_two(char *name1, char *name2)
|
||||
{
|
||||
bool result = true;
|
||||
bool result1 = movie_play(name1);
|
||||
process_messages();
|
||||
bool result2 = movie_play(name2);
|
||||
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name1,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name1);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
|
||||
/*
|
||||
** Check second file exists
|
||||
*/
|
||||
FILE *fp2 = fopen(name2,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name2);
|
||||
|
||||
if(fp2 == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp2);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup();
|
||||
}
|
||||
|
||||
os_app_activate_set(false);
|
||||
|
||||
dx8show_play_cutscene(name1);
|
||||
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
dx8show_play_cutscene(name2);
|
||||
|
||||
os_app_activate_set(true);
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result1 && result2;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Stubs, preprocessor calls were making the win32 code more complex for no good reason.
|
||||
// Using stubs instead.
|
||||
bool movie_play(char *name) {return true;}
|
||||
bool movie_play_two(char *name1, char *name2) {return true;}
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
void movie_set_shutdown_fgx(bool state);
|
||||
bool movie_play(char *name, int unknown_value = 0);
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value = 0);
|
||||
bool movie_play(char *name);
|
||||
bool movie_play_two(char *name1, char *name2);
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
int Texture_compression_enabled=0;
|
||||
|
||||
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels)
|
||||
{
|
||||
char code[5];
|
||||
CFILE *ddsfile;
|
||||
@@ -46,9 +46,15 @@ static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int
|
||||
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
|
||||
|
||||
//stuff important info
|
||||
if (width) *width=lpddsd->dwWidth;
|
||||
if (height) *height=lpddsd->dwHeight;
|
||||
|
||||
if (width)
|
||||
*width = lpddsd->dwWidth;
|
||||
|
||||
if (height)
|
||||
*height = lpddsd->dwHeight;
|
||||
|
||||
if (levels)
|
||||
*levels = lpddsd->dwMipMapCount;
|
||||
|
||||
switch(lpddsd->ddpfPixelFormat.dwFourCC)
|
||||
{
|
||||
case FOURCC_DXT1:
|
||||
@@ -88,10 +94,10 @@ static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int
|
||||
return retval;
|
||||
}
|
||||
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels)
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type);
|
||||
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type, levels);
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
@@ -99,7 +105,7 @@ int dds_read_bitmap(char *filename, int *size, uint* data)
|
||||
{
|
||||
int retval;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int w,h,ct,bpp;
|
||||
int w,h,ct,lvl,bpp;
|
||||
CFILE *cfp;
|
||||
ubyte* tmp;
|
||||
|
||||
@@ -107,7 +113,7 @@ int dds_read_bitmap(char *filename, int *size, uint* data)
|
||||
Assert(size!=NULL);
|
||||
|
||||
//read the header -- if its at this stage, it should be legal.
|
||||
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct);
|
||||
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct, &lvl);
|
||||
Assert(retval==DDS_ERROR_NONE);
|
||||
|
||||
//get some more info from the surface
|
||||
|
||||
@@ -105,7 +105,7 @@ typedef struct _DDSURFACEDESC2
|
||||
//reads a dds header
|
||||
//returns one of the error values
|
||||
//'compression_type' comes back as one of the DDS_DXTC* defines
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type);
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels);
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
@@ -116,4 +116,4 @@ const char* dds_error_string(int code);
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
#endif //__DDS_H
|
||||
#endif //__DDS_H
|
||||
@@ -9,13 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/10/15 22:03:24 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.3 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/19 12:29:01 unknownplayer
|
||||
* Woohoo! Killed two birds with one stone!
|
||||
* Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -220,21 +238,20 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "object/object.h"
|
||||
#include "debris/debris.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "particle/particle.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "io/timer.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multi.h"
|
||||
@@ -259,11 +276,30 @@ int Debris_inited = 0;
|
||||
int Debris_model = -1;
|
||||
int Debris_vaporize_model = -1;
|
||||
int Debris_num_submodels = 0;
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
|
||||
char Debris_texture_files[MAX_SPECIES_NAMES][MAX_DEBRIS_TNAME_LEN+1];
|
||||
|
||||
/*char * Debris_texture_files[MAX_SPECIES_NAMES] = {
|
||||
NOX("debris01a"), // Terran
|
||||
NOX("debris01b"), // Species B
|
||||
NOX("debris01c"), // Shivan
|
||||
NOX("debris01a"), // Ancient
|
||||
NOX("debris01a"), // User1
|
||||
NOX("debris01a"), // User2
|
||||
NOX("debris01a"), // User3
|
||||
NOX("debris01a"), // User4
|
||||
|
||||
};*/
|
||||
|
||||
#else
|
||||
char * Debris_texture_files[MAX_SPECIES_NAMES] = {
|
||||
NOX("debris01a"), // Terran
|
||||
NOX("debris01b"), // Species B
|
||||
NOX("debris01c"), // Shivan
|
||||
};
|
||||
#endif
|
||||
|
||||
int Debris_textures[MAX_SPECIES_NAMES];
|
||||
|
||||
@@ -346,7 +382,11 @@ void debris_page_in()
|
||||
|
||||
Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL );
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
for (i=0; i<MAX_SPECIES_NAMES && i<True_NumSpecies; i++ ) {
|
||||
#else
|
||||
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
|
||||
#endif
|
||||
nprintf(( "Paging", "Paging in debris texture '%s'\n", Debris_texture_files[i] ));
|
||||
Debris_textures[i] = bm_load( Debris_texture_files[i] );
|
||||
if ( Debris_textures[i] < 0 ) {
|
||||
@@ -803,7 +843,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
|
||||
|
||||
if (source_obj->type == OBJ_SHIP) {
|
||||
obj->hull_strength = Ship_info[Ships[source_obj->instance].ship_info_index].initial_hull_strength/8.0f;
|
||||
obj->hull_strength = Ships[source_obj->instance].ship_initial_hull_strength/8.0f;
|
||||
} else
|
||||
obj->hull_strength = 10.0f;
|
||||
|
||||
@@ -1006,7 +1046,7 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
// Return true if hit, else return false.
|
||||
//
|
||||
#pragma warning ( push )
|
||||
#pragma warning ( disable : 4701 )
|
||||
#pragma warning ( disable : 4701 ) // possible use of variable without initialization
|
||||
int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, collision_info_struct *debris_hit_info)
|
||||
{
|
||||
mc_info mc;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-03-05 09:01:59 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -141,6 +144,8 @@
|
||||
#ifndef _DEBRIS_H
|
||||
#define _DEBRIS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct object;
|
||||
struct CFILE;
|
||||
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -105,13 +117,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/timer.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/key.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
#define MAX_COMMANDS 300
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
#include "dbugfile.h"
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
int dbugfile_counters[MAX_COUNTERS];
|
||||
bool dbugfile_init_var = false;
|
||||
|
||||
char dbugfile_filename[512];
|
||||
@@ -29,15 +32,38 @@ void dbugfile_output(char *buffer)
|
||||
}
|
||||
|
||||
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void dbugfile_init()
|
||||
{
|
||||
// Clear the counters
|
||||
memset(dbugfile_counters, 0, sizeof(int) * MAX_COUNTERS);
|
||||
|
||||
char big_buffer[1000];
|
||||
char temp_buff[512];
|
||||
|
||||
strcpy(dbugfile_filename, "DBUG-");
|
||||
dbugfile_filename[0] = '\0';
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
char path[MAX_PATH];
|
||||
|
||||
GetCurrentDirectory(MAX_PATH, path);
|
||||
|
||||
int path_len = strlen(path);
|
||||
if(path[path_len - 1] != '\\')
|
||||
{
|
||||
path[path_len] = '\\';
|
||||
path[path_len + 1] = '\0';
|
||||
}
|
||||
|
||||
strcpy(dbugfile_filename, path);
|
||||
|
||||
#endif
|
||||
|
||||
strcat(dbugfile_filename, "DBUG-");
|
||||
strcpy(big_buffer, "DBUGFILE Active: ");
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -56,14 +82,15 @@ void dbugfile_init()
|
||||
_tzset();
|
||||
|
||||
// Display operating system-style date and time.
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename, "(");
|
||||
_strdate( temp_buff);
|
||||
strcat(dbugfile_filename, "D(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ")-(");
|
||||
strcat(dbugfile_filename, ") T(");
|
||||
strcat(big_buffer, " ");
|
||||
_strdate( temp_buff);
|
||||
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
@@ -72,7 +99,7 @@ void dbugfile_init()
|
||||
|
||||
// Remove invalid slash chars
|
||||
int len = strlen(dbugfile_filename);
|
||||
while(len >= 0)
|
||||
while(len >= 2)
|
||||
{
|
||||
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
|
||||
{
|
||||
@@ -82,6 +109,8 @@ void dbugfile_init()
|
||||
}
|
||||
|
||||
// open file
|
||||
// Uncomment this to see where the file is going
|
||||
//MessageBox(NULL, dbugfile_filename, "das", MB_OK);
|
||||
FILE *fp = fopen(dbugfile_filename, "w");
|
||||
|
||||
if(fp == NULL)
|
||||
@@ -141,11 +170,18 @@ void dbugfile_init()
|
||||
#else
|
||||
release_type = "Release";
|
||||
#endif
|
||||
sprintf(big_buffer, "OS: %s %s\n", version, release_type);
|
||||
sprintf(big_buffer, "OS: %s %s, ", version, release_type);
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
char exe_name[MAX_PATH];
|
||||
|
||||
GetModuleFileName(NULL, exe_name, MAX_PATH);
|
||||
strcat(exe_name, "\n");
|
||||
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
@@ -251,4 +287,120 @@ void dbugfile_sprintf(int line, char *file, const char *format, ...)
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8],
|
||||
matrix[9],
|
||||
matrix[10],
|
||||
matrix[11],
|
||||
matrix[12],
|
||||
matrix[13],
|
||||
matrix[14],
|
||||
matrix[15]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
|
||||
{
|
||||
char buffer[1000];
|
||||
strcpy(buffer, string);
|
||||
strcat(buffer, " %d");
|
||||
|
||||
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#ifndef _DBUGFILE_HEADER_
|
||||
#define _DBUGFILE_HEADER_
|
||||
|
||||
#define MAX_COUNTERS 10
|
||||
|
||||
void dbugfile_init();
|
||||
void dbugfile_deinit();
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
|
||||
|
||||
#ifdef DBUGFILE_ACTIVE
|
||||
|
||||
@@ -16,9 +21,19 @@ void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f;
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
|
||||
|
||||
extern int dbugfile_counters[MAX_COUNTERS];
|
||||
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
|
||||
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
|
||||
|
||||
#else
|
||||
|
||||
@@ -33,7 +48,16 @@ void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h) ;
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
|
||||
|
||||
#define DBUGFILE_INC_COUNTER(n) ;
|
||||
#define DBUGFILE_DEC_COUNTER(n) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,10 +1,26 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is intended as a debug tool to measure the speed of blocks of code and display
|
||||
* that information as coloured bars across the top of the screen.
|
||||
*
|
||||
* This allows interactive measuring of components of the code, very useful for optimisztion.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
||||
#include "dbugfile.h"
|
||||
#include "timerbar.h"
|
||||
#include "globalincs\pstypes.h"
|
||||
|
||||
// Internal structure for handling frame data
|
||||
typedef struct
|
||||
{
|
||||
LARGE_INTEGER start_value;
|
||||
@@ -15,21 +31,68 @@ typedef struct
|
||||
|
||||
} timerbar_profile;
|
||||
|
||||
timerbar_profile profiles[TIMERBAR_COLOUR_MAX];
|
||||
timerbar_profile profiles[MAX_NUM_TIMERBARS];
|
||||
int timerbar_current_profile = 0;
|
||||
|
||||
LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
// Data needed for push and pop functionality
|
||||
const MAX_TB_STACK_SIZE = 100;
|
||||
|
||||
int timerbar_stack[MAX_TB_STACK_SIZE];
|
||||
int timerbar_current_stack_layer = 0;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_push(int value)
|
||||
{
|
||||
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
|
||||
{
|
||||
// To many pushs, this must be a bug
|
||||
// Someone is letting code miss the pops, check for early retuns
|
||||
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
|
||||
timerbar_current_stack_layer++;
|
||||
|
||||
timerbar_switch_type(value);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_pop()
|
||||
{
|
||||
timerbar_current_stack_layer--;
|
||||
if(timerbar_current_stack_layer < 0)
|
||||
{
|
||||
Assert(!(timerbar_current_stack_layer < 0));
|
||||
timerbar_current_stack_layer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
|
||||
}
|
||||
|
||||
// This pointer holds the draw function to use or NULL
|
||||
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
|
||||
|
||||
void timerbar_start_frame()
|
||||
{
|
||||
timerbar_current_profile = 0;
|
||||
timerbar_current_stack_layer = 0;
|
||||
timerbar_current_profile = 0;
|
||||
|
||||
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
draw_func_ptr = NULL;
|
||||
}
|
||||
|
||||
@@ -37,15 +100,23 @@ void timerbar_start_frame()
|
||||
|
||||
}
|
||||
|
||||
// Constants need for timerbar_conv_and_draw calculations
|
||||
const int WIDTH = 480;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.05f;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.01f;
|
||||
|
||||
/**
|
||||
* Internal conversion function to convert draw data into bars for the screen
|
||||
*
|
||||
* @param int colour - colour index (>=0)
|
||||
* @param int xpos - x position to start bar on
|
||||
* @param int xwidth - width of bar
|
||||
* @param int yrow - Index of row bar belongs to
|
||||
*/
|
||||
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
|
||||
{
|
||||
float fxpos = (float) xpos;
|
||||
float fxwidth = (float) xwidth;
|
||||
|
||||
|
||||
|
||||
draw_func_ptr(colour,
|
||||
fxpos / WIDTHF,
|
||||
yrow * 0.01f,
|
||||
@@ -68,7 +139,7 @@ void timerbar_end_frame()
|
||||
int y_pos = 0;
|
||||
|
||||
|
||||
for(int i = 0; i < TIMERBAR_COLOUR_MAX; i++)
|
||||
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
|
||||
{
|
||||
// Nothing to render this frame
|
||||
if(profiles[i].frame_total.QuadPart == 0)
|
||||
@@ -76,10 +147,10 @@ void timerbar_end_frame()
|
||||
continue;
|
||||
}
|
||||
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
|
||||
|
||||
// break condition in else
|
||||
for (;;)
|
||||
while(1)
|
||||
{
|
||||
// if bar runs over
|
||||
if(last_xpos + xsize > WIDTH)
|
||||
@@ -110,20 +181,19 @@ void timerbar_end_frame()
|
||||
|
||||
void timerbar_switch_type(int num)
|
||||
{
|
||||
if(num >= TIMERBAR_COLOUR_MAX)
|
||||
if(num >= MAX_NUM_TIMERBARS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calculate old profile's total
|
||||
LARGE_INTEGER now;
|
||||
if(QueryPerformanceCounter(&now) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
|
||||
profiles[timerbar_current_profile].frame_total.QuadPart =
|
||||
profiles[timerbar_current_profile].frame_total.QuadPart +=
|
||||
(now.QuadPart - timerbar_last_start_value.QuadPart);
|
||||
|
||||
if(num != -1)
|
||||
@@ -135,14 +205,21 @@ void timerbar_switch_type(int num)
|
||||
// Update time to count from
|
||||
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
|
||||
*
|
||||
* Sets the draw function used to output the timer data, designed to be generic allowing any API
|
||||
* to take advantage of this module. Set to NULL to disable drawing.
|
||||
*
|
||||
* By default the draw function is set to NULL
|
||||
*/
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
|
||||
{
|
||||
draw_func_ptr = new_draw_func_ptr;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,34 +1,73 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2004-02-16 11:47:31 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 1.6 2003/11/09 06:31:39 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 1.5 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
enum
|
||||
{
|
||||
TIMERBAR_COLOUR_RED,
|
||||
TIMERBAR_COLOUR_GREEN,
|
||||
TIMERBAR_COLOUR_BLUE,
|
||||
TIMERBAR_COLOUR_MAX,
|
||||
};
|
||||
const int MAX_NUM_TIMERBARS = 20;
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
// These functions should never be used directly, always use macros below
|
||||
void timerbar_start_frame();
|
||||
void timerbar_end_frame();
|
||||
void timerbar_switch_type(int num);
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
|
||||
|
||||
#ifdef TIMEBAR_ACTIVE
|
||||
void timerbar_push(int value);
|
||||
void timerbar_pop();
|
||||
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) timerbar_set_draw_func(f);
|
||||
#define TIMERBAR_START_FRAME() timerbar_start_frame();
|
||||
#define TIMERBAR_END_FRAME() timerbar_end_frame();
|
||||
#define TIMERBAR_SWITCH_TYPE(n) timerbar_switch_type(n);
|
||||
// This function shouldnt not be used any more or it will break push and pop calls
|
||||
void timerbar_switch_type(int num);
|
||||
|
||||
#else
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) if (Cmdline_timerbar) timerbar_set_draw_func(f);
|
||||
#define TIMERBAR_START_FRAME() if (Cmdline_timerbar) timerbar_start_frame();
|
||||
#define TIMERBAR_END_FRAME() if (Cmdline_timerbar) timerbar_end_frame();
|
||||
#define TIMERBAR_SWITCH_TYPE(n) if (Cmdline_timerbar) timerbar_switch_type(n);
|
||||
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) ;
|
||||
#define TIMERBAR_START_FRAME() ;
|
||||
#define TIMERBAR_END_FRAME() ;
|
||||
#define TIMERBAR_SWITCH_TYPE(n) ;
|
||||
|
||||
#endif
|
||||
#define TIMERBAR_PUSH(v) if (Cmdline_timerbar) timerbar_push(v);
|
||||
#define TIMERBAR_POP() if (Cmdline_timerbar) timerbar_pop();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//sorce file for decals-Bobboau
|
||||
//and no, I don't have any idea what I'm doing
|
||||
|
||||
/*
|
||||
#include "decals/decals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "render/3d.h"
|
||||
@@ -52,9 +52,10 @@ static int back_faceing;
|
||||
|
||||
vm_vec_scale_add( top, &temp, &uvec, w/2.0f );
|
||||
vm_vec_scale_add( bot, &temp, &uvec, -w/2.0f );
|
||||
*/
|
||||
|
||||
|
||||
int decal_find_next(object *obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
int oldest = shipp->decals[0].timestamp;
|
||||
int i;
|
||||
@@ -69,6 +70,8 @@ int decal_find_next(object *obj){
|
||||
}
|
||||
}
|
||||
return oldest%MAX_SHIP_DECALS;
|
||||
#else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
|
||||
@@ -391,7 +394,7 @@ void decal_create_sortnorm(ubyte * p)
|
||||
/* if (!fvi_ray_boundingbox( &min, &max, &decal_hit_point, &decal_hit_vect, NULL )) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if (prelist) decal_create_sub(p+prelist);
|
||||
if (backlist) decal_create_sub(p+backlist);
|
||||
if (onlist) decal_create_sub(p+onlist);
|
||||
@@ -405,7 +408,7 @@ typedef struct model_tmap_vert {
|
||||
short normnum;
|
||||
float u,v;
|
||||
} model_tmap_vert;
|
||||
*/
|
||||
|
||||
//int poly_num = 0;
|
||||
// Textured Poly
|
||||
// +0 int id
|
||||
@@ -441,7 +444,7 @@ void decal_create_tmappoly(ubyte * p)
|
||||
// Don't check invisible polygons.
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
verts = (model_tmap_vert *)(p+44);
|
||||
vector temppoly[820];
|
||||
|
||||
@@ -601,7 +604,7 @@ void decal_create_tmappoly(ubyte * p)
|
||||
}
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
|
||||
poly_num++;
|
||||
}*/
|
||||
}
|
||||
for (i=1;i<nv;i++){
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
@@ -667,7 +670,7 @@ int decal_create_sub(void *model_ptr )
|
||||
case DP_BOUNDBOX:
|
||||
/* if (!mc_ray_boundingbox( vp(p+8), vp(p+20), &Mc_p0, &Mc_direction, NULL )) {
|
||||
return 1;
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mprintf(( "Bad chunk type %d, len=%d in decal_create_sub\n", chunk_type, chunk_size ));
|
||||
@@ -738,7 +741,7 @@ mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, v
|
||||
// mprintf(("decals rendered\n"));
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void decal_render_all(object * obj){
|
||||
@@ -800,13 +803,13 @@ void decal_render_all(object * obj){
|
||||
vecs[j].u = dec->poly[i].uv[j].u;
|
||||
vecs[j].v = dec->poly[i].uv[j].v;
|
||||
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
|
||||
/*
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
light_apply_rgb( &vlist[j]->r, &vlist[j]->g, &vlist[j]->b, &pnt, &dec->poly[i].norm, 0 );
|
||||
} else {
|
||||
vlist[j]->b = light_apply( &pnt, &dec->poly[i].norm, 0 );
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
@@ -828,3 +831,5 @@ mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, v
|
||||
// mprintf(("decals rendered\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -9,7 +9,6 @@
|
||||
#define MAX_DECAL_POINT 10
|
||||
#define MAX_SHIP_DECALS 25
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#define DP_EOF 0
|
||||
#define DP_DEFPOINTS 1
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:59 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -47,21 +50,19 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "demo/demo.h"
|
||||
#include "mission/missionload.h"
|
||||
#include "ship/ship.h"
|
||||
#include "Weapon/weapon.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/object.h"
|
||||
#include "io/timer.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
// DEMO DEFINES/VARS
|
||||
|
||||
Binary file not shown.
+269
-185
@@ -4,237 +4,321 @@
|
||||
#include "osapi/osapi.h"
|
||||
#include "dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <commdlg.h>
|
||||
#include <tchar.h>
|
||||
#include <atlbase.h>
|
||||
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
// Local
|
||||
HRESULT InitPlayerWindow(HWND ghApp);
|
||||
HRESULT InitVideoWindow(HWND ghApp, long w, long h);
|
||||
bool HandleGraphEvent(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
const int KEYBOARD_SAMPLE_FREQ = 200; // Sample user input on an interval
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IMediaEvent *pME = NULL;
|
||||
#define WM_GRAPHNOTIFY WM_USER
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
HRESULT get_interfaces(void);
|
||||
bool play_media(LPTSTR movie_filename);
|
||||
bool set_fullscreen(void);
|
||||
void cleanup_interfaces(void);
|
||||
|
||||
HWND internal_hwnd = NULL;
|
||||
|
||||
// This define, 0 by default, if set to 1 will run window binding code which currently
|
||||
// doesnt work, left in for fun
|
||||
#define VIS_CODE 0
|
||||
//
|
||||
// Helper Macros (Jump-If-Failed, Log-If-Failed)
|
||||
//
|
||||
#define RUN_FUNCTION_ROF(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED in " #x); return false;}
|
||||
|
||||
#define RUN_FUNCTION_GET_INTERFACE(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED " #x); cleanup_interfaces(); return hr;}
|
||||
|
||||
#define RUN_FUNCTION(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED " #x);}
|
||||
|
||||
#define RELEASE(i) {if (i) i->Release(); i = NULL;}
|
||||
|
||||
void process_messages(HWND hwnd)
|
||||
char error_buffer[512];
|
||||
char *ParseDShowError(HRESULT hr)
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
AMGetErrorText(hr, error_buffer, 512);
|
||||
return error_buffer;
|
||||
#else
|
||||
return "DShow error";
|
||||
#endif
|
||||
}
|
||||
|
||||
void dx8show_set_hwnd(void *hwnd)
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) " (%s) " TEXT("\n"), hr, ParseDShowError(hr)); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
BOOL g_bAudioOnly=FALSE;
|
||||
LONG g_lVolume=VOLUME_FULL;
|
||||
DWORD g_dwGraphRegister=0;
|
||||
PLAYSTATE g_psCurrent=Stopped;
|
||||
|
||||
// DirectShow interfaces
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IBasicAudio *pBA = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaPosition *pMP = NULL;
|
||||
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
internal_hwnd = (HWND) hwnd;
|
||||
if (pVW)
|
||||
pVW->NotifyOwnerMessage((long) hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
bool dx8show_play_cutscene(char *movie_file)
|
||||
void SetCurrentState(PLAYSTATE state)
|
||||
{
|
||||
g_psCurrent = state;
|
||||
}
|
||||
|
||||
PLAYSTATE GetCurrentState()
|
||||
{
|
||||
return g_psCurrent;
|
||||
}
|
||||
|
||||
BOOL IsAudioOnly()
|
||||
{
|
||||
return g_bAudioOnly;
|
||||
}
|
||||
|
||||
HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
WCHAR wFile[MAX_PATH];
|
||||
HRESULT hr;
|
||||
|
||||
// Initialize COM
|
||||
RUN_FUNCTION_ROF(CoInitialize(NULL));
|
||||
// Clear open dialog remnants before calling RenderFile()
|
||||
UpdateWindow(ghApp);
|
||||
|
||||
// Get DirectShow interfaces
|
||||
RUN_FUNCTION_ROF(get_interfaces());
|
||||
// Convert filename to wide character string
|
||||
wcscpy(wFile, T2W(szFile));
|
||||
|
||||
if(internal_hwnd == NULL)
|
||||
{
|
||||
internal_hwnd = (HWND) os_get_window();
|
||||
}
|
||||
// Get the interface for DirectShow's GraphBuilder
|
||||
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IGraphBuilder, (void **)&pGB));
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OATRUE));
|
||||
RUN_FUNCTION(pVW->put_Owner((OAHWND) internal_hwnd));
|
||||
#endif
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
HRESULT load_attempt = pGB->RenderFile(wFile, NULL);
|
||||
|
||||
// Play the movie / cutscene
|
||||
play_media(movie_file);
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OAFALSE));
|
||||
RUN_FUNCTION(pVW->put_Owner(NULL));
|
||||
#endif
|
||||
// Have the graph builder construct its the appropriate graph automatically
|
||||
if(FAILED(load_attempt))
|
||||
{
|
||||
return load_attempt;
|
||||
}
|
||||
|
||||
// Release DirectShow interfaces
|
||||
cleanup_interfaces();
|
||||
CoUninitialize();
|
||||
// QueryInterface for DirectShow interfaces
|
||||
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
|
||||
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
JIF(pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS));
|
||||
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
|
||||
|
||||
return true;
|
||||
}
|
||||
// Query for video interfaces, which may not be relevant for audio files
|
||||
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
|
||||
JIF(pGB->QueryInterface(IID_IBasicVideo, (void **)&pBV));
|
||||
|
||||
HRESULT get_interfaces(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
// Query for audio interfaces, which may not be relevant for video-only files
|
||||
JIF(pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA));
|
||||
|
||||
// Instantiate filter graph interface
|
||||
RUN_FUNCTION_GET_INTERFACE(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **) &pGB));
|
||||
// Get interfaces to control playback & screensize
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaControl, (void **) &pMC));
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IVideoWindow, (void **) &pVW));
|
||||
// Is this an audio-only file (no video component)?
|
||||
CheckVisibility();
|
||||
|
||||
// Get interface to allow the app to wait for completion of playback
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
// Have the graph signal event via window callbacks for performance
|
||||
JIF(pME->SetNotifyWindow((OAHWND)ghApp, WM_GRAPHNOTIFY, 0));
|
||||
|
||||
long width, height;
|
||||
pBV->get_VideoWidth(&width);
|
||||
pBV->get_VideoHeight(&height);
|
||||
|
||||
JIF(InitVideoWindow(ghApp,width, height));
|
||||
|
||||
if (!g_bAudioOnly)
|
||||
{
|
||||
JIF(pVW->put_Owner((OAHWND)ghApp));
|
||||
JIF(pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE));
|
||||
JIF(pVW->SetWindowForeground(OATRUE));
|
||||
}
|
||||
|
||||
// Run the graph to play the media file
|
||||
JIF(pMC->Run());
|
||||
g_psCurrent=Running;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
void cleanup_interfaces(void)
|
||||
|
||||
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
{
|
||||
// Release the DirectShow interfaces
|
||||
RELEASE(pMC);
|
||||
RELEASE(pVW);
|
||||
RELEASE(pME);
|
||||
RELEASE(pGB);
|
||||
HRESULT hr = S_OK;
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(ghApp, &rect);
|
||||
|
||||
int screen_w = rect.right;
|
||||
int screen_h = rect.bottom;
|
||||
|
||||
int video_rescale_w = (video_w * screen_w) / video_w;
|
||||
int video_rescale_h = (video_rescale_w * video_h) / video_w;
|
||||
|
||||
int extra_w = (screen_w - video_rescale_w) / 2;
|
||||
int extra_h = (screen_h - video_rescale_h) / 2;
|
||||
|
||||
if(SetWindowPos(ghApp, 0, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER) == FALSE) {
|
||||
|
||||
MessageBox(ghApp,"Failed SetWindowPos","Error", MB_OK);
|
||||
}
|
||||
|
||||
JIF(pVW->SetWindowPosition(extra_w, extra_h, video_rescale_w, video_rescale_h));
|
||||
return hr;
|
||||
}
|
||||
|
||||
bool play_media(LPTSTR movie_filename)
|
||||
void CheckVisibility(void)
|
||||
{
|
||||
long lVisible;
|
||||
HRESULT hr;
|
||||
WCHAR file_name[MAX_PATH];
|
||||
|
||||
#ifndef UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, movie_filename, -1, file_name, MAX_PATH);
|
||||
#else
|
||||
lstrcpy(file_name, movie_filename);
|
||||
#endif
|
||||
if ((!pVW) || (!pBV))
|
||||
{
|
||||
// Audio-only files have no video interfaces. This might also
|
||||
// be a file whose video component uses an unknown video codec.
|
||||
g_bAudioOnly = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the global flag
|
||||
g_bAudioOnly = FALSE;
|
||||
}
|
||||
|
||||
// Allow DirectShow to create the FilterGraph for this media file
|
||||
RUN_FUNCTION_ROF(pGB->RenderFile(file_name, NULL));
|
||||
hr = pVW->get_Visible(&lVisible);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
// Set the message drain of the video window to point to our hidden application window. This allows
|
||||
// keyboard input to be transferred to our main window for processing.
|
||||
//
|
||||
// If this is an audio-only or MIDI file, then put_MessageDrain will fail.
|
||||
//
|
||||
RUN_FUNCTION(pVW->put_MessageDrain((OAHWND) internal_hwnd));
|
||||
// If this is an audio-only clip, get_Visible() won't work.
|
||||
//
|
||||
// Also, if this video is encoded with an unsupported codec,
|
||||
// we won't see any video, although the audio will work if it is
|
||||
// of a supported format.
|
||||
//
|
||||
if (hr == E_NOINTERFACE)
|
||||
{
|
||||
g_bAudioOnly = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg(TEXT("Failed(%08lx) in pVW->get_Visible()!\r\n"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(set_fullscreen() == false)
|
||||
{
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName)
|
||||
{
|
||||
// Reset status variables
|
||||
g_psCurrent = Stopped;
|
||||
g_lVolume = VOLUME_FULL;
|
||||
|
||||
// Start playing the media file
|
||||
HRESULT hr = PlayMovieInWindow(ghApp, g_szFileName);
|
||||
|
||||
// If we couldn't play the clip, clean up
|
||||
if (FAILED(hr)) {
|
||||
CloseClip(ghApp);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Display first frame of the movie and play
|
||||
RUN_FUNCTION_ROF(pMC->Pause());
|
||||
RUN_FUNCTION_ROF(pMC->Run());
|
||||
|
||||
// Update state variables
|
||||
bool movie_continue = true;
|
||||
|
||||
// Enter a loop of checking for events and sampling keyboard input
|
||||
while (movie_continue)
|
||||
{
|
||||
long event_code, param1, param2;
|
||||
|
||||
// Has there been a media event? Look for end of stream condition.
|
||||
if(E_ABORT != pME->GetEvent(&event_code, ¶m1, ¶m2, 0))
|
||||
{
|
||||
// Is this the end of the movie?
|
||||
if (event_code == EC_COMPLETE)
|
||||
{
|
||||
movie_continue = false;
|
||||
}
|
||||
|
||||
// Free the media event resources.
|
||||
RUN_FUNCTION(pME->FreeEventParams(event_code, param1, param2));
|
||||
}
|
||||
|
||||
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
Sleep(KEYBOARD_SAMPLE_FREQ);
|
||||
|
||||
MSG msg;
|
||||
// Quits movie if escape, space or return is pressed
|
||||
while(PeekMessage(&msg, internal_hwnd, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
||||
if(msg.message != WM_KEYDOWN)
|
||||
{
|
||||
DispatchMessage(&msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(msg.wParam )
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("User skipped cut scene");
|
||||
movie_continue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool set_fullscreen(void)
|
||||
void CloseClip(HWND ghApp)
|
||||
{
|
||||
HRESULT hr;
|
||||
LONG mode;
|
||||
HWND drain=0;
|
||||
|
||||
if (!pVW)
|
||||
{
|
||||
return S_FALSE;
|
||||
// Stop media playback
|
||||
if(pMC)
|
||||
hr = pMC->Stop();
|
||||
|
||||
// Clear global flags
|
||||
g_psCurrent = Stopped;
|
||||
g_bAudioOnly = TRUE;
|
||||
|
||||
// Free DirectShow interfaces
|
||||
CloseInterfaces();
|
||||
|
||||
// No current media state
|
||||
g_psCurrent = Init;
|
||||
}
|
||||
|
||||
|
||||
void CloseInterfaces(void)
|
||||
{
|
||||
// Relinquish ownership (IMPORTANT!) after hiding video window
|
||||
if(pVW)
|
||||
pVW->put_Visible(OAFALSE);
|
||||
|
||||
// Disable event callbacks
|
||||
if (pME)
|
||||
pME->SetNotifyWindow((OAHWND)NULL, 0, 0);
|
||||
|
||||
// Release and zero DirectShow interfaces
|
||||
SAFE_RELEASE(pME);
|
||||
SAFE_RELEASE(pMS);
|
||||
SAFE_RELEASE(pMP);
|
||||
SAFE_RELEASE(pMC);
|
||||
SAFE_RELEASE(pBA);
|
||||
SAFE_RELEASE(pBV);
|
||||
SAFE_RELEASE(pVW);
|
||||
SAFE_RELEASE(pGB);
|
||||
}
|
||||
|
||||
void Msg(TCHAR *szFormat, ...)
|
||||
{
|
||||
TCHAR szBuffer[512]; // Large buffer for very long filenames (like HTTP)
|
||||
|
||||
// Format the input string
|
||||
va_list pArgs;
|
||||
va_start(pArgs, szFormat);
|
||||
_vstprintf(szBuffer, szFormat, pArgs);
|
||||
va_end(pArgs);
|
||||
|
||||
// Display a message box with the formatted string
|
||||
MessageBox(NULL, szBuffer, TEXT("PlayWnd Sample"), MB_OK);
|
||||
}
|
||||
|
||||
// returns true when finished
|
||||
bool dx8show_stream_movie(void)
|
||||
{
|
||||
LONG evCode, evParam1, evParam2;
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
// Make sure that we don't access the media event interface
|
||||
// after it has already been released.
|
||||
if (!pME) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Read current state
|
||||
RUN_FUNCTION_ROF(pVW->get_FullScreenMode(&mode));
|
||||
// Process all queued events
|
||||
while(SUCCEEDED(pME->GetEvent(&evCode, &evParam1,&evParam2, 0))) {
|
||||
// Free memory associated with callback, since we're not using it
|
||||
hr = pME->FreeEventParams(evCode, evParam1, evParam2);
|
||||
|
||||
// If this is the end of the clip, reset to beginning
|
||||
if(EC_COMPLETE == evCode)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == OAFALSE)
|
||||
{
|
||||
// Save current message drain
|
||||
RUN_FUNCTION_ROF(pVW->get_MessageDrain((OAHWND *) &drain));
|
||||
|
||||
// This is very important. It ensures that the video window doesnt end
|
||||
// up playing behind the main window
|
||||
SetFocus(drain);
|
||||
|
||||
// Set message drain to application main window
|
||||
RUN_FUNCTION_ROF(pVW->put_MessageDrain((OAHWND) internal_hwnd));
|
||||
|
||||
// Switch to full-screen mode
|
||||
mode = OATRUE;
|
||||
|
||||
RUN_FUNCTION_ROF(pVW->put_FullScreenMode(mode));
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool dx8show_play_cutscene(char *filename);
|
||||
void dx8show_set_hwnd(void *hwnd);
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName);
|
||||
void CloseClip(HWND ghApp);
|
||||
bool dx8show_stream_movie(void);
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,896 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3d.h
|
||||
* Content: Direct3D include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3D_H_
|
||||
#define _D3D_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#include "d3dcom.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define D3DAPI WINAPI
|
||||
#else
|
||||
#define D3DAPI
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interface IID's
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM)
|
||||
DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
|
||||
DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
|
||||
DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
|
||||
DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Data structures
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
|
||||
struct IDirect3D;
|
||||
struct IDirect3D2;
|
||||
struct IDirect3DDevice;
|
||||
struct IDirect3DDevice2;
|
||||
struct IDirect3DExecuteBuffer;
|
||||
struct IDirect3DLight;
|
||||
struct IDirect3DMaterial;
|
||||
struct IDirect3DMaterial2;
|
||||
struct IDirect3DTexture;
|
||||
struct IDirect3DTexture2;
|
||||
struct IDirect3DViewport;
|
||||
struct IDirect3DViewport2;
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct IDirect3D *LPDIRECT3D;
|
||||
typedef struct IDirect3D2 *LPDIRECT3D2;
|
||||
typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
|
||||
typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
|
||||
typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
|
||||
typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
|
||||
typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
|
||||
typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
|
||||
typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
|
||||
typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
|
||||
typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
|
||||
typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#endif
|
||||
|
||||
#include "directx/vd3dtypes.h"
|
||||
#include "directx/vd3dcaps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D
|
||||
DECLARE_INTERFACE_(IDirect3D, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ REFIID) PURE;
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#else
|
||||
#define IDirect3D_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D_Release(p) (p)->Release()
|
||||
#define IDirect3D_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3D_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3D2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3D2
|
||||
DECLARE_INTERFACE_(IDirect3D2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3D methods ***/
|
||||
STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
|
||||
STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
|
||||
STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
|
||||
|
||||
STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
|
||||
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->lpVtbl->CreateDevice(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3D2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3D2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3D2_Release(p) (p)->Release()
|
||||
#define IDirect3D2_EnumDevices(p, a, b) (p)->EnumDevices(a, b)
|
||||
#define IDirect3D2_CreateLight(p, a, b) (p)->CreateLight(a, b)
|
||||
#define IDirect3D2_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b)
|
||||
#define IDirect3D2_CreateViewport(p, a, b) (p)->CreateViewport(a, b)
|
||||
#define IDirect3D2_FindDevice(p, a, b) (p)->FindDevice(a, b)
|
||||
#define IDirect3D2_CreateDevice(p, a, b, c) (p)->CreateDevice(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice
|
||||
DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
|
||||
STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
|
||||
STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->lpVtbl->GetStats(p, a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->lpVtbl->Execute(p, a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->lpVtbl->Pick(p, a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->lpVtbl->GetPickRecords(p, a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->lpVtbl->CreateMatrix(p, a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->lpVtbl->SetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->lpVtbl->GetMatrix(p, a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->lpVtbl->DeleteMatrix(p, a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice_Initialize(p, a, b, c) (p)->Initialize(a, b, c)
|
||||
#define IDirect3DDevice_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
|
||||
#define IDirect3DDevice_GetStats(p, a) (p)->GetStats(a)
|
||||
#define IDirect3DDevice_Execute(p, a, b, c) (p)->Execute(a, b, c)
|
||||
#define IDirect3DDevice_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->Pick(a, b, c, d)
|
||||
#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->GetPickRecords(a, b)
|
||||
#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice_CreateMatrix(p, a) (p)->CreateMatrix(a)
|
||||
#define IDirect3DDevice_SetMatrix(p, a, b) (p)->SetMatrix(a, b)
|
||||
#define IDirect3DDevice_GetMatrix(p, a, b) (p)->GetMatrix(a, b)
|
||||
#define IDirect3DDevice_DeleteMatrix(p, a) (p)->DeleteMatrix(a)
|
||||
#define IDirect3DDevice_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DDevice2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DDevice2
|
||||
DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DDevice2 methods ***/
|
||||
STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
|
||||
STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
|
||||
STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
|
||||
STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
|
||||
STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
|
||||
STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
|
||||
STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
|
||||
|
||||
/*** DrawPrimitive API ***/
|
||||
STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
|
||||
STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
|
||||
|
||||
STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
|
||||
|
||||
STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
|
||||
STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
|
||||
STDMETHOD(Index) (THIS_ WORD) PURE;
|
||||
STDMETHOD(End) (THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
|
||||
STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
|
||||
STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
|
||||
|
||||
STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
|
||||
STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
|
||||
|
||||
STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->lpVtbl->CreateViewport(p, a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p)
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p)
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->lpVtbl->SetCurrentViewport(p, a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->lpVtbl->GetCurrentViewport(p, a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->lpVtbl->SetRenderTarget(p, a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->lpVtbl->GetRenderTarget(p, a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->lpVtbl->Begin(p, a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->lpVtbl->Begin(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->lpVtbl->Vertex(p, a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->lpVtbl->Index(p, a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->lpVtbl->End(p, a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->lpVtbl->GetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->lpVtbl->SetRenderState(p, a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->lpVtbl->GetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->lpVtbl->SetLightState(p, a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->lpVtbl->SetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->lpVtbl->GetTransform(p, a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->lpVtbl->MultiplyTransform(p, a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->lpVtbl->SetClipStatus(p, a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->lpVtbl->GetClipStatus(p, a)
|
||||
#else
|
||||
#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DDevice2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DDevice2_Release(p) (p)->Release()
|
||||
#define IDirect3DDevice2_GetCaps(p, a, b) (p)->GetCaps(a, b)
|
||||
#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b)
|
||||
#define IDirect3DDevice2_GetStats(p, a) (p)->CreateViewport(a)
|
||||
#define IDirect3DDevice2_AddViewport(p, a) (p)->AddViewport(a)
|
||||
#define IDirect3DDevice2_DeleteViewport(p, a) (p)->DeleteViewport(a)
|
||||
#define IDirect3DDevice2_NextViewport(p, a, b) (p)->NextViewport(a, b)
|
||||
#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b)
|
||||
#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene()
|
||||
#define IDirect3DDevice2_EndScene(p) (p)->EndScene()
|
||||
#define IDirect3DDevice2_GetDirect3D(p, a) (p)->GetDirect3D(a)
|
||||
|
||||
#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->SetCurrentViewport(a)
|
||||
#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->GetCurrentViewport(a)
|
||||
|
||||
#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->SetRenderTarget(a, b)
|
||||
#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->GetRenderTarget(a)
|
||||
|
||||
#define IDirect3DDevice2_Begin(p, a, b, c) (p)->Begin(a, b, c)
|
||||
#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->Begin(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_Vertex(p, a) (p)->Vertex(a)
|
||||
#define IDirect3DDevice2_Index(p, a) (p)->Index(a)
|
||||
#define IDirect3DDevice2_End(p, a) (p)->End(a)
|
||||
|
||||
#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->GetRenderState(a, b)
|
||||
#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->SetRenderState(a, b)
|
||||
#define IDirect3DDevice2_GetLightState(p, a, b) (p)->GetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetLightState(p, a, b) (p)->SetLightState(a, b)
|
||||
#define IDirect3DDevice2_SetTransform(p, a, b) (p)->SetTransform(a, b)
|
||||
#define IDirect3DDevice2_GetTransform(p, a, b) (p)->GetTransform(a, b)
|
||||
#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->MultiplyTransform(a, b)
|
||||
|
||||
#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
|
||||
#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
|
||||
(p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
|
||||
#define IDirect3DDevice2_SetClipStatus(p, a) (p)->SetClipStatus(a)
|
||||
#define IDirect3DDevice2_GetClipStatus(p, a) (p)->GetClipStatus(a)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DExecuteBuffer
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DExecuteBuffer
|
||||
DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DExecuteBuffer methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
|
||||
STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
|
||||
STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
|
||||
STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Optimize) (THIS_ DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->lpVtbl->Lock(p, a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->lpVtbl->SetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->lpVtbl->GetExecuteData(p, a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->lpVtbl->Optimize(p, a)
|
||||
#else
|
||||
#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DExecuteBuffer_Release(p) (p)->Release()
|
||||
#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DExecuteBuffer_Lock(p, a) (p)->Lock(a)
|
||||
#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock()
|
||||
#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->SetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->GetExecuteData(a)
|
||||
#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
|
||||
#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->Optimize(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DLight
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DLight
|
||||
DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DLight methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->lpVtbl->SetLight(p, a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->lpVtbl->GetLight(p, a)
|
||||
#else
|
||||
#define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DLight_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DLight_Release(p) (p)->Release()
|
||||
#define IDirect3DLight_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DLight_SetLight(p, a) (p)->SetLight(a)
|
||||
#define IDirect3DLight_GetLight(p, a) (p)->GetLight(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
|
||||
STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p)
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p)
|
||||
#else
|
||||
#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DMaterial_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DMaterial_Reserve(p) (p)->Reserve()
|
||||
#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DMaterial2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DMaterial2
|
||||
DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DMaterial2 methods ***/
|
||||
STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#else
|
||||
#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DMaterial2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DMaterial2_Release(p) (p)->Release()
|
||||
#define IDirect3DMaterial2_SetMaterial(p, a) (p)->SetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetMaterial(p, a) (p)->GetMaterial(a)
|
||||
#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture
|
||||
DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
|
||||
STDMETHOD_(HRESULT, Unload) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p)
|
||||
#else
|
||||
#define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture_Initialize(p, a, b) (p)->Initialize(a, b)
|
||||
#define IDirect3DTexture_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture_Load(p, a) (p)->Load(a)
|
||||
#define IDirect3DTexture_Unload(p) (p)->Unload()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DTexture2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DTexture2
|
||||
DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DTexture2 methods ***/
|
||||
STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
|
||||
STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->lpVtbl->Load(p, a)
|
||||
#else
|
||||
#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DTexture2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DTexture2_Release(p) (p)->Release()
|
||||
#define IDirect3DTexture2_GetHandle(p, a, b) (p)->GetHandle(a, b)
|
||||
#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
|
||||
#define IDirect3DTexture2_Load(p, a) (p)->Load(a)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport
|
||||
DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#else
|
||||
#define IDirect3DViewport_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDirect3DViewport2
|
||||
*/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DViewport2
|
||||
DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||
/*** IDirect3DViewport methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
|
||||
STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
|
||||
STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
|
||||
STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
|
||||
STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
|
||||
STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
|
||||
STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
|
||||
STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
|
||||
STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
|
||||
STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
|
||||
/*** IDirect3DViewport2 methods ***/
|
||||
STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->lpVtbl->AddLight(p, a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->lpVtbl->GetViewport2(p, a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->lpVtbl->SetViewport2(p, a)
|
||||
#else
|
||||
#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IDirect3DViewport2_AddRef(p) (p)->AddRef()
|
||||
#define IDirect3DViewport2_Release(p) (p)->Release()
|
||||
#define IDirect3DViewport2_Initialize(p, a) (p)->Initialize(a)
|
||||
#define IDirect3DViewport2_GetViewport(p, a) (p)->GetViewport(a)
|
||||
#define IDirect3DViewport2_SetViewport(p, a) (p)->SetViewport(a)
|
||||
#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
|
||||
#define IDirect3DViewport2_LightElements(p, a, b) (p)->LightElements(a, b)
|
||||
#define IDirect3DViewport2_SetBackground(p, a) (p)->SetBackground(a)
|
||||
#define IDirect3DViewport2_GetBackground(p, a, b) (p)->GetBackground(a, b)
|
||||
#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a)
|
||||
#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b)
|
||||
#define IDirect3DViewport2_Clear(p, a, b, c) (p)->Clear(a, b, c)
|
||||
#define IDirect3DViewport2_AddLight(p, a) (p)->AddLight(a)
|
||||
#define IDirect3DViewport2_DeleteLight(p, a) (p)->DeleteLight(a)
|
||||
#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->NextLight(a, b, c)
|
||||
#define IDirect3DViewport2_GetViewport2(p, a) (p)->GetViewport2(a)
|
||||
#define IDirect3DViewport2_SetViewport2(p, a) (p)->SetViewport2(a)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for IDirect3DDevice::NextViewport
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Return the next viewport
|
||||
*/
|
||||
#define D3DNEXT_NEXT 0x00000001l
|
||||
|
||||
/*
|
||||
* Return the first viewport
|
||||
*/
|
||||
#define D3DNEXT_HEAD 0x00000002l
|
||||
|
||||
/*
|
||||
* Return the last viewport
|
||||
*/
|
||||
#define D3DNEXT_TAIL 0x00000004l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Flags for DrawPrimitive/DrawIndexedPrimitive
|
||||
* Also valid for Begin/BeginIndexed
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Wait until the device is ready to draw the primitive
|
||||
* This will cause DP to not return DDERR_WASSTILLDRAWING
|
||||
*/
|
||||
#define D3DDP_WAIT 0x00000001l
|
||||
|
||||
|
||||
/*
|
||||
* Hint that the primitives have been clipped by the application.
|
||||
*/
|
||||
#define D3DDP_DONOTCLIP 0x00000004l
|
||||
|
||||
/*
|
||||
* Hint that the extents need not be updated.
|
||||
*/
|
||||
#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l
|
||||
|
||||
/*
|
||||
* Direct3D Errors
|
||||
* DirectDraw error codes are used when errors not specified here.
|
||||
*/
|
||||
#define D3D_OK DD_OK
|
||||
#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700)
|
||||
#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701)
|
||||
|
||||
/*
|
||||
* An invalid device was requested by the application.
|
||||
*/
|
||||
#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705)
|
||||
#define D3DERR_INITFAILED MAKE_DDHRESULT(706)
|
||||
|
||||
/*
|
||||
* SetRenderTarget attempted on a device that was
|
||||
* QI'd off the render target.
|
||||
*/
|
||||
#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
|
||||
|
||||
#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710)
|
||||
#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711)
|
||||
#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712)
|
||||
#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713)
|
||||
#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714)
|
||||
#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715)
|
||||
|
||||
#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716)
|
||||
#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717)
|
||||
|
||||
#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720)
|
||||
#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721)
|
||||
#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722)
|
||||
#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723)
|
||||
#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724)
|
||||
#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725)
|
||||
#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726)
|
||||
#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727)
|
||||
#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728)
|
||||
#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729)
|
||||
|
||||
#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
|
||||
#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731)
|
||||
#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732)
|
||||
#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733)
|
||||
#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734)
|
||||
|
||||
#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735)
|
||||
#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736)
|
||||
#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737)
|
||||
#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738)
|
||||
#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739)
|
||||
|
||||
#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740)
|
||||
#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741)
|
||||
#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742)
|
||||
#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743)
|
||||
#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744)
|
||||
|
||||
#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
|
||||
#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746)
|
||||
#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747)
|
||||
|
||||
#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750)
|
||||
#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751)
|
||||
#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752)
|
||||
|
||||
#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760)
|
||||
#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761)
|
||||
#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762)
|
||||
#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763)
|
||||
|
||||
#define D3DERR_INBEGIN MAKE_DDHRESULT(770)
|
||||
#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771)
|
||||
#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772)
|
||||
#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773)
|
||||
#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774)
|
||||
#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3D_H_ */
|
||||
@@ -1,313 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3dcaps.h
|
||||
* Content: Direct3D capabilities include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3DCAPS_H
|
||||
#define _D3DCAPS_H
|
||||
|
||||
/*
|
||||
* Pull in DirectDraw include file automatically:
|
||||
*/
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
/* Description of capabilities of transform */
|
||||
|
||||
typedef struct _D3DTRANSFORMCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps;
|
||||
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
|
||||
|
||||
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
|
||||
|
||||
/* Description of capabilities of lighting */
|
||||
|
||||
typedef struct _D3DLIGHTINGCAPS {
|
||||
DWORD dwSize;
|
||||
DWORD dwCaps; /* Lighting caps */
|
||||
DWORD dwLightingModel; /* Lighting model - RGB or mono */
|
||||
DWORD dwNumLights; /* Number of lights that can be handled */
|
||||
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
|
||||
|
||||
#define D3DLIGHTINGMODEL_RGB 0x00000001L
|
||||
#define D3DLIGHTINGMODEL_MONO 0x00000002L
|
||||
|
||||
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
|
||||
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
|
||||
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
|
||||
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
|
||||
|
||||
/* Description of capabilities for each primitive type */
|
||||
|
||||
typedef struct _D3DPrimCaps {
|
||||
DWORD dwSize;
|
||||
DWORD dwMiscCaps; /* Capability flags */
|
||||
DWORD dwRasterCaps;
|
||||
DWORD dwZCmpCaps;
|
||||
DWORD dwSrcBlendCaps;
|
||||
DWORD dwDestBlendCaps;
|
||||
DWORD dwAlphaCmpCaps;
|
||||
DWORD dwShadeCaps;
|
||||
DWORD dwTextureCaps;
|
||||
DWORD dwTextureFilterCaps;
|
||||
DWORD dwTextureBlendCaps;
|
||||
DWORD dwTextureAddressCaps;
|
||||
DWORD dwStippleWidth; /* maximum width and height of */
|
||||
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
|
||||
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
|
||||
|
||||
/* D3DPRIMCAPS dwMiscCaps */
|
||||
|
||||
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
|
||||
#define D3DPMISCCAPS_MASKZ 0x00000002L
|
||||
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
|
||||
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
|
||||
#define D3DPMISCCAPS_CULLNONE 0x00000010L
|
||||
#define D3DPMISCCAPS_CULLCW 0x00000020L
|
||||
#define D3DPMISCCAPS_CULLCCW 0x00000040L
|
||||
|
||||
/* D3DPRIMCAPS dwRasterCaps */
|
||||
|
||||
#define D3DPRASTERCAPS_DITHER 0x00000001L
|
||||
#define D3DPRASTERCAPS_ROP2 0x00000002L
|
||||
#define D3DPRASTERCAPS_XOR 0x00000004L
|
||||
#define D3DPRASTERCAPS_PAT 0x00000008L
|
||||
#define D3DPRASTERCAPS_ZTEST 0x00000010L
|
||||
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
|
||||
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
|
||||
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
|
||||
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
|
||||
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
|
||||
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
|
||||
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
|
||||
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
|
||||
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
|
||||
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
|
||||
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
|
||||
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
|
||||
|
||||
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
|
||||
|
||||
#define D3DPCMPCAPS_NEVER 0x00000001L
|
||||
#define D3DPCMPCAPS_LESS 0x00000002L
|
||||
#define D3DPCMPCAPS_EQUAL 0x00000004L
|
||||
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
|
||||
#define D3DPCMPCAPS_GREATER 0x00000010L
|
||||
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
|
||||
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
|
||||
#define D3DPCMPCAPS_ALWAYS 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
|
||||
|
||||
#define D3DPBLENDCAPS_ZERO 0x00000001L
|
||||
#define D3DPBLENDCAPS_ONE 0x00000002L
|
||||
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
|
||||
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
|
||||
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
|
||||
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
|
||||
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
|
||||
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
|
||||
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
|
||||
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
|
||||
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
|
||||
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
|
||||
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
|
||||
|
||||
/* D3DPRIMCAPS dwShadeCaps */
|
||||
|
||||
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
|
||||
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
|
||||
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
|
||||
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
|
||||
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
|
||||
|
||||
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
|
||||
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
|
||||
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
|
||||
|
||||
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
|
||||
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
|
||||
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
|
||||
|
||||
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
|
||||
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
|
||||
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureCaps */
|
||||
|
||||
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
|
||||
#define D3DPTEXTURECAPS_POW2 0x00000002L
|
||||
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
|
||||
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
|
||||
#define D3DPTEXTURECAPS_BORDER 0x00000010L
|
||||
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureFilterCaps */
|
||||
|
||||
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
|
||||
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
|
||||
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
|
||||
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
|
||||
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureBlendCaps */
|
||||
|
||||
#define D3DPTBLENDCAPS_DECAL 0x00000001L
|
||||
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
|
||||
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
|
||||
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
|
||||
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
|
||||
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
|
||||
#define D3DPTBLENDCAPS_COPY 0x00000040L
|
||||
#define D3DPTBLENDCAPS_ADD 0x00000080L
|
||||
|
||||
/* D3DPRIMCAPS dwTextureAddressCaps */
|
||||
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
|
||||
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
|
||||
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
|
||||
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
|
||||
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
|
||||
|
||||
/*
|
||||
* Description for a device.
|
||||
* This is used to describe a device that is to be created or to query
|
||||
* the current device.
|
||||
*/
|
||||
typedef struct _D3DDeviceDesc {
|
||||
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
|
||||
DWORD dwFlags; /* Indicates which fields have valid data */
|
||||
D3DCOLORMODEL dcmColorModel; /* Color model of device */
|
||||
DWORD dwDevCaps; /* Capabilities of device */
|
||||
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
|
||||
BOOL bClipping; /* Device can do 3D clipping */
|
||||
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
|
||||
D3DPRIMCAPS dpcLineCaps;
|
||||
D3DPRIMCAPS dpcTriCaps;
|
||||
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
|
||||
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
|
||||
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
|
||||
DWORD dwMaxVertexCount; /* Maximum vertex count */
|
||||
// *** New fields for DX5 *** //
|
||||
|
||||
// Width and height caps are 0 for legacy HALs.
|
||||
DWORD dwMinTextureWidth, dwMinTextureHeight;
|
||||
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
|
||||
DWORD dwMinStippleWidth, dwMaxStippleWidth;
|
||||
DWORD dwMinStippleHeight, dwMaxStippleHeight;
|
||||
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
|
||||
|
||||
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
|
||||
|
||||
typedef HRESULT (FAR PASCAL * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
|
||||
|
||||
/* D3DDEVICEDESC dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
|
||||
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
|
||||
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
|
||||
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
|
||||
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
|
||||
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
|
||||
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
|
||||
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
|
||||
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
|
||||
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
|
||||
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
|
||||
|
||||
/* D3DDEVICEDESC dwDevCaps flags */
|
||||
|
||||
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
|
||||
/* for post-transform vertex data */
|
||||
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z*/
|
||||
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z*/
|
||||
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
|
||||
|
||||
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
|
||||
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
|
||||
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
|
||||
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
|
||||
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
|
||||
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
|
||||
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
|
||||
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
|
||||
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
|
||||
|
||||
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
|
||||
#define D3DFDS_GUID 0x00000002L /* Match guid */
|
||||
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
|
||||
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
|
||||
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
|
||||
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
|
||||
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
|
||||
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
|
||||
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
|
||||
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
|
||||
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
|
||||
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
|
||||
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
|
||||
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
|
||||
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
|
||||
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
|
||||
|
||||
/*
|
||||
* FindDevice arguments
|
||||
*/
|
||||
typedef struct _D3DFINDDEVICESEARCH {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
BOOL bHardware;
|
||||
D3DCOLORMODEL dcmColorModel;
|
||||
GUID guid;
|
||||
DWORD dwCaps;
|
||||
D3DPRIMCAPS dpcPrimCaps;
|
||||
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
|
||||
|
||||
typedef struct _D3DFINDDEVICERESULT {
|
||||
DWORD dwSize;
|
||||
GUID guid; /* guid which matched */
|
||||
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
|
||||
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
|
||||
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
|
||||
|
||||
|
||||
/*
|
||||
* Description of execute buffer.
|
||||
*/
|
||||
typedef struct _D3DExecuteBufferDesc {
|
||||
DWORD dwSize; /* size of this structure */
|
||||
DWORD dwFlags; /* flags indicating which fields are valid */
|
||||
DWORD dwCaps; /* capabilities of execute buffer */
|
||||
DWORD dwBufferSize; /* size of execute buffer data */
|
||||
LPVOID lpData; /* pointer to actual data */
|
||||
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
|
||||
|
||||
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
|
||||
|
||||
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
|
||||
#define D3DDEB_CAPS 0x00000002l /* caps valid */
|
||||
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
|
||||
|
||||
/* D3DEXECUTEBUFFER dwCaps */
|
||||
|
||||
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
|
||||
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
|
||||
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* _D3DCAPS_H_ */
|
||||
@@ -1,793 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3di.h
|
||||
* Content: Direct3D internal include file
|
||||
*@@BEGIN_MSINTERNAL
|
||||
*
|
||||
* $Id: vd3di.h,v 2.2 2002-08-01 01:41:04 penguin Exp $
|
||||
*
|
||||
* History:
|
||||
* Date By Reason
|
||||
* ==== == ======
|
||||
* 05/11/95 stevela Initial rev with this header.
|
||||
* 11/11/95 stevela Light code changed.
|
||||
* 21/11/95 colinmc Made Direct3D aggregatable
|
||||
* (so it can be QI'd off DirectDraw).
|
||||
* 23/11/95 colinmc Made Direct3D textures and devices aggregatable
|
||||
* (QI'd off DirectDrawSurfaces).
|
||||
* 07/12/95 stevela Merged in Colin's changes.
|
||||
* 10/12/95 stevela Removed AGGREGATE_D3D.
|
||||
* Removed Validate macros from here. Now in d3dpr.h
|
||||
* 02/03/96 colinmc Minor build fix
|
||||
* 17/04/96 stevela Use ddraw.h externally and ddrawp.h internally
|
||||
*@@END_MSINTERNAL
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _D3DI_H
|
||||
#define _D3DI_H
|
||||
|
||||
//@@BEGIN_MSINTERNAL
|
||||
#include "vddrawp.h"
|
||||
#if 0
|
||||
//@@END_MSINTERNAL
|
||||
#include "directx/vddraw.h"
|
||||
//@@BEGIN_MSINTERNAL
|
||||
#endif
|
||||
//@@END_MSINTERNAL
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
// @@BEGIN_MSINTERNAL
|
||||
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
|
||||
#include "vddrawi.h"
|
||||
|
||||
#include "rlreg.h"
|
||||
#include "lists.h"
|
||||
#include "object/object.h"
|
||||
|
||||
|
||||
/*
|
||||
INDEX_BATCH_SCALE is the constant which is used by DrawIndexedPrim
|
||||
to deterimine if the number of primitives being drawn is small
|
||||
relative to the number of vertices being passed. If it is then
|
||||
the prims are dereferenced in batches and sent to DrawPrim.
|
||||
*/
|
||||
#define INDEX_BATCH_SCALE 2
|
||||
|
||||
/*
|
||||
typedef D3DCOLORMODEL D3DCOLORMODEL;
|
||||
|
||||
#define D3DCOLOR_RAMP D3DCOLOR_RAMP
|
||||
#define D3DCOLOR_RGB D3DCOLOR_RGB
|
||||
#define D3D_COLORMODEL D3D_COLORMODEL
|
||||
*/
|
||||
#endif /* !BUILD_RLAPI */
|
||||
// @@END_MSINTERNAL
|
||||
|
||||
typedef DWORD D3DI_BUFFERHANDLE, *LPD3DI_BUFFERHANDLE;
|
||||
|
||||
/*
|
||||
* Internal version of executedata
|
||||
*/
|
||||
typedef struct _D3DI_ExecuteData {
|
||||
DWORD dwSize;
|
||||
D3DI_BUFFERHANDLE dwHandle; /* Handle allocated by driver */
|
||||
DWORD dwVertexOffset;
|
||||
DWORD dwVertexCount;
|
||||
DWORD dwInstructionOffset;
|
||||
DWORD dwInstructionLength;
|
||||
DWORD dwHVertexOffset;
|
||||
D3DSTATUS dsStatus; /* Status after execute */
|
||||
} D3DI_EXECUTEDATA, *LPD3DI_EXECUTEDATA;
|
||||
|
||||
/*
|
||||
* Internal version of lightdata and constants for flags
|
||||
*/
|
||||
|
||||
#define D3DLIGHTI_ATT0_IS_NONZERO (0x00010000)
|
||||
#define D3DLIGHTI_ATT1_IS_NONZERO (0x00020000)
|
||||
#define D3DLIGHTI_ATT2_IS_NONZERO (0x00040000)
|
||||
#define D3DLIGHTI_LINEAR_FALLOFF (0x00080000)
|
||||
#define D3DLIGHTI_UNIT_SCALE (0x00100000)
|
||||
#define D3DLIGHTI_LIGHT_AT_EYE (0x00200000)
|
||||
|
||||
typedef struct _D3DI_LIGHT {
|
||||
D3DLIGHTTYPE type;
|
||||
DWORD version; /* matches number on D3DLIGHT struct */
|
||||
BOOL valid;
|
||||
D3DVALUE red, green, blue, shade;
|
||||
D3DVECTOR position;
|
||||
D3DVECTOR model_position;
|
||||
D3DVECTOR direction;
|
||||
D3DVECTOR model_direction;
|
||||
D3DVECTOR halfway;
|
||||
D3DVECTOR model_eye; /* direction from eye in model space */
|
||||
D3DVECTOR model_scale; /* model scale for proper range computations */
|
||||
D3DVALUE range;
|
||||
D3DVALUE range_squared;
|
||||
D3DVALUE falloff;
|
||||
D3DVALUE attenuation0;
|
||||
D3DVALUE attenuation1;
|
||||
D3DVALUE attenuation2;
|
||||
D3DVALUE cos_theta_by_2;
|
||||
D3DVALUE cos_phi_by_2;
|
||||
DWORD flags;
|
||||
} D3DI_LIGHT, *LPD3DI_LIGHT;
|
||||
|
||||
// @@BEGIN_MSINTERNAL
|
||||
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
|
||||
#ifndef BUILD_HEL
|
||||
#ifdef BUILD_D3D_LAYER
|
||||
#include "driver.h"
|
||||
#endif
|
||||
|
||||
typedef struct IUnknownVtbl D3DUNKNOWNCALLBACKS, *LPD3DUNKNOWNCALLBACKS;
|
||||
typedef struct ID3DObjectVtbl D3DOBJECTVTBL, *LPD3DOBJECTVTBL;
|
||||
typedef struct IDirect3DVtbl DIRECT3DCALLBACKS, *LPDIRECT3DCALLBACKS;
|
||||
typedef struct IDirect3D2Vtbl DIRECT3D2CALLBACKS, *LPDIRECT3D2CALLBACKS;
|
||||
typedef struct IDirect3DDeviceVtbl DIRECT3DDEVICECALLBACKS, *LPDIRECT3DDEVICECALLBACKS;
|
||||
typedef struct IDirect3DDevice2Vtbl DIRECT3DDEVICE2CALLBACKS, *LPDIRECT3DDEVICE2CALLBACKS;
|
||||
typedef struct IDirect3DExecuteBufferVtbl DIRECT3DEXECUTEBUFFERCALLBACKS, *LPDIRECT3DEXECUTEBUFFERCALLBACKS;
|
||||
typedef struct IDirect3DLightVtbl DIRECT3DLIGHTCALLBACKS, *LPDIRECT3DLIGHTCALLBACKS;
|
||||
typedef struct IDirect3DMaterialVtbl DIRECT3DMATERIALCALLBACKS, *LPDIRECT3DMATERIALCALLBACKS;
|
||||
typedef struct IDirect3DMaterial2Vtbl DIRECT3DMATERIAL2CALLBACKS, *LPDIRECT3DMATERIAL2CALLBACKS;
|
||||
typedef struct IDirect3DTextureVtbl DIRECT3DTEXTURECALLBACKS, *LPDIRECT3DTEXTURECALLBACKS;
|
||||
typedef struct IDirect3DTexture2Vtbl DIRECT3DTEXTURE2CALLBACKS, *LPDIRECT3DTEXTURE2CALLBACKS;
|
||||
typedef struct IDirect3DViewport2Vtbl DIRECT3DVIEWPORT2CALLBACKS, *LPDIRECT3DVIEWPORT2CALLBACKS;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _DIRECT3DI *LPDIRECT3DI;
|
||||
typedef struct _DIRECT3DDEVICEI *LPDIRECT3DDEVICEI;
|
||||
typedef struct _DIRECT3DEXECUTEBUFFERI *LPDIRECT3DEXECUTEBUFFERI;
|
||||
typedef struct _DIRECT3DLIGHTI *LPDIRECT3DLIGHTI;
|
||||
typedef struct _DIRECT3DMATERIALI *LPDIRECT3DMATERIALI;
|
||||
typedef struct _DIRECT3DTEXTUREI *LPDIRECT3DTEXTUREI;
|
||||
typedef struct _DIRECT3DVIEWPORTI *LPDIRECT3DVIEWPORTI;
|
||||
|
||||
/*
|
||||
* If we have an aggregate Direct3D we need a structure to
|
||||
* represent an interface distinct from the underlying
|
||||
* object. This is that structure. None of this would be necessary
|
||||
* in C++
|
||||
*/
|
||||
typedef struct _DIRECT3DUNKNOWNI
|
||||
{
|
||||
LPD3DUNKNOWNCALLBACKS lpVtbl;
|
||||
LPDIRECT3DI lpObj;
|
||||
} DIRECT3DUNKNOWNI;
|
||||
typedef struct _DIRECT3DUNKNOWNI *LPDIRECT3DUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DOLDI
|
||||
{
|
||||
LPDIRECT3DCALLBACKS lpVtbl;
|
||||
LPDIRECT3DI lpObj;
|
||||
} DIRECT3DOLDI;
|
||||
typedef struct _DIRECT3DOLDI *LPDIRECT3DOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3D object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3D2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count object */
|
||||
|
||||
/*** Object Relations ***/
|
||||
/* Devices */
|
||||
int numDevs;/* Number of devices */
|
||||
LIST_ROOT(_devices, _DIRECT3DDEVICEI) devices;
|
||||
/* Associated IDirect3DDevices */
|
||||
|
||||
/* Viewports */
|
||||
int numViewports; /* Number of viewports */
|
||||
LIST_ROOT(_viewports, _DIRECT3DVIEWPORTI) viewports;
|
||||
/* Created IDirect3DViewports */
|
||||
|
||||
/* Lights */
|
||||
int numLights; /* Number of lights */
|
||||
LIST_ROOT(_lights, _DIRECT3DLIGHTI) lights;
|
||||
/* Created IDirect3DLights */
|
||||
|
||||
/* Materials */
|
||||
int numMaterials; /* Number of materials */
|
||||
LIST_ROOT(_materials, _DIRECT3DMATERIALI) materials;
|
||||
/* Created IDirect3DMaterials */
|
||||
|
||||
/*** Object Data ***/
|
||||
unsigned long v_next; /* id of next viewport to be created */
|
||||
RLDDIRegistry* lpReg; /* Registry */
|
||||
|
||||
/*
|
||||
* DirectDraw Interface
|
||||
*/
|
||||
LPDDRAWI_DIRECTDRAW_INT lpDDInt;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DOLDI lpThisIDirect3D; /* Our IDirect3D interface */
|
||||
|
||||
DWORD dwVersion; /* 1 for legacy D3D, 2 for D3D2 */
|
||||
} DIRECT3DI;
|
||||
|
||||
/*
|
||||
* If we have an aggreate Direct3DDevice we need a structure to
|
||||
* represent an interface distinct from the underlying
|
||||
* object. This is that structure.
|
||||
*/
|
||||
typedef struct _DIRECT3DDEVICEUNKNOWNI
|
||||
{
|
||||
LPDIRECT3DDEVICE2CALLBACKS lpVtbl;
|
||||
LPDIRECT3DDEVICEI lpObj;
|
||||
} DIRECT3DDEVICEUNKNOWNI;
|
||||
typedef struct _DIRECT3DDEVICEUNKNOWNI *LPDIRECT3DDEVICEUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DDEVICEOLDI
|
||||
{
|
||||
LPDIRECT3DDEVICECALLBACKS lpVtbl;
|
||||
LPDIRECT3DDEVICEI lpObj;
|
||||
} DIRECT3DDEVICEOLDI;
|
||||
typedef struct _DIRECT3DDEVICEOLDI *LPDIRECT3DDEVICEOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DDevice object; it has data after the vtable
|
||||
*/
|
||||
|
||||
#include "vd3dhal.h"
|
||||
|
||||
typedef RLDDIDriver* (*RLDDIDDrawCreateDriverFn)(
|
||||
LPDDRAWI_DIRECTDRAW_INT lpDDInt,
|
||||
LPDIRECTDRAWSURFACE lpDDS,
|
||||
LPDIRECTDRAWSURFACE lpZ,
|
||||
LPDIRECTDRAWPALETTE lpPal,
|
||||
LPDIRECT3DDEVICEI);
|
||||
|
||||
typedef HRESULT (*RLDDIGetCapsFn)(LPD3DDEVICEDESC*, LPD3DDEVICEDESC*);
|
||||
typedef void (*RLDDIInitFn)(RLDDIMallocFn, RLDDIReallocFn, RLDDIFreeFn, RLDDIRaiseFn, RLDDIValue**, int, int);
|
||||
typedef void (*RLDDIPushDriverFn)(RLDDIDriverStack*, RLDDIDriver*);
|
||||
typedef void (*RLDDIPopDriverFn)(RLDDIDriverStack*);
|
||||
|
||||
struct _RLDDIGenRasDriver;
|
||||
typedef struct _RLDDIGenRasDriver* LPRLDDIGENRASDRIVER;
|
||||
struct _RLDDIDDrawDriver;
|
||||
typedef struct _RLDDIDDrawDriver* LPRLDDIDDRAWDRIVER;
|
||||
|
||||
struct _RLDDITransformDriver;
|
||||
typedef struct _RLDDITransformDriver* LPRLDDITRANSFORMDRIVER;
|
||||
|
||||
typedef HRESULT (*PFNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver);
|
||||
typedef void (*PFNUNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver);
|
||||
typedef int (*PFNSETFILLPARAMS)(LPRLDDIGENRASDRIVER driver, D3DSTATE* in_params,
|
||||
int count);
|
||||
typedef HRESULT (*PFNREALLOCALIGNED)(void** p_inout, size_t size);
|
||||
typedef HRESULT (*PFNMALLOCALIGNED)(void** p_inout, size_t size);
|
||||
typedef HRESULT (*PFNFREEALIGNED)(void* p_inout);
|
||||
typedef HRESULT (*PFNDRVSETRENDERTARGET)(LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE,
|
||||
LPDIRECTDRAWPALETTE, LPDIRECT3DDEVICEI);
|
||||
typedef HRESULT (*PFNDOFLUSHBEGINEND)(LPDIRECT3DDEVICE2, DWORD);
|
||||
typedef HRESULT (*PFNDRAWPRIMITIVES)(LPDIRECT3DDEVICEI, LPD3DTLVERTEX, LPVOID, LPD3DINSTRUCTION, DWORD);
|
||||
|
||||
|
||||
typedef struct _D3DI_TEXTUREBLOCK
|
||||
{
|
||||
LIST_MEMBER(_D3DI_TEXTUREBLOCK) list;
|
||||
/* Next block in IDirect3DTexture */
|
||||
LIST_MEMBER(_D3DI_TEXTUREBLOCK) devList;
|
||||
/* Next block in IDirect3DDevice */
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI;
|
||||
LPDIRECT3DTEXTUREI lpD3DTextureI;
|
||||
D3DTEXTUREHANDLE hTex;
|
||||
/* texture handle */
|
||||
} D3DI_TEXTUREBLOCK;
|
||||
typedef struct _D3DI_TEXTUREBLOCK *LPD3DI_TEXTUREBLOCK;
|
||||
|
||||
typedef struct _D3DI_MATERIALBLOCK
|
||||
{
|
||||
LIST_MEMBER(_D3DI_MATERIALBLOCK) list;
|
||||
/* Next block in IDirect3DMaterial */
|
||||
LIST_MEMBER(_D3DI_MATERIALBLOCK) devList;
|
||||
/* Next block in IDirect3DDevice */
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI;
|
||||
LPDIRECT3DMATERIALI lpD3DMaterialI;
|
||||
D3DMATERIALHANDLE hMat;
|
||||
/* material handle */
|
||||
} D3DI_MATERIALBLOCK;
|
||||
typedef struct _D3DI_MATERIALBLOCK *LPD3DI_MATERIALBLOCK;
|
||||
|
||||
#define D3D_RSTATEBUF_SIZE 128
|
||||
#define D3D_MAX_RSTATES 96 /* Last render state ID + 1 */
|
||||
#define D3D_MAX_MMX_VERTICES 1024
|
||||
|
||||
extern DWORD dwD3DTriBatchSize, dwTriBatchSize, dwLineBatchSize;
|
||||
extern DWORD dwHWBufferSize, dwHWMaxTris;
|
||||
extern DWORD dwHWFewVertices;
|
||||
|
||||
typedef struct _D3DHAL_DRAWPRIMCOUNTS *LPD3DHAL_DRAWPRIMCOUNTS;
|
||||
|
||||
// Legacy HAL batching is done with these structs.
|
||||
typedef struct _D3DI_HWCOUNTS {
|
||||
WORD wNumStateChanges; // Number of state changes batched
|
||||
WORD wNumVertices; // Number of vertices in tri list
|
||||
WORD wNumTriangles; // Number of triangles in tri list
|
||||
} D3DI_HWCOUNTS, *LPD3DI_HWCOUNTS;
|
||||
|
||||
typedef struct _DIRECT3DDEVICEI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DDEVICE2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* parent */
|
||||
LIST_MEMBER(_DIRECT3DDEVICEI)list; /* Next device IDirect3D */
|
||||
|
||||
/* Textures */
|
||||
LIST_ROOT(_textures, _D3DI_TEXTUREBLOCK) texBlocks;
|
||||
/* Ref to created IDirect3DTextures */
|
||||
|
||||
/* Execute buffers */
|
||||
LIST_ROOT(_buffers, _DIRECT3DEXECUTEBUFFERI) buffers;
|
||||
/* Created IDirect3DExecuteBuffers */
|
||||
|
||||
/* Viewports */
|
||||
int numViewports;
|
||||
CIRCLE_QUEUE_ROOT(_dviewports, _DIRECT3DVIEWPORTI) viewports;
|
||||
/* Associated IDirect3DViewports */
|
||||
LPDIRECT3DVIEWPORT2 lpCurrentViewport;
|
||||
|
||||
/* Materials */
|
||||
LIST_ROOT(_dmmaterials, _D3DI_MATERIALBLOCK) matBlocks;
|
||||
/* Ref to associated IDirect3DMaterials */
|
||||
|
||||
/*** Object Data ***/
|
||||
/* Private interfaces */
|
||||
LPD3DOBJECTVTBL lpClassVtbl; /* Private Vtbl */
|
||||
LPD3DOBJECTVTBL lpObjVtbl; /* Private Vtbl */
|
||||
|
||||
LPD3DHAL_CALLBACKS lpD3DHALCallbacks; /* HW specific */
|
||||
LPD3DHAL_GLOBALDRIVERDATA lpD3DHALGlobalDriverData; /* HW specific */
|
||||
|
||||
/* Viewports */
|
||||
unsigned long v_id; /* ID of last viewport rendered */
|
||||
|
||||
/* Lights */
|
||||
int numLights;
|
||||
/* This indicates the maximum number
|
||||
of lights that have been set in
|
||||
the device. */
|
||||
|
||||
/* Device characteristics */
|
||||
int age;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
unsigned long red_mask, green_mask, blue_mask;
|
||||
|
||||
int dither;
|
||||
int ramp_size; /* SW specific */
|
||||
D3DCOLORMODEL color_model;
|
||||
int wireframe_options;
|
||||
D3DTEXTUREFILTER texture_quality;
|
||||
D3DVALUE gamma;
|
||||
unsigned char gamma_table[256];
|
||||
int aspectx, aspecty;
|
||||
D3DVALUE perspective_tolerance;
|
||||
|
||||
/* Library information */
|
||||
#ifdef _WIN32
|
||||
HINSTANCE hDrvDll;
|
||||
char dllname[MAXPATH];
|
||||
char base[256];
|
||||
#endif
|
||||
#ifdef SHLIB
|
||||
void* so;
|
||||
#endif
|
||||
|
||||
/* Are we in a scene? */
|
||||
BOOL bInScene;
|
||||
|
||||
/* Our Device type */
|
||||
GUID guid;
|
||||
|
||||
/* GetCaps function from the library */
|
||||
RLDDIGetCapsFn GetCapsFn;
|
||||
|
||||
/* Functions required to build driver */
|
||||
RLDDIInitFn RLDDIInit;
|
||||
RLDDIPushDriverFn RLDDIPushDriver;
|
||||
RLDDIPopDriverFn RLDDIPopDriver;
|
||||
RLDDIDDrawCreateDriverFn RLDDIDDrawCreateDriver;
|
||||
|
||||
/* Device description */
|
||||
D3DDEVICEDESC d3dHWDevDesc;
|
||||
D3DDEVICEDESC d3dHELDevDesc;
|
||||
|
||||
/* Driver stack */
|
||||
RLDDIDriverStack* stack;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DDEVICEUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DDEVICEOLDI lpThisID3DDev; /* Our IDirect3DDevice interface */
|
||||
|
||||
LPD3DHAL_CALLBACKS2 lpD3DHALCallbacks2; /* HW specific */
|
||||
|
||||
/*
|
||||
* Renderstate cache for DrawPrimitive
|
||||
*/
|
||||
WORD wRStateBufLevel;
|
||||
D3DSTATE renStateBuf[D3D_RSTATEBUF_SIZE];
|
||||
|
||||
/* Pointers to drivers used by DrawPrimitive */
|
||||
LPRLDDIGENRASDRIVER rasDriver; /* SW specific */
|
||||
LPRLDDITRANSFORMDRIVER xfmDriver; /* Assumed to be NULL for HW */
|
||||
LPRLDDIDDRAWDRIVER drawDriver; /* Assumed to be NULL for HW */
|
||||
|
||||
/*
|
||||
* Pointers to functions used by DrawPrim&Begin/End
|
||||
*/
|
||||
|
||||
PFNLOCKTEXTURE pfnLockTexture; /* SW specific */
|
||||
PFNUNLOCKTEXTURE pfnUnlockTexture; /* SW specific */
|
||||
PFNSETFILLPARAMS pfnSetFillParams; /* SW specific */
|
||||
PFNREALLOCALIGNED pfnReallocAligned; /* SW specific */
|
||||
PFNDRVSETRENDERTARGET pfnDrvSetRenderTarget; /* SW specific */
|
||||
HRESULT (*pfnFlushStates)(struct _DIRECT3DDEVICEI*);
|
||||
PFNDOFLUSHBEGINEND pfnDoFlushBeginEnd;
|
||||
PFNDRAWPRIMITIVES pfnDrawPrimitives;
|
||||
|
||||
/* Are we between Begin/End? */
|
||||
BOOL bInBegin;
|
||||
D3DVERTEXTYPE vtVertexType;
|
||||
D3DPRIMITIVETYPE ptPrimitiveType;
|
||||
CRITICAL_SECTION BeginEndCSect;
|
||||
|
||||
// max number of vertices
|
||||
#define BEGIN_DATA_BLOCK_SIZE 256
|
||||
|
||||
LPVOID lpvVertexBatch;
|
||||
WORD *lpIndexBatch;
|
||||
|
||||
// lpvVertexData is non-NULL if we are InBegin and indexed.
|
||||
LPVOID lpvVertexData;
|
||||
DWORD dwNumVertices;
|
||||
DWORD dwMaxVertexCount; // current number of vertices there is space for
|
||||
WORD *lpVertexIndices;
|
||||
DWORD dwNumIndices;
|
||||
DWORD dwMaxIndexCount; // current number of indices there is space for
|
||||
|
||||
DWORD dwFlags;
|
||||
WORD wFlushed;
|
||||
|
||||
/*
|
||||
* DrawPrimitives batching
|
||||
*/
|
||||
|
||||
|
||||
// Buffer to put DrawPrimitives stuff into
|
||||
// Used for both legacy and DrawPrimitive HALs
|
||||
WORD *lpwDPBuffer;
|
||||
WORD *lpwDPBufferAlloced;
|
||||
|
||||
/* Legacy HALs */
|
||||
// pointer to current prim counts struct
|
||||
LPD3DHAL_DRAWPRIMCOUNTS lpDPPrimCounts;
|
||||
|
||||
// Buffer of counts structures that keep track of the
|
||||
// number of render states and vertices buffered
|
||||
LPD3DI_HWCOUNTS lpHWCounts;
|
||||
|
||||
// Buffer of triangle structures.
|
||||
LPD3DTRIANGLE lpHWTris;
|
||||
|
||||
// Buffer of interleaved render states and primitives.
|
||||
LPD3DTLVERTEX lpHWVertices;
|
||||
|
||||
// Byte offset into lpHWVertices. This gets incremented
|
||||
// by 8 when a render state is batched and by 32*dwNumVertices
|
||||
// when a primitive is batched.
|
||||
DWORD dwHWOffset;
|
||||
|
||||
// Max value of dwHWOffset. Used to decide whether to flush.
|
||||
DWORD dwHWMaxOffset;
|
||||
|
||||
// Index into lpHWTris.
|
||||
DWORD dwHWTriIndex;
|
||||
|
||||
// Number of counts structures used so far. This actually
|
||||
// gives the number of primitives batched and the index of
|
||||
// the counts structure to batch render states into.
|
||||
DWORD dwHWNumCounts;
|
||||
|
||||
/* DrawPrimitive-aware HALs */
|
||||
|
||||
// Byte offset into buffer (we are currently
|
||||
// using the device's wTriIndex)
|
||||
DWORD dwDPOffset;
|
||||
|
||||
// Maximum offset. If dwDPOffset exceeds this, it is
|
||||
// time to flush.
|
||||
DWORD dwDPMaxOffset;
|
||||
|
||||
WORD *wTriIndex;
|
||||
|
||||
// buffers for TL and H vertices
|
||||
LPD3DTLVERTEX lpTLVbuf;
|
||||
LPD3DHVERTEX lpHVbuf;
|
||||
DWORD dwVbufSize;
|
||||
|
||||
LPD3DHAL_D3DEXTENDEDCAPS lpD3DExtendedCaps; /* HW specific */
|
||||
|
||||
} DIRECT3DDEVICEI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DExecuteBuffer object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DEXECUTEBUFFERI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DEXECUTEBUFFERCALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DEXECUTEBUFFERI)list;
|
||||
/* Next buffer in IDirect3D */
|
||||
|
||||
/*** Object Data ***/
|
||||
DWORD pid; /* Process locking execute buffer */
|
||||
D3DEXECUTEBUFFERDESC debDesc;
|
||||
/* Description of the buffer */
|
||||
D3DEXECUTEDATA exData; /* Execute Data */
|
||||
BOOL locked; /* Is the buffer locked */
|
||||
|
||||
D3DI_BUFFERHANDLE hBuf;
|
||||
/* Execute buffer handle */
|
||||
} DIRECT3DEXECUTEBUFFERI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DLight object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DLIGHTI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DLIGHTCALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DLIGHTI)list;
|
||||
/* Next light in IDirect3D */
|
||||
|
||||
LPDIRECT3DVIEWPORTI lpD3DViewportI; /* Guardian */
|
||||
CIRCLE_QUEUE_MEMBER(_DIRECT3DLIGHTI)light_list;
|
||||
/* Next light in IDirect3DViewport */
|
||||
|
||||
/*** Object Data ***/
|
||||
D3DLIGHT2 dlLight;/* Data describing light */
|
||||
D3DI_LIGHT diLightData;
|
||||
/* Internal representation of light */
|
||||
} DIRECT3DLIGHTI;
|
||||
|
||||
typedef struct _DIRECT3DMATERIALOLDI
|
||||
{
|
||||
LPDIRECT3DMATERIALCALLBACKS lpVtbl;
|
||||
LPDIRECT3DMATERIALI lpObj;
|
||||
} DIRECT3DMATERIALOLDI, *LPDIRECT3DMATERIALOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DMaterial object;
|
||||
* it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DMATERIALI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DMATERIAL2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations ***/
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
DIRECT3DMATERIALOLDI lpThisID3DMat; /* Our IDirect3DMaterial interface */
|
||||
LIST_MEMBER(_DIRECT3DMATERIALI)list;
|
||||
/* Next MATERIAL in IDirect3D */
|
||||
|
||||
LIST_ROOT(_mblocks, _D3DI_MATERIALBLOCK)blocks;
|
||||
/* devices we're associated with */
|
||||
|
||||
/*** Object Data ***/
|
||||
D3DMATERIAL dmMaterial; /* Data describing material */
|
||||
BOOL bRes; /* Is this material reserved in the driver */
|
||||
} DIRECT3DMATERIALI;
|
||||
|
||||
/*
|
||||
* If we have an aggreate Direct3DTexture we need a structure
|
||||
* to represent an unknown interface distinct from the underlying
|
||||
* object. This is that structure.
|
||||
*/
|
||||
typedef struct _DIRECT3DTEXTUREUNKNOWNI
|
||||
{
|
||||
LPDIRECT3DTEXTURECALLBACKS lpVtbl;
|
||||
LPDIRECT3DTEXTUREI lpObj;
|
||||
} DIRECT3DTEXTUREUNKNOWNI;
|
||||
typedef struct _DIRECT3DTEXTUREUNKNOWNI *LPDIRECT3DTEXTUREUNKNOWNI;
|
||||
|
||||
typedef struct _DIRECT3DTEXTUREOLDI
|
||||
{
|
||||
LPDIRECT3DTEXTURECALLBACKS lpVtbl;
|
||||
LPDIRECT3DTEXTUREI lpObj;
|
||||
} DIRECT3DTEXTUREOLDI, *LPDIRECT3DTEXTUREOLDI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DTexture object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DTEXTUREI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DTEXTURE2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
|
||||
/*** Object Relations ***/
|
||||
LIST_ROOT(_blocks, _D3DI_TEXTUREBLOCK) blocks;
|
||||
/* Devices we're associated with */
|
||||
|
||||
/*** Object Data ***/
|
||||
LPDIRECTDRAWSURFACE lpDDS;
|
||||
|
||||
/*
|
||||
* The special IUnknown interface for the aggregate that does
|
||||
* not punt to the parent object.
|
||||
*/
|
||||
LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */
|
||||
DIRECT3DTEXTUREUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */
|
||||
DIRECT3DTEXTUREOLDI lpThisID3DTex; /* Our IDirect3DTexture interface */
|
||||
BOOL bIsPalettized;
|
||||
|
||||
} DIRECT3DTEXTUREI;
|
||||
|
||||
/*
|
||||
* Internal version of Direct3DViewport object; it has data after the vtable
|
||||
*/
|
||||
typedef struct _DIRECT3DVIEWPORTI
|
||||
{
|
||||
/*** Object Interface ***/
|
||||
LPDIRECT3DVIEWPORT2CALLBACKS lpVtbl; /* Pointer to callbacks */
|
||||
int refCnt; /* Reference count */
|
||||
|
||||
/*** Object Relations */
|
||||
LPDIRECT3DI lpDirect3DI; /* Parent */
|
||||
LIST_MEMBER(_DIRECT3DVIEWPORTI)list;
|
||||
/* Next viewport in IDirect3D */
|
||||
|
||||
LPDIRECT3DDEVICEI lpD3DDeviceI; /* Guardian */
|
||||
CIRCLE_QUEUE_MEMBER(_DIRECT3DVIEWPORTI)vw_list;
|
||||
/* Next viewport in IDirect3DDevice */
|
||||
|
||||
/* Lights */
|
||||
int numLights;
|
||||
CIRCLE_QUEUE_ROOT(_dlights, _DIRECT3DLIGHTI) lights;
|
||||
/* Associated IDirect3DLights */
|
||||
|
||||
/*** Object Data ***/
|
||||
unsigned long v_id; /* Id for this viewport */
|
||||
D3DVIEWPORT2 v_data;
|
||||
BOOL v_data_is_set;
|
||||
|
||||
BOOL have_background;
|
||||
D3DMATERIALHANDLE background;
|
||||
/* Background material */
|
||||
BOOL have_depth;
|
||||
LPDIRECTDRAWSURFACE depth; /* Background depth */
|
||||
|
||||
BOOL bLightsChanged;
|
||||
/* Have the lights changed since they
|
||||
were last collected? */
|
||||
DWORD clrCount; /* Number of rects allocated */
|
||||
LPD3DRECT clrRects; /* Rects used for clearing */
|
||||
} DIRECT3DVIEWPORTI;
|
||||
|
||||
/*
|
||||
* Picking stuff.
|
||||
*/
|
||||
typedef struct _D3DI_PICKDATA {
|
||||
D3DI_EXECUTEDATA* exe;
|
||||
D3DPICKRECORD* records;
|
||||
int pick_count;
|
||||
D3DRECT pick;
|
||||
} D3DI_PICKDATA, *LPD3DI_PICKDATA;
|
||||
|
||||
/*
|
||||
* Direct3D memory allocation
|
||||
*/
|
||||
|
||||
/*
|
||||
* Register a set of functions to be used in place of malloc, realloc
|
||||
* and free for memory allocation. The functions D3DMalloc, D3DRealloc
|
||||
* and D3DFree will use these functions. The default is to use the
|
||||
* ANSI C library routines malloc, realloc and free.
|
||||
*/
|
||||
typedef LPVOID (*D3DMALLOCFUNCTION)(size_t);
|
||||
typedef LPVOID (*D3DREALLOCFUNCTION)(LPVOID, size_t);
|
||||
typedef VOID (*D3DFREEFUNCTION)(LPVOID);
|
||||
|
||||
/*
|
||||
* Allocate size bytes of memory and return a pointer to it in *p_return.
|
||||
* Returns D3DERR_BADALLOC with *p_return unchanged if the allocation fails.
|
||||
*/
|
||||
extern __declspec (dllexport) HRESULT D3DAPI D3DMalloc(LPVOID* p_return, size_t size);
|
||||
|
||||
/*
|
||||
* Change the size of an allocated block of memory. A pointer to the
|
||||
* block is passed in in *p_inout. If *p_inout is NULL then a new
|
||||
* block is allocated. If the reallocation is successful, *p_inout is
|
||||
* changed to point to the new block. If the allocation fails,
|
||||
* *p_inout is unchanged and D3DERR_BADALLOC is returned.
|
||||
*/
|
||||
HRESULT D3DAPI D3DRealloc(LPVOID* p_inout, size_t size);
|
||||
|
||||
/*
|
||||
* Free a block of memory previously allocated with D3DMalloc or
|
||||
* D3DRealloc.
|
||||
*/
|
||||
extern __declspec (dllexport) VOID D3DAPI D3DFree(LPVOID p);
|
||||
|
||||
/*
|
||||
* Used for raising errors from the driver.
|
||||
*/
|
||||
HRESULT D3DAPI D3DRaise(HRESULT);
|
||||
|
||||
/*
|
||||
* Convert RLDDI error codes to D3D error codes
|
||||
*/
|
||||
#define RLDDITOD3DERR(_errcode) (RLDDIToD3DErrors[_errcode])
|
||||
extern HRESULT RLDDIToD3DErrors[];
|
||||
|
||||
/*
|
||||
* maths
|
||||
*/
|
||||
#if 1 /* defined(STACK_CALL) && defined(__WATCOMC__) */
|
||||
D3DVALUE D3DIPow(D3DVALUE, D3DVALUE);
|
||||
#else
|
||||
#define D3DIPow(v,p) DTOVAL(pow(VALTOD(v), VALTOD(p)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Light utils
|
||||
*/
|
||||
void D3DI_DeviceMarkLightEnd(LPDIRECT3DDEVICEI, int);
|
||||
void D3DI_UpdateLightInternal(LPDIRECT3DLIGHTI);
|
||||
void D3DI_VectorNormalise12(LPD3DVECTOR v);
|
||||
D3DTEXTUREHANDLE D3DI_FindTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI);
|
||||
void D3DI_SetTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI, D3DTEXTUREHANDLE);
|
||||
void D3DI_RemoveTextureBlock(LPD3DI_TEXTUREBLOCK);
|
||||
void D3DI_RemoveMaterialBlock(LPD3DI_MATERIALBLOCK);
|
||||
|
||||
extern BOOL D3DI_isHALValid(LPD3DHAL_CALLBACKS);
|
||||
|
||||
#ifdef BUILD_D3D_LAYER
|
||||
extern RLDDIValue* RLDDIFInvSqrtTable;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* BUILD_HEL */
|
||||
#endif /* !BUILD_RLAPI */
|
||||
// @@END_MSINTERNAL
|
||||
|
||||
#endif /* _D3DI_H */
|
||||
@@ -1,229 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRM_H__
|
||||
#define __D3DRM_H__
|
||||
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3drmobj.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
struct IDirect3DRM;
|
||||
#endif
|
||||
|
||||
|
||||
DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
|
||||
WIN_TYPES(IDirect3DRM, DIRECT3DRM);
|
||||
WIN_TYPES(IDirect3DRM2, DIRECT3DRM2);
|
||||
|
||||
|
||||
/* Create a Direct3DRM API */
|
||||
STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRM2
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRM2, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
|
||||
STDMETHOD(CreateObject)
|
||||
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
|
||||
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE;
|
||||
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
|
||||
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
|
||||
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
|
||||
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
|
||||
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
|
||||
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateLightRGB)
|
||||
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
|
||||
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
|
||||
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
/* Create a Windows Device using DirectDraw surfaces */
|
||||
STDMETHOD(CreateDeviceFromSurface)
|
||||
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
|
||||
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
/* Create a Windows Device using D3D objects */
|
||||
STDMETHOD(CreateDeviceFromD3D)
|
||||
( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev,
|
||||
LPDIRECT3DRMDEVICE2 *
|
||||
) PURE;
|
||||
|
||||
STDMETHOD(CreateDeviceFromClipper)
|
||||
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
|
||||
int width, int height, LPDIRECT3DRMDEVICE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(CreateShadow)
|
||||
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
|
||||
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
|
||||
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
|
||||
LPDIRECT3DRMVISUAL *
|
||||
) PURE;
|
||||
STDMETHOD(CreateViewport)
|
||||
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
|
||||
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
|
||||
) PURE;
|
||||
STDMETHOD(CreateWrap)
|
||||
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
|
||||
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
|
||||
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
|
||||
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
|
||||
D3DVALUE ou, D3DVALUE ov,
|
||||
D3DVALUE su, D3DVALUE sv,
|
||||
LPDIRECT3DRMWRAP *
|
||||
) PURE;
|
||||
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
|
||||
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE;
|
||||
|
||||
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
|
||||
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
|
||||
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
|
||||
|
||||
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
|
||||
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
|
||||
|
||||
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
|
||||
|
||||
STDMETHOD(Load)
|
||||
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
|
||||
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
|
||||
LPDIRECT3DRMFRAME
|
||||
) PURE;
|
||||
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
|
||||
|
||||
STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE;
|
||||
};
|
||||
|
||||
#define D3DRM_OK DD_OK
|
||||
#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781)
|
||||
#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782)
|
||||
#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783)
|
||||
#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784)
|
||||
#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785)
|
||||
#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786)
|
||||
#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787)
|
||||
#define D3DRMERR_BADFILE MAKE_DDHRESULT(788)
|
||||
#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789)
|
||||
#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790)
|
||||
#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791)
|
||||
#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792)
|
||||
#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793)
|
||||
#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794)
|
||||
#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795)
|
||||
#define D3DRMERR_PENDING MAKE_DDHRESULT(796)
|
||||
#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797)
|
||||
#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798)
|
||||
#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799)
|
||||
#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800)
|
||||
#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801)
|
||||
#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802)
|
||||
#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803)
|
||||
#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804)
|
||||
#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805)
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _D3DRMAPI_H_ */
|
||||
|
||||
@@ -1,472 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMDEFS_H__
|
||||
#define __D3DRMDEFS_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define D3DRMAPI __stdcall
|
||||
#else
|
||||
#define D3DRMAPI
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
typedef struct _D3DRMVECTOR4D
|
||||
{ D3DVALUE x, y, z, w;
|
||||
} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
|
||||
|
||||
typedef D3DVALUE D3DRMMATRIX4D[4][4];
|
||||
|
||||
typedef struct _D3DRMQUATERNION
|
||||
{ D3DVALUE s;
|
||||
D3DVECTOR v;
|
||||
} D3DRMQUATERNION, *LPD3DRMQUATERNION;
|
||||
|
||||
typedef struct _D3DRMRAY
|
||||
{ D3DVECTOR dvDir;
|
||||
D3DVECTOR dvPos;
|
||||
} D3DRMRAY, *LPD3DRMRAY;
|
||||
|
||||
typedef struct _D3DRMBOX
|
||||
{ D3DVECTOR min, max;
|
||||
} D3DRMBOX, *LPD3DRMBOX;
|
||||
|
||||
typedef void (*D3DRMWRAPCALLBACK)
|
||||
(LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID);
|
||||
|
||||
typedef enum _D3DRMLIGHTTYPE
|
||||
{ D3DRMLIGHT_AMBIENT,
|
||||
D3DRMLIGHT_POINT,
|
||||
D3DRMLIGHT_SPOT,
|
||||
D3DRMLIGHT_DIRECTIONAL,
|
||||
D3DRMLIGHT_PARALLELPOINT
|
||||
} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
|
||||
|
||||
typedef enum _D3DRMSHADEMODE {
|
||||
D3DRMSHADE_FLAT = 0,
|
||||
D3DRMSHADE_GOURAUD = 1,
|
||||
D3DRMSHADE_PHONG = 2,
|
||||
|
||||
D3DRMSHADE_MASK = 7,
|
||||
D3DRMSHADE_MAX = 8
|
||||
} D3DRMSHADEMODE, *LPD3DRMSHADEMODE;
|
||||
|
||||
typedef enum _D3DRMLIGHTMODE {
|
||||
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX,
|
||||
|
||||
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX,
|
||||
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX
|
||||
} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE;
|
||||
|
||||
typedef enum _D3DRMFILLMODE {
|
||||
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX,
|
||||
|
||||
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX,
|
||||
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX
|
||||
} D3DRMFILLMODE, *LPD3DRMFILLMODE;
|
||||
|
||||
typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
|
||||
|
||||
#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
|
||||
#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
|
||||
|
||||
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
|
||||
#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
|
||||
|
||||
typedef enum _D3DRMTEXTUREQUALITY
|
||||
{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */
|
||||
D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */
|
||||
D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */
|
||||
D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */
|
||||
D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */
|
||||
D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */
|
||||
} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
|
||||
|
||||
typedef enum _D3DRMCOMBINETYPE
|
||||
{ D3DRMCOMBINE_REPLACE,
|
||||
D3DRMCOMBINE_BEFORE,
|
||||
D3DRMCOMBINE_AFTER
|
||||
} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
|
||||
|
||||
typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL;
|
||||
|
||||
typedef enum _D3DRMPALETTEFLAGS
|
||||
{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */
|
||||
D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */
|
||||
D3DRMPALETTE_RESERVED /* may not be used by renderer */
|
||||
} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
|
||||
|
||||
typedef struct _D3DRMPALETTEENTRY
|
||||
{ unsigned char red; /* 0 .. 255 */
|
||||
unsigned char green; /* 0 .. 255 */
|
||||
unsigned char blue; /* 0 .. 255 */
|
||||
unsigned char flags; /* one of D3DRMPALETTEFLAGS */
|
||||
} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
|
||||
|
||||
typedef struct _D3DRMIMAGE
|
||||
{ int width, height; /* width and height in pixels */
|
||||
int aspectx, aspecty; /* aspect ratio for non-square pixels */
|
||||
int depth; /* bits per pixel */
|
||||
int rgb; /* if false, pixels are indices into a
|
||||
palette otherwise, pixels encode
|
||||
RGB values. */
|
||||
int bytes_per_line; /* number of bytes of memory for a
|
||||
scanline. This must be a multiple
|
||||
of 4. */
|
||||
void* buffer1; /* memory to render into (first buffer). */
|
||||
void* buffer2; /* second rendering buffer for double
|
||||
buffering, set to NULL for single
|
||||
buffering. */
|
||||
unsigned long red_mask;
|
||||
unsigned long green_mask;
|
||||
unsigned long blue_mask;
|
||||
unsigned long alpha_mask; /* if rgb is true, these are masks for
|
||||
the red, green and blue parts of a
|
||||
pixel. Otherwise, these are masks
|
||||
for the significant bits of the
|
||||
red, green and blue elements in the
|
||||
palette. For instance, most SVGA
|
||||
displays use 64 intensities of red,
|
||||
green and blue, so the masks should
|
||||
all be set to 0xfc. */
|
||||
int palette_size; /* number of entries in palette */
|
||||
D3DRMPALETTEENTRY* palette; /* description of the palette (only if
|
||||
rgb is false). Must be (1<<depth)
|
||||
elements. */
|
||||
} D3DRMIMAGE, *LPD3DRMIMAGE;
|
||||
|
||||
typedef enum _D3DRMWRAPTYPE
|
||||
{ D3DRMWRAP_FLAT,
|
||||
D3DRMWRAP_CYLINDER,
|
||||
D3DRMWRAP_SPHERE,
|
||||
D3DRMWRAP_CHROME
|
||||
} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
|
||||
|
||||
#define D3DRMWIREFRAME_CULL 1 /* cull backfaces */
|
||||
#define D3DRMWIREFRAME_HIDDENLINE 2 /* lines are obscured by closer objects */
|
||||
|
||||
typedef enum _D3DRMPROJECTIONTYPE
|
||||
{ D3DRMPROJECT_PERSPECTIVE,
|
||||
D3DRMPROJECT_ORTHOGRAPHIC,
|
||||
D3DRMPROJECT_RIGHTHANDPERSPECTIVE,
|
||||
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
|
||||
} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
|
||||
|
||||
typedef enum _D3DRMXOFFORMAT
|
||||
{ D3DRMXOF_BINARY,
|
||||
D3DRMXOF_COMPRESSED,
|
||||
D3DRMXOF_TEXT
|
||||
} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
|
||||
|
||||
typedef DWORD D3DRMSAVEOPTIONS;
|
||||
#define D3DRMXOFSAVE_NORMALS 1
|
||||
#define D3DRMXOFSAVE_TEXTURECOORDINATES 2
|
||||
#define D3DRMXOFSAVE_MATERIALS 4
|
||||
#define D3DRMXOFSAVE_TEXTURENAMES 8
|
||||
#define D3DRMXOFSAVE_ALL 15
|
||||
#define D3DRMXOFSAVE_TEMPLATES 16
|
||||
#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
|
||||
|
||||
typedef enum _D3DRMCOLORSOURCE
|
||||
{ D3DRMCOLOR_FROMFACE,
|
||||
D3DRMCOLOR_FROMVERTEX
|
||||
} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
|
||||
|
||||
typedef enum _D3DRMFRAMECONSTRAINT
|
||||
{ D3DRMCONSTRAIN_Z, /* use only X and Y rotations */
|
||||
D3DRMCONSTRAIN_Y, /* use only X and Z rotations */
|
||||
D3DRMCONSTRAIN_X /* use only Y and Z rotations */
|
||||
} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
|
||||
|
||||
typedef enum _D3DRMMATERIALMODE
|
||||
{ D3DRMMATERIAL_FROMMESH,
|
||||
D3DRMMATERIAL_FROMPARENT,
|
||||
D3DRMMATERIAL_FROMFRAME
|
||||
} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
|
||||
|
||||
typedef enum _D3DRMFOGMODE
|
||||
{ D3DRMFOG_LINEAR, /* linear between start and end */
|
||||
D3DRMFOG_EXPONENTIAL, /* density * exp(-distance) */
|
||||
D3DRMFOG_EXPONENTIALSQUARED /* density * exp(-distance*distance) */
|
||||
} D3DRMFOGMODE, *LPD3DRMFOGMODE;
|
||||
|
||||
typedef enum _D3DRMZBUFFERMODE {
|
||||
D3DRMZBUFFER_FROMPARENT, /* default */
|
||||
D3DRMZBUFFER_ENABLE, /* enable zbuffering */
|
||||
D3DRMZBUFFER_DISABLE /* disable zbuffering */
|
||||
} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
|
||||
|
||||
typedef enum _D3DRMSORTMODE {
|
||||
D3DRMSORT_FROMPARENT, /* default */
|
||||
D3DRMSORT_NONE, /* don't sort child frames */
|
||||
D3DRMSORT_FRONTTOBACK, /* sort child frames front-to-back */
|
||||
D3DRMSORT_BACKTOFRONT /* sort child frames back-to-front */
|
||||
} D3DRMSORTMODE, *LPD3DRMSORTMODE;
|
||||
|
||||
/*
|
||||
* Values for flags in Frame2::AddMoveCallback.
|
||||
*/
|
||||
#define D3DRMCALLBACK_PREORDER 0
|
||||
#define D3DRMCALLBACK_POSTORDER 1
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::RayPick.
|
||||
*/
|
||||
#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 1
|
||||
#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 2
|
||||
#define D3DRMRAYPICK_INTERPOLATEUV 4
|
||||
#define D3DRMRAYPICK_INTERPOLATECOLOR 8
|
||||
#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
|
||||
|
||||
/*
|
||||
* Values for flags in MeshBuilder2::GenerateNormals.
|
||||
*/
|
||||
#define D3DRMGENERATENORMALS_PRECOMPACT 1
|
||||
#define D3DRMGENERATENORMALS_USECREASEANGLE 2
|
||||
|
||||
typedef DWORD D3DRMANIMATIONOPTIONS;
|
||||
#define D3DRMANIMATION_OPEN 0x01L
|
||||
#define D3DRMANIMATION_CLOSED 0x02L
|
||||
#define D3DRMANIMATION_LINEARPOSITION 0x04L
|
||||
#define D3DRMANIMATION_SPLINEPOSITION 0x08L
|
||||
#define D3DRMANIMATION_SCALEANDROTATION 0x00000010L
|
||||
#define D3DRMANIMATION_POSITION 0x00000020L
|
||||
|
||||
typedef DWORD D3DRMINTERPOLATIONOPTIONS;
|
||||
#define D3DRMINTERPOLATION_OPEN 0x01L
|
||||
#define D3DRMINTERPOLATION_CLOSED 0x02L
|
||||
#define D3DRMINTERPOLATION_NEAREST 0x0100L
|
||||
#define D3DRMINTERPOLATION_LINEAR 0x04L
|
||||
#define D3DRMINTERPOLATION_SPLINE 0x08L
|
||||
#define D3DRMINTERPOLATION_VERTEXCOLOR 0x40L
|
||||
#define D3DRMINTERPOLATION_SLERPNORMALS 0x80L
|
||||
|
||||
typedef DWORD D3DRMLOADOPTIONS;
|
||||
|
||||
#define D3DRMLOAD_FROMFILE 0x00L
|
||||
#define D3DRMLOAD_FROMRESOURCE 0x01L
|
||||
#define D3DRMLOAD_FROMMEMORY 0x02L
|
||||
#define D3DRMLOAD_FROMSTREAM 0x04L
|
||||
#define D3DRMLOAD_FROMURL 0x08L
|
||||
|
||||
#define D3DRMLOAD_BYNAME 0x10L
|
||||
#define D3DRMLOAD_BYPOSITION 0x20L
|
||||
#define D3DRMLOAD_BYGUID 0x40L
|
||||
#define D3DRMLOAD_FIRST 0x80L
|
||||
|
||||
#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L
|
||||
#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L
|
||||
|
||||
#define D3DRMLOAD_ASYNCHRONOUS 0x400L
|
||||
|
||||
typedef struct _D3DRMLOADRESOURCE {
|
||||
HMODULE hModule;
|
||||
LPCTSTR lpName;
|
||||
LPCTSTR lpType;
|
||||
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
|
||||
|
||||
typedef struct _D3DRMLOADMEMORY {
|
||||
LPVOID lpMemory;
|
||||
DWORD dSize;
|
||||
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
|
||||
|
||||
#define D3DRMPMESHSTATUS_VALID 0x01L
|
||||
#define D3DRMPMESHSTATUS_INTERRUPTED 0x02L
|
||||
#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04L
|
||||
#define D3DRMPMESHSTATUS_COMPLETE 0x08L
|
||||
#define D3DRMPMESHSTATUS_RENDERABLE 0x10L
|
||||
|
||||
#define D3DRMPMESHEVENT_BASEMESH 0x01L
|
||||
#define D3DRMPMESHEVENT_COMPLETE 0x02L
|
||||
|
||||
typedef struct _D3DRMPMESHLOADSTATUS {
|
||||
DWORD dwSize; // Size of this structure
|
||||
DWORD dwPMeshSize; // Total Size (bytes)
|
||||
DWORD dwBaseMeshSize; // Total Size of the Base Mesh
|
||||
DWORD dwBytesLoaded; // Total bytes loaded
|
||||
DWORD dwVerticesLoaded; // Number of vertices loaded
|
||||
DWORD dwFacesLoaded; // Number of faces loaded
|
||||
HRESULT dwLoadResult; // Result of the load operation
|
||||
DWORD dwFlags;
|
||||
} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
|
||||
|
||||
typedef enum _D3DRMUSERVISUALREASON {
|
||||
D3DRMUSERVISUAL_CANSEE,
|
||||
D3DRMUSERVISUAL_RENDER
|
||||
} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
|
||||
|
||||
|
||||
typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2;
|
||||
static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4;
|
||||
|
||||
typedef struct _D3DRMVERTEX
|
||||
{ D3DVECTOR position;
|
||||
D3DVECTOR normal;
|
||||
D3DVALUE tu, tv;
|
||||
D3DCOLOR color;
|
||||
} D3DRMVERTEX, *LPD3DRMVERTEX;
|
||||
|
||||
typedef LONG D3DRMGROUPINDEX; /* group indexes begin a 0 */
|
||||
static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1;
|
||||
|
||||
/*
|
||||
* Create a color from three components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGB(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue);
|
||||
|
||||
/*
|
||||
* Create a color from four components in the range 0-1 inclusive.
|
||||
*/
|
||||
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE red,
|
||||
D3DVALUE green,
|
||||
D3DVALUE blue,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Get the red component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetRed(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the green component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetGreen(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the blue component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetBlue(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Get the alpha component of a color.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMColorGetAlpha(D3DCOLOR);
|
||||
|
||||
/*
|
||||
* Add two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorAdd(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Subtract two vectors. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorSubtract(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Reflect a ray about a given normal. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorReflect(LPD3DVECTOR d,
|
||||
LPD3DVECTOR ray,
|
||||
LPD3DVECTOR norm);
|
||||
|
||||
/*
|
||||
* Calculate the vector cross product. Returns its first argument.
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorCrossProduct(LPD3DVECTOR d,
|
||||
LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
/*
|
||||
* Return the vector dot product.
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorDotProduct(LPD3DVECTOR s1,
|
||||
LPD3DVECTOR s2);
|
||||
|
||||
/*
|
||||
* Scale a vector so that its modulus is 1. Returns its argument or
|
||||
* NULL if there was an error (e.g. a zero vector was passed).
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorNormalize(LPD3DVECTOR);
|
||||
#define D3DRMVectorNormalise D3DRMVectorNormalize
|
||||
|
||||
/*
|
||||
* Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
|
||||
*/
|
||||
extern D3DVALUE D3DRMAPI D3DRMVectorModulus(LPD3DVECTOR v);
|
||||
|
||||
/*
|
||||
* Set the rotation part of a matrix to be a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR axis, D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Scale a vector uniformly in all three axes
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor);
|
||||
|
||||
/*
|
||||
* Return a random unit vector
|
||||
*/
|
||||
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d);
|
||||
|
||||
/*
|
||||
* Returns a unit quaternion that represents a rotation of theta radians
|
||||
* around the given axis.
|
||||
*/
|
||||
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION quat,
|
||||
LPD3DVECTOR v,
|
||||
D3DVALUE theta);
|
||||
|
||||
/*
|
||||
* Calculate the product of two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b);
|
||||
|
||||
/*
|
||||
* Interpolate between two quaternions
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q,
|
||||
LPD3DRMQUATERNION a,
|
||||
LPD3DRMQUATERNION b,
|
||||
D3DVALUE alpha);
|
||||
|
||||
/*
|
||||
* Calculate the matrix for the rotation that a unit quaternion represents
|
||||
*/
|
||||
extern void D3DRMAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D dmMat, LPD3DRMQUATERNION lpDqQuat);
|
||||
|
||||
/*
|
||||
* Calculate the quaternion that corresponds to a rotation matrix
|
||||
*/
|
||||
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromMatrix(LPD3DRMQUATERNION, D3DRMMATRIX4D);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,51 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3drm.h
|
||||
* Content: Direct3DRM include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __D3DRMWIN_H__
|
||||
#define __D3DRMWIN_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "directx/vd3drm.h"
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
/*
|
||||
* GUIDS used by Direct3DRM Windows interface
|
||||
*/
|
||||
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
|
||||
|
||||
WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirect3DRMWinDevice
|
||||
|
||||
DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECT3DRMOBJECT_METHODS(PURE);
|
||||
|
||||
/*
|
||||
* IDirect3DRMWinDevice methods
|
||||
*/
|
||||
|
||||
/* Repaint the window with the last frame which was rendered. */
|
||||
STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE;
|
||||
|
||||
/* Respond to a WM_ACTIVATE message. */
|
||||
STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -305,6 +305,14 @@ typedef struct _D3DTLVERTEX {
|
||||
D3DVALUE tv;
|
||||
D3DVALUE dvTV;
|
||||
};
|
||||
union {
|
||||
D3DVALUE env_u; /* Texture coordinates */
|
||||
D3DVALUE dvenv_U;
|
||||
};
|
||||
union {
|
||||
D3DVALUE env_v;
|
||||
D3DVALUE dvenv_V;
|
||||
};
|
||||
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
||||
_D3DTLVERTEX() { }
|
||||
_D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
|
||||
@@ -320,6 +328,7 @@ typedef struct _D3DTLVERTEX {
|
||||
/*
|
||||
* Untransformed/lit vertices
|
||||
*/
|
||||
//(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1)
|
||||
typedef struct _D3DLVERTEX {
|
||||
union {
|
||||
D3DVALUE x; /* Homogeneous coordinates */
|
||||
@@ -399,12 +408,21 @@ typedef struct _D3DVERTEX {
|
||||
D3DVALUE tv;
|
||||
D3DVALUE dvTV;
|
||||
};
|
||||
union {
|
||||
D3DVALUE tu2; /* Texture coordinates */
|
||||
D3DVALUE dvTU2;
|
||||
};
|
||||
union {
|
||||
D3DVALUE tv2;
|
||||
D3DVALUE dvTV2;
|
||||
};
|
||||
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
|
||||
_D3DVERTEX() { }
|
||||
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
|
||||
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv, float _tu2=_tu, float _tv2=_tv)
|
||||
{ x = v.x; y = v.y; z = v.z;
|
||||
nx = n.x; ny = n.y; nz = n.z;
|
||||
tu = _tu; tv = _tv;
|
||||
tu2 = _tu2; tv2 = _tv2;
|
||||
}
|
||||
#endif
|
||||
} D3DVERTEX, *LPD3DVERTEX;
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
|
||||
/******************************************************************
|
||||
* *
|
||||
* D3DVec.inl *
|
||||
* *
|
||||
* Float-valued 3D vector class for Direct3D. *
|
||||
* *
|
||||
* Copyright (c) 1996-1997 Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
******************************************************************/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// =====================================
|
||||
// Constructors
|
||||
// =====================================
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE f)
|
||||
{
|
||||
x = y = z = f;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
|
||||
{
|
||||
x = _x; y = _y; z = _z;
|
||||
}
|
||||
|
||||
inline
|
||||
_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3])
|
||||
{
|
||||
x = f[0]; y = f[1]; z = f[2];
|
||||
}
|
||||
|
||||
// =====================================
|
||||
// Access grants
|
||||
// =====================================
|
||||
|
||||
inline const D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i) const
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
inline D3DVALUE&
|
||||
_D3DVECTOR::operator[](int i)
|
||||
{
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
||||
// =====================================
|
||||
// Assignment operators
|
||||
// =====================================
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator += (const _D3DVECTOR& v)
|
||||
{
|
||||
x += v.x; y += v.y; z += v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator -= (const _D3DVECTOR& v)
|
||||
{
|
||||
x -= v.x; y -= v.y; z -= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (const _D3DVECTOR& v)
|
||||
{
|
||||
x *= v.x; y *= v.y; z *= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (const _D3DVECTOR& v)
|
||||
{
|
||||
x /= v.x; y /= v.y; z /= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator *= (D3DVALUE s)
|
||||
{
|
||||
x *= s; y *= s; z *= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR&
|
||||
_D3DVECTOR::operator /= (D3DVALUE s)
|
||||
{
|
||||
x /= s; y /= s; z /= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(-v.x, -v.y, -v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2];
|
||||
}
|
||||
|
||||
inline int
|
||||
operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2];
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator * (D3DVALUE s, const _D3DVECTOR& v)
|
||||
{
|
||||
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
operator / (const _D3DVECTOR& v, D3DVALUE s)
|
||||
{
|
||||
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
|
||||
}
|
||||
|
||||
inline int
|
||||
operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Magnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return (D3DVALUE) sqrt(SquareMagnitude(v));
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
SquareMagnitude (const _D3DVECTOR& v)
|
||||
{
|
||||
return v.x*v.x + v.y*v.y + v.z*v.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Normalize (const _D3DVECTOR& v)
|
||||
{
|
||||
return v / Magnitude(v);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Min (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (v.y < ret) ret = v.y;
|
||||
if (v.z < ret) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
Max (const _D3DVECTOR& v)
|
||||
{
|
||||
D3DVALUE ret = v.x;
|
||||
if (ret < v.y) ret = v.y;
|
||||
if (ret < v.z) ret = v.z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0],
|
||||
v1[1] < v2[1] ? v1[1] : v2[1],
|
||||
v1[2] < v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0],
|
||||
v1[1] > v2[1] ? v1[1] : v2[1],
|
||||
v1[2] > v2[2] ? v1[2] : v2[2]);
|
||||
}
|
||||
|
||||
inline D3DVALUE
|
||||
DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z;
|
||||
}
|
||||
|
||||
inline _D3DVECTOR
|
||||
CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
|
||||
{
|
||||
_D3DVECTOR result;
|
||||
|
||||
result[0] = v1[1] * v2[2] - v1[2] * v2[1];
|
||||
result[1] = v1[2] * v2[0] - v1[0] * v2[2];
|
||||
result[2] = v1[0] * v2[1] - v1[1] * v2[0];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -9,13 +9,35 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-02 05:10:42 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2004/03/06 23:28:22 bobboau
|
||||
* fixed motion debris
|
||||
* animated laser textures
|
||||
* and added a new error check called a safepoint, mostly for tracking the 'Y bug'
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/11/06 20:22:03 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 2.1 2003/03/02 05:10:42 penguin
|
||||
* Added #ifdef _MSC_VER around strange exception-handling code
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -46,6 +68,8 @@ on how to hook it in.
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Defines
|
||||
@@ -329,6 +353,7 @@ static char* GetFilePart(char *source)
|
||||
//
|
||||
// --------------------
|
||||
|
||||
extern char safe_string[512];
|
||||
|
||||
// Entry point into the main exception handling routine. This routine is put into an except()
|
||||
// statment at the beginning of a thread and is called anytime that there is a program exception
|
||||
@@ -513,11 +538,15 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
RecordModuleList(LogFile);
|
||||
|
||||
CloseHandle(LogFile);
|
||||
// Return the magic value which tells Win32 that this handler didn't
|
||||
// actually handle the exception - so that things will proceed as per
|
||||
// normal.
|
||||
if(safe_string[0])hprintf(LogFile, "\nlast safe point \n%s\n",safe_string);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -9,13 +9,58 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-12-07 01:37:41 $
|
||||
* $Author: bobboau $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2004-05-12 22:49:14 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.11 2004/03/17 04:07:29 bobboau
|
||||
* new fighter beam code
|
||||
* fixed old after burner trails
|
||||
* had to bump a few limits, working on some dynamic solutions
|
||||
* a few fixed to background POF rendering
|
||||
* fixing asorted bugs
|
||||
*
|
||||
* Revision 2.10 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/14 00:18:30 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.8 2003/11/16 04:09:19 Goober5000
|
||||
* language
|
||||
*
|
||||
* Revision 2.7 2003/11/11 03:56:10 bobboau
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.6 2003/10/23 18:03:23 randomtiger
|
||||
* Bobs changes (take 2)
|
||||
*
|
||||
* Revision 2.5 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/18 01:44:30 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/07 01:37:41 bobboau
|
||||
* inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
|
||||
* collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
|
||||
* it needs a better renderer, but is in prety good shape for now,
|
||||
* I also (think) I squashed a bug in the warpmodel code
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
@@ -126,7 +171,7 @@
|
||||
* Made warp in glow page in
|
||||
*
|
||||
* 67 3/27/98 2:17p Lawrance
|
||||
* Don't play warphole closing for non-captial sized warp effects
|
||||
* Don't play warphole closing for non-capital sized warp effects
|
||||
*
|
||||
* 66 3/26/98 5:44p Lawrance
|
||||
* take out debug comments for warphole sounds playing
|
||||
@@ -332,59 +377,23 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "math/vecmat.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "model/model.h"
|
||||
#include "io/key.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "lighting/lighting.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "localization/localize.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
int wm;
|
||||
int Warp_model;
|
||||
|
||||
#define WARPHOLE_GROW_TIME (3.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
|
||||
#define MAX_FIREBALL_LOD 4
|
||||
|
||||
typedef struct fireball_lod {
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int bitmap_id;
|
||||
int num_frames;
|
||||
int fps;
|
||||
} fireball_lod;
|
||||
|
||||
typedef struct fireball_info {
|
||||
int lod_count;
|
||||
fireball_lod lod[4];
|
||||
} fireball_info;
|
||||
|
||||
// flag values for fireball struct flags member
|
||||
#define FBF_WARP_CLOSE_SOUND_PLAYED (1<<0)
|
||||
#define FBF_WARP_CAPTIAL_SIZE (1<<1)
|
||||
#define FBF_WARP_CRUISER_SIZE (1<<2)
|
||||
|
||||
typedef struct fireball {
|
||||
int objnum; // If -1 this object is unused
|
||||
int fireball_info_index; // Index into Fireball_info array
|
||||
int current_bitmap;
|
||||
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
|
||||
int flags; // see #define FBF_*
|
||||
char lod; // current LOD
|
||||
float time_elapsed; // in seconds
|
||||
float total_time; // total lifetime of animation in seconds
|
||||
} fireball;
|
||||
|
||||
#define MAX_FIREBALLS 200
|
||||
|
||||
fireball Fireballs[MAX_FIREBALLS];
|
||||
@@ -417,12 +426,16 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
|
||||
if((ship_class >= 0) && (ship_class < Num_ship_types)){
|
||||
if ( Ship_info[ship_class].flags & SIF_HUGE_SHIP ) {
|
||||
sound_index = SND_CAPITAL_WARP_IN;
|
||||
fb->flags |= FBF_WARP_CAPTIAL_SIZE;
|
||||
fb->flags |= FBF_WARP_CAPITAL_SIZE;
|
||||
} else if ( Ship_info[ship_class].flags & SIF_BIG_SHIP ) {
|
||||
range_multiplier = 6.0f;
|
||||
fb->flags |= FBF_WARP_CRUISER_SIZE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sound_index = fb->warp_open_sound_index;
|
||||
}
|
||||
|
||||
snd_play_3d(&Snds[sound_index], &fireball_objp->pos, &Eye_position, fireball_objp->radius, NULL, 0, 1.0f, SND_PRIORITY_DOUBLE_INSTANCE, NULL, range_multiplier); // play warp sound effect
|
||||
}
|
||||
@@ -438,10 +451,12 @@ void fireball_play_warphole_close_sound(fireball *fb)
|
||||
|
||||
sound_index = SND_WARP_OUT;
|
||||
|
||||
if ( fb->flags & FBF_WARP_CAPTIAL_SIZE ) {
|
||||
if ( fb->flags & FBF_WARP_CAPITAL_SIZE ) {
|
||||
sound_index = SND_CAPITAL_WARP_OUT;
|
||||
} else if ( fb->flags & FBF_WARP_VIA_SEXP ) {
|
||||
sound_index = fb->warp_close_sound_index;
|
||||
} else {
|
||||
// AL 27-3-98: Decided that warphole closing is only required for captial ship sized warp effects.
|
||||
// AL 27-3-98: Decided that warphole closing is only required for capital ship sized warp effects.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -550,21 +565,19 @@ void fireball_init()
|
||||
}
|
||||
|
||||
mprintf(("loading warp model"));
|
||||
wm = -1;
|
||||
wm = model_load("warp.pof", 0, NULL, 0);
|
||||
mprintf((" %d\n", wm));
|
||||
Warp_model = -1;
|
||||
Warp_model = model_load("warp.pof", 0, NULL, 0);
|
||||
mprintf((" %d\n", Warp_model));
|
||||
|
||||
|
||||
}
|
||||
|
||||
MONITOR( NumFireballsRend );
|
||||
|
||||
//extern int tcache_hit(int);
|
||||
//extern int Glide_expl_textures_in_frame;
|
||||
//extern float Glide_avg_exp_text_per_sec;
|
||||
|
||||
void fireball_render(object * obj)
|
||||
{
|
||||
// if(!Cmdline_nohtl)gr_set_lighting(false,false);
|
||||
|
||||
int num;
|
||||
vertex p;
|
||||
fireball *fb;
|
||||
@@ -588,13 +601,17 @@ void fireball_render(object * obj)
|
||||
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
}
|
||||
|
||||
g3_rotate_vertex(&p, &obj->pos );
|
||||
if(Cmdline_nohtl) {
|
||||
g3_rotate_vertex(&p, &obj->pos );
|
||||
}else{
|
||||
g3_transfer_vertex(&p, &obj->pos);
|
||||
}
|
||||
|
||||
switch( fb->fireball_info_index ) {
|
||||
|
||||
case FIREBALL_EXPLOSION_MEDIUM:
|
||||
gr_set_bitmap(Fireballs[num].current_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.3f );
|
||||
g3_draw_bitmap(&p, fb->orient, obj->radius, TMAP_FLAG_TEXTURED );
|
||||
g3_draw_bitmap(&p, fb->orient, obj->radius, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT );
|
||||
break;
|
||||
|
||||
case FIREBALL_EXPLOSION_LARGE1:
|
||||
@@ -603,27 +620,12 @@ void fireball_render(object * obj)
|
||||
/*
|
||||
if (!tcache_hit(Fireballs[num].current_bitmap)) {
|
||||
// if we're over 200k exp vram upload this frame, change to lower lod
|
||||
if (Glide_expl_textures_in_frame > 1024 * 200) {
|
||||
// change fireball instance to lower LOD or don't draw
|
||||
|
||||
// get current LOD and number of LODs
|
||||
int cur_lod = Fireballs[num].lod;
|
||||
int num_lods = Fireball_info[Fireballs[num].fireball_info_index].lod_count;
|
||||
|
||||
if (num_lods > cur_lod+1) {
|
||||
// bump lod
|
||||
int frame = Fireballs[num].current_bitmap - Fireball_info[Fireballs[num].fireball_info_index].lod[cur_lod].bitmap_id;
|
||||
Fireballs[num].lod++;
|
||||
Fireballs[num].current_bitmap = Fireball_info[Fireballs[num].fireball_info_index].lod[cur_lod+1].bitmap_id + frame;
|
||||
mprintf(("bumping down lod for fireball %s, frame %d\n", Fireball_info[Fireballs[num].fireball_info_index].lod[cur_lod].filename, frame));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
case FIREBALL_ASTEROID:
|
||||
// Make the big explosions rotate with the viewer.
|
||||
gr_set_bitmap(Fireballs[num].current_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.3f );
|
||||
g3_draw_rotated_bitmap(&p, (i2fl(fb->orient)*PI)/180.0f, obj->radius, TMAP_FLAG_TEXTURED );
|
||||
g3_draw_rotated_bitmap(&p, (i2fl(fb->orient)*PI)/180.0f, obj->radius, TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT);
|
||||
break;
|
||||
|
||||
case FIREBALL_WARP_EFFECT:
|
||||
@@ -650,7 +652,7 @@ void fireball_render(object * obj)
|
||||
// obj->alt_rad = rad;
|
||||
|
||||
|
||||
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius );
|
||||
warpin_render(obj, &obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius, (Fireballs[num].flags & FBF_WARP_FORCE_OLD) );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -995,7 +997,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
|
||||
}
|
||||
|
||||
// Create a fireball, return object index.
|
||||
int fireball_create( vector * pos, int fireball_type, int parent_obj, float size, int reverse, vector *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res)
|
||||
int fireball_create( vector * pos, int fireball_type, int parent_obj, float size, int reverse, vector *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res, int extra_flags, int warp_open_sound, int warp_close_sound)
|
||||
{
|
||||
int n, objnum, fb_lod;
|
||||
object *obj;
|
||||
@@ -1064,7 +1066,11 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
|
||||
fl = &fd->lod[fb_lod];
|
||||
|
||||
fb->lod = (char)fb_lod;
|
||||
fb->flags = 0;
|
||||
|
||||
fb->flags = extra_flags;
|
||||
fb->warp_open_sound_index = warp_open_sound;
|
||||
fb->warp_close_sound_index = warp_close_sound;
|
||||
|
||||
matrix orient;
|
||||
if(orient_override != NULL){
|
||||
orient = *orient_override;
|
||||
|
||||
@@ -9,13 +9,32 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:12:39 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-05-12 22:49:13 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/03/17 04:07:29 bobboau
|
||||
* new fighter beam code
|
||||
* fixed old after burner trails
|
||||
* had to bump a few limits, working on some dynamic solutions
|
||||
* a few fixed to background POF rendering
|
||||
* fixing asorted bugs
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/02 05:12:39 penguin
|
||||
* Moved "extern int wm" declaration inside the header #ifdef block
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
@@ -168,8 +187,9 @@
|
||||
#ifndef _FIREBALLS_H
|
||||
#define _FIREBALLS_H
|
||||
|
||||
#include "object/object.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct object;
|
||||
|
||||
// these values correspond to the fireball.tbl entries
|
||||
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
|
||||
@@ -183,6 +203,40 @@
|
||||
|
||||
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
|
||||
|
||||
// all this moved here by Goober5000 because it makes more sense in the H file
|
||||
typedef struct fireball_lod {
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int bitmap_id;
|
||||
int num_frames;
|
||||
int fps;
|
||||
} fireball_lod;
|
||||
|
||||
typedef struct fireball_info {
|
||||
int lod_count;
|
||||
fireball_lod lod[4];
|
||||
} fireball_info;
|
||||
|
||||
// flag values for fireball struct flags member
|
||||
#define FBF_WARP_CLOSE_SOUND_PLAYED (1<<0)
|
||||
#define FBF_WARP_CAPITAL_SIZE (1<<1)
|
||||
#define FBF_WARP_CRUISER_SIZE (1<<2)
|
||||
#define FBF_WARP_FORCE_OLD (1<<3) // Goober5000
|
||||
#define FBF_WARP_VIA_SEXP (1<<4) // Goober5000
|
||||
|
||||
typedef struct fireball {
|
||||
int objnum; // If -1 this object is unused
|
||||
int fireball_info_index; // Index into Fireball_info array
|
||||
int current_bitmap;
|
||||
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
|
||||
int flags; // see #define FBF_*
|
||||
char lod; // current LOD
|
||||
float time_elapsed; // in seconds
|
||||
float total_time; // total lifetime of animation in seconds
|
||||
int warp_open_sound_index; // for warp-effect - Goober5000
|
||||
int warp_close_sound_index; // for warp-effect - Goober5000
|
||||
} fireball;
|
||||
// end move
|
||||
|
||||
void fireball_init();
|
||||
void fireball_render(object * obj);
|
||||
void fireball_delete( object * obj );
|
||||
@@ -192,7 +246,7 @@ void fireball_process_post(object * obj, float frame_time);
|
||||
// reversed is for warp_in/out effects
|
||||
// Velocity: If not NULL, the fireball will move at a constant velocity.
|
||||
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
|
||||
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0);
|
||||
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
|
||||
void fireball_render_plane(int plane);
|
||||
void fireball_close();
|
||||
void fireball_level_close();
|
||||
@@ -211,9 +265,9 @@ float fireball_lifeleft( object *obj );
|
||||
float fireball_lifeleft_percent( object *obj );
|
||||
|
||||
// internal function to draw warp grid.
|
||||
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
|
||||
extern void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old = 0 );
|
||||
extern int Warp_glow_bitmap; // Internal
|
||||
|
||||
extern int wm;
|
||||
extern int Warp_model;
|
||||
|
||||
#endif /* _FIREBALLS_H */
|
||||
@@ -9,13 +9,69 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-05 23:41:50 $
|
||||
* $Author: bobboau $
|
||||
* $Revision: 2.15 $
|
||||
* $Date: 2004-05-12 22:49:13 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14 2004/05/08 01:08:48 Goober5000
|
||||
* small fix
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/03/17 04:07:29 bobboau
|
||||
* new fighter beam code
|
||||
* fixed old after burner trails
|
||||
* had to bump a few limits, working on some dynamic solutions
|
||||
* a few fixed to background POF rendering
|
||||
* fixing asorted bugs
|
||||
*
|
||||
* Revision 2.12 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/11/16 04:09:19 Goober5000
|
||||
* language
|
||||
*
|
||||
* Revision 2.10 2003/11/11 03:56:10 bobboau
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.9 2003/09/26 14:37:13 bobboau
|
||||
* commiting Hardware T&L code, everything is ifdefed out with the compile flag HTL
|
||||
* still needs a lot of work, ubt the frame rates were getting with it are incredable
|
||||
* the biggest problem it still has is a bad lightmanegment system, and the zbuffer
|
||||
* doesn't work well with things still getting rendered useing the sofware pipeline, like thrusters,
|
||||
* and weapons, I think these should be modifyed to be sent through hardware,
|
||||
* it would be slightly faster and it would likely fix the problem
|
||||
*
|
||||
* also the thruster glow/particle stuff I did is now in.
|
||||
*
|
||||
* Revision 2.8 2003/08/31 06:00:41 bobboau
|
||||
* an asortment of bugfixes, mostly with the specular code,
|
||||
* HUD flickering should be completly gone now
|
||||
*
|
||||
* Revision 2.7 2003/03/19 23:06:40 Goober5000
|
||||
* bit o' housecleaning
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/03/19 22:49:32 Goober5000
|
||||
* added some mission flags
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/18 01:44:30 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
@@ -127,25 +183,13 @@
|
||||
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "model/model.h"
|
||||
#include "io/key.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "lighting/lighting.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "Weapon/Beam.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "Nebula/Neb.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
extern int wm;
|
||||
extern int Warp_model;
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
@@ -179,9 +223,8 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
|
||||
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
|
||||
|
||||
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius )
|
||||
void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
@@ -199,18 +242,18 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
vector vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
if(wm > -1){
|
||||
if(Warp_model > -1 && !force_old && !(The_mission.flags & MISSION_FLAG_OLD_WARP_EFFECT)){
|
||||
float model_Interp_scale_x = radius /20;
|
||||
float model_Interp_scale_y = radius /20;
|
||||
float model_Interp_scale_z = max_radius /20;
|
||||
float model_Interp_scale_z = radius /20;
|
||||
|
||||
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
gr_set_cull(0);
|
||||
model_render( wm, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
model_render( Warp_model, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
gr_set_cull(1);
|
||||
|
||||
// Warp_Map = -1;//un sets the warp map
|
||||
@@ -219,11 +262,13 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
model_Interp_scale_y = 1.0f;
|
||||
model_Interp_scale_z = 1.0f;
|
||||
|
||||
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, 0.0f);
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, -1.0f);
|
||||
|
||||
gr_set_cull(0);
|
||||
/*
|
||||
//this is that half done effect that was pissing people off-Bobboau
|
||||
|
||||
gr_set_cull(0);
|
||||
|
||||
matrix m;
|
||||
vector ray_dir;
|
||||
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
|
||||
@@ -254,8 +299,9 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
gr_set_bitmap(Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
|
||||
g3_draw_poly( 4, verts, TMAP_FLAG_TILED | TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT); // added TMAP_FLAG_TILED flag for beam texture tileing -Bobboau
|
||||
}
|
||||
*/
|
||||
|
||||
gr_set_cull(1);
|
||||
*/
|
||||
|
||||
vecs[4] = center; //this is for the warp glow-Bobboau
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
@@ -299,7 +345,7 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
}
|
||||
if ( Warp_glow_bitmap != -1 ) {
|
||||
gr_set_bitmap( Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
gr_set_bitmap( Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, (The_mission.flags & MISSION_FLAG_FULLNEB)?(1.0f - neb2_get_fog_intensity(obj)):1.0f );
|
||||
|
||||
float r = radius;
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 7.2 KiB |
+1064
-441
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-04-07 03:31:53 $
|
||||
* $Author: righteous1 $
|
||||
*
|
||||
* FreeSpace, the game, not the project, header information.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -353,5 +356,9 @@ int game_hacked_data();
|
||||
// show the oem upsell screens (end of campaign, or close of game
|
||||
void oem_upsell_show_screens();
|
||||
|
||||
// function to handle pausing the game when the game is minimized
|
||||
// called from osapi.cpp
|
||||
void alt_tab_pause();
|
||||
|
||||
#endif // endif of #ifndef STAMPER_PROGRAM
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "freespaceresource.h"
|
||||
#include "FreespaceResource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -222,6 +222,15 @@ BEGIN
|
||||
CTEXT "",IDC_FIELD3,27,49,138,8
|
||||
END
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -294,6 +303,14 @@ BEGIN
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
|
||||
IDD_DIALOG1, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#define IDB_GOAL_FAIL 122
|
||||
#define IDI_APP_ICON 124
|
||||
#define IDD_GEN 127
|
||||
#define IDD_RT_VSELECT 128
|
||||
#define IDD_DIALOG1 129
|
||||
#define IDC_LIST_DEBUG 1000
|
||||
#define IDC_DEBUG_TEXT1 1001
|
||||
#define IDC_DEBUG_TEXT2 1002
|
||||
@@ -73,6 +75,11 @@
|
||||
#define IDC_FIELD2 1065
|
||||
#define IDC_FIELD3 1066
|
||||
#define IDC_PXO_REFRESH 1067
|
||||
#define IDC_COMBO_VCARD 1069
|
||||
#define IDC_COMBO_VMODE 1070
|
||||
#define IDC_COMBO_AATYPE 1071
|
||||
#define ID_CANCEL 1072
|
||||
#define ID_OK 1073
|
||||
#define IDC_CON_COUNT 2000
|
||||
#define IDC_FRAMECAP_STATIC 2001
|
||||
#define IDC_GODSTUFF_FPS 2002
|
||||
@@ -85,9 +92,9 @@
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 128
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1068
|
||||
#define _APS_NEXT_CONTROL_VALUE 1074
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:02:01 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -57,7 +60,6 @@
|
||||
*/
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "freespace2/levelpaging.h"
|
||||
|
||||
// All the page in functions
|
||||
|
||||
@@ -0,0 +1,560 @@
|
||||
// Client.cpp
|
||||
// Client Functions for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/Client.cpp $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2004-03-07 23:07:20 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.12 2004/03/05 09:01:56 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.11 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.10 2004/02/04 09:02:42 Goober5000
|
||||
* got rid of unnecessary double semicolons
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2003/11/11 02:15:42 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2003/11/06 20:22:05 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 1.6 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Client.h"
|
||||
//#include "protocol.h"
|
||||
#include "udpsocket.h"
|
||||
#include <iostream.h>
|
||||
#include <time.h>
|
||||
#include "network/multi_log.h"
|
||||
#include "playerman/player.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
|
||||
#define PXO_ADDINT(n) *((int *)cur) = (n); cur += sizeof(int);
|
||||
#define PXO_ADDSTRING(x, y) memcpy(cur, x, y); cur += y;
|
||||
// need to compile and link UDP_Server.cpp
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int CheckSingleMission(const char* mission, unsigned int crc32, UDP_Socket &Socket, const char* masterserver, int port, int timeout)
|
||||
{
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
fs2open_file_check_single checkpack;
|
||||
memset((char *) &checkpack, 0, sizeof(fs2open_file_check_single));
|
||||
checkpack.pid = PCKT_MISSION_CHECK;
|
||||
strncpy(checkpack.name, mission, 60);
|
||||
checkpack.crc32 = crc32;
|
||||
|
||||
|
||||
if (Socket.SendPacket((char *) &checkpack, sizeof(fs2open_file_check_single), sender, port) == -1)
|
||||
return NULL;
|
||||
|
||||
|
||||
fs2open_fcheck_reply c_reply;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket((char *) &c_reply, sizeof(fs2open_fcheck_reply), sender) != -1)
|
||||
{
|
||||
|
||||
if (c_reply.pid != PCKT_MCHECK_REPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return c_reply.status;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int SendPlayerData(int SID, const char* player_name, const char* user, player *pl, const char* masterserver, UDP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
|
||||
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
memset(PacketBuffer,0, 16384);
|
||||
// char *cur = PacketBuffer;
|
||||
|
||||
fs2open_pilot_update *p_update = (fs2open_pilot_update *) PacketBuffer;
|
||||
fs2open_ship_typekill *type_kills = (fs2open_ship_typekill *) (PacketBuffer + (sizeof(fs2open_pilot_update) - sizeof(fs2open_ship_typekill *)));
|
||||
|
||||
|
||||
p_update->pid = PCKT_PILOT_UPDATE;
|
||||
p_update->sid = SID;
|
||||
|
||||
strncpy(p_update->name, player_name, 65);
|
||||
strncpy(p_update->user, user, 65);
|
||||
|
||||
p_update->points = pl->stats.score;
|
||||
p_update->missions = pl->stats.missions_flown;
|
||||
p_update->flighttime = pl->stats.flight_time;
|
||||
p_update->LastFlight = pl->stats.last_flown;
|
||||
p_update->Kills = pl->stats.kill_count;
|
||||
p_update->FriendlyKills = pl->stats.kill_count - pl->stats.kill_count_ok;
|
||||
p_update->Assists = pl->stats.assists;
|
||||
p_update->PriShots = pl->stats.p_shots_fired;
|
||||
p_update->PriHits = pl->stats.p_shots_hit;
|
||||
p_update->PriFHits = pl->stats.p_bonehead_hits;
|
||||
p_update->SecShots = pl->stats.s_shots_fired;
|
||||
p_update->SecHits = pl->stats.s_shots_hit;
|
||||
p_update->SecFHits = pl->stats.s_bonehead_hits;
|
||||
p_update->ship_types = MAX_SHIP_TYPES;
|
||||
|
||||
for (int i = 0; i < MAX_SHIP_TYPES; i++)
|
||||
{
|
||||
|
||||
strncpy(type_kills[i].name, Ship_info[i].name, 32);
|
||||
type_kills[i].kills = pl->stats.kills[i];
|
||||
}
|
||||
|
||||
|
||||
int packet_size = 194; // size of all the ints only
|
||||
packet_size += sizeof(fs2open_ship_typekill) * MAX_SHIP_TYPES; // add the size of the ship_kills array
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket(PacketBuffer, packet_size, sender, port) == -1)
|
||||
return NULL;
|
||||
|
||||
|
||||
fs2open_pilot_updatereply u_reply;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket((char *) &u_reply, sizeof(fs2open_pilot_updatereply), sender) != -1)
|
||||
{
|
||||
|
||||
if (u_reply.pid != PCKT_PILOT_UREPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return u_reply.replytype;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int GetPlayerData(int SID, const char* player_name, player *pl, const char* masterserver, UDP_Socket &Socket, int port, bool CanCreate, int timeout)
|
||||
{
|
||||
|
||||
fs2open_get_pilot prq_packet;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
memset((char *) &prq_packet, 0, sizeof(fs2open_get_pilot));
|
||||
prq_packet.pid = PCKT_PILOT_GET;
|
||||
prq_packet.sid = SID;
|
||||
strncpy(prq_packet.pilotname, player_name, 64);
|
||||
prq_packet.create = CanCreate;
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket((char *)&prq_packet, sizeof(fs2open_get_pilot), sender, port) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pilot_reply *p_reply = (fs2open_pilot_reply *) PacketBuffer;
|
||||
memset(PacketBuffer, 0, 16384);
|
||||
fs2open_ship_typekill *type_kills = (fs2open_ship_typekill *) (PacketBuffer + sizeof(fs2open_pilot_reply) - sizeof(fs2open_ship_typekill *));
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket((char *) &PacketBuffer, 16384, sender) != -1)
|
||||
{
|
||||
|
||||
if (p_reply->pid != PCKT_PILOT_REPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p_reply->replytype > 1)
|
||||
return p_reply->replytype; // don't want to try and access non-existant data
|
||||
|
||||
pl->stats.score = p_reply->points;
|
||||
pl->stats.missions_flown = p_reply->missions;
|
||||
pl->stats.flight_time = p_reply->flighttime;
|
||||
pl->stats.last_flown = p_reply->LastFlight;
|
||||
pl->stats.kill_count = p_reply->Kills;
|
||||
pl->stats.kill_count_ok = p_reply->Kills - p_reply->FriendlyKills;
|
||||
// p_reply.FriendlyKills = pl->stats.kill_count -> pl->stats.kill_count_ok;
|
||||
pl->stats.assists = p_reply->Assists;
|
||||
pl->stats.p_shots_fired = p_reply->PriShots;
|
||||
pl->stats.p_shots_hit = p_reply->PriHits;
|
||||
pl->stats.p_bonehead_hits = p_reply->PriFHits;
|
||||
pl->stats.s_shots_fired = p_reply->SecShots;
|
||||
pl->stats.s_shots_hit = p_reply->SecHits;
|
||||
pl->stats.s_bonehead_hits = p_reply->SecFHits;
|
||||
|
||||
|
||||
if (p_reply->ship_types == 0)
|
||||
memset(pl->stats.kills, 0, sizeof(int) * MAX_SHIP_TYPES);
|
||||
else
|
||||
{
|
||||
// i should really assert p_reply->ship_types == MAX_SHIP_TYPES
|
||||
for (int i = 0; i < MAX_SHIP_TYPES && p_reply->ship_types; i++)
|
||||
{
|
||||
pl->stats.kills[i] = type_kills[i].kills;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ignored on load... fs2 doesn't need this
|
||||
// type_kills[index].name[65] = Ship_info[index].name[32]
|
||||
|
||||
|
||||
|
||||
return p_reply->replytype;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
|
||||
file_record* GetTablesList(int &numTables, const char *masterserver, UDP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
fs2open_file_check fc_packet;
|
||||
fc_packet.pid = PCKT_TABLES_RQST;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket((char *)&fc_packet, sizeof(fs2open_file_check), sender, port) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pxo_missreply *misreply_ptr = (fs2open_pxo_missreply *) PacketBuffer;
|
||||
|
||||
file_record *frecs = NULL;
|
||||
numTables = 0;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket(PacketBuffer, 16384, sender) != -1)
|
||||
{
|
||||
if (misreply_ptr->pid != PCKT_TABLES_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
|
||||
if ((misreply_ptr->num_files * sizeof(file_record)) + (sizeof(int) * 2) > 16384)
|
||||
{
|
||||
// WE'RE IN TROUBLE!
|
||||
|
||||
ml_printf("Network (FS2OpenPXO): PCKT_TABLES_REPLY was larger than 16k!!!\n");
|
||||
return NULL;
|
||||
}
|
||||
frecs = new file_record[misreply_ptr->num_files];
|
||||
memcpy(frecs, PacketBuffer + 8, sizeof(file_record) * misreply_ptr->num_files); // packet buffer will be two ints then the array;
|
||||
numTables = misreply_ptr->num_files;
|
||||
return frecs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
file_record* GetMissionsList(int &numMissions, const char *masterserver, UDP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
fs2open_file_check fc_packet;
|
||||
fc_packet.pid = PCKT_MISSIONS_RQST;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendPacket((char *)&fc_packet, sizeof(fs2open_file_check), sender, port) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pxo_missreply *misreply_ptr = (fs2open_pxo_missreply *) PacketBuffer;
|
||||
|
||||
file_record *frecs = NULL;
|
||||
numMissions = 0;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket(PacketBuffer, 16384, sender) != -1)
|
||||
{
|
||||
if (misreply_ptr->pid != PCKT_MISSIONS_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
|
||||
if ((misreply_ptr->num_files * sizeof(file_record)) + (sizeof(int) * 2) > 16384)
|
||||
{
|
||||
// WE'RE IN TROUBLE!
|
||||
|
||||
ml_printf("Network (FS2OpenPXO): PCKT_MISSIONS_REPLY was larger than 16k!!!\n");
|
||||
return NULL;
|
||||
}
|
||||
frecs = new file_record[misreply_ptr->num_files];
|
||||
memcpy(frecs, PacketBuffer + 8, sizeof(file_record) * misreply_ptr->num_files); // packet buffer will be two ints then the array;
|
||||
numMissions = misreply_ptr->num_files;
|
||||
return frecs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
int Fs2OpenPXO_Login(const char* username, const char* password, UDP_Socket &Socket, const char* masterserver, int port, int timeout)
|
||||
{
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// create and send login packet
|
||||
fs2open_pxo_login loginpckt;
|
||||
memset(&loginpckt, 0, sizeof(loginpckt));
|
||||
loginpckt.pid = PCKT_LOGIN_AUTH;
|
||||
strncpy(loginpckt.username, username, 64);
|
||||
strncpy(loginpckt.password, password, 64);
|
||||
|
||||
|
||||
if (Socket.SendPacket((char *) &loginpckt, sizeof(loginpckt), sender, port) == -1)
|
||||
{
|
||||
cout << "Error Sending Packet" << endl;
|
||||
}
|
||||
|
||||
// await reply
|
||||
fs2open_pxo_lreply loginreply;
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.GetPacket((char *)&loginreply, sizeof(fs2open_pxo_lreply), sender) != -1)
|
||||
{
|
||||
if (loginreply.pid != PCKT_LOGIN_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
if (loginreply.login_status == false)
|
||||
return -1;
|
||||
else
|
||||
return loginreply.sid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
void SendHeartBeat(const char* masterserver, int targetport, UDP_Socket &Socket, const char* myName, const char* MisName, const char* title, int flags, int port, int players)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
//Socket.IgnorePackets();
|
||||
|
||||
// ---------- Prepair and send packet ------------
|
||||
serverlist_hb_packet hbpack;
|
||||
memset(&hbpack, 0, sizeof(serverlist_hb_packet));
|
||||
|
||||
hbpack.pid = PCKT_SLIST_HB;
|
||||
strncpy(hbpack.name, myName, 64);
|
||||
strncpy(hbpack.mission_name, MisName, 64);
|
||||
strncpy(hbpack.title, title, 64);
|
||||
hbpack.flags = flags; // cooperative
|
||||
hbpack.players = (short) players;
|
||||
hbpack.port = port;
|
||||
|
||||
|
||||
Socket.SendPacket((char *) &hbpack, sizeof(serverlist_hb_packet), std::string(masterserver), targetport);
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
net_server* GetServerList(const char* masterserver, int &numServersFound, UDP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
numServersFound = 0;
|
||||
|
||||
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
// ---------- Prepair and send request packet ------------
|
||||
serverlist_request_packet rpack;
|
||||
rpack.pid = PCKT_SLIST_REQUEST;
|
||||
rpack.type = 0xFFFFFFFF;
|
||||
rpack.status = 0xFFFFFFFF;
|
||||
std::string sender = masterserver;
|
||||
|
||||
Socket.SendPacket((char *) &rpack, sizeof(serverlist_request_packet), sender, port);
|
||||
|
||||
|
||||
// ---------- Receive Reply ------------
|
||||
|
||||
serverlist_reply_packet NewServer;
|
||||
net_server *retlist, templist[MAX_SERVERS];
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
if (Socket.GetPacket((char *)&NewServer, sizeof(serverlist_reply_packet), sender) != -1)
|
||||
{
|
||||
|
||||
if (!strcmp(NewServer.name, "TERM") && NewServer.flags == 0 && NewServer.players == 0)
|
||||
{
|
||||
starttime = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy((char *)&templist[numServersFound], (char *)&NewServer, sizeof(serverlist_reply_packet));
|
||||
|
||||
numServersFound++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ---------- Prepair and return list ------------
|
||||
retlist = new net_server[numServersFound];
|
||||
memcpy(retlist, templist, sizeof(net_server) * numServersFound);
|
||||
|
||||
return retlist;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
int Ping(const char* target, UDP_Socket &Socket)
|
||||
{
|
||||
fs2open_ping ping;
|
||||
fs2open_pingreply rping;
|
||||
ping.pid = PCKT_PING;
|
||||
ping.time = time(0);
|
||||
std::string rctp = target;
|
||||
|
||||
Socket.SendPacket((char *)&ping, sizeof(fs2open_ping), rctp, FS2OPEN_PXO_PORT);
|
||||
|
||||
Socket.GetPacket((char *)&rping, sizeof(fs2open_pingreply), rctp);
|
||||
|
||||
return int( float(time(0) - rping.time)/2.0 );
|
||||
}
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
||||
|
||||
int Ping(const char* target)
|
||||
{
|
||||
// ---------- Open and Bind Socket ------------
|
||||
UDP_Socket Socket(FS2OPEN_CLIENT_PORT);
|
||||
if (!Socket.InitSocket())
|
||||
{
|
||||
cout << "Initialization Error!" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
fs2open_ping ping;
|
||||
fs2open_pingreply rping;
|
||||
ping.pid = PCKT_PING;
|
||||
ping.time = time(0);
|
||||
std::string rctp = target;
|
||||
|
||||
Socket.SendPacket((char *)&ping, sizeof(fs2open_ping), rctp, FS2OPEN_PXO_PORT);
|
||||
|
||||
Socket.GetPacket((char *)&rping, sizeof(fs2open_pingreply), rctp);
|
||||
|
||||
return int( float(time(0) - rping.time)/2.0 );
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
// Client.h
|
||||
// Client Functions for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/Client.h $
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.13 2004/03/09 00:02:16 Kazan
|
||||
* more fs2netd stuff
|
||||
*
|
||||
* Revision 1.12 2004/03/07 23:07:20 Kazan
|
||||
* [Incomplete] Readd of Software renderer so Standalone server works
|
||||
*
|
||||
* Revision 1.11 2004/03/05 09:01:56 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.10 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.9 2003/11/11 02:15:42 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2003/11/06 20:22:05 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 1.7 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma warning(disable:4018) // signed/unsigned mismatch
|
||||
#pragma warning(disable:4100) // unreferenced formal parameter
|
||||
#pragma warning(disable:4511) // copy constructor could not be generated
|
||||
#pragma warning(disable:4512) // assignment operator could not be generated
|
||||
#pragma warning(disable:4663) // new template specification syntax
|
||||
#pragma warning(disable:4710) // function not inlined
|
||||
|
||||
#if !defined(__pxo_client_h_)
|
||||
#define __pxo_client_h_
|
||||
|
||||
#define MAX_SERVERS 512
|
||||
#include "protocol.h"
|
||||
|
||||
#if !defined(PXO_TCP)
|
||||
#include "udpsocket.h"
|
||||
#else
|
||||
#include "TCP_Socket.h"
|
||||
#endif
|
||||
|
||||
struct player;
|
||||
|
||||
struct net_server
|
||||
{
|
||||
int pid; // 0x2 : serverlist reply (PCKT_SLIST_REPLY)
|
||||
char name[65];
|
||||
char mission_name[65];
|
||||
char title[65];
|
||||
short players;
|
||||
int flags;
|
||||
|
||||
char ip[16]; // "255.255.255.255"
|
||||
int port;
|
||||
};
|
||||
|
||||
|
||||
#if !defined(PXO_TCP)
|
||||
// ********************************************************************************************************
|
||||
// UDP Version of PXO
|
||||
// ********************************************************************************************************
|
||||
// Variants of the above functions with persistant connections
|
||||
int SendPlayerData(int SID, const char* player_name, const char* user, player *pl, const char* masterserver, UDP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
int GetPlayerData(int SID, const char* player_name, player *pl, const char* masterserver, UDP_Socket &Socket, int port=FS2OPEN_PXO_PORT, bool CanCreate=false, int timeout=15);
|
||||
int CheckSingleMission(const char* mission, unsigned int crc32, UDP_Socket &Socket, const char* masterserver, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
|
||||
net_server* GetServerList(const char* masterserver, int &numServersFound, UDP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
int Ping(const char* target, UDP_Socket &Socket);
|
||||
void SendHeartBeat(const char* masterserver, int targetport, UDP_Socket &Socket, const char* myName, const char* MisName, const char* title, int flags, int port, int players)
|
||||
int Fs2OpenPXO_Login(const char* username, const char* password, UDP_Socket &Socket, const char* masterserver, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
|
||||
|
||||
// longer timeouts - mySQL operations
|
||||
file_record* GetTablesList(int &numTables, const char *masterserver, UDP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=30);
|
||||
file_record* GetMissionsList(int &numMissions, const char *masterserver, UDP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=30);
|
||||
#else
|
||||
// ********************************************************************************************************
|
||||
// TCP Version of PXO
|
||||
// ********************************************************************************************************
|
||||
int SendPlayerData(int SID, const char* player_name, const char* user, player *pl, const char* masterserver, TCP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
int GetPlayerData(int SID, const char* player_name, player *pl, const char* masterserver, TCP_Socket &Socket, int port=FS2OPEN_PXO_PORT, bool CanCreate=false, int timeout=15);
|
||||
int CheckSingleMission(const char* mission, unsigned int crc32, TCP_Socket &Socket, const char* masterserver, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
|
||||
net_server* GetServerList(const char* masterserver, int &numServersFound, TCP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
int Ping(const char* target, TCP_Socket &Socket);
|
||||
void SendHeartBeat(const char* masterserver, int targetport, TCP_Socket &Socket, const char* myName, const char* MisName, const char* title, int flags, int port, int players);
|
||||
int Fs2OpenPXO_Login(const char* username, const char* password, TCP_Socket &Socket, const char* masterserver, int port=FS2OPEN_PXO_PORT, int timeout=15);
|
||||
int GetPingReply(TCP_Socket &Socket);
|
||||
|
||||
// longer timeouts - mySQL operations
|
||||
file_record* GetTablesList(int &numTables, const char *masterserver, TCP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=30);
|
||||
file_record* GetMissionsList(int &numMissions, const char *masterserver, TCP_Socket &Socket, int port=FS2OPEN_PXO_PORT, int timeout=30);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,702 @@
|
||||
// TCP_Client.cpp
|
||||
// TCP Client Functions for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/TCP_Client.cpp $
|
||||
* $Revision: 1.15 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.14 2004/03/09 17:59:01 Kazan
|
||||
* Disabled multithreaded TCP_Socket in favor of safer single threaded
|
||||
* FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
|
||||
*
|
||||
* Revision 1.13 2004/03/08 15:06:23 Kazan
|
||||
* Did, undo
|
||||
*
|
||||
* Revision 1.12 2004/03/07 23:07:20 Kazan
|
||||
* [Incomplete] Readd of Software renderer so Standalone server works
|
||||
*
|
||||
* Revision 1.11 2004/03/05 21:19:39 Kazan
|
||||
* Fixed mission validation (was returning false positives)
|
||||
*
|
||||
* Revision 1.10 2004/03/05 09:01:56 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.8 2004/02/04 09:02:42 Goober5000
|
||||
* got rid of unnecessary double semicolons
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2003/11/13 03:59:52 Kazan
|
||||
* PXO_SID changed from unsigned to signed
|
||||
*
|
||||
* Revision 1.6 2003/11/11 02:15:42 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.5 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/06 20:22:05 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 1.3 2003/10/13 05:57:47 Kazan
|
||||
* Removed a bunch of Useless *_printf()s in the rendering pipeline that were just slowing stuff down
|
||||
* Commented out the "warning null vector in vector normalize" crap since we don't give a rats arse
|
||||
* Added "beam no whack" flag for beams - said beams NEVER whack
|
||||
* Some reliability updates in FS2NetD
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// 4018 = signed/unsigned mismatch
|
||||
// 4663 = new template specification syntax
|
||||
// 4245 = signed/unsigned mismatch in conversion of const value
|
||||
#pragma warning(disable: 4663 4018 4663 4245)
|
||||
|
||||
#include "Client.h"
|
||||
#include "protocol.h"
|
||||
#include "TCP_Socket.h"
|
||||
#include <iostream.h>
|
||||
#include "playerman/player.h"
|
||||
#include "ship/ship.h"
|
||||
#include <time.h>
|
||||
#include "network/multi_log.h"
|
||||
|
||||
|
||||
#define PXO_ADDINT(n) *((int *)cur) = (n); cur += sizeof(int);
|
||||
#define PXO_ADDSTRING(x, y) memcpy(cur, x, y); cur += y;
|
||||
|
||||
// need to compile and link TCP_Socket.cpp
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int CheckSingleMission(const char* mission, unsigned int crc32, TCP_Socket &Socket, const char* masterserver, int port, int timeout)
|
||||
{
|
||||
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
fs2open_file_check_single checkpack;
|
||||
memset((char *) &checkpack, 0, sizeof(fs2open_file_check_single));
|
||||
checkpack.pid = PCKT_MISSION_CHECK;
|
||||
strncpy(checkpack.name, mission, 60);
|
||||
checkpack.crc32 = crc32;
|
||||
|
||||
|
||||
|
||||
if (Socket.SendData((char *) &checkpack, sizeof(fs2open_file_check_single)) == -1)
|
||||
return NULL;
|
||||
|
||||
|
||||
fs2open_fcheck_reply c_reply;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.DataReady() && Socket.GetData((char *) &c_reply, sizeof(fs2open_fcheck_reply)) != -1)
|
||||
{
|
||||
|
||||
if (c_reply.pid != PCKT_MCHECK_REPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return c_reply.status;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int SendPlayerData(int SID, const char* player_name, const char* user, player *pl, const char* masterserver, TCP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
memset(PacketBuffer,0, 16384);
|
||||
// char *cur = PacketBuffer;
|
||||
|
||||
fs2open_pilot_update *p_update = (fs2open_pilot_update *) PacketBuffer;
|
||||
fs2open_ship_typekill *type_kills = (fs2open_ship_typekill *) (PacketBuffer + (sizeof(fs2open_pilot_update) - sizeof(fs2open_ship_typekill *)));
|
||||
|
||||
|
||||
p_update->pid = PCKT_PILOT_UPDATE;
|
||||
p_update->sid = SID;
|
||||
|
||||
strncpy(p_update->name, player_name, 65);
|
||||
strncpy(p_update->user, user, 65);
|
||||
|
||||
p_update->points = pl->stats.score;
|
||||
p_update->missions = pl->stats.missions_flown;
|
||||
p_update->flighttime = pl->stats.flight_time;
|
||||
p_update->LastFlight = pl->stats.last_flown;
|
||||
p_update->Kills = pl->stats.kill_count;
|
||||
p_update->FriendlyKills = pl->stats.kill_count - pl->stats.kill_count_ok;
|
||||
p_update->Assists = pl->stats.assists;
|
||||
p_update->PriShots = pl->stats.p_shots_fired;
|
||||
p_update->PriHits = pl->stats.p_shots_hit;
|
||||
p_update->PriFHits = pl->stats.p_bonehead_hits;
|
||||
p_update->SecShots = pl->stats.s_shots_fired;
|
||||
p_update->SecHits = pl->stats.s_shots_hit;
|
||||
p_update->SecFHits = pl->stats.s_bonehead_hits;
|
||||
p_update->ship_types = MAX_SHIP_TYPES;
|
||||
|
||||
for (int i = 0; i < MAX_SHIP_TYPES; i++)
|
||||
{
|
||||
|
||||
strncpy(type_kills[i].name, Ship_info[i].name, 32);
|
||||
type_kills[i].kills = pl->stats.kills[i];
|
||||
}
|
||||
|
||||
|
||||
int packet_size = 194; // size of all the ints only
|
||||
packet_size += sizeof(fs2open_ship_typekill) * MAX_SHIP_TYPES; // add the size of the ship_kills array
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendData(PacketBuffer, packet_size) == -1)
|
||||
return NULL;
|
||||
|
||||
|
||||
fs2open_pilot_updatereply u_reply;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.DataReady() && Socket.GetData((char *) &u_reply, sizeof(fs2open_pilot_updatereply)) != -1)
|
||||
{
|
||||
|
||||
if (u_reply.pid != PCKT_PILOT_UREPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return u_reply.replytype;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
int GetPlayerData(int SID, const char* player_name, player *pl, const char* masterserver, TCP_Socket &Socket, int port, bool CanCreate, int timeout)
|
||||
{
|
||||
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
fs2open_get_pilot prq_packet;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
|
||||
memset((char *) &prq_packet, 0, sizeof(fs2open_get_pilot));
|
||||
prq_packet.pid = PCKT_PILOT_GET;
|
||||
prq_packet.sid = SID;
|
||||
strncpy(prq_packet.pilotname, player_name, 64);
|
||||
prq_packet.create = CanCreate;
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendData((char *)&prq_packet, sizeof(fs2open_get_pilot)) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pilot_reply *p_reply = (fs2open_pilot_reply *) PacketBuffer;
|
||||
memset(PacketBuffer, 0, 16384);
|
||||
fs2open_ship_typekill *type_kills = (fs2open_ship_typekill *) (PacketBuffer + sizeof(fs2open_pilot_reply) - sizeof(fs2open_ship_typekill *));
|
||||
|
||||
int CheckSize = sizeof(fs2open_pilot_reply) - sizeof(fs2open_ship_typekill *) - 2; //2 for the weird stinking msvc stuff
|
||||
int recvsize = 0, rs2;
|
||||
Sleep(2); // give them a second
|
||||
int starttime = clock();
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
|
||||
if (Socket.DataReady() && (recvsize = Socket.GetData((char *) &PacketBuffer, 16384)) != -1)
|
||||
{
|
||||
|
||||
if (p_reply->pid != PCKT_PILOT_REPLY) // ignore packet
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
CheckSize += sizeof(fs2open_ship_typekill) * p_reply->ship_types;
|
||||
|
||||
ml_printf("Precompletion Pilot Update: CheckSize = %d, recvsize = %d", CheckSize, recvsize);
|
||||
while (CheckSize - recvsize > 0 && (clock() - starttime) <= timeout)
|
||||
{
|
||||
if (Socket.DataReady())
|
||||
{
|
||||
rs2 = Socket.GetData((char *) &PacketBuffer+recvsize, 16384-recvsize);
|
||||
ml_printf("Tables Completetion: Got Additional %u bytes", rs2);
|
||||
recvsize += rs2;
|
||||
}
|
||||
}
|
||||
ml_printf("PostCompletion Tables Get: CheckSize = %u, recvsize = %u", CheckSize, recvsize);
|
||||
|
||||
// if we timed out
|
||||
if ((clock() - starttime) >= timeout)
|
||||
{
|
||||
ml_printf("Pilot Update completetion timed out");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (p_reply->replytype > 1)
|
||||
return p_reply->replytype; // don't want to try and access non-existant data
|
||||
|
||||
pl->stats.score = p_reply->points;
|
||||
pl->stats.missions_flown = p_reply->missions;
|
||||
pl->stats.flight_time = p_reply->flighttime;
|
||||
pl->stats.last_flown = p_reply->LastFlight;
|
||||
pl->stats.kill_count = p_reply->Kills;
|
||||
pl->stats.kill_count_ok = p_reply->Kills - p_reply->FriendlyKills;
|
||||
// p_reply.FriendlyKills = pl->stats.kill_count -> pl->stats.kill_count_ok;
|
||||
pl->stats.assists = p_reply->Assists;
|
||||
pl->stats.p_shots_fired = p_reply->PriShots;
|
||||
pl->stats.p_shots_hit = p_reply->PriHits;
|
||||
pl->stats.p_bonehead_hits = p_reply->PriFHits;
|
||||
pl->stats.s_shots_fired = p_reply->SecShots;
|
||||
pl->stats.s_shots_hit = p_reply->SecHits;
|
||||
pl->stats.s_bonehead_hits = p_reply->SecFHits;
|
||||
|
||||
|
||||
if (p_reply->ship_types == 0)
|
||||
memset(pl->stats.kills, 0, sizeof(int) * MAX_SHIP_TYPES);
|
||||
else
|
||||
{
|
||||
// i should really assert p_reply->ship_types == MAX_SHIP_TYPES
|
||||
for (int i = 0; i < MAX_SHIP_TYPES && p_reply->ship_types; i++)
|
||||
{
|
||||
pl->stats.kills[i] = type_kills[i].kills;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ignored on load... fs2 doesn't need this
|
||||
// type_kills[index].name[65] = Ship_info[index].name[32]
|
||||
|
||||
|
||||
|
||||
return p_reply->replytype;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
|
||||
file_record* GetTablesList(int &numTables, const char *masterserver, TCP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
fs2open_file_check fc_packet;
|
||||
fc_packet.pid = PCKT_TABLES_RQST;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendData((char *)&fc_packet, sizeof(fs2open_file_check)) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
fs2open_pxo_missreply *misreply_ptr = (fs2open_pxo_missreply *) PacketBuffer;
|
||||
|
||||
file_record *frecs = NULL;
|
||||
numTables = 0;
|
||||
Sleep(2); //lets give them a second
|
||||
|
||||
int starttime = clock();
|
||||
|
||||
int recvsize = 0, rs2;
|
||||
int CheckSize = sizeof(int) * 2;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.DataReady() && (recvsize = Socket.GetData(PacketBuffer, 16384)) != -1)
|
||||
{
|
||||
if (misreply_ptr->pid != PCKT_TABLES_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
|
||||
CheckSize += misreply_ptr->num_files * sizeof(file_record);
|
||||
|
||||
ml_printf("Precompletion Table Get: CheckSize = %d, recvsize = %d", CheckSize, recvsize);
|
||||
while (CheckSize - recvsize > 0 && (clock() - starttime) <= timeout)
|
||||
{
|
||||
if (Socket.DataReady())
|
||||
{
|
||||
rs2 = Socket.GetData(PacketBuffer+recvsize, 16384-recvsize);
|
||||
ml_printf("Tables Completetion: Got Additional %u bytes", rs2);
|
||||
recvsize += rs2;
|
||||
}
|
||||
}
|
||||
ml_printf("PostCompletion Tables Get: CheckSize = %u, recvsize = %u", CheckSize, recvsize);
|
||||
|
||||
if ((clock() - starttime) >= timeout)
|
||||
{
|
||||
ml_printf("Tables Transfer completetion timed out");
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
if ((misreply_ptr->num_files * sizeof(file_record)) + (sizeof(int) * 2) > 16384)
|
||||
{
|
||||
// WE'RE IN TROUBLE!
|
||||
|
||||
ml_printf("Network (FS2OpenPXO): PCKT_TABLES_REPLY was larger than 16k!!!\n");
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
frecs = new file_record[misreply_ptr->num_files];
|
||||
memcpy(frecs, PacketBuffer + 8, sizeof(file_record) * misreply_ptr->num_files); // packet buffer will be two ints then the array;
|
||||
numTables = misreply_ptr->num_files;
|
||||
|
||||
/*for (int i = 0; i < misreply_ptr->num_files; i++)
|
||||
{
|
||||
ml_printf("Tables[%u] = { \"%s\", %u}", i, frecs[i].name, frecs[i].crc32);
|
||||
}*/
|
||||
return frecs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
file_record* GetMissionsList(int &numMissions, const char *masterserver, TCP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
fs2open_file_check fc_packet;
|
||||
fc_packet.pid = PCKT_MISSIONS_RQST;
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// send Packet
|
||||
if (Socket.SendData((char *)&fc_packet, sizeof(fs2open_file_check)) == -1)
|
||||
return NULL;
|
||||
|
||||
char PacketBuffer[16384]; // 16K should be enough i think..... I HOPE!
|
||||
memset(PacketBuffer, 0, 16384);
|
||||
|
||||
fs2open_pxo_missreply *misreply_ptr = (fs2open_pxo_missreply *) PacketBuffer;
|
||||
|
||||
file_record *frecs = NULL;
|
||||
numMissions = 0;
|
||||
//int depth = 0;
|
||||
Sleep(2); // lets give it a second
|
||||
int starttime = clock();
|
||||
|
||||
int recvsize = 0, rs2;
|
||||
int CheckSize = sizeof(int) * 2;
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.DataReady() && (recvsize = Socket.GetData(PacketBuffer, 16384)) != -1)
|
||||
{
|
||||
|
||||
if (misreply_ptr->pid != PCKT_MISSIONS_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
CheckSize += misreply_ptr->num_files * sizeof(file_record);
|
||||
|
||||
ml_printf("Precompletion Missions Get: CheckSize = %d, recvsize = %d", CheckSize, recvsize);
|
||||
while (CheckSize - recvsize > 0 && (clock() - starttime) <= timeout)
|
||||
{
|
||||
if (Socket.DataReady())
|
||||
{
|
||||
rs2 = Socket.GetData(PacketBuffer+recvsize, 16384-recvsize);
|
||||
ml_printf("Missions Completetion: Got Additional %u bytes", rs2);
|
||||
recvsize += rs2;
|
||||
}
|
||||
}
|
||||
ml_printf("PostCompletion Missions Get: CheckSize = %u, recvsize = %u", CheckSize, recvsize);
|
||||
|
||||
if ((clock() - starttime) >= timeout)
|
||||
{
|
||||
ml_printf("Missions Transfer completetion timed out");
|
||||
break;
|
||||
}
|
||||
/*
|
||||
if ((misreply_ptr->num_files * sizeof(file_record)) + (sizeof(int) * 2) > 16384)
|
||||
{
|
||||
// WE'RE IN TROUBLE!
|
||||
|
||||
ml_printf("Network (FS2OpenPXO): PCKT_MISSIONS_REPLY was larger than 16k!!!\n");
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
frecs = new file_record[misreply_ptr->num_files];
|
||||
memcpy(frecs, PacketBuffer + 8, sizeof(file_record) * misreply_ptr->num_files); // packet buffer will be two ints then the array;
|
||||
numMissions = misreply_ptr->num_files;
|
||||
|
||||
for (int i = 0; i < misreply_ptr->num_files; i++)
|
||||
{
|
||||
ml_printf("Tables[%u] = { \"%s\", %u}", i, frecs[i].name, frecs[i].crc32);
|
||||
}
|
||||
return frecs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
int Fs2OpenPXO_Login(const char* username, const char* password, TCP_Socket &Socket, const char* masterserver, int port, int timeout)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
|
||||
std::string sender = masterserver;
|
||||
|
||||
// create and send login packet
|
||||
fs2open_pxo_login loginpckt;
|
||||
memset(&loginpckt, 0, sizeof(loginpckt));
|
||||
loginpckt.pid = PCKT_LOGIN_AUTH;
|
||||
strncpy(loginpckt.username, username, 64);
|
||||
strncpy(loginpckt.password, password, 64);
|
||||
|
||||
|
||||
if (Socket.SendData((char *) &loginpckt, sizeof(loginpckt)) == -1)
|
||||
{
|
||||
cout << "Error Sending Packet" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// await reply
|
||||
fs2open_pxo_lreply loginreply;
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
|
||||
if (Socket.DataReady() && Socket.GetData((char *)&loginreply, sizeof(fs2open_pxo_lreply)) != -1)
|
||||
{
|
||||
if (loginreply.pid != PCKT_LOGIN_REPLY)
|
||||
{
|
||||
continue; // skip and ignore this packet
|
||||
}
|
||||
|
||||
if (loginreply.login_status == false)
|
||||
return -1;
|
||||
else
|
||||
return loginreply.sid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
|
||||
void SendHeartBeat(const char* masterserver, int targetport, TCP_Socket &Socket, const char* myName, const char* MisName, const char* title, int flags, int port, int players)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
// ---------- Prepair and send packet ------------
|
||||
serverlist_hb_packet hbpack;
|
||||
memset(&hbpack, 0, sizeof(serverlist_hb_packet));
|
||||
|
||||
hbpack.pid = PCKT_SLIST_HB;
|
||||
strncpy(hbpack.name, myName, 64);
|
||||
strncpy(hbpack.mission_name, MisName, 64);
|
||||
strncpy(hbpack.title, title, 64);
|
||||
hbpack.flags = flags; // cooperative
|
||||
hbpack.players = (short) players;
|
||||
hbpack.port = port;
|
||||
|
||||
|
||||
Socket.SendData((char *) &hbpack, sizeof(serverlist_hb_packet));
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
|
||||
net_server* GetServerList(const char* masterserver, int &numServersFound, TCP_Socket &Socket, int port, int timeout)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
numServersFound = 0;
|
||||
|
||||
|
||||
|
||||
timeout = timeout * CLK_TCK;
|
||||
int starttime = clock();
|
||||
// ---------- Prepair and send request packet ------------
|
||||
serverlist_request_packet rpack;
|
||||
rpack.pid = PCKT_SLIST_REQUEST;
|
||||
rpack.type = 0xFFFFFFFF;
|
||||
rpack.status = 0xFFFFFFFF;
|
||||
std::string sender = masterserver;
|
||||
|
||||
Socket.SendData((char *) &rpack, sizeof(serverlist_request_packet));
|
||||
|
||||
|
||||
// ---------- Receive Reply ------------
|
||||
|
||||
serverlist_reply_packet NewServer;
|
||||
net_server *retlist, templist[MAX_SERVERS];
|
||||
|
||||
while ((clock() - starttime) <= timeout)
|
||||
{
|
||||
if (Socket.DataReady() && Socket.GetData((char *)&NewServer, sizeof(serverlist_reply_packet)) != -1)
|
||||
{
|
||||
|
||||
if (!strcmp(NewServer.name, "TERM") && NewServer.flags == 0 && NewServer.players == 0)
|
||||
{
|
||||
starttime = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy((char *)&templist[numServersFound], (char *)&NewServer, sizeof(serverlist_reply_packet));
|
||||
|
||||
|
||||
numServersFound++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ---------- Prepair and return list ------------
|
||||
retlist = new net_server[numServersFound];
|
||||
memcpy(retlist, templist, sizeof(net_server) * numServersFound);
|
||||
|
||||
return retlist;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
|
||||
int Ping(const char* target, TCP_Socket &Socket)
|
||||
{
|
||||
// Clear any old dead crap data
|
||||
Socket.IgnorePackets();
|
||||
|
||||
fs2open_ping ping;
|
||||
//fs2open_pingreply rping;
|
||||
ping.pid = PCKT_PING;
|
||||
ping.time = clock();
|
||||
//std::string rctp = target;
|
||||
|
||||
Socket.SendData((char *)&ping, sizeof(fs2open_ping));
|
||||
|
||||
//Socket.GetData((char *)&rping, sizeof(fs2open_pingreply));
|
||||
|
||||
//return int( float(time(0) - rping.time)/2.0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
//**************************************************************************************************************************************************
|
||||
|
||||
/*
|
||||
struct fs2open_pingreply
|
||||
{
|
||||
int pid; // 0xE (PCKT_PINGREPLY
|
||||
int time;
|
||||
};
|
||||
*/
|
||||
|
||||
int GetPingReply(TCP_Socket &Socket)
|
||||
{
|
||||
fs2open_pingreply rping;
|
||||
|
||||
Socket.GetData((char *)&rping, sizeof(fs2open_pingreply));
|
||||
|
||||
return int( float(clock() - rping.time)/2.0 );
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
// TCP_Socket.cpp
|
||||
// TCP_Socket for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/TCP_Socket.cpp $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.8 2004/03/09 17:59:01 Kazan
|
||||
* Disabled multithreaded TCP_Socket in favor of safer single threaded
|
||||
* FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
|
||||
*
|
||||
* Revision 1.7 2004/03/05 09:01:56 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.6 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.5 2003/11/11 02:15:42 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/06 20:22:05 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 1.3 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma warning(disable:4100) // unreferenced formal parameter
|
||||
#pragma warning(disable:4511) // copy constructor could not be generated
|
||||
#pragma warning(disable:4512) // assignment operator could not be generated
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
#include "TCP_Socket.h"
|
||||
//#include <process.h>
|
||||
//#include <iostream.h>
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TCP_Socket Implementation
|
||||
//**************************************************************************
|
||||
|
||||
extern void ml_printf(char *, ...);
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
void _cdecl tcp_socket_mt_run(void *arg)
|
||||
{
|
||||
TCP_Socket *socket = (TCP_Socket *)arg;
|
||||
|
||||
|
||||
while (!socket->MtDie)
|
||||
{
|
||||
if (socket->DataReady())
|
||||
{
|
||||
//ml_printf("Got Some Data via multithreads!");
|
||||
if (socket->GetDataFromNetwork() == 0)
|
||||
{
|
||||
// socket has died!
|
||||
socket->IgnorePackets();
|
||||
socket->Close();
|
||||
socket->Initialized = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_endthread();
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// arguments are ignored if we're in ServerMode
|
||||
bool TCP_Socket::InitSocket(std::string rem_host, int rem_port)
|
||||
{
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
QueueLen = 0;
|
||||
|
||||
memset(ReceiveBuffer, 0, FS2_TCP_MaxWaiting * FS2_TCP_ReceiveBuffer);
|
||||
memset(ReceiveLen, 0, sizeof(int) * FS2_TCP_MaxWaiting);
|
||||
Lock = false;
|
||||
MtDie = false;
|
||||
#endif
|
||||
|
||||
sockaddr_in adr_inet;
|
||||
|
||||
|
||||
memset(&adr_inet, 0, sizeof(adr_inet));
|
||||
adr_inet.sin_family = AF_INET;
|
||||
|
||||
if (ServerMode) //adr_inet will be MY address
|
||||
{
|
||||
adr_inet.sin_port = htons((unsigned short)port);
|
||||
adr_inet.sin_addr.s_addr = INADDR_ANY;
|
||||
}
|
||||
else // adr_inet is the remote address
|
||||
{
|
||||
adr_inet.sin_port = htons((unsigned short)rem_port);
|
||||
adr_inet.sin_addr.s_addr = inet_addr(rem_host.c_str());
|
||||
}
|
||||
|
||||
|
||||
#if defined(WIN32)
|
||||
// Windows Version
|
||||
int rc=startWinsock();
|
||||
if(rc != 0)
|
||||
return false;
|
||||
|
||||
mySocket = ::socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
|
||||
if(mySocket == INVALID_SOCKET)
|
||||
return false;
|
||||
|
||||
/*
|
||||
int timeout = TCP_SOCKET_TIMEOUT;
|
||||
setsockopt(mySocket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(int));
|
||||
setsockopt(mySocket, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof(int)); */
|
||||
|
||||
if (ServerMode)
|
||||
{
|
||||
if (bind(mySocket, (sockaddr *)&adr_inet, sizeof(adr_inet)) == SOCKET_ERROR)
|
||||
return false;
|
||||
|
||||
if (listen(mySocket, 10) == SOCKET_ERROR)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (connect(mySocket, (sockaddr *)&adr_inet, sizeof(sockaddr_in)) == SOCKET_ERROR)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#else
|
||||
// Unix Version
|
||||
|
||||
|
||||
|
||||
mySocket = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (mySocket == -1)
|
||||
{
|
||||
cout << "Couldn't Get Socket (" << strerror(errno) << ")" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (ServerMode)
|
||||
{
|
||||
if (bind(mySocket, (sockaddr *)&adr_inet, sizeof(adr_inet)) == -1)
|
||||
{
|
||||
cout << "Couldn't Bind Socket" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (listen(mySocket, 10) == -1)
|
||||
{
|
||||
cout << "Couldn't create Listen Socket" << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (connect(mySocket, (sockaddr *)&adr_inet, sizeof(sockaddr_in)) == -1)
|
||||
{
|
||||
cout << "Couldn't Connect to Remote system" << endl;
|
||||
return fasle;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
_beginthread(tcp_socket_mt_run, 0, (void *)this);
|
||||
#endif
|
||||
|
||||
Initialized = true;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4127) // conditional expression is constant
|
||||
bool TCP_Socket::DataReady()
|
||||
{
|
||||
timeval wait;
|
||||
wait.tv_sec = 0;
|
||||
wait.tv_usec = 1;
|
||||
|
||||
fd_set recvs;
|
||||
|
||||
FD_ZERO(&recvs);
|
||||
FD_SET(mySocket, &recvs);
|
||||
|
||||
int status = select(1, &recvs, NULL, NULL, &wait);
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
return (status != 0 && status != SOCKET_ERROR) || this->MT_DataReady();
|
||||
#else
|
||||
return (status != 0 && status != SOCKET_ERROR);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(FS2_TCP_RMultithread)
|
||||
void TCP_Socket::IgnorePackets()
|
||||
{
|
||||
if (DataReady())
|
||||
{
|
||||
// let's say most that is going to be backed up is 32K
|
||||
char *bitbox = new char[1024*32];
|
||||
|
||||
GetData(bitbox, 1024*32);
|
||||
|
||||
delete[] bitbox;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool TCP_Socket::OOBDataReady()
|
||||
{
|
||||
timeval wait;
|
||||
wait.tv_sec = 0;
|
||||
wait.tv_usec = 1;
|
||||
|
||||
fd_set recvs;
|
||||
|
||||
FD_ZERO(&recvs);
|
||||
FD_SET(mySocket, &recvs);
|
||||
|
||||
int status = select(1, NULL, NULL, &recvs, &wait);
|
||||
|
||||
return (status != 0 && status != SOCKET_ERROR);
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
|
||||
|
||||
int TCP_Socket::GetDataFromNetwork()
|
||||
{
|
||||
char buffer[FS2_TCP_ReceiveBuffer];
|
||||
memset(buffer, 0, FS2_TCP_ReceiveBuffer);
|
||||
|
||||
|
||||
int size = recv(mySocket, buffer, FS2_TCP_ReceiveBuffer, 0);
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
while (Lock);
|
||||
Lock = true;
|
||||
|
||||
while (QueueLen >= FS2_TCP_MaxWaiting)
|
||||
RemoveFirstPacket();
|
||||
|
||||
memcpy(ReceiveBuffer[QueueLen], buffer, size);
|
||||
ReceiveLen[QueueLen] = size;
|
||||
QueueLen++;
|
||||
|
||||
Lock = false;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
void TCP_Socket::RemoveFirstPacket()
|
||||
{
|
||||
|
||||
for (int i = 0; i < QueueLen-1; i++)
|
||||
{
|
||||
memcpy(ReceiveBuffer[i], ReceiveBuffer[i+1], FS2_TCP_ReceiveBuffer);
|
||||
ReceiveLen[i] = ReceiveLen[i+1];
|
||||
}
|
||||
memset(ReceiveBuffer[QueueLen-1], 0, FS2_TCP_ReceiveBuffer);
|
||||
QueueLen--;
|
||||
}
|
||||
#endif
|
||||
|
||||
int TCP_Socket::GetData(char *buffer, int blen, bool OOB)
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
if (OOB)
|
||||
flags = flags | MSG_OOB;
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
if (MT_DataReady())
|
||||
{
|
||||
while (Lock);
|
||||
Lock = true;
|
||||
|
||||
int cpylen = ReceiveLen[0];
|
||||
if (cpylen > blen)
|
||||
cpylen = blen;
|
||||
|
||||
memcpy(buffer, ReceiveBuffer[0], cpylen);
|
||||
|
||||
|
||||
RemoveFirstPacket();
|
||||
Lock = false;
|
||||
|
||||
return cpylen;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
#else
|
||||
// clear the buffer
|
||||
memset(buffer, 0, blen);
|
||||
|
||||
|
||||
|
||||
return recv(mySocket, buffer, blen, flags);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
int TCP_Socket::SendData(char *buffer, int msg_len, bool OOB)
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
if (OOB)
|
||||
flags = flags | MSG_OOB;
|
||||
|
||||
|
||||
return send(mySocket, buffer, msg_len, flags);
|
||||
}
|
||||
|
||||
#if defined(WIN32) && defined(MT_TCP_Socket)
|
||||
void __cdecl StartServerProc(void *arg)
|
||||
{
|
||||
|
||||
TCP_Socket *sock = (TCP_Socket *)arg;
|
||||
sock->nServProc(sock->nServerSocket);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
STYPE TCP_Socket::AcceptConnections()
|
||||
{
|
||||
sockaddr_in adr_client;
|
||||
int len = sizeof(sockaddr_in);
|
||||
STYPE client = accept(mySocket, (sockaddr *) &adr_client, &len);
|
||||
|
||||
return client; // some sort of error
|
||||
}
|
||||
|
||||
#if defined(MT_TCP_Socket)
|
||||
bool TCP_Socket::AcceptConnections(sproc server_process)
|
||||
{
|
||||
|
||||
sockaddr_in adr_client;
|
||||
int len = sizeof(sockaddr_in);
|
||||
STYPE client = accept(mySocket, (sockaddr *) &adr_client, &len);
|
||||
|
||||
|
||||
if (client == -1) //SOCKET_ERROR on windows
|
||||
return false; // some sort of error
|
||||
|
||||
#if defined(WIN32)
|
||||
// --------- Windows ---------
|
||||
nServerSocket = client;
|
||||
_beginthread(StartServerProc, 0, NULL);
|
||||
#else
|
||||
// --------- Unix ---------
|
||||
pid_t pid;
|
||||
|
||||
switch(pid=fork()){
|
||||
case -1:
|
||||
cout << "can't fork\n";
|
||||
exit(-1);
|
||||
|
||||
case 0 :
|
||||
nServProc(client);
|
||||
exit(0);
|
||||
|
||||
default: // this is the code the parent runs
|
||||
close(client); // we don't want to keep a copy around for us
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
// TCP_Socket.h
|
||||
// TCP_Socket for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/TCP_Socket.h $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2004/03/09 17:59:01 Kazan
|
||||
* Disabled multithreaded TCP_Socket in favor of safer single threaded
|
||||
* FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
|
||||
*
|
||||
* Revision 1.4 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.3 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// Enable Multithread
|
||||
//#define MT_TCP_Socket
|
||||
|
||||
// Enable MultiThreaded Receive - FreeSpace 2 TCP_Socket only!
|
||||
//#define FS2_TCP_RMultithread
|
||||
|
||||
#if defined(WIN32)
|
||||
// Windows Version
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#pragma warning(push, 2) // ignore all those warnings for Microsoft stuff
|
||||
#include <string>
|
||||
#pragma warning(pop)
|
||||
|
||||
//#include <winsock2.h>
|
||||
|
||||
#if !defined(STYPE)
|
||||
#define STYPE SOCKET
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(CLOSEFUNC)
|
||||
#define CLOSEFUNC closesocket
|
||||
#endif
|
||||
|
||||
#else
|
||||
// Unix Version
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string>
|
||||
|
||||
#if !defined(STYPE)
|
||||
#define STYPE int
|
||||
#endif
|
||||
|
||||
#if !defined(CLOSEFUNC)
|
||||
#define CLOSEFUNC close
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(__TCP_SOCKET_H_)
|
||||
#define __TCP_SOCKET_H_
|
||||
|
||||
// From UDP_Socket
|
||||
int startWinsock();
|
||||
|
||||
|
||||
class Generic_Socket
|
||||
{
|
||||
protected:
|
||||
|
||||
bool Initialized;
|
||||
STYPE mySocket;
|
||||
int port;
|
||||
|
||||
public:
|
||||
Generic_Socket() : Initialized(false), port(0) {}
|
||||
|
||||
bool isInitialized() { return Initialized; }
|
||||
void Close() { CLOSEFUNC(mySocket); Initialized = false; }
|
||||
void SetPort(int aport) { port = aport; }
|
||||
|
||||
// purely virtual
|
||||
virtual bool InitSocket()=0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(WIN32) && defined(MT_TCP_Socket)
|
||||
typedef void (__cdecl *sproc)(STYPE);
|
||||
#endif
|
||||
|
||||
#define TCP_SOCKET_TIMEOUT 15000
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
#define FS2_TCP_MaxWaiting 20
|
||||
#define FS2_TCP_ReceiveBuffer 16384
|
||||
|
||||
|
||||
#endif
|
||||
class TCP_Socket : public Generic_Socket
|
||||
{
|
||||
private:
|
||||
bool ServerMode;
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
int QueueLen;
|
||||
char ReceiveBuffer[FS2_TCP_MaxWaiting][FS2_TCP_ReceiveBuffer];
|
||||
int ReceiveLen[FS2_TCP_MaxWaiting];
|
||||
|
||||
bool Lock;
|
||||
bool MtDie;
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined(MT_TCP_Socket)
|
||||
// used for servers in windows
|
||||
STYPE nServerSocket;
|
||||
sproc nServProc;
|
||||
#endif
|
||||
|
||||
public:
|
||||
TCP_Socket(int aport = 0, bool WillbeServer = false) : ServerMode(WillbeServer), Generic_Socket() { port = aport; }
|
||||
~TCP_Socket()
|
||||
{
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
MtDie = true;
|
||||
#endif
|
||||
Close();
|
||||
}
|
||||
void MakeFromSocket(STYPE nSocket) { mySocket = nSocket; Initialized = true; }
|
||||
|
||||
|
||||
// if "WillbeServer" wasn't set on construction SetServerMode() MUST be called BEFORE InitSocket() for this to be a server
|
||||
void SetServerMode() { ServerMode = true; };
|
||||
|
||||
// arguments are ignored if we're in ServerMode
|
||||
bool InitSocket(void) { return TCP_Socket::InitSocket("", 0);}
|
||||
|
||||
bool InitSocket(std::string rem_host, int rem_port);
|
||||
|
||||
#if defined(FS2_TCP_RMultithread)
|
||||
|
||||
void IgnorePackets() { ClearData(); QueueLen = 0; }
|
||||
bool MT_DataReady() { return (QueueLen > 0); }
|
||||
|
||||
void ClearData() { memset(ReceiveBuffer, 0, FS2_TCP_MaxWaiting * FS2_TCP_ReceiveBuffer); }
|
||||
int GetDataFromNetwork();
|
||||
void RemoveFirstPacket();
|
||||
|
||||
friend void _cdecl tcp_socket_mt_run(void *arg);
|
||||
#else
|
||||
void IgnorePackets();
|
||||
#endif
|
||||
|
||||
|
||||
STYPE GetSocketNum() { return mySocket; };
|
||||
|
||||
|
||||
|
||||
bool DataReady();
|
||||
bool OOBDataReady();
|
||||
|
||||
|
||||
int GetData(char *buffer, int blen, bool OOB=false);
|
||||
int SendData(char *buffer, int msg_len, bool OOB=false);
|
||||
|
||||
//server calls
|
||||
|
||||
#if defined(MT_TCP_Socket)
|
||||
// AcceptConnections will accept a connection and spawn a new server process
|
||||
// the argument is a function pointer
|
||||
|
||||
bool AcceptConnections(sproc server_process);
|
||||
#endif
|
||||
STYPE AcceptConnections();
|
||||
|
||||
#if defined(WIN32) && defined(MT_TCP_Socket)
|
||||
// used for servers in windows
|
||||
friend void __cdecl StartServerProc(void *arg);
|
||||
#endif
|
||||
};
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,287 @@
|
||||
// Protocol.h
|
||||
// Protocol Definitions for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/protocol.h $
|
||||
* $Revision: 1.11 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.10 2004/03/07 23:07:20 Kazan
|
||||
* [Incomplete] Readd of Software renderer so Standalone server works
|
||||
*
|
||||
* Revision 1.9 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.8 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2003/10/30 15:30:23 Kazan
|
||||
* lil update
|
||||
*
|
||||
* Revision 1.6 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__pxo_protocol_h_)
|
||||
#define __pxo_protocol_h_
|
||||
|
||||
#pragma warning(disable:4663) // new template specification syntax
|
||||
|
||||
#define PXO_PROTO_VER "1.2"
|
||||
// PUT the Protocol into TCP mode
|
||||
#define PXO_TCP
|
||||
|
||||
// Packet IDs
|
||||
#define PCKT_SLIST_REQUEST 0x1
|
||||
#define PCKT_SLIST_REPLY 0x2
|
||||
#define PCKT_SLIST_HB 0x3
|
||||
#define PCKT_LOGIN_AUTH 0x4
|
||||
#define PCKT_LOGIN_REPLY 0x5
|
||||
#define PCKT_MISSIONS_RQST 0x5
|
||||
#define PCKT_MISSIONS_REPLY 0x6
|
||||
#define PCKT_TABLES_RQST 0x7
|
||||
#define PCKT_TABLES_REPLY 0x8
|
||||
#define PCKT_PILOT_GET 0x9
|
||||
#define PCKT_PILOT_REPLY 0xA
|
||||
#define PCKT_PILOT_UPDATE 0xB
|
||||
#define PCKT_PILOT_UREPLY 0xC
|
||||
#define PCKT_PING 0xD
|
||||
#define PCKT_PINGREPLY 0xE
|
||||
|
||||
#define PCKT_MISSION_CHECK 0xF
|
||||
#define PCKT_MCHECK_REPLY 0x10
|
||||
|
||||
#define FS2OPEN_PXO_PORT 12000
|
||||
#define FS2OPEN_CLIENT_PORT FS2OPEN_PXO_PORT + 1
|
||||
|
||||
|
||||
//***********************************************************************************************************************
|
||||
// Packet Structures
|
||||
//***********************************************************************************************************************
|
||||
|
||||
// ----- Server List -----
|
||||
|
||||
//this one is sent Client->Server and when the Server receives it sends back the server list to the sender of this packet
|
||||
struct serverlist_request_packet
|
||||
{
|
||||
int pid; // 0x1 : serverlist request (PCKT_SLIST_REQUEST)
|
||||
int type; // so you can request only servers of a certain time
|
||||
int status; // so you can request only servers of a certain status
|
||||
};
|
||||
|
||||
//the server list will be sent one server at a time - each server being on UDP packet containing this
|
||||
// a terminator will be sent with the following values
|
||||
// servername = "TERM"
|
||||
// netspeed = status = players = type = 0
|
||||
|
||||
|
||||
struct serverlist_reply_packet
|
||||
{
|
||||
int pid; // 0x2 : serverlist reply (PCKT_SLIST_REPLY)
|
||||
char name[65];
|
||||
char mission_name[65];
|
||||
char title[65];
|
||||
short players;
|
||||
int flags;
|
||||
|
||||
char ip[16]; // "255.255.255.255"
|
||||
int port;
|
||||
};
|
||||
|
||||
//a server sends this UDP packet to the server every 60 seconds has a "Heartbeat" telling the server it's here -
|
||||
// if one isn't received for 120 seconds the server is dropped from the list
|
||||
struct serverlist_hb_packet
|
||||
{
|
||||
int pid; // 0x3 : serverlist register (PCKT_SLIST_HB)
|
||||
|
||||
char name[65];
|
||||
char mission_name[65];
|
||||
char title[65];
|
||||
short players;
|
||||
int flags;
|
||||
int port;
|
||||
};
|
||||
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
// ----- Logins -----
|
||||
|
||||
//login request
|
||||
struct fs2open_pxo_login
|
||||
{
|
||||
int pid; // 0x4 : fs2open_pxo_login (PCKT_LOGIN_AUTH)
|
||||
char username[65];
|
||||
char password[65];
|
||||
};
|
||||
|
||||
//and the reply
|
||||
struct fs2open_pxo_lreply
|
||||
{
|
||||
int pid; // 0x5 (PCKT_LOGIN_REPLY)
|
||||
bool login_status; // true if successful, false if failed
|
||||
int sid; // if (login_status) sid = session id, ip associated and expires after 1 hour
|
||||
int pilots; // if (login_status) pilots = number of pilots for this account
|
||||
};
|
||||
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
// ----- Missions & Tables -----
|
||||
|
||||
struct fs2open_file_check_single
|
||||
{
|
||||
int pid; //PCKT_MISSION_CHECK
|
||||
char name[60];
|
||||
unsigned int crc32;
|
||||
};
|
||||
|
||||
struct fs2open_fcheck_reply
|
||||
{
|
||||
int pid; //PCKT_MCHECK_REPLY
|
||||
int status; // 1 = valid, 0 = invalid
|
||||
};
|
||||
|
||||
//request
|
||||
|
||||
struct fs2open_file_check
|
||||
{
|
||||
int pid; // 0x5 for missions 0x7 for tables ( PCKT_MISSIONS_RQST / PCKT_TABLES_RQST )
|
||||
};
|
||||
|
||||
|
||||
//reply
|
||||
|
||||
struct file_record
|
||||
{
|
||||
char name[60];
|
||||
unsigned int crc32;
|
||||
};
|
||||
|
||||
struct fs2open_pxo_missreply
|
||||
{
|
||||
int pid; // 0x6 for missions 0x8 for tables ( PCKT_MISSIONS_REPLY / PCKT_TABLES_REPLY )
|
||||
int num_files;
|
||||
file_record *files;
|
||||
};
|
||||
|
||||
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
// ----- Pilot Management -----
|
||||
|
||||
|
||||
|
||||
struct fs2open_get_pilot
|
||||
{
|
||||
int pid; // 0x9 ( PCKT_PILOT_GET )
|
||||
int sid; // session id returned upon login
|
||||
char pilotname[65];
|
||||
bool create; // create pilot
|
||||
};
|
||||
|
||||
struct fs2open_ship_typekill
|
||||
{
|
||||
char name[65];
|
||||
unsigned int kills;
|
||||
};
|
||||
|
||||
struct fs2open_pilot_reply
|
||||
{
|
||||
int pid; // 0x0A (PCKT_PILOT_REPLY)
|
||||
int replytype; // 0 = pilot retrieved, 1 = pilot created, 2 = invalid pilot, 3 = invalid (expired?) sid, 4 = pilot already exists
|
||||
|
||||
// if and only if (replytype == 0) then the rest of this data
|
||||
|
||||
// unsigned __int64 points; -- i'd use this except MICROSOFT DOESN'T SUPPORT INT64 COPRRECTLY!
|
||||
unsigned int points;
|
||||
unsigned int missions;
|
||||
//unsigned __int64 flighttime;
|
||||
unsigned int flighttime;
|
||||
unsigned int LastFlight;
|
||||
unsigned int Kills;
|
||||
unsigned int Assists;
|
||||
unsigned int FriendlyKills;
|
||||
unsigned int PriShots;
|
||||
unsigned int PriHits;
|
||||
unsigned int PriFHits;
|
||||
unsigned int SecShots;
|
||||
unsigned int SecHits;
|
||||
unsigned int SecFHits;
|
||||
|
||||
unsigned int ship_types;
|
||||
fs2open_ship_typekill *type_kills;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct fs2open_pilot_update
|
||||
{
|
||||
int pid; // 0x0B (PCKT_PILOT_UPDATE)
|
||||
int sid; // session id
|
||||
|
||||
char name[65];
|
||||
char user[65];
|
||||
// unsigned __int64 points; -- i'd use this except MICROSOFT DOESN'T SUPPORT INT64 COPRRECTLY!
|
||||
unsigned int points;
|
||||
unsigned int missions;
|
||||
//unsigned __int64 flighttime;
|
||||
unsigned int flighttime;
|
||||
unsigned int LastFlight;
|
||||
unsigned int Kills;
|
||||
unsigned int Assists;
|
||||
unsigned int FriendlyKills;
|
||||
unsigned int PriShots;
|
||||
unsigned int PriHits;
|
||||
unsigned int PriFHits;
|
||||
unsigned int SecShots;
|
||||
unsigned int SecHits;
|
||||
unsigned int SecFHits;
|
||||
|
||||
unsigned int ship_types;
|
||||
fs2open_ship_typekill *type_kills;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct fs2open_pilot_updatereply
|
||||
{
|
||||
int pid; // 0x0C (PCKT_PILOT_UREPLY)
|
||||
int replytype; // 0 = pilot updated, 1 = invalid pilot, 2 = invalid (expired?) sid
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ---------------- Generic Ping -----------------
|
||||
|
||||
// ping time is in ticks returned by clock()
|
||||
struct fs2open_ping
|
||||
{
|
||||
int pid; // 0xD (PCKT_PING)
|
||||
int time;
|
||||
};
|
||||
|
||||
struct fs2open_pingreply
|
||||
{
|
||||
int pid; // 0xE (PCKT_PINGREPLY
|
||||
int time;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,165 @@
|
||||
// udpsocket.cpp
|
||||
// UDP Socket class for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/udpsocket.cpp $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.3 2003/11/11 02:15:42 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma warning(disable:4710) // function not inlined
|
||||
#pragma warning(disable:4711) // function inlined
|
||||
|
||||
#include "udpsocket.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
//*******************************************************************************
|
||||
// Windows Version
|
||||
//*******************************************************************************
|
||||
#include <windows.h>
|
||||
|
||||
int startWinsock()
|
||||
{
|
||||
WSADATA wsa;
|
||||
return WSAStartup(MAKEWORD(2,0),&wsa);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
bool UDP_Socket::InitSocket()
|
||||
{
|
||||
if (Initialized)
|
||||
return true; // we're already initialized!
|
||||
|
||||
sockaddr_in adr_inet;
|
||||
|
||||
memset(&adr_inet, 0, sizeof(adr_inet));
|
||||
adr_inet.sin_family = AF_INET;
|
||||
adr_inet.sin_port = htons((unsigned short) port);
|
||||
adr_inet.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
// Windows Version
|
||||
int rc = startWinsock();
|
||||
if(rc != 0)
|
||||
return false;
|
||||
|
||||
this->socket = ::socket(AF_INET,SOCK_DGRAM,0);
|
||||
if(this->socket == INVALID_SOCKET)
|
||||
return false;
|
||||
|
||||
if (bind(this->socket, (sockaddr *)&adr_inet, sizeof(adr_inet)) == SOCKET_ERROR)
|
||||
return false;
|
||||
#else
|
||||
// Unix Version
|
||||
|
||||
this->socket = ::socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (this->socket == -1)
|
||||
{
|
||||
Out << "Couldn't Get Socket (" << strerror(errno) << ")" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (bind(this->socket, (sockaddr *)&adr_inet, sizeof(adr_inet)) == -1)
|
||||
{
|
||||
Out << "Couldn't Bind Socket" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//*******************************************************************************
|
||||
// Uniform Version
|
||||
//*******************************************************************************
|
||||
|
||||
int UDP_Socket::GetPacket(char *buffer, int blen, std::string &from)
|
||||
{
|
||||
if (!Initialized)
|
||||
return false;
|
||||
|
||||
sockaddr_in from_addr;
|
||||
memset(&from_addr, 0, sizeof(from_addr));
|
||||
|
||||
int recvbytes = -1;
|
||||
int from_size = sizeof(from_addr);
|
||||
|
||||
#if defined(WIN32)
|
||||
timeval wait;
|
||||
wait.tv_sec = 0;
|
||||
wait.tv_usec = 1;
|
||||
|
||||
fd_set recvs;
|
||||
recvs.fd_count = 1;
|
||||
recvs.fd_array[0] = this->socket;
|
||||
|
||||
int status = select(NULL, &recvs, NULL, NULL, &wait);
|
||||
if (status != 0 && status != SOCKET_ERROR)
|
||||
recvbytes = recvfrom(this->socket, buffer, blen, 0, (sockaddr *)&from_addr, &from_size);
|
||||
|
||||
#else
|
||||
// +#@$++#@$+ +#@$++#@$+ CRITICAL FIX REQURED +#@$++#@$+ +#@$++#@$+
|
||||
// FIX THIS FOR IT NOT TO BLOCK LIKE I DID ON WINDOWS!
|
||||
// +#@$++#@$+ +#@$++#@$+ CRITICAL FIX REQURED +#@$++#@$+ +#@$++#@$+
|
||||
recvbytes = recvfrom(this->socket, buffer, blen, 0, (sockaddr *)&from_addr, (socklen_t *)&from_size);
|
||||
#endif
|
||||
from = inet_ntoa(from_addr.sin_addr);
|
||||
|
||||
return recvbytes;
|
||||
}
|
||||
|
||||
int UDP_Socket::SendPacket(char *buffer, int plen, std::string &to, int toport)
|
||||
{
|
||||
if (!Initialized)
|
||||
return false;
|
||||
|
||||
sockaddr_in to_addr;
|
||||
int to_size = sizeof(to_addr);
|
||||
|
||||
to_addr.sin_family = AF_INET;
|
||||
to_addr.sin_port = htons((unsigned short) toport);
|
||||
#if !defined(WIN32)
|
||||
to_addr.sin_addr.s_addr = inet_addr(to.c_str());
|
||||
#else
|
||||
|
||||
to_addr.sin_addr.s_addr = inet_addr(to.c_str());
|
||||
#endif
|
||||
|
||||
int sent = sendto(this->socket, buffer, plen, 0, (sockaddr *)&to_addr, to_size);
|
||||
return sent;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
// udpsocket.h
|
||||
// UDP Socket class for FS2Open PXO
|
||||
// Derek Meek
|
||||
// 2-14-2003
|
||||
|
||||
// ############## ATTENTION ##########
|
||||
// Licensed under the Academic Free License version 2.0
|
||||
// View License at http://www.opensource.org/licenses/afl-2.0.php
|
||||
// ###################################
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/fs2open_pxo/udpsocket.h $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2004/02/21 00:59:43 Kazan
|
||||
* FS2NETD License Comments
|
||||
*
|
||||
* Revision 1.2 2003/10/13 06:02:50 Kazan
|
||||
* Added Log Comment Thingy to these files
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__protocol_h_)
|
||||
#define __protocol_h_
|
||||
|
||||
#if defined(WIN32)
|
||||
// Windows Version
|
||||
#include <windows.h>
|
||||
|
||||
#pragma warning(push, 2) // ignore all those warnings for Microsoft stuff
|
||||
#include <string>
|
||||
#pragma warning(pop)
|
||||
|
||||
//#include <winsock2.h>
|
||||
#define STYPE SOCKET
|
||||
#define CLOSEFUNC closesocket
|
||||
|
||||
#else
|
||||
// Unix Version
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string>
|
||||
#define STYPE int
|
||||
#define CLOSEFUNC close
|
||||
|
||||
#endif
|
||||
|
||||
class UDP_Socket
|
||||
{
|
||||
private:
|
||||
|
||||
bool Initialized;
|
||||
STYPE socket;
|
||||
int port;
|
||||
|
||||
|
||||
public:
|
||||
UDP_Socket() : Initialized(false), port(0)
|
||||
{}
|
||||
UDP_Socket(int aport) : Initialized(false), port(aport)
|
||||
{}
|
||||
|
||||
~UDP_Socket() { Close(); }
|
||||
|
||||
bool isInitialized() { return Initialized; }
|
||||
void SetPort(int aport) { port = aport; }
|
||||
bool InitSocket();
|
||||
int GetPacket(char *buffer, int blen, std::string &from);
|
||||
int SendPacket(char *buffer, int plen, std::string &to, int toport);
|
||||
|
||||
void Close() { CLOSEFUNC(socket); }
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-03-08 22:02:38 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Functions to drive the context-sensitive help
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2004/02/20 04:29:54 bobboau
|
||||
* pluged memory leaks,
|
||||
* 3D HTL lasers (they work perfictly)
|
||||
* and posably fixed Turnsky's shinemap bug
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -112,19 +124,12 @@
|
||||
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "io/mouse.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "menuui/techmenu.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "localization/localize.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@@ -389,7 +394,16 @@ void launch_context_help()
|
||||
help_overlay_set_state(MULTI_START_OVERLAY, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case GS_STATE_NET_CHAT:
|
||||
if (!help_overlay_active(FS2OX_OVERLAY) ) {
|
||||
help_overlay_set_state(FS2OX_OVERLAY, 1);
|
||||
}
|
||||
else {
|
||||
help_overlay_set_state(FS2OX_OVERLAY, 1);
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case GS_STATE_MULTI_JOIN_GAME:
|
||||
if ( !help_overlay_active(MULTI_JOIN_OVERLAY) ) {
|
||||
help_overlay_set_state(MULTI_JOIN_OVERLAY, 1);
|
||||
@@ -452,6 +466,12 @@ void launch_context_help()
|
||||
} // end switch
|
||||
}
|
||||
|
||||
void close_help(){
|
||||
for (int overlay_id=0; overlay_id<MAX_HELP_OVERLAYS; overlay_id++){
|
||||
for(int i = 0; i<HELP_MAX_ITEM; i++)
|
||||
safe_kill(help_overlaylist[overlay_id].textlist[GR_640][i].string);
|
||||
}
|
||||
}
|
||||
|
||||
// Called once at the beginning of the game to load help bitmaps & data
|
||||
void help_overlay_init()
|
||||
@@ -470,11 +490,11 @@ void help_overlay_init()
|
||||
Int3();
|
||||
}
|
||||
|
||||
atexit(close_help);
|
||||
// parse help.tbl
|
||||
parse_helptbl();
|
||||
}
|
||||
|
||||
|
||||
// parses help.tbl and populates help_overlaylist[]
|
||||
void parse_helptbl()
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define SIM_ROOM_OVERLAY 13 // sim room help overlay
|
||||
#define TECH_ROOM_OVERLAY 14 // tech room (general) help overlay
|
||||
#define CMD_BRIEF_OVERLAY 15 // command briefing help overlay
|
||||
//#define FS2OX_OVERLAY 16 // Chat help overlay
|
||||
|
||||
// other help overlay constants
|
||||
#define HELP_MAX_ITEM 50 // max number of screen elements per element type per overlay
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Module for displaying in-game help
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/03/18 10:07:02 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:42 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -118,15 +130,9 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "io/mouse.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "ui/ui.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-05-03 21:22:20 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* File to control Game Sequencing
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2004/03/05 09:02:03 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -243,8 +250,8 @@
|
||||
* States should always be referred to using the macros.
|
||||
*/
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// local defines
|
||||
#define MAX_GAMESEQ_EVENTS 20 // maximum number of events on the game sequencing queue
|
||||
@@ -459,6 +466,12 @@ int gameseq_get_event()
|
||||
return event;
|
||||
}
|
||||
|
||||
// Is our state stack valid
|
||||
bool GameState_Stack_Valid()
|
||||
{
|
||||
return (gs_current_stack != -1);
|
||||
}
|
||||
|
||||
// returns one of the GS_STATE_ macros
|
||||
int gameseq_get_state(int depth)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-05-03 21:22:20 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Header file for Game Sequencing items
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2004/03/08 22:02:38 Kazan
|
||||
* Lobby GUI screen restored
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:02:03 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -334,74 +344,73 @@
|
||||
#ifndef __GAMESEQUENCE_H__
|
||||
#define __GAMESEQUENCE_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// defines for game sequencing events
|
||||
//
|
||||
|
||||
#define GS_EVENT_MAIN_MENU 0 // first event to move to first state
|
||||
#define GS_EVENT_MAIN_MENU 0 // first event to move to first state
|
||||
#define GS_EVENT_START_GAME 1 // start a new game (Loads a mission then goes to briefing state)
|
||||
#define GS_EVENT_ENTER_GAME 2 // switches into game state, probably after mission briefing or ship selection.
|
||||
#define GS_EVENT_START_GAME_QUICK 3 // start a new game (Loads a mission then goes to directly to game state)
|
||||
#define GS_EVENT_END_GAME 4 // end the current game (i.e. back to main menu)
|
||||
#define GS_EVENT_QUIT_GAME 5 // quit the entire game
|
||||
#define GS_EVENT_END_GAME 4 // end the current game (i.e. back to main menu)
|
||||
#define GS_EVENT_QUIT_GAME 5 // quit the entire game
|
||||
#define GS_EVENT_PAUSE_GAME 6 // pause the current game
|
||||
#define GS_EVENT_PREVIOUS_STATE 7 // return to the previous state
|
||||
#define GS_EVENT_OPTIONS_MENU 8 // go to the options menu
|
||||
#define GS_EVENT_OPTIONS_MENU 8 // go to the options menu
|
||||
#define GS_EVENT_BARRACKS_MENU 9 // go to the barracks menu
|
||||
#define GS_EVENT_TRAINING_MENU 10 // go to the training menu
|
||||
#define GS_EVENT_TECH_MENU 11 // go to the tech room menu
|
||||
#define GS_EVENT_TECH_MENU 11 // go to the tech room menu
|
||||
#define GS_EVENT_LOAD_MISSION_MENU 12 // go to the load mission menu
|
||||
#define GS_EVENT_SHIP_SELECTION 13 // Show ship selection menu
|
||||
#define GS_EVENT_TOGGLE_FULLSCREEN 14 // toggle fullscreen mode
|
||||
#define GS_EVENT_START_BRIEFING 15 // go to the briefing for the current mission
|
||||
#define GS_EVENT_DEBUG_PAUSE_GAME 16
|
||||
#define GS_EVENT_HUD_CONFIG 17 // start the HUD configuration screen
|
||||
#define GS_EVENT_MULTI_JOIN_GAME 18 // start multiplayer join game screen
|
||||
#define GS_EVENT_MULTI_JOIN_GAME 18 // start multiplayer join game screen
|
||||
#define GS_EVENT_CONTROL_CONFIG 19 // get user to choose what type of controller to config
|
||||
#define GS_EVENT_EVENT_DEBUG 20 // an event debug trace scroll list display screen
|
||||
#define GS_EVENT_EVENT_DEBUG 20 // an event debug trace scroll list display screen
|
||||
#define GS_EVENT_WEAPON_SELECTION 21 // Do weapon loadout
|
||||
#define GS_EVENT_MISSION_LOG_SCROLLBACK 22 // scrollback screen for message log entries
|
||||
#define GS_EVENT_MISSION_LOG_SCROLLBACK 22 // scrollback screen for message log entries
|
||||
#define GS_EVENT_GAMEPLAY_HELP 23 // show help for the gameplay
|
||||
#define GS_EVENT_DEATH_DIED 24 // Player just died
|
||||
#define GS_EVENT_DEATH_BLEW_UP 25 // Saw ship explode.
|
||||
#define GS_EVENT_NEW_CAMPAIGN 26
|
||||
#define GS_EVENT_CREDITS 27 // Got to the credits
|
||||
#define GS_EVENT_NEW_CAMPAIGN 26
|
||||
#define GS_EVENT_CREDITS 27 // Got to the credits
|
||||
#define GS_EVENT_SHOW_GOALS 28 // Show the goal status screen
|
||||
#define GS_EVENT_HOTKEY_SCREEN 29 // Show the hotkey assignment screen
|
||||
#define GS_EVENT_VIEW_MEDALS 30 // Go to the View Medals screen
|
||||
#define GS_EVENT_VIEW_MEDALS 30 // Go to the View Medals screen
|
||||
#define GS_EVENT_MULTI_HOST_SETUP 31 // host setup for multiplayer
|
||||
#define GS_EVENT_MULTI_CLIENT_SETUP 32 // client setup for multiplayer
|
||||
#define GS_EVENT_DEBRIEF 33 // go to debriefing
|
||||
#define GS_EVENT_GOTO_VIEW_CUTSCENES_SCREEN 34 // go to the demo management screen
|
||||
#define GS_EVENT_DEBRIEF 33 // go to debriefing
|
||||
#define GS_EVENT_GOTO_VIEW_CUTSCENES_SCREEN 34 // go to the demo management screen
|
||||
#define GS_EVENT_MULTI_STD_WAIT 35 // standalone wait state
|
||||
#define GS_EVENT_STANDALONE_MAIN 36 // the main do-nothing state of the standalone
|
||||
#define GS_EVENT_MULTI_PAUSE 37 // pause your multiplayer game
|
||||
#define GS_EVENT_TEAM_SELECT 38 // team selection for multiplayer
|
||||
#define GS_EVENT_STANDALONE_MAIN 36 // the main do-nothing state of the standalone
|
||||
#define GS_EVENT_MULTI_PAUSE 37 // pause your multiplayer game
|
||||
#define GS_EVENT_TEAM_SELECT 38 // team selection for multiplayer
|
||||
#define GS_EVENT_TRAINING_PAUSE 39 // pause game while training message is displayed
|
||||
#define GS_EVENT_INGAME_PRE_JOIN 40 // go to ship selection screen for ingame join
|
||||
#define GS_EVENT_INGAME_PRE_JOIN 40 // go to ship selection screen for ingame join
|
||||
#define GS_EVENT_PLAYER_WARPOUT_START 41 // player hit 'j' to warp out
|
||||
#define GS_EVENT_PLAYER_WARPOUT_START_FORCED 42 // player is being forced out of mission no matter what
|
||||
#define GS_EVENT_PLAYER_WARPOUT_START_FORCED 42 // player is being forced out of mission no matter what
|
||||
#define GS_EVENT_PLAYER_WARPOUT_STOP 43 // player hit 'esc' or something to cancel warp out
|
||||
#define GS_EVENT_PLAYER_WARPOUT_DONE_STAGE1 44 // player ship got up to speed
|
||||
#define GS_EVENT_PLAYER_WARPOUT_DONE_STAGE2 45 // player ship got through the warp effect
|
||||
#define GS_EVENT_PLAYER_WARPOUT_DONE_STAGE1 44 // player ship got up to speed
|
||||
#define GS_EVENT_PLAYER_WARPOUT_DONE_STAGE2 45 // player ship got through the warp effect
|
||||
#define GS_EVENT_PLAYER_WARPOUT_DONE 46 // warp effect went away
|
||||
#define GS_EVENT_STANDALONE_POSTGAME 47 // debriefing, etc
|
||||
#define GS_EVENT_INITIAL_PLAYER_SELECT 48 // initial screen where player selects from multi/single player pilots
|
||||
#define GS_EVENT_GAME_INIT 49
|
||||
#define GS_EVENT_MULTI_MISSION_SYNC 50 // sychronize/transfer/load any mission specific data in multiplayer
|
||||
#define GS_EVENT_GAME_INIT 49
|
||||
#define GS_EVENT_MULTI_MISSION_SYNC 50 // sychronize/transfer/load any mission specific data in multiplayer
|
||||
#define GS_EVENT_MULTI_START_GAME 51 // immediately before the create game screen for the host to set the game variables
|
||||
#define GS_EVENT_MULTI_HOST_OPTIONS 52 // options the host can set while in the create game scree
|
||||
#define GS_EVENT_MULTI_DOGFIGHT_DEBRIEF 53 // multiplayer furball debriefing screen (replaces normal debriefing)
|
||||
#define GS_EVENT_MULTI_DOGFIGHT_DEBRIEF 53 // multiplayer furball debriefing screen (replaces normal debriefing)
|
||||
#define GS_EVENT_CAMPAIGN_ROOM 54
|
||||
#define GS_EVENT_CMD_BRIEF 55 // switch to command briefing screen
|
||||
#define GS_EVENT_TOGGLE_GLIDE 56 // GS_EVENT_TOGGLE_GLIDE
|
||||
#define GS_EVENT_RED_ALERT 57 // go to red alert screen
|
||||
#define GS_EVENT_CMD_BRIEF 55 // switch to command briefing screen
|
||||
#define GS_EVENT_TOGGLE_GLIDE 56 // GS_EVENT_TOGGLE_GLIDE
|
||||
#define GS_EVENT_RED_ALERT 57 // go to red alert screen
|
||||
#define GS_EVENT_SIMULATOR_ROOM 58
|
||||
#define GS_EVENT_END_CAMPAIGN 59 // end of the whole thang.
|
||||
#define GS_EVENT_END_DEMO 60 // end of demo campaign
|
||||
#define GS_EVENT_END_CAMPAIGN 59 // end of the whole thang.
|
||||
#define GS_EVENT_END_DEMO 60 // end of demo campaign
|
||||
#define GS_EVENT_LOOP_BRIEF 61 // campaign loop brief
|
||||
#define GS_EVENT_CAMPAIGN_CHEAT 62 // skip to a mission in a campaign
|
||||
#define GS_EVENT_NET_CHAT 63 // #Kazan# - Go to net chat for Fs2NetD
|
||||
|
||||
// IMPORTANT: When you add a new event, update the initialization for GS_event_text[]
|
||||
// which is done in GameSequence.cpp
|
||||
@@ -461,7 +470,7 @@ extern char *GS_event_text[]; // text description for the GS_EVENT_* #defines a
|
||||
#define GS_STATE_GAMEPLAY_HELP 47
|
||||
#define GS_STATE_END_DEMO 48 // end of demo campaign (upsell then main menu)
|
||||
#define GS_STATE_LOOP_BRIEF 49
|
||||
|
||||
#define GS_STATE_NET_CHAT 50 // #Kazan# - state for the pxo chat readded by penguin
|
||||
|
||||
// IMPORTANT: When you add a new state, update the initialization for GS_state_text[]
|
||||
// which is done in GameSequence.cpp
|
||||
@@ -491,4 +500,7 @@ void game_leave_state(int old_state,int new_state);
|
||||
void game_enter_state(int old_state,int new_state);
|
||||
void game_do_state(int current_state);
|
||||
|
||||
// Kazan
|
||||
bool GameState_Stack_Valid();
|
||||
|
||||
#endif /* __GAMESEQUENCE_H__ */
|
||||
@@ -9,13 +9,43 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2004-03-05 09:02:00 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.8 2004/02/08 03:35:08 Goober5000
|
||||
* fixed a small bug in FS1-compatible music
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2004/01/30 07:39:06 Goober5000
|
||||
* whew - I just went through all the code I ever added (or at least, that I could
|
||||
* find that I commented with a Goober5000 tag) and added a bunch of Asserts
|
||||
* and error-checking
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/10/14 16:47:34 Goober5000
|
||||
* tweaked a thingy with FS1-style music to make deciding the style less of a hack
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/08/25 04:46:53 Goober5000
|
||||
* added extra code to enable playing of FS1 music tracks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/04/29 01:03:23 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/22 06:06:22 Goober5000
|
||||
* changed event_sexp_change_music to event_change_sexp_soundtrack
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/01/25 04:17:39 Goober5000
|
||||
* added change-music sexp and bumped MAX_SOUNDTRACKS from 10 to 25
|
||||
* --Ian Warfield
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -117,22 +147,18 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "mission/missionload.h" /* for Builtin_mission_names[] */
|
||||
#include "mission/missionparse.h"
|
||||
#include "io/timer.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "mission/missioncampaign.h"
|
||||
#include "sound/sound.h"
|
||||
#include "time.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "mission/missiongoals.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
#pragma optimize("", off)
|
||||
|
||||
@@ -175,6 +201,7 @@ int Current_soundtrack_num; // Active soundtrack for the current mission.. index
|
||||
int Current_pattern = -1; // currently playing part of track
|
||||
int Pending_pattern = -1;
|
||||
int Pattern_timer_id = 0;
|
||||
int Current_nrml = SONG_NRML_1;
|
||||
|
||||
// File Globals
|
||||
static int Num_enemy_arrivals;
|
||||
@@ -187,6 +214,7 @@ static int Mission_over_timestamp;
|
||||
static int Victory2_music_played;
|
||||
static int Next_arrival_timestamp;
|
||||
static int Check_for_battle_music;
|
||||
static int Current_soundtrack_fs1_style;
|
||||
|
||||
// stores the number of measures for the different patterns (data from music.tbl)
|
||||
float Pattern_num_measures[MAX_SOUNDTRACKS][MAX_PATTERNS];
|
||||
@@ -207,8 +235,10 @@ char* Pattern_names[MAX_PATTERNS] =
|
||||
"EARV_2", // Enemy Arrival 2
|
||||
"VICT_1", // Victory Song 1
|
||||
"VICT_2", // Victory Song 2
|
||||
"FAIL_1" // Goal Failed 1
|
||||
"DEAD_1" // Death Song 1
|
||||
"FAIL_1", // Goal Failed 1
|
||||
"DEAD_1", // Death Song 1
|
||||
"NRML_2", // Normal Song 2
|
||||
"NRML_3" // Normal Song 3
|
||||
//XSTR:ON
|
||||
};
|
||||
|
||||
@@ -225,8 +255,10 @@ char* Pattern_description[MAX_PATTERNS] =
|
||||
"enemey arrival 2",
|
||||
"victory 1",
|
||||
"victory 2",
|
||||
"goal failed 1"
|
||||
"death "
|
||||
"goal failed 1",
|
||||
"death",
|
||||
"normal 2",
|
||||
"normal 3"
|
||||
//XSTR:ON
|
||||
};
|
||||
|
||||
@@ -242,8 +274,10 @@ int Pattern_loop_for[MAX_PATTERNS] =
|
||||
1, // Enemy Arrival 2
|
||||
1, // Victory Song 1
|
||||
1, // Victory Song 2
|
||||
1, // Goal Failed 1
|
||||
1 // Death Song 1
|
||||
1, // Goal Failed 1
|
||||
1, // Death Song 1
|
||||
1, // Normal Song 2
|
||||
1 // Normal Song 3
|
||||
};
|
||||
|
||||
int Pattern_default_next[MAX_PATTERNS] =
|
||||
@@ -259,7 +293,9 @@ int Pattern_default_next[MAX_PATTERNS] =
|
||||
SONG_NRML_1, // VICT_1 progresses to NRML_1 by default
|
||||
SONG_NRML_1, // VICT_2 progresses to NRML_1 by default
|
||||
SONG_NRML_1, // FAIL_1 progresses to NRML_1 by default
|
||||
-1 // no music plays after dead
|
||||
-1, // no music plays after dead
|
||||
SONG_NRML_1, // NRML_2 progresses to NRML_1 by default (but we intercept this)
|
||||
SONG_NRML_1 // NRML_3 progresses to NRML_1 by default (but we intercept this)
|
||||
};
|
||||
|
||||
|
||||
@@ -278,7 +314,9 @@ int Pattern_can_force[MAX_PATTERNS] =
|
||||
FALSE, // VICT_1
|
||||
TRUE, // VICT_2
|
||||
FALSE, // FAIL_1
|
||||
TRUE // DEAD_1
|
||||
TRUE, // DEAD_1
|
||||
TRUE, // NRML_2
|
||||
TRUE // NRML_3
|
||||
};
|
||||
|
||||
|
||||
@@ -300,6 +338,42 @@ int Num_music_files; // Number of spooled music files
|
||||
// Array that holds indicies into Spooled_music[], these specify which music is played in breifing/debriefing
|
||||
int Mission_music[NUM_SCORES];
|
||||
|
||||
// Goober5000
|
||||
int maybe_cycle_nrml(int pattern)
|
||||
{
|
||||
if ((pattern == SONG_NRML_1) || (pattern == SONG_NRML_2) || (pattern == SONG_NRML_3))
|
||||
{
|
||||
Current_nrml = maybe_get_next_nrml_no_cycle(Current_nrml);
|
||||
pattern = Current_nrml;
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
// Goober5000
|
||||
int maybe_get_next_nrml_no_cycle(int pattern)
|
||||
{
|
||||
switch (pattern)
|
||||
{
|
||||
case SONG_NRML_1:
|
||||
if (Patterns[SONG_NRML_2].handle == -1)
|
||||
return SONG_NRML_1;
|
||||
else
|
||||
return SONG_NRML_2;
|
||||
|
||||
case SONG_NRML_2:
|
||||
if (Patterns[SONG_NRML_3].handle == -1)
|
||||
return SONG_NRML_1;
|
||||
else
|
||||
return SONG_NRML_3;
|
||||
|
||||
case SONG_NRML_3:
|
||||
return SONG_NRML_1;
|
||||
|
||||
default:
|
||||
return pattern;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// event_music_init()
|
||||
//
|
||||
@@ -356,8 +430,11 @@ void event_music_force_switch()
|
||||
|
||||
new_pattern = Patterns[Current_pattern].next_pattern;
|
||||
|
||||
if ( (new_pattern == SONG_BTTL_3) && (Patterns[SONG_BTTL_3].handle == -1) ) {
|
||||
if ( Current_pattern == SONG_BTTL_2 ) {
|
||||
// make sure we have a valid track to switch to
|
||||
if ( (new_pattern == SONG_BTTL_2) && (Patterns[SONG_BTTL_2].handle == -1) ) {
|
||||
new_pattern = SONG_BTTL_1;
|
||||
} else if ( (new_pattern == SONG_BTTL_3) && (Patterns[SONG_BTTL_3].handle == -1) ) {
|
||||
if ( (Current_pattern == SONG_BTTL_2) || (Patterns[SONG_BTTL_2].handle == -1) ) {
|
||||
new_pattern = SONG_BTTL_1;
|
||||
} else {
|
||||
new_pattern = SONG_BTTL_2;
|
||||
@@ -367,8 +444,8 @@ void event_music_force_switch()
|
||||
// AL 06-24-99: maybe switch to battle 2 if hull is less than 70%
|
||||
if (Player_obj != NULL && Player_ship != NULL) {
|
||||
Assert(Player_ship->ship_info_index >= 0);
|
||||
Assert(Ship_info[Player_ship->ship_info_index].initial_hull_strength != 0);
|
||||
float integrity = Player_obj->hull_strength / Ship_info[Player_ship->ship_info_index].initial_hull_strength;
|
||||
Assert(Player_ship->ship_initial_hull_strength != 0);
|
||||
float integrity = Player_obj->hull_strength / Player_ship->ship_initial_hull_strength;
|
||||
if (integrity < HULL_VALUE_TO_PLAY_INTENSE_BATTLE_MUSIC) {
|
||||
new_pattern = SONG_BTTL_2;
|
||||
}
|
||||
@@ -376,6 +453,9 @@ void event_music_force_switch()
|
||||
}
|
||||
}
|
||||
|
||||
// set up switching
|
||||
new_pattern = maybe_cycle_nrml(new_pattern);
|
||||
|
||||
if ( new_pattern == -1 ) {
|
||||
return;
|
||||
}
|
||||
@@ -389,6 +469,8 @@ void event_music_force_switch()
|
||||
Patterns[Current_pattern].next_pattern = Patterns[Current_pattern].default_next_pattern;
|
||||
Patterns[Current_pattern].force_pattern = FALSE;
|
||||
nprintf(("EVENTMUSIC", "EVENTMUSIC => switching to %s from %s\n", Pattern_names[new_pattern], Pattern_names[Current_pattern]));
|
||||
|
||||
// actually switch the pattern
|
||||
Current_pattern = new_pattern;
|
||||
}
|
||||
|
||||
@@ -470,7 +552,7 @@ void event_music_do_frame()
|
||||
}
|
||||
|
||||
if (Event_Music_battle_started == 0) {
|
||||
if (Current_pattern == SONG_NRML_1) {
|
||||
if (Current_pattern == SONG_NRML_1 || Current_pattern == SONG_NRML_2 || Current_pattern == SONG_NRML_3 ) {
|
||||
if (timestamp_elapsed(Check_for_battle_music)) {
|
||||
Check_for_battle_music = timestamp(1000);
|
||||
if (hostile_ships_present() == TRUE) {
|
||||
@@ -519,6 +601,7 @@ void event_music_level_init(int force_soundtrack)
|
||||
return;
|
||||
|
||||
Current_pattern = -1;
|
||||
Current_nrml = SONG_NRML_1;
|
||||
|
||||
if ( Event_music_inited == FALSE )
|
||||
return;
|
||||
@@ -545,7 +628,12 @@ void event_music_level_init(int force_soundtrack)
|
||||
strack = &Soundtracks[Current_soundtrack_num];
|
||||
|
||||
// open the pattern files, and get ready to play them
|
||||
for ( i = 0; i < strack->num_patterns; i++ ) {
|
||||
// Goober5000 - changed from strack->num_patterns to MAX_PATTERNS so that *all*
|
||||
// patterns would be checked; the behavior is the same because they were previously
|
||||
// set to none.wav in event_music_parse_musictbl, but this change was needed because
|
||||
// the NRML_2 and NRML_3 at the end of the pattern array kept getting spurious music
|
||||
// tracks because their patterns weren't -1
|
||||
for ( i = 0; i < MAX_PATTERNS; i++ ) {
|
||||
if ( !stricmp(NOX("none.wav"), strack->pattern_fnames[i]) ) {
|
||||
Patterns[i].handle = -1;
|
||||
continue;
|
||||
@@ -576,6 +664,9 @@ void event_music_level_init(int force_soundtrack)
|
||||
Victory2_music_played = 0;
|
||||
Check_for_battle_music = 0;
|
||||
|
||||
// Goober5000 - is this FS1 style?
|
||||
Current_soundtrack_fs1_style = stristr(Soundtracks[Current_soundtrack_num].name, "fs1") ? 1 : 0;
|
||||
|
||||
if ( Event_music_level_inited ) {
|
||||
if ( force_soundtrack != -1 ) {
|
||||
event_music_first_pattern();
|
||||
@@ -734,7 +825,7 @@ int event_music_enemy_arrival()
|
||||
next_pattern = SONG_EARV_1;
|
||||
}
|
||||
|
||||
if ( Current_pattern == next_pattern )
|
||||
if ( Current_pattern == maybe_get_next_nrml_no_cycle(next_pattern) )
|
||||
return 0; // already playing
|
||||
|
||||
if ( Current_pattern == SONG_DEAD_1 )
|
||||
@@ -752,8 +843,8 @@ int event_music_enemy_arrival()
|
||||
bool play_intense_battle_music = false;
|
||||
if (Player_obj != NULL && Player_ship != NULL) {
|
||||
Assert(Player_ship->ship_info_index >= 0);
|
||||
Assert(Ship_info[Player_ship->ship_info_index].initial_hull_strength != 0);
|
||||
float integrity = Player_obj->hull_strength / Ship_info[Player_ship->ship_info_index].initial_hull_strength;
|
||||
Assert(Player_ship->ship_initial_hull_strength != 0);
|
||||
float integrity = Player_obj->hull_strength / Player_ship->ship_initial_hull_strength;
|
||||
if (integrity < HULL_VALUE_TO_PLAY_INTENSE_BATTLE_MUSIC) {
|
||||
play_intense_battle_music = true;
|
||||
}
|
||||
@@ -824,7 +915,7 @@ int event_music_friendly_arrival()
|
||||
next_pattern = SONG_AARV_1;
|
||||
}
|
||||
|
||||
if ( Current_pattern == next_pattern )
|
||||
if ( Current_pattern == maybe_get_next_nrml_no_cycle(next_pattern) )
|
||||
return 0; // already playing
|
||||
|
||||
if ( Current_pattern == SONG_DEAD_1 )
|
||||
@@ -833,6 +924,9 @@ int event_music_friendly_arrival()
|
||||
if ( (Current_pattern == SONG_VICT_1) || (Current_pattern == SONG_VICT_1) )
|
||||
return 0;
|
||||
|
||||
// Goober5000 - to avoid array out-of-bounds
|
||||
Assert(Current_pattern >= 0 && Current_pattern < MAX_PATTERNS);
|
||||
|
||||
if ( Patterns[Current_pattern].next_pattern != Patterns[Current_pattern].default_next_pattern )
|
||||
return 0; // don't squash a pending pattern
|
||||
|
||||
@@ -841,16 +935,21 @@ int event_music_friendly_arrival()
|
||||
|
||||
if ( Current_pattern != -1 ) {
|
||||
// AL 06-24-99: always overlay allied arrivals
|
||||
/*
|
||||
if (next_pattern == SONG_AARV_1) {
|
||||
// Goober5000 - bah, this screws up the FS1 music... so this is a hack to *not* overlay
|
||||
// *if* the soundtrack title includes "FS1" in it (as set in event_music_level_init)
|
||||
|
||||
// don't overlay
|
||||
if (Current_soundtrack_fs1_style) {
|
||||
Patterns[Current_pattern].next_pattern = next_pattern;
|
||||
Patterns[Current_pattern].force_pattern = TRUE;
|
||||
// overlay
|
||||
} else {
|
||||
*/
|
||||
// Goober5000 - I didn't touch this part... for some reason, FS2 only has one
|
||||
// arrival music pattern, and this is it
|
||||
Assert(Patterns[SONG_AARV_1].handle >= 0 );
|
||||
audiostream_play(Patterns[SONG_AARV_1].handle, Master_event_music_volume, 0); // no looping
|
||||
audiostream_set_byte_cutoff(Patterns[SONG_AARV_1].handle, fl2i(Patterns[SONG_AARV_1].num_measures * Patterns[SONG_AARV_1].bytes_per_measure) );
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Next_arrival_timestamp = timestamp(ARRIVAL_INTERVAL_TIMESTAMP);
|
||||
@@ -1041,10 +1140,20 @@ void event_music_parse_musictbl()
|
||||
{
|
||||
char fname[MAX_FILENAME_LEN];
|
||||
char line_buf[128];
|
||||
int rval;
|
||||
int rval, i, j;
|
||||
|
||||
int num_patterns = 0;
|
||||
|
||||
// Goober5000 - clear all the filenames, so we're compatible with the extra NRMLs in FS1 music
|
||||
for (i = 0; i < MAX_SOUNDTRACKS; i++)
|
||||
{
|
||||
for (j = 0; j < MAX_PATTERNS; j++)
|
||||
{
|
||||
strcpy(Soundtracks[i].pattern_fnames[j], "none.wav");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Num_music_files = 0;
|
||||
Num_soundtracks = 0; // Global
|
||||
event_music_reset_choices();
|
||||
@@ -1149,7 +1258,7 @@ void event_music_change_pattern(int new_pattern)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Current_pattern == new_pattern )
|
||||
if ( Current_pattern == maybe_get_next_nrml_no_cycle(new_pattern) );
|
||||
return; // already playing
|
||||
|
||||
if ( Current_pattern != -1 ) {
|
||||
@@ -1243,11 +1352,15 @@ void event_music_start_default()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
next_pattern = SONG_NRML_1;
|
||||
|
||||
if ( Current_pattern == -1 ) {
|
||||
Current_pattern = next_pattern;
|
||||
}
|
||||
|
||||
// switch now
|
||||
if ( Current_pattern == -1 ) {
|
||||
Current_pattern = maybe_cycle_nrml(next_pattern);
|
||||
}
|
||||
// switch later
|
||||
else {
|
||||
Patterns[Current_pattern].next_pattern = next_pattern;
|
||||
Patterns[Current_pattern].force_pattern = TRUE;
|
||||
@@ -1419,7 +1532,7 @@ int event_music_next_soundtrack(int delta)
|
||||
}
|
||||
|
||||
// Goober5000 - along the same lines; this is for the sexp
|
||||
void event_sexp_change_music(char *name)
|
||||
void event_sexp_change_soundtrack(char *name)
|
||||
{
|
||||
Assert(name);
|
||||
|
||||
|
||||
@@ -9,13 +9,30 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-03-05 09:02:00 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2003/08/25 04:46:53 Goober5000
|
||||
* added extra code to enable playing of FS1 music tracks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/29 05:18:17 Goober5000
|
||||
* yay for limit bumping!
|
||||
* bumped number of battle tracks and briefing/mainhall/credits tracks, both to 30
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/22 06:06:22 Goober5000
|
||||
* changed event_sexp_change_music to event_change_sexp_soundtrack
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/01/25 04:17:39 Goober5000
|
||||
* added change-music sexp and bumped MAX_SOUNDTRACKS from 10 to 25
|
||||
* --Ian Warfield
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -130,7 +147,8 @@
|
||||
#ifndef __EVENT_MUSIC_H__
|
||||
#define __EVENT_MUSIC_H__
|
||||
|
||||
#include "parse/parselo.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// Identifies songs in the Soundtrack_filenames[] structure. The order matches up with
|
||||
// what is in music.tbl. Do not modify without synching music.tbl.
|
||||
@@ -146,8 +164,10 @@
|
||||
#define SONG_VICT_2 9 // Victory Song 2
|
||||
#define SONG_FAIL_1 10 // Goal Failed
|
||||
#define SONG_DEAD_1 11 // Death Song 1
|
||||
#define SONG_NRML_2 12 // Normal Song 2 - for FS1
|
||||
#define SONG_NRML_3 13 // Normal Song 3 - for FS1
|
||||
|
||||
#define MAX_PATTERNS 12
|
||||
#define MAX_PATTERNS 14
|
||||
|
||||
// if player targets a hostile ship at less than this range, switch to battle track
|
||||
#define BATTLE_START_MIN_TARGET_DIST 500
|
||||
@@ -176,7 +196,7 @@ typedef struct menu_music {
|
||||
char filename[MAX_FILENAME_LEN]; // name music is stored on disk as
|
||||
} menu_music;
|
||||
|
||||
#define MAX_SPOOLED_MUSIC 20
|
||||
#define MAX_SPOOLED_MUSIC 30 // max number of briefing/mainhall/credits tracks
|
||||
|
||||
extern menu_music Spooled_music[MAX_SPOOLED_MUSIC];
|
||||
extern int Num_music_files;
|
||||
@@ -188,13 +208,17 @@ typedef struct tagSOUNDTRACK_INFO {
|
||||
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
|
||||
} SOUNDTRACK_INFO;
|
||||
|
||||
#define MAX_SOUNDTRACKS 25
|
||||
#define MAX_SOUNDTRACKS 30 // max number of battle tracks
|
||||
|
||||
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
|
||||
extern int Num_soundtracks;
|
||||
|
||||
#ifndef NO_SOUND
|
||||
|
||||
// Goober5000 - for handling NRML tracks from FS1
|
||||
int maybe_get_next_nrml_no_cycle(int pattern);
|
||||
int maybe_cycle_nrml(int pattern);
|
||||
|
||||
void event_music_init();
|
||||
void event_music_close();
|
||||
void event_music_level_init(int force_soundtrack = -1);
|
||||
@@ -220,7 +244,7 @@ void event_music_start_default();
|
||||
void event_music_get_info(char *outbuf);
|
||||
void event_music_get_soundtrack_name(char *outbuf);
|
||||
int event_music_next_soundtrack(int delta);
|
||||
void event_sexp_change_music(char *name);
|
||||
void event_sexp_change_soundtrack(char *name);
|
||||
void event_music_set_soundtrack(char *name);
|
||||
void event_music_set_score(int score_index, char *name);
|
||||
int event_music_get_spooled_music_index(char *name);
|
||||
@@ -231,6 +255,10 @@ void event_music_hostile_ship_destroyed();
|
||||
|
||||
#else
|
||||
|
||||
// Goober5000 - for NO_SOUND
|
||||
#define maybe_get_next_nrml_no_cycle(int pattern) (0)
|
||||
#define maybe_cycle_nrml(int pattern) (0)
|
||||
|
||||
#define event_music_init()
|
||||
#define event_music_close()
|
||||
#define event_music_level_init(force_soundtrack) ((void)(force_soundtrack))
|
||||
|
||||
@@ -9,13 +9,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-04-26 00:25:08 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2004/04/03 02:55:49 bobboau
|
||||
* commiting recent minor bug fixes
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/10/15 22:03:24 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -170,11 +183,10 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "sound/sound.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "localization/localize.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
// Global array that holds data about the gameplay sound effects.
|
||||
game_snd Snds[MAX_GAME_SOUNDS];
|
||||
@@ -229,7 +241,9 @@ void gamesnd_load_gameplay_sounds()
|
||||
for ( i = 0; i < MAX_GAME_SOUNDS; i++ ) {
|
||||
gs = &Snds[i];
|
||||
if ( gs->filename[0] != 0 && stricmp(gs->filename, NOX("none.wav")) ) {
|
||||
gs->id = snd_load(gs);
|
||||
if ( !gs->preload ) { // don't try to load anything that's already preloaded
|
||||
gs->id = snd_load(gs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -364,6 +378,16 @@ void gamesnd_parse_soundstbl()
|
||||
// parse flyby sound section
|
||||
required_string("#Flyby Sounds Start");
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
char cstrtemp[SPECIES_NAME_MAXLEN+3];
|
||||
|
||||
for (int i = 0; i < True_NumSpecies; i++)
|
||||
{
|
||||
sprintf(cstrtemp, "$%s:", Species_names[i]);
|
||||
gamesnd_parse_line(&Snds_flyby[i][0], cstrtemp);
|
||||
gamesnd_parse_line(&Snds_flyby[i][1], cstrtemp);
|
||||
}
|
||||
#else
|
||||
// read 2 terran sounds
|
||||
gamesnd_parse_line(&Snds_flyby[SPECIES_TERRAN][0], "$Terran:");
|
||||
gamesnd_parse_line(&Snds_flyby[SPECIES_TERRAN][1], "$Terran:");
|
||||
@@ -374,6 +398,7 @@ void gamesnd_parse_soundstbl()
|
||||
|
||||
gamesnd_parse_line(&Snds_flyby[SPECIES_SHIVAN][0], "$Shivan:");
|
||||
gamesnd_parse_line(&Snds_flyby[SPECIES_SHIVAN][1], "$Shivan:");
|
||||
#endif
|
||||
|
||||
required_string("#Flyby Sounds End");
|
||||
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-10 05:43:35 $
|
||||
* $Author: Goober5000 $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-03-12 16:23:49 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2003/03/20 22:58:43 Goober5000
|
||||
* moved ballistic primary reload sounds to indexes 171 and 172
|
||||
*
|
||||
* Revision 2.3 2003/03/18 01:44:31 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/12/10 05:43:35 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -96,7 +106,7 @@
|
||||
* Added sound hooks for Shivan flyby sound, subspace ambient effect
|
||||
*
|
||||
* 71 3/23/98 4:13p Lawrance
|
||||
* Add hooks for captial ship specific warp sounds
|
||||
* Add hooks for capital ship specific warp sounds
|
||||
*
|
||||
* 70 3/21/98 3:34p Lawrance
|
||||
* Added highlight icon sound, added static sound for briefing cut
|
||||
@@ -363,7 +373,12 @@ void common_play_highlight_sound();
|
||||
|
||||
|
||||
// Misc_sounds[] holds handles for misc sounds in the game (list appears in sounds.tbl)
|
||||
#ifdef INF_BUILD
|
||||
#define MAX_GAME_SOUNDS 400
|
||||
#else
|
||||
#define MAX_GAME_SOUNDS 200
|
||||
#endif
|
||||
|
||||
#define MAX_INTERFACE_SOUNDS 70
|
||||
#define MAX_SPECIES_FLYBY_SOUNDS 4 // 4 different possible flybys for species
|
||||
|
||||
@@ -534,8 +549,8 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
#define SND_COPILOT 162
|
||||
|
||||
// added for ballistic primaries - Goober5000
|
||||
#define SND_BALLISTIC_START_LOAD 165
|
||||
#define SND_BALLISTIC_LOAD 166
|
||||
#define SND_BALLISTIC_START_LOAD 171
|
||||
#define SND_BALLISTIC_LOAD 172
|
||||
|
||||
// supernova 1 and supernova 2
|
||||
#define SND_SUPERNOVA_1 173
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
*/
|
||||
#ifndef __3DFX_H__
|
||||
#define __3DFX_H__
|
||||
|
||||
/*
|
||||
** basic data types
|
||||
*/
|
||||
typedef unsigned char FxU8;
|
||||
typedef signed char FxI8;
|
||||
typedef unsigned short FxU16;
|
||||
typedef signed short FxI16;
|
||||
typedef signed long FxI32;
|
||||
typedef unsigned long FxU32;
|
||||
typedef int FxBool;
|
||||
typedef float FxFloat;
|
||||
typedef double FxDouble;
|
||||
|
||||
/*
|
||||
** color types
|
||||
*/
|
||||
typedef unsigned long FxColor_t;
|
||||
typedef struct { float r, g, b, a; } FxColor4;
|
||||
|
||||
/*
|
||||
** fundamental types
|
||||
*/
|
||||
#define FXTRUE 1
|
||||
#define FXFALSE 0
|
||||
|
||||
/*
|
||||
** helper macros
|
||||
*/
|
||||
#define FXUNUSED( a ) ( (a) = (a) )
|
||||
#define FXBIT( i ) ( 1L << (i) )
|
||||
|
||||
/*
|
||||
** export macros
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined (MSVC16)
|
||||
#define FX_ENTRY
|
||||
#define FX_CALL
|
||||
#else
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL __stdcall
|
||||
#endif
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL __stdcall
|
||||
#elif defined (__IBMC__) || defined (__IBMCPP__)
|
||||
/* IBM Visual Age C/C++: */
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL __stdcall
|
||||
#elif defined(__DJGPP__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#elif defined(__unix__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#elif defined(__GNUC__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#else
|
||||
#warning define FX_ENTRY & FX_CALL for your compiler
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#endif
|
||||
|
||||
/*
|
||||
** x86 compiler specific stuff
|
||||
*/
|
||||
#if defined(__BORLANDC_)
|
||||
# define REALMODE
|
||||
|
||||
# define REGW( a, b ) ((a).x.b)
|
||||
# define REGB( a, b ) ((a).h.b)
|
||||
# define INT86( a, b, c ) int86(a,b,c)
|
||||
# define INT86X( a, b, c, d ) int86x(a,b,c,d)
|
||||
|
||||
# define RM_SEG( a ) FP_SEG( a )
|
||||
# define RM_OFF( a ) FP_OFF( a )
|
||||
#elif defined(__WATCOMC__)
|
||||
# undef FP_SEG
|
||||
# undef FP_OFF
|
||||
|
||||
# define REGW( a, b ) ((a).w.b)
|
||||
# define REGB( a, b ) ((a).h.b)
|
||||
# define INT86( a, b, c ) int386(a,b,c)
|
||||
# define INT86X( a, b, c, d ) int386x(a,b,c,d)
|
||||
|
||||
# define RM_SEG( a ) ( ( ( ( FxU32 ) (a) ) & 0x000F0000 ) >> 4 )
|
||||
# define RM_OFF( a ) ( ( FxU16 ) (a) )
|
||||
#endif
|
||||
|
||||
#endif /* !__3DFX_H__ */
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 1996, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
*/
|
||||
/* preprocessor defines for libraries to support DLL creation */
|
||||
|
||||
/* in header file, use FX_ENTRY return-type FX_CALL function-name ( ... ) */
|
||||
/* in source file, use FX_EXPORT return-type FX_CSTYLE function-name (... ) */
|
||||
|
||||
/* in source file, set FX_DLL_DEFINITION, include this file, then include
|
||||
header file for library. */
|
||||
|
||||
/* we need to use two macros per declaration/definition because MSVC
|
||||
requires __stdcall and __declspec( dllexport ) be in different parts
|
||||
of the prototype! */
|
||||
|
||||
/* I use two sets in case we need to control declarations and definitions
|
||||
differently. If it turns out we don't, it should be easy to do a search
|
||||
and replace to eliminate one set */
|
||||
|
||||
/* NOTE: this header file may be included more than once, and FX_DLL_DEFINITION
|
||||
may have changed, so we do not protect this with an #fndef __FXDLL_H__
|
||||
statement like we normally would. */
|
||||
|
||||
|
||||
#ifdef FX_ENTRY
|
||||
#undef FX_ENTRY
|
||||
#endif
|
||||
|
||||
#ifdef FX_CALL
|
||||
#undef FX_CALL
|
||||
#endif
|
||||
|
||||
#ifdef FX_EXPORT
|
||||
#undef FX_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef FX_CSTYLE
|
||||
#undef FX_CSTYLE
|
||||
#endif
|
||||
|
||||
#if defined(FX_DLL_DEFINITION)
|
||||
#if defined(FX_DLL_ENABLE)
|
||||
#if defined(_MSC_VER)
|
||||
#ifndef KERNEL
|
||||
#define FX_ENTRY __declspec( dllexport )
|
||||
#define FX_EXPORT __declspec( dllexport )
|
||||
#else
|
||||
#define FX_ENTRY
|
||||
#define FX_EXPORT
|
||||
#endif /* #ifndef KERNEL */
|
||||
#define FX_CALL __stdcall
|
||||
#define FX_CSTYLE __stdcall
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
#define FX_ENTRY
|
||||
#define FX_CALL __stdcall __export
|
||||
|
||||
#define FX_EXPORT
|
||||
#define FX_CSTYLE __stdcall __export
|
||||
|
||||
#else /* compiler */
|
||||
#error define FX_ENTRY,FX_CALL & FX_EXPORT,FX_CSTYLE for your compiler
|
||||
#endif /* compiler */
|
||||
|
||||
#else /* FX_DLL_ENABLE */
|
||||
#define FX_ENTRY
|
||||
#define FX_CALL __stdcall
|
||||
|
||||
#define FX_EXPORT
|
||||
#define FX_CSTYLE __stdcall
|
||||
#endif /* FX_DLL_ENABLE */
|
||||
|
||||
#else /* FX_DLL_DEFINITION */
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL __stdcall
|
||||
#endif /* FX_DLL_DEFINITION */
|
||||
|
||||
/*
|
||||
* We don't want any of this DLL junk for DJGPP or UNIX
|
||||
* so undo what is done above.
|
||||
*/
|
||||
#if defined(__DJGPP__) || defined(__unix__)
|
||||
#ifdef FX_CALL
|
||||
#undef FX_CALL
|
||||
#endif
|
||||
|
||||
#ifdef FX_CSTYLE
|
||||
#undef FX_CSTYLE
|
||||
#endif
|
||||
|
||||
#ifdef FX_EXPORT
|
||||
#undef FX_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef FX_ENTRY
|
||||
#undef FX_ENTRY
|
||||
#endif
|
||||
|
||||
#define FX_CALL
|
||||
#define FX_CSTYLE
|
||||
#define FX_EXPORT
|
||||
#define FX_ENTRY
|
||||
#endif
|
||||
|
||||
#if defined (MSVC16)
|
||||
#undef FX_CALL
|
||||
#define FX_CALL
|
||||
#endif
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $ Revision: $
|
||||
** $ Date: $
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FXGLOB_H_
|
||||
#define _FXGLOB_H_
|
||||
|
||||
|
||||
void fxGlobify( int *argc, char ***argv );
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
** $ Revision: $
|
||||
** $ Date: $
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FXOS_H_
|
||||
#define _FXOS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifdef _WIN32
|
||||
void sleep(int secs);
|
||||
#define gethostname fxGethostname
|
||||
|
||||
int gethostname(char *name, int namelen);
|
||||
|
||||
# endif
|
||||
|
||||
float fxTime(void);
|
||||
float timer(int flag);
|
||||
|
||||
FILE *fxFopenPath(const char *filename, const char *mode,
|
||||
const char *path, const char **pprefix);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
@@ -1,460 +0,0 @@
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/glide/Glide.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for dynamically loading glide libraries
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 11/11/98 5:37p Dave
|
||||
* Checkin for multiplayer testing.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 4 3/18/98 1:57p John
|
||||
* Made non-perspective correct textures do 2d clipping before rendering.
|
||||
*
|
||||
* 3 2/21/98 11:58a John
|
||||
* Put in some stuff to externalize strings
|
||||
*
|
||||
* 2 2/19/98 6:13p John
|
||||
* Made Glide do texturing & zbuffering.
|
||||
*
|
||||
* 1 1/05/98 10:38a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "glide/glide.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
static HMODULE Glide_lib_handle;
|
||||
|
||||
void vglide_close()
|
||||
{
|
||||
if ( Glide_lib_handle ) {
|
||||
FreeLibrary(Glide_lib_handle);
|
||||
Glide_lib_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns 1 if Glide found, else 0 if not
|
||||
int vglide_init()
|
||||
{
|
||||
HMODULE lib_handle;
|
||||
Glide_lib_handle = LoadLibrary(NOX("glide2x.dll"));
|
||||
if (Glide_lib_handle == NULL) {
|
||||
//No lib so no glide
|
||||
return 0;
|
||||
}
|
||||
|
||||
lib_handle = Glide_lib_handle;
|
||||
|
||||
//XSTR:OFF
|
||||
|
||||
grDrawLine = (void (__stdcall*)(const GrVertex *, const GrVertex *))GetProcAddress(lib_handle, "_grDrawLine@8");
|
||||
grDrawPlanarPolygon = (void (__stdcall *)(int,const int [],const GrVertex []))GetProcAddress(lib_handle, "_grDrawPlanarPolygon@12");
|
||||
grDrawPlanarPolygonVertexList = (void (__stdcall *)(int,const GrVertex []))GetProcAddress(lib_handle, "_grDrawPlanarPolygonVertexList@8");
|
||||
grDrawPoint = (void (__stdcall *)(const GrVertex *))GetProcAddress(lib_handle, "_grDrawPoint@4");
|
||||
grDrawPolygon = (void (__stdcall *)(int,const int [],const GrVertex []))GetProcAddress(lib_handle, "_grDrawPolygon@12");
|
||||
grDrawPolygonVertexList = (void (__stdcall *)(int,const GrVertex []))GetProcAddress(lib_handle, "_grDrawPolygonVertexList@8");
|
||||
grDrawTriangle = (void (__stdcall *)(const GrVertex *,const GrVertex *,const GrVertex *))GetProcAddress(lib_handle, "_grDrawTriangle@12");
|
||||
guDrawTriangleWithClip = (void (__stdcall *)(const GrVertex *,const GrVertex *,const GrVertex *))GetProcAddress(lib_handle, "_guDrawTriangleWithClip@12");
|
||||
grBufferClear = (void (__stdcall *)(unsigned long,unsigned char,unsigned short))GetProcAddress(lib_handle, "_grBufferClear@12");
|
||||
grBufferNumPending = GetProcAddress(lib_handle, "_grBufferNumPending@0");
|
||||
grBufferSwap = (void (__stdcall *)(int))GetProcAddress(lib_handle, "_grBufferSwap@4");
|
||||
grRenderBuffer = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grRenderBuffer@4");
|
||||
|
||||
grErrorSetCallback = (void (__stdcall *)(void (__cdecl *)(const char *,int)))GetProcAddress(lib_handle, "_grErrorSetCallback@4");
|
||||
grSstIdle = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstIdle@0");
|
||||
grSstVideoLine = (unsigned long (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstVideoLine@0");
|
||||
grSstVRetraceOn = (int (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstVRetraceOn@0");
|
||||
grSstIsBusy = (int (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstIsBusy@0");
|
||||
grSstWinOpen = (int (__stdcall *)(unsigned long,long,long,long,long,int,int))GetProcAddress(lib_handle, "_grSstWinOpen@28");
|
||||
grSstWinClose = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstWinClose@0");
|
||||
grSstControl = (int (__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_grSstControl@4");
|
||||
grSstQueryHardware = (int (__stdcall *)(GrHwConfiguration *))GetProcAddress(lib_handle, "_grSstQueryHardware@4");
|
||||
grSstQueryBoards = (int (__stdcall *)(GrHwConfiguration *))GetProcAddress(lib_handle, "_grSstQueryBoards@4");
|
||||
|
||||
grSstOrigin = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grSstOrigin@4");
|
||||
grSstSelect = (void (__stdcall *)(int))GetProcAddress(lib_handle, "_grSstSelect@4");
|
||||
grSstScreenHeight = (unsigned long (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstScreenHeight@0");
|
||||
grSstScreenWidth = (unsigned long (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstScreenWidth@0");
|
||||
grSstStatus = (unsigned long (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstStatus@0");
|
||||
grSstPerfStats = (void (__stdcall *)(struct GrSstPerfStats_s *))GetProcAddress(lib_handle, "_grSstPerfStats@4");
|
||||
grSstResetPerfStats = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grSstResetPerfStats@0");
|
||||
grResetTriStats = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grResetTriStats@0");
|
||||
grTriStats = (void (__stdcall *)(unsigned long *,unsigned long *))GetProcAddress(lib_handle, "_grTriStats@8");
|
||||
grAlphaBlendFunction = (void (__stdcall *)(long,long,long,long))GetProcAddress(lib_handle, "_grAlphaBlendFunction@16");
|
||||
|
||||
grAlphaCombine = (void (__stdcall *)(long,long,long,long,int))GetProcAddress(lib_handle, "_grAlphaCombine@20");
|
||||
grAlphaControlsITRGBLighting = (void (__stdcall *)(int))GetProcAddress(lib_handle, "_grAlphaControlsITRGBLighting@4");
|
||||
grAlphaTestFunction = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grAlphaTestFunction@4");
|
||||
grAlphaTestReferenceValue = (void (__stdcall *)(unsigned char))GetProcAddress(lib_handle, "_grAlphaTestReferenceValue@4");
|
||||
grChromakeyMode = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grChromakeyMode@4");
|
||||
grChromakeyValue = (void (__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_grChromakeyValue@4");
|
||||
grClipWindow = (void (__stdcall *)(unsigned long,unsigned long,unsigned long,unsigned long))GetProcAddress(lib_handle, "_grClipWindow@16");
|
||||
|
||||
grColorCombine = (void (__stdcall *)(long,long,long,long,int))GetProcAddress(lib_handle, "_grColorCombine@20");
|
||||
grColorMask = (void (__stdcall *)(int,int))GetProcAddress(lib_handle, "_grColorMask@8");
|
||||
grCullMode = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grCullMode@4");
|
||||
grConstantColorValue = (void (__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_grConstantColorValue@4");
|
||||
grConstantColorValue4 = (void (__stdcall *)(float,float,float,float))GetProcAddress(lib_handle, "_grConstantColorValue4@16");
|
||||
grDepthBiasLevel = (void (__stdcall *)(short))GetProcAddress(lib_handle, "_grDepthBiasLevel@4");
|
||||
grDepthBufferFunction = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grDepthBufferFunction@4");
|
||||
grDepthBufferMode = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grDepthBufferMode@4");
|
||||
grDepthMask = (void (__stdcall *)(int))GetProcAddress(lib_handle, "_grDepthMask@4");
|
||||
grDisableAllEffects = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grDisableAllEffects@0");
|
||||
grDitherMode = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grDitherMode@4");
|
||||
|
||||
grFogColorValue = (void (__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_grFogColorValue@4");
|
||||
grFogMode = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grFogMode@4");
|
||||
grFogTable = (void (__stdcall *)(const unsigned char []))GetProcAddress(lib_handle, "_grFogTable@4");
|
||||
grGammaCorrectionValue = (void (__stdcall *)(float))GetProcAddress(lib_handle, "_grGammaCorrectionValue@4");
|
||||
grSplash = (void (__stdcall *)(float,float,float,float,unsigned long))GetProcAddress(lib_handle, "_grSplash@20");
|
||||
|
||||
grTexCalcMemRequired = (unsigned long (__stdcall *)(long,long,long,long))GetProcAddress(lib_handle, "_grTexCalcMemRequired@16");
|
||||
grTexTextureMemRequired = (unsigned long (__stdcall *)(unsigned long,GrTexInfo *))GetProcAddress(lib_handle, "_grTexTextureMemRequired@8");
|
||||
grTexMinAddress = (unsigned long (__stdcall *)(long))GetProcAddress(lib_handle, "_grTexMinAddress@4");
|
||||
grTexMaxAddress = (unsigned long (__stdcall *)(long))GetProcAddress(lib_handle, "_grTexMaxAddress@4");
|
||||
grTexNCCTable = (void (__stdcall *)(long,unsigned long))GetProcAddress(lib_handle, "_grTexNCCTable@8");
|
||||
grTexSource = (void (__stdcall *)(long,unsigned long,unsigned long,GrTexInfo *))GetProcAddress(lib_handle, "_grTexSource@16");
|
||||
grTexClampMode = (void (__stdcall *)(long,long,long))GetProcAddress(lib_handle, "_grTexClampMode@12");
|
||||
grTexCombine = (void (__stdcall *)(long,long,long,long,long,int,int))GetProcAddress(lib_handle, "_grTexCombine@28");
|
||||
grTexCombineFunction = (void (__stdcall *)(long,long))GetProcAddress(lib_handle, "_grTexCombineFunction@8");
|
||||
grTexDetailControl = (void (__stdcall *)(long,int,unsigned char,float))GetProcAddress(lib_handle, "_grTexDetailControl@16");
|
||||
grTexFilterMode = (void (__stdcall *)(long,long,long))GetProcAddress(lib_handle, "_grTexFilterMode@12");
|
||||
grTexLodBiasValue = (void (__stdcall *)(long,float))GetProcAddress(lib_handle, "_grTexLodBiasValue@8");
|
||||
grTexDownloadMipMap = (void (__stdcall *)(long,unsigned long,unsigned long,GrTexInfo *))GetProcAddress(lib_handle, "_grTexDownloadMipMap@16");
|
||||
grTexDownloadMipMapLevel = (void (__stdcall *)(long,unsigned long,long,long,long,long,unsigned long,void *))GetProcAddress(lib_handle, "_grTexDownloadMipMapLevel@32");
|
||||
grTexDownloadMipMapLevelPartial = (void (__stdcall *)(long,unsigned long,long,long,long,long,unsigned long,void *,int,int))GetProcAddress(lib_handle, "_grTexDownloadMipMapLevelPartial@40");
|
||||
ConvertAndDownloadRle = (void (__stdcall *)(long,unsigned long,long,long,long,long,unsigned long,unsigned char *,long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned short *))GetProcAddress(lib_handle, "_ConvertAndDownloadRle@64");
|
||||
|
||||
grCheckForRoom = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grCheckForRoom@4");
|
||||
grTexDownloadTable = (void (__stdcall *)(long,unsigned long,void *))GetProcAddress(lib_handle, "_grTexDownloadTable@12");
|
||||
grTexDownloadTablePartial = (void (__stdcall *)(long,unsigned long,void *,int,int))GetProcAddress(lib_handle, "_grTexDownloadTablePartial@20");
|
||||
grTexMipMapMode = (void (__stdcall *)(long,long,int))GetProcAddress(lib_handle, "_grTexMipMapMode@12");
|
||||
grTexMultibase = (void (__stdcall *)(long,int))GetProcAddress(lib_handle, "_grTexMultibase@8");
|
||||
grTexMultibaseAddress = (void (__stdcall *)(long,unsigned long,unsigned long,unsigned long,GrTexInfo *))GetProcAddress(lib_handle, "_grTexMultibaseAddress@20");
|
||||
|
||||
guTexAllocateMemory = (unsigned long (__stdcall *)(long,unsigned char,int,int,long,long,long,long,long,long,long,long,long,float,int))GetProcAddress(lib_handle, "_guTexAllocateMemory@60");
|
||||
guTexChangeAttributes = (int (__stdcall *)(unsigned long,int,int,long,long,long,long,long,long,long,long,long))GetProcAddress(lib_handle, "_guTexChangeAttributes@48");
|
||||
guTexCombineFunction = (void (__stdcall *)(long,long))GetProcAddress(lib_handle, "_guTexCombineFunction@8");
|
||||
guTexGetCurrentMipMap = (unsigned long (__stdcall *)(long))GetProcAddress(lib_handle, "_guTexGetCurrentMipMap@4");
|
||||
guTexGetMipMapInfo = (GrMipMapInfo *(__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_guTexGetMipMapInfo@4");
|
||||
guTexMemQueryAvail = (unsigned long (__stdcall *)(long))GetProcAddress(lib_handle, "_guTexMemQueryAvail@4");
|
||||
guTexMemReset = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_guTexMemReset@0");
|
||||
guTexDownloadMipMap = (void (__stdcall *)(unsigned long,const void *,const GuNccTable *))GetProcAddress(lib_handle, "_guTexDownloadMipMap@12");
|
||||
guTexDownloadMipMapLevel = (void (__stdcall *)(unsigned long,long,const void ** ))GetProcAddress(lib_handle, "_guTexDownloadMipMapLevel@12");
|
||||
guTexSource = (void (__stdcall *)(unsigned long))GetProcAddress(lib_handle, "_guTexSource@4");
|
||||
guColorCombineFunction = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_guColorCombineFunction@4");
|
||||
|
||||
grLfbLock = (int (__stdcall *)(unsigned long,long,long,long,int,GrLfbInfo_t *))GetProcAddress(lib_handle, "_grLfbLock@24");
|
||||
grLfbUnlock = (int (__stdcall *)(unsigned long,long))GetProcAddress(lib_handle, "_grLfbUnlock@8");
|
||||
grLfbConstantAlpha = (void (__stdcall *)(unsigned char))GetProcAddress(lib_handle, "_grLfbConstantAlpha@4");
|
||||
grLfbConstantDepth = (void (__stdcall *)(unsigned short))GetProcAddress(lib_handle, "_grLfbConstantDepth@4");
|
||||
grLfbWriteColorSwizzle = (void (__stdcall *)(int,int))GetProcAddress(lib_handle, "_grLfbWriteColorSwizzle@8");
|
||||
grLfbWriteColorFormat = (void (__stdcall *)(long))GetProcAddress(lib_handle, "_grLfbWriteColorFormat@4");
|
||||
grLfbWriteRegion = (int (__stdcall *)(long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,long,void *))GetProcAddress(lib_handle, "_grLfbWriteRegion@32");
|
||||
grLfbReadRegion = (int (__stdcall *)(long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,void *))GetProcAddress(lib_handle, "_grLfbReadRegion@28");
|
||||
|
||||
grAADrawLine = (void (__stdcall *)(const GrVertex *,const GrVertex *))GetProcAddress(lib_handle, "_grAADrawLine@8");
|
||||
grAADrawPoint = (void (__stdcall *)(const GrVertex *))GetProcAddress(lib_handle, "_grAADrawPoint@4");
|
||||
grAADrawPolygon = (void (__stdcall *)(const int,const int [],const GrVertex []))GetProcAddress(lib_handle, "_grAADrawPolygon@12");
|
||||
grAADrawPolygonVertexList = (void (__stdcall *)(const int,const GrVertex []))GetProcAddress(lib_handle, "_grAADrawPolygonVertexList@8");
|
||||
grAADrawTriangle = (void (__stdcall *)(const GrVertex *,const GrVertex *,const GrVertex *,int,int,int))GetProcAddress(lib_handle, "_grAADrawTriangle@24");
|
||||
|
||||
grGlideInit = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grGlideInit@0");
|
||||
grGlideShutdown = (void (__stdcall *)(void))GetProcAddress(lib_handle, "_grGlideShutdown@0");
|
||||
grGlideGetVersion = (void (__stdcall *)(char []))GetProcAddress(lib_handle, "_grGlideGetVersion@4");
|
||||
grGlideGetState = (void (__stdcall *)(struct _GrState_s *))GetProcAddress(lib_handle, "_grGlideGetState@4");
|
||||
grGlideSetState = (void (__stdcall *)(const struct _GrState_s *))GetProcAddress(lib_handle, "_grGlideSetState@4");
|
||||
grGlideShamelessPlug = (void (__stdcall *)(const int))GetProcAddress(lib_handle, "_grGlideShamelessPlug@4");
|
||||
grHints = (void (__stdcall *)(unsigned long,unsigned long))GetProcAddress(lib_handle, "_grHints@8");
|
||||
|
||||
guFogTableIndexToW = (float (__stdcall *)(int))GetProcAddress(lib_handle, "_guFogTableIndexToW@4");
|
||||
guFogGenerateExp = (void (__stdcall *)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float))GetProcAddress(lib_handle, "_guFogGenerateExp@8");
|
||||
guFogGenerateExp2 = (void (__stdcall *)(GrFog_t fogtable[GR_FOG_TABLE_SIZE], float))GetProcAddress(lib_handle, "_guFogGenerateExp2@8");
|
||||
guFogGenerateLinear = (void (__stdcall *)(GrFog_t fogtable[GR_FOG_TABLE_SIZE], float , float))GetProcAddress(lib_handle, "_guFogGenerateLinear@12");
|
||||
|
||||
//XSTR:ON
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void (__stdcall *grDrawLine)(const GrVertex *v1, const GrVertex *v2) = NULL;
|
||||
void (__stdcall *grDrawPlanarPolygon)(int nverts, const int ilist[], const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grDrawPlanarPolygonVertexList)(int nverts, const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grDrawPoint)(const GrVertex *pt) = NULL;
|
||||
void (__stdcall *grDrawPolygon)(int nverts, const int ilist[], const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grDrawPolygonVertexList)(int nverts, const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grDrawTriangle)(const GrVertex *a, const GrVertex *b, const GrVertex *c) = NULL;
|
||||
void (__stdcall *guDrawTriangleWithClip)(const GrVertex *a, const GrVertex *b, const GrVertex *c) = NULL;
|
||||
void (__stdcall *grBufferClear)(GrColor_t color, GrAlpha_t alpha, FxU16 depth) = NULL;
|
||||
int (__stdcall *grBufferNumPending)(void) = NULL;
|
||||
void (__stdcall *grBufferSwap)(int swap_interval) = NULL;
|
||||
void (__stdcall *grRenderBuffer)(GrBuffer_t buffer) = NULL;
|
||||
|
||||
typedef void (*GrErrorCallbackFnc_t)(const char *string, FxBool fatal);
|
||||
|
||||
void (__stdcall *grErrorSetCallback)(GrErrorCallbackFnc_t fnc) = NULL;
|
||||
void (__stdcall *grSstIdle)(void) = NULL;
|
||||
FxU32 (__stdcall *grSstVideoLine)(void) = NULL;
|
||||
FxBool (__stdcall *grSstVRetraceOn)(void) = NULL;
|
||||
FxBool (__stdcall *grSstIsBusy)(void) = NULL;
|
||||
FxBool (__stdcall *grSstWinOpen)(
|
||||
FxU32 hWnd,
|
||||
GrScreenResolution_t screen_resolution,
|
||||
GrScreenRefresh_t refresh_rate,
|
||||
GrColorFormat_t color_format,
|
||||
GrOriginLocation_t origin_location,
|
||||
int nColBuffers,
|
||||
int nAuxBuffers) = NULL;
|
||||
void (__stdcall *grSstWinClose)(void) = NULL;
|
||||
FxBool (__stdcall *grSstControl)(FxU32 code) = NULL;
|
||||
FxBool (__stdcall *grSstQueryHardware)(GrHwConfiguration *hwconfig) = NULL;
|
||||
FxBool (__stdcall *grSstQueryBoards)(GrHwConfiguration *hwconfig) = NULL;
|
||||
void (__stdcall *grSstOrigin)(GrOriginLocation_t origin) = NULL;
|
||||
void (__stdcall *grSstSelect)(int which_sst) = NULL;
|
||||
FxU32 (__stdcall *grSstScreenHeight)(void) = NULL;
|
||||
FxU32 (__stdcall *grSstScreenWidth)(void) = NULL;
|
||||
FxU32 (__stdcall *grSstStatus)(void) = NULL;
|
||||
void (__stdcall *grSstPerfStats)(GrSstPerfStats_t *pStats) = NULL;
|
||||
void (__stdcall *grSstResetPerfStats)(void) = NULL;
|
||||
void (__stdcall *grResetTriStats)() = NULL;
|
||||
void (__stdcall *grTriStats)(FxU32 *trisProcessed, FxU32 *trisDrawn) = NULL;
|
||||
void (__stdcall *grAlphaBlendFunction)(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df) = NULL;
|
||||
void (__stdcall *grAlphaCombine)(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert) = NULL;
|
||||
void (__stdcall *grAlphaControlsITRGBLighting)(FxBool enable) = NULL;
|
||||
void (__stdcall *grAlphaTestFunction)(GrCmpFnc_t function) = NULL;
|
||||
void (__stdcall *grAlphaTestReferenceValue)(GrAlpha_t value) = NULL;
|
||||
void (__stdcall *grChromakeyMode)(GrChromakeyMode_t mode) = NULL;
|
||||
void (__stdcall *grChromakeyValue)(GrColor_t value) = NULL;
|
||||
void (__stdcall *grClipWindow)(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy) = NULL;
|
||||
void (__stdcall *grColorCombine)(
|
||||
GrCombineFunction_t function, GrCombineFactor_t factor,
|
||||
GrCombineLocal_t local, GrCombineOther_t other,
|
||||
FxBool invert) = NULL;
|
||||
void (__stdcall *grColorMask)(FxBool rgb, FxBool a) = NULL;
|
||||
void (__stdcall *grCullMode)(GrCullMode_t mode) = NULL;
|
||||
void (__stdcall *grConstantColorValue)(GrColor_t value) = NULL;
|
||||
void (__stdcall *grConstantColorValue4)(float a, float r, float g, float b) = NULL;
|
||||
void (__stdcall *grDepthBiasLevel)(FxI16 level) = NULL;
|
||||
void (__stdcall *grDepthBufferFunction)(GrCmpFnc_t function) = NULL;
|
||||
void (__stdcall *grDepthBufferMode)(GrDepthBufferMode_t mode) = NULL;
|
||||
void (__stdcall *grDepthMask)(FxBool mask) = NULL;
|
||||
void (__stdcall *grDisableAllEffects)(void) = NULL;
|
||||
void (__stdcall *grDitherMode)( GrDitherMode_t mode) = NULL;
|
||||
void (__stdcall *grFogColorValue)( GrColor_t fogcolor) = NULL;
|
||||
void (__stdcall *grFogMode)(GrFogMode_t mode) = NULL;
|
||||
void (__stdcall *grFogTable)(const GrFog_t ft[GR_FOG_TABLE_SIZE]) = NULL;
|
||||
void (__stdcall *grGammaCorrectionValue)(float value) = NULL;
|
||||
void (__stdcall *grSplash)(float x, float y, float width, float height, FxU32 frame) = NULL;
|
||||
FxU32 (__stdcall *grTexCalcMemRequired)(
|
||||
GrLOD_t lodmin, GrLOD_t lodmax,
|
||||
GrAspectRatio_t aspect, GrTextureFormat_t fmt) = NULL;
|
||||
FxU32 (__stdcall *grTexTextureMemRequired)(FxU32 evenOdd, GrTexInfo *info) = NULL;
|
||||
FxU32 (__stdcall *grTexMinAddress)(GrChipID_t tmu) = NULL;
|
||||
FxU32 (__stdcall *grTexMaxAddress)(GrChipID_t tmu) = NULL;
|
||||
void (__stdcall *grTexNCCTable)(GrChipID_t tmu, GrNCCTable_t table) = NULL;
|
||||
void (__stdcall *grTexSource)(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info) = NULL;
|
||||
void (__stdcall *grTexClampMode)(GrChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode) = NULL;
|
||||
void (__stdcall *grTexCombine)(
|
||||
GrChipID_t tmu,
|
||||
GrCombineFunction_t rgb_function,
|
||||
GrCombineFactor_t rgb_factor,
|
||||
GrCombineFunction_t alpha_function,
|
||||
GrCombineFactor_t alpha_factor,
|
||||
FxBool rgb_invert,
|
||||
FxBool alpha_invert
|
||||
) = NULL;
|
||||
void (__stdcall *grTexCombineFunction)(
|
||||
GrChipID_t tmu,
|
||||
GrTextureCombineFnc_t fnc
|
||||
) = NULL;
|
||||
void (__stdcall *grTexDetailControl)(
|
||||
GrChipID_t tmu,
|
||||
int lod_bias,
|
||||
FxU8 detail_scale,
|
||||
float detail_max
|
||||
) = NULL;
|
||||
void (__stdcall *grTexFilterMode)(
|
||||
GrChipID_t tmu,
|
||||
GrTextureFilterMode_t minfilter_mode,
|
||||
GrTextureFilterMode_t magfilter_mode
|
||||
) = NULL;
|
||||
void (__stdcall *grTexLodBiasValue)(GrChipID_t tmu, float bias) = NULL;
|
||||
void (__stdcall *grTexDownloadMipMap)(GrChipID_t tmu,
|
||||
FxU32 startAddress,
|
||||
FxU32 evenOdd,
|
||||
GrTexInfo *info) = NULL;
|
||||
|
||||
void (__stdcall *grTexDownloadMipMapLevel)(GrChipID_t tmu,
|
||||
FxU32 startAddress,
|
||||
GrLOD_t thisLod,
|
||||
GrLOD_t largeLod,
|
||||
GrAspectRatio_t aspectRatio,
|
||||
GrTextureFormat_t format,
|
||||
FxU32 evenOdd,
|
||||
void *data) = NULL;
|
||||
|
||||
void (__stdcall *grTexDownloadMipMapLevelPartial)(GrChipID_t tmu,
|
||||
FxU32 startAddress,
|
||||
GrLOD_t thisLod,
|
||||
GrLOD_t largeLod,
|
||||
GrAspectRatio_t aspectRatio,
|
||||
GrTextureFormat_t format,
|
||||
FxU32 evenOdd,
|
||||
void *data,
|
||||
int start,
|
||||
int end) = NULL;
|
||||
|
||||
|
||||
void (__stdcall *ConvertAndDownloadRle)(GrChipID_t tmu,
|
||||
FxU32 startAddress,
|
||||
GrLOD_t thisLod,
|
||||
GrLOD_t largeLod,
|
||||
GrAspectRatio_t aspectRatio,
|
||||
GrTextureFormat_t format,
|
||||
FxU32 evenOdd,
|
||||
FxU8 *bm_data,
|
||||
long bm_h,
|
||||
FxU32 u0,
|
||||
FxU32 v0,
|
||||
FxU32 width,
|
||||
FxU32 height,
|
||||
FxU32 dest_width,
|
||||
FxU32 dest_height,
|
||||
FxU16 *tlut) = NULL;
|
||||
|
||||
void (__stdcall *grCheckForRoom)(FxI32 n);
|
||||
|
||||
void (__stdcall *grTexDownloadTable)(GrChipID_t tmu,
|
||||
GrTexTable_t type,
|
||||
void *data) = NULL;
|
||||
|
||||
void (__stdcall *grTexDownloadTablePartial)(GrChipID_t tmu,
|
||||
GrTexTable_t type,
|
||||
void *data,
|
||||
int start,
|
||||
int end) = NULL;
|
||||
|
||||
void (__stdcall *grTexMipMapMode)(GrChipID_t tmu,
|
||||
GrMipMapMode_t mode,
|
||||
FxBool lodBlend) = NULL;
|
||||
|
||||
void (__stdcall *grTexMultibase)(GrChipID_t tmu,
|
||||
FxBool enable) = NULL;
|
||||
|
||||
void (__stdcall *grTexMultibaseAddress)(GrChipID_t tmu,
|
||||
GrTexBaseRange_t range,
|
||||
FxU32 startAddress,
|
||||
FxU32 evenOdd,
|
||||
GrTexInfo *info) = NULL;
|
||||
|
||||
GrMipMapId_t (__stdcall *guTexAllocateMemory)(
|
||||
GrChipID_t tmu,
|
||||
FxU8 odd_even_mask,
|
||||
int width, int height,
|
||||
GrTextureFormat_t fmt,
|
||||
GrMipMapMode_t mm_mode,
|
||||
GrLOD_t smallest_lod, GrLOD_t largest_lod,
|
||||
GrAspectRatio_t aspect,
|
||||
GrTextureClampMode_t s_clamp_mode,
|
||||
GrTextureClampMode_t t_clamp_mode,
|
||||
GrTextureFilterMode_t minfilter_mode,
|
||||
GrTextureFilterMode_t magfilter_mode,
|
||||
float lod_bias,
|
||||
FxBool trilinear
|
||||
) = NULL;
|
||||
|
||||
FxBool (__stdcall *guTexChangeAttributes)(
|
||||
GrMipMapId_t mmid,
|
||||
int width, int height,
|
||||
GrTextureFormat_t fmt,
|
||||
GrMipMapMode_t mm_mode,
|
||||
GrLOD_t smallest_lod, GrLOD_t largest_lod,
|
||||
GrAspectRatio_t aspect,
|
||||
GrTextureClampMode_t s_clamp_mode,
|
||||
GrTextureClampMode_t t_clamp_mode,
|
||||
GrTextureFilterMode_t minFilterMode,
|
||||
GrTextureFilterMode_t magFilterMode
|
||||
) = NULL;
|
||||
void (__stdcall *guTexCombineFunction)(
|
||||
GrChipID_t tmu,
|
||||
GrTextureCombineFnc_t fnc
|
||||
) = NULL;
|
||||
GrMipMapId_t (__stdcall *guTexGetCurrentMipMap)(GrChipID_t tmu) = NULL;
|
||||
GrMipMapInfo* (__stdcall *guTexGetMipMapInfo)(GrMipMapId_t mmid);
|
||||
FxU32 (__stdcall *guTexMemQueryAvail)(GrChipID_t tmu) = NULL;
|
||||
void (__stdcall *guTexMemReset)(void) = NULL;
|
||||
void (__stdcall *guTexDownloadMipMap)(
|
||||
GrMipMapId_t mmid,
|
||||
const void *src,
|
||||
const GuNccTable *table
|
||||
) = NULL;
|
||||
void (__stdcall *guTexDownloadMipMapLevel)(
|
||||
GrMipMapId_t mmid,
|
||||
GrLOD_t lod,
|
||||
const void **src
|
||||
) = NULL;
|
||||
void (__stdcall *guTexSource)(GrMipMapId_t id) = NULL;
|
||||
void (__stdcall *guColorCombineFunction)(GrColorCombineFnc_t fnc) = NULL;
|
||||
|
||||
FxBool (__stdcall *grLfbLock)( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
|
||||
GrOriginLocation_t origin, FxBool pixelPipeline,
|
||||
GrLfbInfo_t *info) = NULL;
|
||||
FxBool (__stdcall *grLfbUnlock)(GrLock_t type, GrBuffer_t buffer) = NULL;
|
||||
void (__stdcall *grLfbConstantAlpha)(GrAlpha_t alpha) = NULL;
|
||||
void (__stdcall *grLfbConstantDepth)(FxU16 depth) = NULL;
|
||||
void (__stdcall *grLfbWriteColorSwizzle)(FxBool swizzleBytes, FxBool swapWords) = NULL;
|
||||
void (__stdcall *grLfbWriteColorFormat)(GrColorFormat_t colorFormat) = NULL;
|
||||
FxBool (__stdcall *grLfbWriteRegion)(GrBuffer_t dst_buffer,
|
||||
FxU32 dst_x, FxU32 dst_y,
|
||||
GrLfbSrcFmt_t src_format,
|
||||
FxU32 src_width, FxU32 src_height,
|
||||
FxI32 src_stride, void *src_data) = NULL;
|
||||
|
||||
FxBool (__stdcall *grLfbReadRegion)(GrBuffer_t src_buffer,
|
||||
FxU32 src_x, FxU32 src_y,
|
||||
FxU32 src_width, FxU32 src_height,
|
||||
FxU32 dst_stride, void *dst_data) = NULL;
|
||||
|
||||
void (__stdcall *grAADrawLine)(const GrVertex *v1, const GrVertex *v2) = NULL;
|
||||
void (__stdcall *grAADrawPoint)(const GrVertex *pt) = NULL;
|
||||
void (__stdcall *grAADrawPolygon)(const int nverts, const int ilist[], const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grAADrawPolygonVertexList)(const int nverts, const GrVertex vlist[]) = NULL;
|
||||
void (__stdcall *grAADrawTriangle)(
|
||||
const GrVertex *a, const GrVertex *b, const GrVertex *c,
|
||||
FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
|
||||
) = NULL;
|
||||
void (__stdcall *grGlideInit)(void) = NULL;
|
||||
void (__stdcall *grGlideShutdown)(void) = NULL;
|
||||
void (__stdcall *grGlideGetVersion)(char version[80]) = NULL;
|
||||
void (__stdcall *grGlideGetState)(GrState *state) = NULL;
|
||||
void (__stdcall *grGlideSetState)( const GrState *state) = NULL;
|
||||
void (__stdcall *grGlideShamelessPlug)(const FxBool on) = NULL;
|
||||
void (__stdcall *grHints)(GrHint_t hintType, FxU32 hintMask) = NULL;
|
||||
|
||||
float (__stdcall *guFogTableIndexToW)(int i) = NULL;
|
||||
void (__stdcall *guFogGenerateExp)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ) = NULL;
|
||||
void (__stdcall *guFogGenerateExp2)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ) = NULL;
|
||||
void (__stdcall *guFogGenerateLinear)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float nearZ, float farZ ) = NULL;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glidesys.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
**
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 2 2/27/98 3:25p Frank
|
||||
* (John/Frank K.) updated to 2.43 headers
|
||||
*
|
||||
* 1 10/16/97 11:51a Klier
|
||||
*/
|
||||
#ifndef __GLIDESYS_H__
|
||||
#define __GLIDESYS_H__
|
||||
|
||||
/*
|
||||
n** -----------------------------------------------------------------------
|
||||
** COMPILER/ENVIRONMENT CONFIGURATION
|
||||
** -----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Endianness is stored in bits [30:31] */
|
||||
#define GLIDE_ENDIAN_SHIFT 30
|
||||
#define GLIDE_ENDIAN_LITTLE (0x1 << GLIDE_ENDIAN_SHIFT)
|
||||
#define GLIDE_ENDIAN_BIG (0x2 << GLIDE_ENDIAN_SHIFT)
|
||||
|
||||
/* OS is stored in bits [0:6] */
|
||||
#define GLIDE_OS_SHIFT 0
|
||||
#define GLIDE_OS_UNIX 0x1
|
||||
#define GLIDE_OS_DOS32 0x2
|
||||
#define GLIDE_OS_WIN32 0x4
|
||||
#define GLIDE_OS_SYSTEM7 0x8
|
||||
#define GLIDE_OS_OS2 0x10
|
||||
#define GLIDE_OS_OTHER 0x20 /* For Proprietary Arcade HW */
|
||||
|
||||
/* Sim vs. Hardware is stored in bits [7:8] */
|
||||
#define GLIDE_SST_SHIFT 7
|
||||
#define GLIDE_SST_SIM (0x1 << GLIDE_SST_SHIFT)
|
||||
#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT )
|
||||
|
||||
/* Hardware Type is stored in bits [9:12] */
|
||||
#define GLIDE_HW_SHIFT 9
|
||||
#define GLIDE_HW_SST1 (0x1 << GLIDE_HW_SHIFT)
|
||||
#define GLIDE_HW_SST96 (0x2 << GLIDE_HW_SHIFT)
|
||||
#define GLIDE_HW_SSTH3 (0x4 << GLIDE_HW_SHIFT)
|
||||
#define GLIDE_HW_SST2 (0x8 << GLIDE_HW_SHIFT)
|
||||
|
||||
/*
|
||||
** Make sure we handle all instances of WIN32
|
||||
*/
|
||||
#ifndef __WIN32__
|
||||
# if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__)
|
||||
# define __WIN32__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We need two checks on the OS: one for endian, the other for OS */
|
||||
/* Check for endianness */
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(MACOS)
|
||||
# define GLIDE_ENDIAN GLIDE_ENDIAN_BIG
|
||||
#else
|
||||
# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
/* Check for OS */
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
|
||||
# define GLIDE_OS GLIDE_OS_UNIX
|
||||
#elif defined(__DOS__)
|
||||
# define GLIDE_OS GLIDE_OS_DOS32
|
||||
#elif defined(__WIN32__)
|
||||
# define GLIDE_OS GLIDE_OS_WIN32
|
||||
#endif
|
||||
|
||||
/* Check for Simulator vs. Hardware */
|
||||
#ifdef GLIDE_SIMULATOR
|
||||
# define GLIDE_SST GLIDE_SST_SIM
|
||||
#else
|
||||
# define GLIDE_SST GLIDE_SST_HW
|
||||
#endif
|
||||
|
||||
/* Check for type of hardware */
|
||||
#ifdef SST96
|
||||
# define GLIDE_HW GLIDE_HW_SST96
|
||||
#elif defined(SSTH3)
|
||||
# define GLIDE_HW GLIDE_HW_SSTH3
|
||||
#elif defined(SST2)
|
||||
# define GLIDE_HW GLIDE_HW_SST2
|
||||
#else /* Default to SST1 */
|
||||
# define GLIDE_HW GLIDE_HW_SST1
|
||||
#endif
|
||||
|
||||
|
||||
#define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW)
|
||||
|
||||
/*
|
||||
** Control the number of TMUs
|
||||
*/
|
||||
#ifndef GLIDE_NUM_TMU
|
||||
# define GLIDE_NUM_TMU 2
|
||||
#endif
|
||||
|
||||
|
||||
#if ( ( GLIDE_NUM_TMU < 0 ) && ( GLIDE_NUM_TMU > 3 ) )
|
||||
# error "GLIDE_NUM_TMU set to an invalid value"
|
||||
#endif
|
||||
|
||||
#endif /* __GLIDESYS_H__ */
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glideutl.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
**
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 2 2/27/98 3:25p Frank
|
||||
* (John/Frank K.) updated to 2.43 headers
|
||||
*
|
||||
* 1 10/16/97 11:51a Klier
|
||||
*
|
||||
* 6 8/14/97 5:32p Pgj
|
||||
* remove dead code per GMT
|
||||
*
|
||||
* 5 6/12/97 5:19p Pgj
|
||||
* Fix bug 578
|
||||
*
|
||||
* 4 3/05/97 9:36p Jdt
|
||||
* Removed guFbWriteRegion added guEncodeRLE16
|
||||
*
|
||||
* 3 1/16/97 3:45p Dow
|
||||
* Embedded fn protos in ifndef FX_GLIDE_NO_FUNC_PROTO
|
||||
*/
|
||||
|
||||
/* Glide Utility routines */
|
||||
|
||||
#ifndef __GLIDEUTL_H__
|
||||
#define __GLIDEUTL_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef FX_GLIDE_NO_FUNC_PROTO
|
||||
/*
|
||||
** rendering functions
|
||||
*/
|
||||
FX_ENTRY void FX_CALL
|
||||
guAADrawTriangleWithClip( const GrVertex *a, const GrVertex
|
||||
*b, const GrVertex *c);
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guDrawTriangleWithClip(
|
||||
const GrVertex *a,
|
||||
const GrVertex *b,
|
||||
const GrVertex *c
|
||||
);
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guDrawPolygonVertexListWithClip( int nverts, const GrVertex vlist[] );
|
||||
|
||||
/*
|
||||
** hi-level rendering utility functions
|
||||
*/
|
||||
FX_ENTRY void FX_CALL
|
||||
guAlphaSource( GrAlphaSource_t mode );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guColorCombineFunction( GrColorCombineFnc_t fnc );
|
||||
|
||||
FX_ENTRY int FX_CALL
|
||||
guEncodeRLE16( void *dst,
|
||||
void *src,
|
||||
FxU32 width,
|
||||
FxU32 height );
|
||||
|
||||
FX_ENTRY FxU16 * FX_CALL
|
||||
guTexCreateColorMipMap( void );
|
||||
|
||||
/*
|
||||
** fog stuff
|
||||
*/
|
||||
FX_ENTRY float FX_CALL
|
||||
guFogTableIndexToW( int i );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateExp( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateExp2( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density );
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
guFogGenerateLinear(
|
||||
GrFog_t fogtable[GR_FOG_TABLE_SIZE],
|
||||
float nearZ, float farZ );
|
||||
|
||||
/*
|
||||
** endian stuff
|
||||
*/
|
||||
FX_ENTRY FxU32 FX_CALL
|
||||
guEndianSwapWords( FxU32 value );
|
||||
|
||||
FX_ENTRY FxU16 FX_CALL
|
||||
guEndianSwapBytes( FxU16 value );
|
||||
|
||||
/*
|
||||
** hi-level texture manipulation tools.
|
||||
*/
|
||||
FX_ENTRY FxBool FX_CALL
|
||||
gu3dfGetInfo( const char *filename, Gu3dfInfo *info );
|
||||
|
||||
FX_ENTRY FxBool FX_CALL
|
||||
gu3dfLoad( const char *filename, Gu3dfInfo *data );
|
||||
|
||||
#endif /* FX_GLIDE_NO_FUNC_PROTO */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLIDEUTL_H__ */
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 1995, 3Dfx Interactive, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/sst1vid.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
**
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 2 2/27/98 3:25p Frank
|
||||
* (John/Frank K.) updated to 2.43 headers
|
||||
*
|
||||
* 1 10/16/97 11:51a Klier
|
||||
*
|
||||
* 4 9/09/97 7:35p Sellers
|
||||
* Added 400x300 resolution
|
||||
*
|
||||
* 3 8/24/97 9:31a Sellers
|
||||
* moved new video timing to sst1vid.h
|
||||
* redefined 1600x1280 to be 1600x1200
|
||||
*
|
||||
* 2 6/05/97 11:14p Pgj
|
||||
*
|
||||
* 5 7/24/96 3:43p Sellers
|
||||
* added 512x384 @ 60 Hz for arcade monitors
|
||||
* added 512x256 @ 60 Hz for arcade monitors
|
||||
*
|
||||
* 4 7/18/96 10:58a Sellers
|
||||
* fixed FT and TF clock delay values for lower frequencies with
|
||||
* .5/.5 combos
|
||||
*
|
||||
* 3 6/18/96 6:54p Sellers
|
||||
* added sst1InitShutdownSli() to fix Glide Splash screen problems with
|
||||
* SLI
|
||||
*
|
||||
* 2 6/13/96 7:45p Sellers
|
||||
* added "voodoo.ini" support
|
||||
* added DirectX support
|
||||
* misc cleanup
|
||||
*
|
||||
* 2 6/11/96 1:43p Sellers
|
||||
* added support for 60, 75, 85, and 120 Hz refresh rates for "most"
|
||||
* resolutions
|
||||
*
|
||||
* 1 5/08/96 5:43p Paik
|
||||
* Video definitions
|
||||
*/
|
||||
#ifndef __SST1VID_H__
|
||||
#define __SST1VID_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Video defines */
|
||||
|
||||
typedef FxI32 GrScreenRefresh_t;
|
||||
#define GR_REFRESH_60Hz 0x0
|
||||
#define GR_REFRESH_70Hz 0x1
|
||||
#define GR_REFRESH_72Hz 0x2
|
||||
#define GR_REFRESH_75Hz 0x3
|
||||
#define GR_REFRESH_80Hz 0x4
|
||||
#define GR_REFRESH_90Hz 0x5
|
||||
#define GR_REFRESH_100Hz 0x6
|
||||
#define GR_REFRESH_85Hz 0x7
|
||||
#define GR_REFRESH_120Hz 0x8
|
||||
#define GR_REFRESH_NONE 0xff
|
||||
|
||||
typedef FxI32 GrScreenResolution_t;
|
||||
#define GR_RESOLUTION_320x200 0x0
|
||||
#define GR_RESOLUTION_320x240 0x1
|
||||
#define GR_RESOLUTION_400x256 0x2
|
||||
#define GR_RESOLUTION_512x384 0x3
|
||||
#define GR_RESOLUTION_640x200 0x4
|
||||
#define GR_RESOLUTION_640x350 0x5
|
||||
#define GR_RESOLUTION_640x400 0x6
|
||||
#define GR_RESOLUTION_640x480 0x7
|
||||
#define GR_RESOLUTION_800x600 0x8
|
||||
#define GR_RESOLUTION_960x720 0x9
|
||||
#define GR_RESOLUTION_856x480 0xa
|
||||
#define GR_RESOLUTION_512x256 0xb
|
||||
#define GR_RESOLUTION_1024x768 0xC
|
||||
#define GR_RESOLUTION_1280x1024 0xD
|
||||
#define GR_RESOLUTION_1600x1200 0xE
|
||||
#define GR_RESOLUTION_400x300 0xF
|
||||
#define GR_RESOLUTION_NONE 0xff
|
||||
|
||||
#ifdef GR_RESOLUTION_MAX
|
||||
#undef GR_RESOLUTION_MAX
|
||||
#endif
|
||||
#ifdef GR_RESOLUTION_MIN
|
||||
#undef GR_RESOLUTION_MIN
|
||||
#endif
|
||||
#define GR_RESOLUTION_MIN GR_RESOLUTION_320x200
|
||||
#define GR_RESOLUTION_MAX GR_RESOLUTION_1600x1200
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SST1VID_H__ */
|
||||
@@ -10,6 +10,8 @@
|
||||
#ifndef _GLOBAL_ALPHACOLORS_HEADER_FILE
|
||||
#define _GLOBAL_ALPHACOLORS_HEADER_FILE
|
||||
|
||||
#include "graphics/2d.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// ALPHA DEFINES/VARS
|
||||
//
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* Created by Ian "Goober5000" Warfield for the Freespace2 Source Code Project.
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* create based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/globals.h $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2004-05-10 10:51:54 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header for common global #defines, to cut down on #includes
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.1 2004/02/28 20:26:10 Goober5000
|
||||
* preliminary checking of globals.h
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.0 2004/02/28 20:26:00 Goober5000
|
||||
* Addition to CVS repository
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
|
||||
// from parselo.h
|
||||
#define PATHNAME_LENGTH 192
|
||||
#define NAME_LENGTH 32
|
||||
#define SEXP_LENGTH 128
|
||||
#define DATE_LENGTH 32
|
||||
#define TIME_LENGTH 16
|
||||
#define DATE_TIME_LENGTH 48
|
||||
#define NOTES_LENGTH 1024
|
||||
// Kazan - this used to be 1024, now 4096
|
||||
#define MULTITEXT_LENGTH 4096
|
||||
#define FILESPEC_LENGTH 64
|
||||
#define MESSAGE_LENGTH 512
|
||||
|
||||
// from missionparse.h
|
||||
#define MISSION_DESC_LENGTH 512
|
||||
|
||||
|
||||
// from player.h
|
||||
#define CALLSIGN_LEN 28 // shortened from 32 to allow .plr to be attached without exceeding MAX_FILENAME_LEN
|
||||
#define SHORT_CALLSIGN_PIXEL_W 80 // max width of short_callsign[] in pixels
|
||||
|
||||
|
||||
// from ship.h
|
||||
#ifdef NDEBUG
|
||||
#ifdef FRED
|
||||
#define MAX_SHIPS 400 // max number of ship instances there can be. DTP; bumped from 100 to 400
|
||||
#define SHIPS_LIMIT 400 // what MAX_SHIPS will be at release time (for error checking in debug mode), DTP bumped from 100 to 400
|
||||
#else
|
||||
#define MAX_SHIPS 400 // max number of ship instances there can be. /DTP bumped from 100 to 400
|
||||
#define SHIPS_LIMIT 400 // what MAX_SHIPS will be at release time (for error checking in debug mode); DTP bumped from 100 to 400
|
||||
#endif
|
||||
#else
|
||||
#define MAX_SHIPS 400 // max number of ship instances there can be.DTP; bumped from 200 to 400
|
||||
#define SHIPS_LIMIT 400 // what MAX_SHIPS will be at release time (for error checking in debug mode); dtp Bumped from 200 to 400
|
||||
#endif
|
||||
|
||||
// ****************************************************************
|
||||
// DO NOT CHANGE THIS - IT WILL LIKELY BREAK FREESPACE2 PXO SUPPORT
|
||||
// TALK TO DAVE B FIRST
|
||||
// ****************************************************************
|
||||
#ifdef INF_BUILD
|
||||
#define MAX_SHIP_TYPES 250
|
||||
#else
|
||||
#define MAX_SHIP_TYPES 130
|
||||
#endif
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_WINGS 15
|
||||
#else
|
||||
#define MAX_WINGS 25
|
||||
#endif
|
||||
|
||||
|
||||
// from ship.h
|
||||
#define MAX_PLAYER_PRIMARY_BANKS 2
|
||||
#define MAX_PLAYER_SECONDARY_BANKS 3
|
||||
#define MAX_PLAYER_WEAPONS 5
|
||||
|
||||
|
||||
// from model.h
|
||||
#define MAX_SHIP_PRIMARY_BANKS 3
|
||||
#define MAX_SHIP_SECONDARY_BANKS 4 // Lowered from 5 to 4 by MK on 3/25/98. This needs to be <= MAX_WL_SECONDARY or you'll get stack overwrites.
|
||||
#define MAX_SHIP_WEAPONS 7
|
||||
|
||||
|
||||
// limit checks - Goober5000
|
||||
|
||||
#if (MAX_PLAYER_PRIMARY_BANKS+MAX_PLAYER_SECONDARY_BANKS != MAX_PLAYER_WEAPONS)
|
||||
#error MAX_PLAYER_PRIMARY_BANKS + MAX_PLAYER_SECONDARY_BANKS must equal MAX_PLAYER_WEAPONS
|
||||
#endif
|
||||
|
||||
#if (MAX_SHIP_PRIMARY_BANKS+MAX_SHIP_SECONDARY_BANKS != MAX_SHIP_WEAPONS)
|
||||
#error MAX_SHIP_PRIMARY_BANKS + MAX_SHIP_SECONDARY_BANKS must equal MAX_SHIP_WEAPONS
|
||||
#endif
|
||||
|
||||
#if (MAX_PLAYER_PRIMARY_BANKS > MAX_SHIP_PRIMARY_BANKS)
|
||||
#error MAX_PLAYER_PRIMARY_BANKS must be less than or equal to MAX_SHIP_PRIMARY_BANKS)
|
||||
#endif
|
||||
|
||||
#if (MAX_PLAYER_SECONDARY_BANKS > MAX_SHIP_SECONDARY_BANKS)
|
||||
#error MAX_PLAYER_SECONDARY_BANKS must be less than or equal to MAX_SHIP_SECONDARY_BANKS)
|
||||
#endif
|
||||
|
||||
|
||||
// Goober5000 - moved from hudescort.cpp
|
||||
// size of complete escort list, including all those wanting to get onto list but without space
|
||||
#define MAX_COMPLETE_ESCORT_LIST 20
|
||||
|
||||
|
||||
// from weapon.h
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_WEAPONS 100
|
||||
#else
|
||||
// upped 5/6/98 from 200 - DB
|
||||
#define MAX_WEAPONS 350
|
||||
#endif
|
||||
|
||||
#ifdef INF_BUILD
|
||||
#define MAX_WEAPON_TYPES 300
|
||||
#else
|
||||
#define MAX_WEAPON_TYPES 200
|
||||
#endif
|
||||
|
||||
|
||||
// from model.h
|
||||
|
||||
#define MAX_MODEL_TEXTURES 64
|
||||
|
||||
|
||||
// from object.h; probably will be redone eventually
|
||||
// Team bitmasks.
|
||||
#define TEAM_HOSTILE (1 << 0)
|
||||
#define TEAM_FRIENDLY (1 << 1)
|
||||
#define TEAM_NEUTRAL (1 << 2)
|
||||
#define TEAM_UNKNOWN (1 << 3)
|
||||
#define TEAM_TRAITOR (1 << 4)
|
||||
#define TEAM_ANY (TEAM_HOSTILE|TEAM_FRIENDLY|TEAM_NEUTRAL|TEAM_UNKNOWN|TEAM_TRAITOR)
|
||||
#define MAX_TEAM_NAMES_INDEX TEAM_TRAITOR
|
||||
|
||||
|
||||
// from pstypes.h - don't ask me why it was there
|
||||
#define MAX_TEAMS 3
|
||||
|
||||
|
||||
// from scoring.h
|
||||
// ARGH. IMPORTANT : do not change NUM_MEDALS without talking to DaveB first. It will affect the size of the scoring struct and hence, will break
|
||||
// a lot of PXO related stuff. SEE ALSO : MAX_SHIP_TYPES
|
||||
#ifdef FS2_DEMO
|
||||
#define NUM_MEDALS 16
|
||||
#define NUM_MEDALS_FS1 16
|
||||
#else
|
||||
#define NUM_MEDALS 18
|
||||
#define NUM_MEDALS_FS1 16
|
||||
#endif
|
||||
|
||||
|
||||
// object.h
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_OBJECTS 300
|
||||
#else
|
||||
#define MAX_OBJECTS 1000
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // _GLOBALS_H
|
||||
@@ -9,13 +9,84 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-03-02 05:27:44 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2004-04-03 18:11:20 $
|
||||
* $Author: Kazan $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2004-04-03 18:11:20 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Header file containg global typedefs, constants and macros
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.14 2003/11/17 06:52:51 bobboau
|
||||
* got assert to work again
|
||||
*
|
||||
* Revision 2.13 2003/09/26 14:37:13 bobboau
|
||||
* commiting Hardware T&L code, everything is ifdefed out with the compile flag HTL
|
||||
* still needs a lot of work, ubt the frame rates were getting with it are incredable
|
||||
* the biggest problem it still has is a bad lightmanegment system, and the zbuffer
|
||||
* doesn't work well with things still getting rendered useing the sofware pipeline, like thrusters,
|
||||
* and weapons, I think these should be modifyed to be sent through hardware,
|
||||
* it would be slightly faster and it would likely fix the problem
|
||||
*
|
||||
* also the thruster glow/particle stuff I did is now in.
|
||||
*
|
||||
* Revision 2.12 2003/08/16 03:52:23 bobboau
|
||||
* update for the specmapping code includeing
|
||||
* suport for seperate specular levels on lights and
|
||||
* optional strings for the stars table
|
||||
* code has been made more organised,
|
||||
* though there seems to be a bug in the state selecting code
|
||||
* resulting in the HUD being rendered incorectly
|
||||
* and specmapping failing ocasionaly
|
||||
*
|
||||
* Revision 2.11 2003/08/12 03:18:33 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.10 2003/06/08 17:38:21 phreak
|
||||
* added a vector in the vertex struct that stores the real world position
|
||||
* the x,y,z variables do not accurately reflect the real position
|
||||
* this is for opengl fogging
|
||||
*
|
||||
* Revision 2.9 2003/03/18 10:07:02 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.8 2003/03/02 05:27:44 penguin
|
||||
* only define min() and max() if they're not already defined
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.7 2003/01/18 19:48:19 phreak
|
||||
* added some defines that deal with mages using DXTC
|
||||
*
|
||||
@@ -25,6 +96,16 @@
|
||||
* Revision 2.5 2002/12/02 20:49:14 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.4.2.3 2002/10/19 23:56:40 randomtiger
|
||||
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
|
||||
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
|
||||
*
|
||||
* Revision 2.4.2.2 2002/09/24 18:56:42 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.4 2002/08/06 01:49:08 penguin
|
||||
* Renamed ccode members to cc_or and cc_and
|
||||
*
|
||||
@@ -258,8 +339,6 @@
|
||||
#define MAX_PLAYERS 12
|
||||
#endif
|
||||
|
||||
#define MAX_TEAMS 3
|
||||
|
||||
#define USE_INLINE_ASM 1 // Define this to use inline assembly
|
||||
#define STRUCT_CMP(a, b) memcmp((void *) &a, (void *) &b, sizeof(a))
|
||||
|
||||
@@ -331,15 +410,28 @@ typedef struct uv_pair {
|
||||
// Used to store rotated points for mines.
|
||||
// Has flag to indicate if projected.
|
||||
typedef struct vertex {
|
||||
vertex(){
|
||||
x=0.0f;y=0.0f;z=0.0f;
|
||||
u=0.0f;v=0.0f;
|
||||
sx=0.0f;sy=0.0f;sw=0.0f;
|
||||
env_u=0.0f;env_v=0.0f;
|
||||
spec_r=0;spec_g=0;spec_b=0;
|
||||
r=0;g=0;b=0;a=0;
|
||||
}
|
||||
float x, y, z; // world space position
|
||||
float sx, sy, sw; // screen space position (sw == 1/z)
|
||||
float u, v; // texture position
|
||||
vector real_pos; // _real_ world position
|
||||
ubyte spec_r, spec_b, spec_g; //specular highlights -Bobboau
|
||||
float env_u, env_v;
|
||||
ubyte r, g, b, a; // color. Use b for darkening;
|
||||
ubyte codes; // what sides of view pyramid this point is on/off. 0 = Inside view pyramid.
|
||||
ubyte flags; // Projection flags. Indicates whether it is projected or not or if projection overflowed.
|
||||
ubyte pad[2]; // pad structure to be 4 byte aligned.
|
||||
} vertex;
|
||||
|
||||
extern int spec;
|
||||
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
#define BMP_TEX_XPARENT (1<<1) // transparent texture
|
||||
#define BMP_TEX_NONDARK (1<<2) // nondarkening texture
|
||||
@@ -360,7 +452,7 @@ typedef struct vertex {
|
||||
// max res == 1024x768. max texture size == 256
|
||||
#define MAX_BMAP_SECTIONS_X 4
|
||||
#define MAX_BMAP_SECTIONS_Y 3
|
||||
#define MAX_BMAP_SECTION_SIZE 256
|
||||
|
||||
typedef struct bitmap_section_info {
|
||||
ushort sx[MAX_BMAP_SECTIONS_X]; // x offset of each section
|
||||
ushort sy[MAX_BMAP_SECTIONS_Y]; // y offset of each section
|
||||
@@ -404,12 +496,20 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
|
||||
// or,
|
||||
// Error( LOCATION, "Error opening %s", filename );
|
||||
|
||||
//#if defined(NDEBUG)
|
||||
/*******************NEVER UNCOMMENT Assert ************************************************/
|
||||
// Please never uncomment the functionality of Assert in debug
|
||||
// The code, as with all developement like this is littered with Asserts which are designed to throw
|
||||
// up an error message if variables are out of range.
|
||||
|
||||
// Disabling this functionality is dangerous, crazy values can run rampent unchecked and the longer its disabled
|
||||
// the more likely you are to have problems getting it working again.
|
||||
#if defined(NDEBUG)
|
||||
#define Assert(x) do {} while (0)
|
||||
//#else
|
||||
//void gr_activate(int);
|
||||
//#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
|
||||
//#endif
|
||||
#else
|
||||
void gr_activate(int);
|
||||
#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
|
||||
#endif
|
||||
/*******************NEVER UNCOMMENT Assert ************************************************/
|
||||
|
||||
//#define Int3() _asm { int 3 }
|
||||
|
||||
@@ -570,6 +670,7 @@ void dc_printf( char *format, ... );
|
||||
// Some constants for stuff
|
||||
#ifdef _WIN32
|
||||
#define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
|
||||
|
||||
#define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
|
||||
#endif
|
||||
|
||||
@@ -752,6 +853,8 @@ template <class T> void CAP( T& v, T mn, T mx )
|
||||
#define malloc(size) vm_malloc(size)
|
||||
#define free(ptr) vm_free(ptr)
|
||||
#define strdup(ptr) vm_strdup(ptr)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Loaded 100 of 445 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user