mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Compare commits
572
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
022a04472c | ||
|
|
e80b91c27e | ||
|
|
26a66f9c53 | ||
|
|
a337c9a5d5 | ||
|
|
85da72fb16 | ||
|
|
13ee1bdb60 | ||
|
|
02465b9db6 | ||
|
|
b33417a918 | ||
|
|
f802db8345 | ||
|
|
56054d6782 | ||
|
|
1c3fb592cb | ||
|
|
049870c973 | ||
|
|
22c0882bc6 | ||
|
|
ffd3fbd922 | ||
|
|
42e496d103 | ||
|
|
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 | ||
|
|
d8f9376d55 | ||
|
|
2c95fa52f8 | ||
|
|
993740e06f | ||
|
|
da67b2b53c | ||
|
|
7d08fec7cc | ||
|
|
6ec2c31678 | ||
|
|
e469a54429 | ||
|
|
2352055d98 | ||
|
|
7892625474 | ||
|
|
58a1497614 | ||
|
|
76d94278a8 | ||
|
|
47b2c3cd88 | ||
|
|
1f55e87876 | ||
|
|
cdd1a0b743 | ||
|
|
f864a28bb3 | ||
|
|
993a176572 | ||
|
|
414a344f33 | ||
|
|
28848dcbc8 | ||
|
|
ea32341410 | ||
|
|
ad53507f1c | ||
|
|
8f9e7cf941 | ||
|
|
1f1339cb01 | ||
|
|
e5eafea546 | ||
|
|
373d2c201c | ||
|
|
ec63b64b1f | ||
|
|
e6da9a6d68 | ||
|
|
4fac9708ec | ||
|
|
71d4bd62b2 | ||
|
|
3e96899ace | ||
|
|
51c590c6a6 | ||
|
|
e7d1452827 | ||
|
|
137e7a8cdd | ||
|
|
77f769b328 | ||
|
|
c85cb1377b | ||
|
|
f3362d6a2f | ||
|
|
043310f88a | ||
|
|
46f524706c | ||
|
|
7b7df3caba | ||
|
|
a47ff4d7a5 | ||
|
|
70fc3119e7 | ||
|
|
830be35c58 | ||
|
|
2fff39194f | ||
|
|
fffa377d2f | ||
|
|
a819e73388 | ||
|
|
0562965e69 | ||
|
|
7928823b96 | ||
|
|
3b92333b16 | ||
|
|
7238ae9025 | ||
|
|
f6634e882c | ||
|
|
f99a3916de | ||
|
|
cc9f972e80 | ||
|
|
609da60af3 | ||
|
|
7b794ea056 | ||
|
|
3f66617c68 | ||
|
|
f8f60965a9 | ||
|
|
6f0832c6d8 | ||
|
|
33c321d328 | ||
|
|
16fdb53870 | ||
|
|
b5ab80797d | ||
|
|
1385a9c6ac | ||
|
|
a11c390fd5 | ||
|
|
a498b79b2d | ||
|
|
6a22f2443e | ||
|
|
cd2597f3a2 | ||
|
|
d32a38c267 | ||
|
|
64bcc9942e | ||
|
|
cf750429cb | ||
|
|
32843f18f8 | ||
|
|
d7bd110ffe | ||
|
|
36176b8eb4 | ||
|
|
8c94fbd199 | ||
|
|
d9e1e01afc | ||
|
|
8edec19426 | ||
|
|
5419f3b5de | ||
|
|
6df0403964 | ||
|
|
2bef522bfc | ||
|
|
4e86a928b3 | ||
|
|
254b4f6603 | ||
|
|
7373203236 | ||
|
|
55a4c34bab | ||
|
|
b060ac5928 | ||
|
|
ab27958761 | ||
|
|
dca1600f46 | ||
|
|
218ac8a0d7 | ||
|
|
cac96f1a44 | ||
|
|
55948f0db1 | ||
|
|
c80033de55 | ||
|
|
dd378506ee | ||
|
|
9e890d8df5 | ||
|
|
f4030700dc | ||
|
|
b7f924ea6b | ||
|
|
c5c4fd08e9 | ||
|
|
bf7871905e | ||
|
|
28ef47c26f | ||
|
|
7a6e12df06 | ||
|
|
97130623dc | ||
|
|
a1ad295557 | ||
|
|
ecc552eda8 | ||
|
|
56d7afd8a0 | ||
|
|
46e465b1d2 | ||
|
|
4c52cb0441 | ||
|
|
4da09ccefc | ||
|
|
389921bd48 | ||
|
|
e9f6827211 | ||
|
|
042d935a80 | ||
|
|
1f7fee5baa | ||
|
|
ff33077291 | ||
|
|
70c909302c | ||
|
|
900f57bc94 | ||
|
|
41fabe25bd | ||
|
|
1e634da6dd | ||
|
|
a4386862f5 | ||
|
|
7435ddd89b | ||
|
|
f1e5508023 | ||
|
|
0fd8e46ea2 | ||
|
|
cb4764e8d0 | ||
|
|
0c55ff682b | ||
|
|
8659222b82 | ||
|
|
64b2332534 | ||
|
|
303278228a | ||
|
|
16baec8877 | ||
|
|
0b7cc9aa9d | ||
|
|
77bc1ed93b | ||
|
|
d2969046d4 | ||
|
|
b3c67343e5 | ||
|
|
f26624902f | ||
|
|
f96196c271 | ||
|
|
f47b3c0fd0 | ||
|
|
170ac43ebe | ||
|
|
93e0b43b03 | ||
|
|
b9c9069c5a | ||
|
|
fdc9b42d14 | ||
|
|
6cb690996d | ||
|
|
eb63396934 | ||
|
|
f1aa394d29 | ||
|
|
415969fca0 | ||
|
|
dfbd9ad9d0 | ||
|
|
a50424930b | ||
|
|
9843ff7b49 | ||
|
|
7ea79b3ed4 | ||
|
|
b783b7e364 | ||
|
|
60d0011159 | ||
|
|
e730044cc1 | ||
|
|
60ea566ecc | ||
|
|
fd797419dd | ||
|
|
3a5a785f51 | ||
|
|
65564198ef | ||
|
|
def0b0ceb0 | ||
|
|
01776721ab | ||
|
|
6f7d012184 | ||
|
|
7d4d468e58 | ||
|
|
d1a870b372 | ||
|
|
680e55e493 | ||
|
|
c779bae39a | ||
|
|
5a4fafec31 | ||
|
|
cfcc94c2bb | ||
|
|
8d1c8fad7c | ||
|
|
c6cc437092 | ||
|
|
6a30e96439 | ||
|
|
95d7869aa6 | ||
|
|
95a26b87ce | ||
|
|
6c0bfdd0b7 | ||
|
|
0e19a3a614 | ||
|
|
35350315b7 | ||
|
|
8f97380d75 | ||
|
|
fe6bac98c7 | ||
|
|
77c5502b19 | ||
|
|
065eb6f1d5 | ||
|
|
103e4b2b22 | ||
|
|
cb4e5b551f | ||
|
|
c22d9a7e99 | ||
|
|
2b52cf3896 | ||
|
|
5b16bd3748 | ||
|
|
40bbe0cd39 | ||
|
|
661dc39d9c | ||
|
|
07c240e9a1 | ||
|
|
93f20cb8e4 | ||
|
|
e512f60386 | ||
|
|
59442ea786 | ||
|
|
ee8a7f67a7 | ||
|
|
c2c24787da | ||
|
|
60f69cb79b | ||
|
|
3bc70fc2c2 | ||
|
|
f09a3c0a09 | ||
|
|
f15a879898 | ||
|
|
984f3f0aa7 | ||
|
|
1559d18757 | ||
|
|
c2c0ca0eeb | ||
|
|
754c35f2f5 | ||
|
|
2bbd5a806b | ||
|
|
5891192fda | ||
|
|
5effb36530 | ||
|
|
bc72cea911 | ||
|
|
ec8886cf09 | ||
|
|
bce0cc4ca0 | ||
|
|
66eaf28ac8 | ||
|
|
d728b3d745 | ||
|
|
11426ed5a2 | ||
|
|
386abb7000 | ||
|
|
476fb7bbfc | ||
|
|
c825720ae0 | ||
|
|
6e407fff7b | ||
|
|
11b24d23aa | ||
|
|
2135e20299 | ||
|
|
123277167b | ||
|
|
4a9f85674f | ||
|
|
719579177e | ||
|
|
3f6a1f33d4 | ||
|
|
688dee73c2 | ||
|
|
5fa10d82f4 | ||
|
|
4cde77929f | ||
|
|
41f66ee2f3 | ||
|
|
2ee9db9479 | ||
|
|
f87883712e | ||
|
|
ea22ebfe09 | ||
|
|
0edd905be5 | ||
|
|
47e2ff7500 | ||
|
|
c011621363 | ||
|
|
8c47d95901 | ||
|
|
e08be40462 | ||
|
|
d7022ad67b | ||
|
|
38f435eba8 | ||
|
|
6f429c16ee | ||
|
|
dfaebd0908 | ||
|
|
d6abb06544 | ||
|
|
d950369202 | ||
|
|
745fc385e9 | ||
|
|
f02a1caced | ||
|
|
e547962d31 | ||
|
|
31fe8e2a4c | ||
|
|
1b1dc86fb6 | ||
|
|
7539390fc3 | ||
|
|
ad7b508184 | ||
|
|
0fa37a5b62 | ||
|
|
1cbfc73384 | ||
|
|
c58ae29dd5 | ||
|
|
96e442b564 | ||
|
|
e817f867af | ||
|
|
8c8c96bb89 | ||
|
|
f0e7af10bb | ||
|
|
4e44bcfdef | ||
|
|
d4cea3a9ff | ||
|
|
f06b7dfd20 | ||
|
|
6dd4f692e2 | ||
|
|
d860dc0011 | ||
|
|
d5d8e66dee | ||
|
|
ad4843b8ea | ||
|
|
3162ede091 | ||
|
|
f9e3871b3e | ||
|
|
53abc32182 | ||
|
|
39267bcb05 | ||
|
|
7398df34ec | ||
|
|
62c8792c2a | ||
|
|
e561a547a7 | ||
|
|
5128907c07 | ||
|
|
5ddef96ccc | ||
|
|
e75251141a | ||
|
|
4f419025fe | ||
|
|
c6cf69e4a3 | ||
|
|
10e444df95 | ||
|
|
eeab39d62d | ||
|
|
28e46d411b | ||
|
|
1195eb3ada | ||
|
|
5f779fae4c | ||
|
|
cdb274654e | ||
|
|
b486c02ac8 | ||
|
|
9bcb08776c | ||
|
|
d36c788e00 | ||
|
|
00bbac6ae1 | ||
|
|
40db1ce831 | ||
|
|
bbf18d5667 | ||
|
|
377f78db0f | ||
|
|
ad96da3537 | ||
|
|
db8cf9134f | ||
|
|
0d65873a0b | ||
|
|
c38ff6302d | ||
|
|
abc9a3ddb1 | ||
|
|
650c4dea46 | ||
|
|
a2d1cf8f37 | ||
|
|
23c449af6c | ||
|
|
2d548f46bf | ||
|
|
c3c4ce064c | ||
|
|
fb7a0d5257 | ||
|
|
f8351a9818 | ||
|
|
5aefddd246 | ||
|
|
facefe5872 | ||
|
|
ef794efbb3 | ||
|
|
573a1f2fa3 | ||
|
|
a763d84b56 | ||
|
|
c06ccbb602 | ||
|
|
ffd8a5ae2a | ||
|
|
aa753d5d6e | ||
|
|
1cf042064f | ||
|
|
a4e14a94d2 | ||
|
|
5871d644cc | ||
|
|
145a149873 | ||
|
|
7492c51ee6 | ||
|
|
be4954a69e | ||
|
|
875a95b82e | ||
|
|
f6b129577b | ||
|
|
4d30bbba3e | ||
|
|
8823dc67eb | ||
|
|
8690c9d7f6 | ||
|
|
f70d242903 | ||
|
|
5b4306dbd6 | ||
|
|
013870fc6a | ||
|
|
0e3d4e562f | ||
|
|
48d1ec4575 | ||
|
|
32ad077676 | ||
|
|
9942308fc8 |
No files matched your search
@@ -1,13 +0,0 @@
|
||||
# The "checkoutlist" file is used to support additional version controlled
|
||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
||||
#
|
||||
# The first entry on a line is a filename which will be checked out from
|
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
||||
# The remainder of the line is an error message to use if the file cannot
|
||||
# be checked out.
|
||||
#
|
||||
# File format:
|
||||
#
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
@@ -1,15 +0,0 @@
|
||||
# The "commitinfo" file is used to control pre-commit checks.
|
||||
# The filter on the right is invoked with the repository and a list
|
||||
# of files to check. A non-zero exit of the filter program will
|
||||
# cause the commit to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,14 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
#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'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
||||
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
|
||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
||||
#LogHistory=TOFEWGCMAR
|
||||
@@ -1,23 +0,0 @@
|
||||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -t/-f options allow one to treat directories of files
|
||||
# as a single file, or to transform a file in other ways on
|
||||
# its way in and out of CVS.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,26 +0,0 @@
|
||||
# The "loginfo" file controls where "cvs commit" log information
|
||||
# is sent. The first entry on a line is a regular expression which must match
|
||||
# the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
||||
# program that should expect log information on its standard input.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name ALL appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or DEFAULT.
|
||||
#
|
||||
# You may specify a format string as part of the
|
||||
# filter. The string is composed of a `%' followed
|
||||
# by a single format character, or followed by a set of format
|
||||
# characters surrounded by `{' and `}' as separators. The format
|
||||
# characters are:
|
||||
#
|
||||
# s = file name
|
||||
# V = old version number (pre-checkin)
|
||||
# v = new version number (post-checkin)
|
||||
#
|
||||
# For example:
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
@@ -1,26 +0,0 @@
|
||||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
@@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail %s -s "CVS notification"
|
||||
@@ -1,9 +0,0 @@
|
||||
drevil:f76FWdDTUBG5c:fs2source
|
||||
mysterial:f7nJUwoIhmSrg:fs2source
|
||||
wmcoolmon:f7JRB.js9Q1sE:fs2source
|
||||
inquisitor:f7BVkOvwjDlWk:fs2source
|
||||
penguin:Jh.dOjaiO2jHk:fs2source
|
||||
DTP:f7M92Z/6/uep.:fs2source
|
||||
unknownplayer:f79BgAn.IzJs6:fs2source
|
||||
phreak:f7WQyGiT/jzlM:fs2source
|
||||
anonymous:oIKtWP1q6GDt6:fs2source
|
||||
@@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,4 +0,0 @@
|
||||
drevil
|
||||
inquisitor
|
||||
mysterial
|
||||
penguin
|
||||
@@ -0,0 +1,29 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
|
||||
|
||||
Modifications by the FreeSpace Source Code Project (FSSCP)
|
||||
http://fs2source.warpcore.org
|
||||
|
||||
FS2_OPEN STAFF:
|
||||
|
||||
Project leader:
|
||||
Edward "Inquisitor" Gardner
|
||||
|
||||
Programmers:
|
||||
"Bobboau"
|
||||
Dennis "DTP" Pedersen
|
||||
Ian "Goober5000" Warfield
|
||||
Joe "Righteous1" Dowd
|
||||
Mike "penguin" Harris
|
||||
"Mysterial"
|
||||
"PhReAk"
|
||||
Thomas "Random Tiger" Whittaker
|
||||
Will "Unknown PLayer" Rousnel
|
||||
"WMCoolmon"
|
||||
|
||||
Web support:
|
||||
Icefire and the staff at Volitionwatch.com
|
||||
Alex "Thunder" Avery and the staff at Hard Light Productions
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
@@ -0,0 +1,14 @@
|
||||
Volition Copyright (applies to original FreeSpace2 source code
|
||||
developed and released by Volition):
|
||||
|
||||
"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."
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,3 +1,761 @@
|
||||
ChangeLog for fs2_open. All times are UTC.
|
||||
Updated 2002-10-31 03:46
|
||||
|
||||
|
||||
2002-10-30 22:57 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.8), graphics/grd3d.cpp (2.2.2.18),
|
||||
graphics/grd3dinternal.h (2.1.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.16), model/modelinterp.cpp (2.3.2.1):
|
||||
|
||||
Changed DX8 code to not use set render and texture states if they
|
||||
are already set to that value. Disabled buffer saving and
|
||||
restoring code when windowed to stop DX8 debug runs from crashing.
|
||||
- RT
|
||||
|
||||
2002-10-30 20:22 inquisitor
|
||||
|
||||
* code/cmdline/cmdline.h (2.10):
|
||||
|
||||
Bad Committ, Rolling back
|
||||
|
||||
2002-10-30 06:29 DTP
|
||||
|
||||
* code/cfile/: cfilesystem.cpp (2.5), cfile.cpp (2.5):
|
||||
|
||||
doh!, used upper case in include, dont know how much it matters for
|
||||
*nix systems, but here it is
|
||||
|
||||
2002-10-30 06:26 DTP
|
||||
|
||||
* code/cfile/cfilesystem.cpp (2.4):
|
||||
|
||||
DTP Implemented basic VP files handling. mission and campaign files
|
||||
inside VP files found in mod dir still not supported, cheking /
|
||||
creating directories not implented either
|
||||
|
||||
2002-10-29 22:41 sesquipedalian
|
||||
|
||||
* code/parse/: sexp.cpp (2.3), sexp.h (2.3):
|
||||
|
||||
no message
|
||||
|
||||
2002-10-28 02:28 DTP
|
||||
|
||||
* code/cmdline/cmdline.h (2.9):
|
||||
|
||||
Crap, somebody may restore cmdline.h to 2 version before this.
|
||||
|
||||
2002-10-28 00:40 randomtiger
|
||||
|
||||
* code/graphics/grd3d.cpp (2.2.2.17):
|
||||
|
||||
Implemented screen saving code for restoring when drawing popups, a
|
||||
bit slow but works. - RT
|
||||
|
||||
2002-10-27 23:59 DTP
|
||||
|
||||
* code/cfile/: cfile.cpp (2.4), cfile.h (2.3):
|
||||
|
||||
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.
|
||||
|
||||
2002-10-27 23:55 DTP
|
||||
|
||||
* code/cmdline/: cmdline.cpp (2.9), cmdline.h (2.8):
|
||||
|
||||
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.
|
||||
|
||||
2002-10-26 09:55 unknownplayer
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.5), nebula/neb.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
Fixed the nebula flicker bug. Check the NO_DIRECT3D conditional
|
||||
compile sections in the future for bits of code which may cause
|
||||
problems due to hacks correcting for DirectX5 that no longer apply.
|
||||
|
||||
2002-10-26 01:24 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.10), bmpman/bmpman.h (2.0.2.7),
|
||||
graphics/grd3d.cpp (2.2.2.16), graphics/grd3drender.cpp (2.3.2.15),
|
||||
graphics/grd3dtexture.cpp (2.1.2.15):
|
||||
|
||||
Fixed debug bitmap compiling bug. Fixed tga bug. - RT
|
||||
|
||||
2002-10-22 23:02 randomtiger
|
||||
|
||||
* code/: cmdline/cmdline.cpp (2.8), cmdline/cmdline.h (2.7),
|
||||
debugconsole/timerbar.h (1.2), hud/hudtargetbox.cpp (2.4),
|
||||
model/modelinterp.cpp (2.5):
|
||||
|
||||
Made Phreaks alternative scanning style optional under the command
|
||||
line tag "-phreak" Fixed bug that changes HUD colour when
|
||||
targetting debris in a full nebula. - RT
|
||||
|
||||
2002-10-22 17:46 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.7.2.4), code/bmpman/bmpman.cpp (2.2.2.9),
|
||||
code/bmpman/bmpman.h (2.0.2.6), code/graphics/grd3dtexture.cpp
|
||||
(2.1.2.14):
|
||||
|
||||
Fixed new TGA code texturing bug. - RT
|
||||
|
||||
2002-10-22 17:42 randomtiger
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.13),
|
||||
missionui/missionpause.cpp (2.3):
|
||||
|
||||
Fixed lighting bug that caused special pause to crash on debug
|
||||
build. Also added TAB functionality for special pause that toggles
|
||||
HUD. - RT
|
||||
|
||||
2002-10-21 16:33 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.8), bmpman/bmpman.h (2.0.2.5),
|
||||
graphics/grd3d.cpp (2.2.2.15), graphics/grd3dinternal.h (2.1.2.6),
|
||||
graphics/grd3drender.cpp (2.3.2.14), graphics/grd3dtexture.cpp
|
||||
(2.1.2.13):
|
||||
|
||||
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
|
||||
|
||||
2002-10-20 22:21 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.7), graphics/grd3d.cpp
|
||||
(2.2.2.14), graphics/grd3drender.cpp (2.3.2.13), palman/palman.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
Some incomplete code to handle background drawing when message
|
||||
boxes are drawn. It doesnt work but its a good base for someone to
|
||||
start from. - RT
|
||||
|
||||
2002-10-19 23:56 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.6), bmpman/bmpman.h (2.0.2.4),
|
||||
globalincs/pstypes.h (2.4.2.3), graphics/grd3d.cpp (2.2.2.13),
|
||||
graphics/grd3dtexture.cpp (2.1.2.12):
|
||||
|
||||
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
|
||||
|
||||
2002-10-19 19:29 bobboau
|
||||
|
||||
* code/: controlconfig/controlsconfig.h (2.2),
|
||||
controlconfig/controlsconfigcommon.cpp (2.3), model/model.h (2.5),
|
||||
model/modelinterp.cpp (2.4), model/modelread.cpp (2.4),
|
||||
model/modelsinc.h (2.4), object/object.cpp (2.2), osapi/outwnd.cpp
|
||||
(2.2), physics/physics.cpp (2.2), physics/physics.h (2.2),
|
||||
playerman/playercontrol.cpp (2.2), ship/ai.h (2.2), ship/aibig.cpp
|
||||
(2.2), ship/aicode.cpp (2.8), ship/ship.cpp (2.7), ship/ship.h
|
||||
(2.4), ship/shipcontrails.cpp (2.3), ship/shipcontrails.h (2.1),
|
||||
ship/shiphit.cpp (2.6), starfield/starfield.cpp (2.3),
|
||||
weapon/beam.cpp (2.4), weapon/beam.h (2.3), weapon/weapon.h (2.2),
|
||||
weapon/weapons.cpp (2.2):
|
||||
|
||||
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
|
||||
|
||||
2002-10-19 03:50 randomtiger
|
||||
|
||||
* code/: cmdline/cmdline.cpp (2.7), cmdline/cmdline.h (2.6),
|
||||
freespace2/freespace.cpp (2.12), io/keycontrol.cpp (2.4),
|
||||
menuui/readyroom.cpp (2.2), missionui/missionpause.cpp (2.2),
|
||||
missionui/missionpause.h (2.2):
|
||||
|
||||
Added special pause mode for easier action screenshots. Added new
|
||||
command line parameter for accessing all single missions in tech
|
||||
room. - RT
|
||||
|
||||
2002-10-17 20:40 randomtiger
|
||||
|
||||
* code/: controlconfig/controlsconfig.h (2.1),
|
||||
controlconfig/controlsconfigcommon.cpp (2.2), hud/hud.cpp (2.2),
|
||||
hud/hud.h (2.2), io/keycontrol.cpp (2.3),
|
||||
mission/missionmessage.cpp (2.2):
|
||||
|
||||
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.
|
||||
|
||||
2002-10-16 00:41 randomtiger
|
||||
|
||||
* code/graphics/: 2d.cpp (2.3.2.8), 2d.h (2.1.2.2), grd3d.cpp
|
||||
(2.2.2.12), grd3d.h (2.0.2.4), grd3drender.cpp (2.3.2.12):
|
||||
|
||||
Fixed small bug that was stopping unactive text from displaying
|
||||
greyed out Also added ability to run FS2 DX8 in 640x480, however I
|
||||
needed to make a small change to 2d.cpp which invloved calling the
|
||||
resolution processing code after initialising the device for D3D
|
||||
only. This is because D3D8 for the moment has its own internal
|
||||
launcher. Also I added a fair bit of documentation and tidied some
|
||||
stuff up. - RT
|
||||
|
||||
2002-10-14 21:52 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.5), graphics/grd3d.cpp
|
||||
(2.2.2.11), graphics/grd3drender.cpp (2.3.2.11),
|
||||
graphics/grd3dtexture.cpp (2.1.2.11):
|
||||
|
||||
Finally tracked down and killed off that 8 bit alpha bug. So the
|
||||
font, HUD and 8 bit ani's now work fine. - RT
|
||||
|
||||
2002-10-14 19:49 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.4):
|
||||
|
||||
screenshots, yay!
|
||||
|
||||
2002-10-13 21:43 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.3):
|
||||
|
||||
further optimizations
|
||||
|
||||
2002-10-12 17:48 phreak
|
||||
|
||||
* code/graphics/gropenglw32x.cpp (1.2):
|
||||
|
||||
fixed text
|
||||
|
||||
2002-10-11 21:35 phreak
|
||||
|
||||
* code/graphics/gropenglw32.cpp (1.2):
|
||||
|
||||
dont use this one
|
||||
|
||||
2002-10-11 21:30 phreak
|
||||
|
||||
* code/graphics/: gropenglw32.cpp (1.1), gropenglw32x.cpp (1.1):
|
||||
|
||||
first run at opengl for w32, only useful in main hall, barracks and
|
||||
campaign room
|
||||
|
||||
2002-10-11 18:50 randomtiger
|
||||
|
||||
* code/graphics/: 2d.cpp (2.3.2.7), 2d.h (2.1.2.1), grd3d.cpp
|
||||
(2.2.2.10), grd3d.h (2.0.2.3), grd3dinternal.h (2.1.2.5),
|
||||
grd3drender.cpp (2.3.2.10), grd3dtexture.cpp (2.1.2.10):
|
||||
|
||||
Checked in fix for 16 bit problem, thanks to Righteous1 Removed a
|
||||
fair bit of code that was used by the 16 bit code path which no
|
||||
longer exists. 32 bit and 16 bit should now work in exactly the
|
||||
same way. - RT
|
||||
|
||||
2002-10-08 14:33 randomtiger
|
||||
|
||||
* code/: graphics/grd3d.cpp (2.2.2.9), graphics/grd3drender.cpp
|
||||
(2.3.2.9), graphics/grd3dtexture.cpp (2.1.2.9), osapi/outwnd.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
OK, I've fixed the z-buffer problem. However I have abandoned
|
||||
using w-buffer for now because of problems. I think I know how to
|
||||
solve it but Im not sure it would make much difference given the
|
||||
way FS2 engine works. I have left code in there of use if anyone
|
||||
wants to turn their hand to it. However for now we just need to
|
||||
crack of the alpha problem then we will have FS2 fully wokring in
|
||||
DX8 on GF4 in 32 bit.
|
||||
|
||||
2002-10-05 16:46 randomtiger
|
||||
|
||||
* code/: code.dsp (1.10), debugconsole/timerbar.cpp (1.1),
|
||||
debugconsole/timerbar.h (1.1), freespace2/freespace.cpp (2.11),
|
||||
globalincs/systemvars.h (2.2), graphics/grd3d.cpp (2.3),
|
||||
graphics/grd3dinternal.h (2.2), graphics/grd3drender.cpp (2.4),
|
||||
menuui/credits.cpp (2.3):
|
||||
|
||||
Added us fs2_open people to the credits. Worth looking at just for
|
||||
that. Added timer bar code, by default its not compiled in. Use
|
||||
TIMEBAR_ACTIVE in project and dependancy code settings to activate.
|
||||
Added the new timebar files with the new code.
|
||||
|
||||
2002-10-04 00:48 randomtiger
|
||||
|
||||
* code/graphics/: grd3d.cpp (2.2.2.8), grd3dinternal.h (2.1.2.4),
|
||||
grd3drender.cpp (2.3.2.8), grd3dtexture.cpp (2.1.2.8):
|
||||
|
||||
Fixed video memory leaks Added code to cope with lost device, not
|
||||
tested Got rid of some DX5 stuff we definately dont need Moved some
|
||||
enum's into internal,h because gr_d3d_set_state should be able to
|
||||
be called from any dx file Cleaned up some stuff - RT
|
||||
|
||||
2002-10-03 08:32 unknownplayer
|
||||
|
||||
* code/: graphics/grd3d.cpp (2.2.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.7), osapi/osapi.cpp (2.2.2.2):
|
||||
|
||||
Hacked in a windowed mode so we can properly debug this without
|
||||
using monitors (although I drool at the concept of having that!)
|
||||
|
||||
2002-10-02 17:52 randomtiger
|
||||
|
||||
* code/: debugconsole/dbugfile.cpp (2.1.2.3),
|
||||
debugconsole/dbugfile.h (2.1.2.3), graphics/grd3d.cpp (2.2.2.6),
|
||||
graphics/grd3drender.cpp (2.3.2.7), graphics/grd3dtexture.cpp
|
||||
(2.1.2.6):
|
||||
|
||||
Fixed blue lighting bug. Put filtering flag set back in that I
|
||||
accidentally removed Added some new functionality to my debuging
|
||||
system - RT
|
||||
|
||||
2002-10-02 11:40 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.7), bmpman/bmpman.cpp (2.2.2.4),
|
||||
bmpman/bmpman.h (2.0.2.3), graphics/2d.cpp (2.3.2.6),
|
||||
graphics/grd3d.cpp (2.2.2.5), graphics/grd3d.h (2.0.2.2),
|
||||
graphics/grd3dinternal.h (2.1.2.3), graphics/grd3drender.cpp
|
||||
(2.3.2.6), graphics/grd3dtexture.cpp (2.1.2.5),
|
||||
pcxutils/pcxutils.cpp (2.1.2.2):
|
||||
|
||||
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
|
||||
|
||||
2002-09-28 22:13 randomtiger
|
||||
|
||||
* code/: anim/animplay.cpp (2.1.2.2), bmpman/bmpman.cpp (2.2.2.3),
|
||||
graphics/grd3d.cpp (2.2.2.4), graphics/grd3dinternal.h (2.1.2.2),
|
||||
graphics/grd3drender.cpp (2.3.2.5), graphics/grd3dtexture.cpp
|
||||
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
|
||||
|
||||
Sorted out some bits and pieces. The background nebula blends now
|
||||
which is nice. – RT
|
||||
|
||||
2002-09-28 12:20 randomtiger
|
||||
|
||||
* code/graphics/: grd3d.cpp (2.2.2.3), grd3drender.cpp (2.3.2.4),
|
||||
grd3dtexture.cpp (2.1.2.3):
|
||||
|
||||
Just a tiny code change that lets stuff work in 16 bit. For some
|
||||
reason 16 bit code was taking a different code path for displaying
|
||||
textures. So until I unstand why, Im cutting off that codepath
|
||||
because it isnt easy to convert into DX8.
|
||||
|
||||
2002-09-28 00:18 randomtiger
|
||||
|
||||
* code/: bmpman/bmpman.cpp (2.2.2.2), bmpman/bmpman.h (2.0.2.2),
|
||||
graphics/grd3drender.cpp (2.3.2.3), graphics/grd3dtexture.cpp
|
||||
(2.1.2.2):
|
||||
|
||||
Did some work on trying to get textures to load from pcx, define
|
||||
TX_ATTEMPT for access to it. Converted some DX7 blending calls to
|
||||
DX8 which a fair difference to ingame visuals.
|
||||
|
||||
- RT
|
||||
|
||||
2002-09-24 18:56 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.7.2.3), code/code.dsp (1.6.2.6),
|
||||
code/anim/animplay.cpp (2.1.2.1), code/bmpman/bmpman.cpp (2.2.2.1),
|
||||
code/bmpman/bmpman.h (2.0.2.1), code/cfile/cfile.cpp (2.3.2.1),
|
||||
code/cmeasure/cmeasure.cpp (2.1.2.1),
|
||||
code/controlconfig/controlsconfig.cpp (2.1.2.1),
|
||||
code/cutscene/cutscenes.cpp (2.2.2.4), code/cutscene/movie.cpp
|
||||
(2.1.2.4), code/cutscene/movie.h (2.1.2.2),
|
||||
code/debugconsole/console.cpp (2.1.2.1),
|
||||
code/debugconsole/dbugfile.cpp (2.1.2.2),
|
||||
code/debugconsole/dbugfile.h (2.1.2.2),
|
||||
code/freespace2/freespace.cpp (2.6.2.4),
|
||||
code/freespace2/freespace.rc (2.0.2.1),
|
||||
code/freespace2/freespaceresource.h (2.0.2.1),
|
||||
code/gamehelp/gameplayhelp.cpp (2.1.2.1), code/globalincs/pstypes.h
|
||||
(2.4.2.2), code/graphics/2d.cpp (2.3.2.5), code/graphics/bitblt.cpp
|
||||
(2.1.2.1), code/graphics/grd3d.cpp (2.2.2.2), code/graphics/grd3d.h
|
||||
(2.0.2.1), code/graphics/grd3dinternal.h (2.1.2.1),
|
||||
code/graphics/grd3drender.cpp (2.3.2.2),
|
||||
code/graphics/grd3dtexture.cpp (2.1.2.1),
|
||||
code/graphics/grdirectdraw.cpp (2.1.2.2), code/hud/hudconfig.cpp
|
||||
(2.2.2.1), code/hud/hudmessage.cpp (2.1.2.1),
|
||||
code/menuui/barracks.cpp (2.2.2.1), code/menuui/credits.cpp
|
||||
(2.2.2.1), code/menuui/mainhallmenu.cpp (2.3.2.4),
|
||||
code/menuui/mainhalltemp.cpp (2.1.2.1), code/menuui/optionsmenu.cpp
|
||||
(2.1.2.1), code/menuui/playermenu.cpp (2.2.2.1),
|
||||
code/menuui/readyroom.cpp (2.1.2.1), code/menuui/techmenu.cpp
|
||||
(2.1.2.1), code/menuui/trainingmenu.cpp (2.1.2.1),
|
||||
code/mission/missioncampaign.cpp (2.3.2.3),
|
||||
code/mission/missiongoals.cpp (2.1.2.1),
|
||||
code/mission/missionhotkey.cpp (2.1.2.1),
|
||||
code/mission/missionload.cpp (2.1.2.1),
|
||||
code/missionui/missionbrief.cpp (2.1.2.1),
|
||||
code/missionui/missioncmdbrief.cpp (2.1.2.1),
|
||||
code/missionui/missiondebrief.cpp (2.2.2.1),
|
||||
code/missionui/missionloopbrief.cpp (2.1.2.1),
|
||||
code/missionui/missionpause.cpp (2.1.2.1),
|
||||
code/missionui/missionshipchoice.cpp (2.1.2.1),
|
||||
code/missionui/missionweaponchoice.cpp (2.1.2.1),
|
||||
code/missionui/redalert.cpp (2.1.2.1),
|
||||
code/network/multi_dogfight.cpp (2.1.2.1),
|
||||
code/network/multi_ingame.cpp (2.1.2.1),
|
||||
code/network/multi_pinfo.cpp (2.1.2.1),
|
||||
code/network/multiteamselect.cpp (2.2.2.1),
|
||||
code/network/multiui.cpp (2.4.2.1), code/pcxutils/pcxutils.cpp
|
||||
(2.1.2.1), code/popup/popup.cpp (2.1.2.1), code/render/3ddraw.cpp
|
||||
(2.2.2.1), code/ship/ship.cpp (2.6.2.1), code/stats/medals.cpp
|
||||
(2.2.2.1), code/ui/gadget.cpp (2.1.2.1), code/weapon/weapons.cpp
|
||||
(2.1.2.1):
|
||||
|
||||
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
|
||||
|
||||
2002-09-20 20:09 phreak
|
||||
|
||||
* code/freespace2/freespace.cpp (2.10):
|
||||
|
||||
did glare stuff in game_sunspot_process()
|
||||
|
||||
2002-09-20 20:05 phreak
|
||||
|
||||
* code/starfield/starfield.cpp (2.2):
|
||||
|
||||
glare parser stuff in stars_init()
|
||||
|
||||
2002-09-20 20:04 phreak
|
||||
|
||||
* code/starfield/starfield.h (2.2):
|
||||
|
||||
added glare variable for ambient suns if glare is 0 then the sun
|
||||
glare whiteout is not shown when looking at the sun
|
||||
|
||||
2002-09-20 20:02 phreak
|
||||
|
||||
* code/hud/hudtarget.cpp (2.2):
|
||||
|
||||
lead indicator for dumbfire missiles
|
||||
|
||||
2002-09-20 20:01 phreak
|
||||
|
||||
* code/hud/hudtargetbox.cpp (2.3):
|
||||
|
||||
extra effects during cargo scan
|
||||
|
||||
2002-09-10 21:58 unknownplayer
|
||||
|
||||
* code/graphics/directx8/GrD3d81Stubs.cpp (1.1):
|
||||
|
||||
file GrD3d81Stubs.cpp was initially added on branch directx8.
|
||||
|
||||
2002-09-10 21:58 unknownplayer
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.3), graphics/2d.cpp
|
||||
(2.3.2.4), graphics/grdirectdraw.cpp (2.1.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.4),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.4),
|
||||
graphics/directx8/GrD3d81Stubs.cpp (1.1.2.1):
|
||||
|
||||
Added the DX8 stub file, plus new CODE!
|
||||
|
||||
2002-09-08 02:36 unknownplayer
|
||||
|
||||
* code/: code.dsp (1.6.2.5), graphics/2d.cpp (2.3.2.3),
|
||||
graphics/grd3d.cpp (2.2.2.1), graphics/grd3drender.cpp (2.3.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.3),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.3):
|
||||
|
||||
Framework for the new D3DRENDER class is in place, and gr_screen
|
||||
function structures are now there too. The way it's done is
|
||||
probably kind of inefficient, but until we're further along
|
||||
actually drawing polygons we should keep it that way for
|
||||
consistency's sake.
|
||||
|
||||
2002-09-01 08:18 unknownplayer
|
||||
|
||||
* Freespace2.dsp (1.7.2.2), code/code.dsp (1.6.2.4),
|
||||
code/globalincs/pstypes.h (2.4.2.1), code/graphics/2d.cpp
|
||||
(2.3.2.2), code/graphics/directx8/GrD3D81.cpp (1.2.2.2),
|
||||
code/graphics/directx8/GrD3D81.h (1.1.2.2),
|
||||
code/menuui/mainhallmenu.cpp (2.3.2.3):
|
||||
|
||||
Started writing some code for the new DX8.1 class and hit a serious
|
||||
snag to do with window handling and DirectDraw (and possibly my
|
||||
unfamiliarity with DX). It seems we may need to make some changes
|
||||
further up the code because we no longer use DX through DD in 8.1
|
||||
and the V code did that a lot (to go fullscreen and such check out
|
||||
the device creation code)
|
||||
|
||||
2002-08-31 04:50 unknownplayer
|
||||
|
||||
* code/: code.dsp (1.6.2.3), graphics/2d.cpp (2.3.2.1),
|
||||
graphics/directx8/GrD3D81.cpp (1.2.2.1),
|
||||
graphics/directx8/GrD3D81.h (1.1.2.1):
|
||||
|
||||
Removed some older DX81 stuff I added before and changed some other
|
||||
things. I'm currently thinking that I'm going to run with putting
|
||||
everything into a specialized class with the d3d_init and
|
||||
d3d_cleanup functions as gods. (Creation / Destruction functions -
|
||||
i.e. gods :)
|
||||
|
||||
2002-08-31 04:48 unknownplayer
|
||||
|
||||
* code/graphics/directx8/grd3d81internal.h (1.2.2.1):
|
||||
|
||||
These are all officially now out of FS2 unless you have a specific
|
||||
reason to need them. I'm running with the idea that we make a C++
|
||||
class and use that as an effective way to control the code.
|
||||
Rewriting V's stuff is just insanely difficult.
|
||||
|
||||
2002-08-28 21:47 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.10), code/cutscene/cutscenes.cpp (2.2.2.3),
|
||||
code/cutscene/movie.cpp (2.1.2.3):
|
||||
|
||||
Tiny change to DX branch to keep movie code optional (default off)
|
||||
|
||||
2002-08-28 12:39 randomtiger
|
||||
|
||||
* code/: code.dsp (1.6.2.2), cutscene/cutscenes.cpp (2.2.2.2),
|
||||
cutscene/movie.cpp (2.1.2.2), debugconsole/dbugfile.cpp (2.1.2.1),
|
||||
debugconsole/dbugfile.h (2.1.2.1), directx/dx8show.cpp (1.1.2.2),
|
||||
directx/dx8show.h (1.1.2.2), freespace2/freespace.cpp (2.6.2.2),
|
||||
menuui/mainhallmenu.cpp (2.3.2.2), mission/missioncampaign.cpp
|
||||
(2.3.2.2), osapi/osapi.cpp (2.2.2.1), osapi/osapi.h (2.2.2.1):
|
||||
|
||||
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!
|
||||
|
||||
2002-08-28 10:51 randomtiger
|
||||
|
||||
* code/: code.dsp (1.9), debugconsole/dbugfile.cpp (2.1),
|
||||
debugconsole/dbugfile.h (2.1), freespace2/freespace.cpp (2.9):
|
||||
|
||||
Woh! I sure as hell didnt modify all these files it says I did. I
|
||||
will put this down to the branch! Note: I did start from a fresh
|
||||
checkout!
|
||||
|
||||
2002-08-27 13:38 penguin
|
||||
|
||||
* Freespace2.dsp (1.9), code/code.dsp (1.8),
|
||||
code/cmdline/cmdline.cpp (2.6), code/cmdline/cmdline.h (2.5),
|
||||
code/cutscene/cutscenes.cpp (2.4), code/cutscene/movie.cpp (2.2),
|
||||
code/cutscene/movie.h (2.2), code/directx/DShow.h (1.2),
|
||||
code/directx/ddraw.lib (1.2), code/directx/dx8show.cpp (1.2),
|
||||
code/directx/dx8show.h (1.2), code/directx/dxguid.lib (1.2),
|
||||
code/directx/strmiids.lib (1.2), code/freespace2/freespace.cpp
|
||||
(2.8), code/menuui/mainhallmenu.cpp (2.5),
|
||||
code/mission/missioncampaign.cpp (2.5):
|
||||
|
||||
Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
|
||||
2002-08-27 13:25 penguin
|
||||
|
||||
* code/directx/: DShow.h (1.1.2.1), ddraw.lib (1.1.2.1),
|
||||
dx8show.cpp (1.1.2.1), dx8show.h (1.1.2.1), dxguid.lib (1.1.2.1),
|
||||
strmiids.lib (1.1.2.1):
|
||||
|
||||
Moved to directx8 branch
|
||||
|
||||
2002-08-27 13:21 penguin
|
||||
|
||||
* code/: freespace2/freespace.cpp (2.6.2.1),
|
||||
menuui/mainhallmenu.cpp (2.3.2.1), mission/missioncampaign.cpp
|
||||
(2.3.2.1), code.dsp (1.6.2.1), cmdline/cmdline.cpp (2.4.2.1),
|
||||
cmdline/cmdline.h (2.3.2.1), cutscene/cutscenes.cpp (2.2.2.1),
|
||||
cutscene/movie.cpp (2.1.2.1), cutscene/movie.h (2.1.2.1),
|
||||
Freespace2.dsp (1.7.2.1):
|
||||
|
||||
Moved to directx8 branch
|
||||
|
||||
2002-08-18 19:48 randomtiger
|
||||
|
||||
* Freespace2.dsp (1.8), code/code.dsp (1.7),
|
||||
code/cmdline/cmdline.cpp (2.5), code/cmdline/cmdline.h (2.4),
|
||||
code/cutscene/cutscenes.cpp (2.3), code/cutscene/movie.cpp (2.1),
|
||||
code/cutscene/movie.h (2.1), code/directx/DShow.h (1.1),
|
||||
code/directx/ddraw.lib (1.1), code/directx/dx8show.cpp (1.1),
|
||||
code/directx/dx8show.h (1.1), code/directx/dxguid.lib (1.1),
|
||||
code/directx/strmiids.lib (1.1), code/freespace2/freespace.cpp
|
||||
(2.7), code/menuui/mainhallmenu.cpp (2.4),
|
||||
code/mission/missioncampaign.cpp (2.4):
|
||||
|
||||
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
|
||||
|
||||
2002-08-15 04:41 penguin
|
||||
|
||||
* code/globalincs/systemvars.h (2.1):
|
||||
|
||||
Added #include, needed for FRED
|
||||
|
||||
2002-08-13 03:40 penguin
|
||||
|
||||
RELEASED: fs2_open 3.2 (tag: fs2_open3_2)
|
||||
|
||||
2002-08-13 03:34 penguin
|
||||
|
||||
* code/freespace2/freespace.cpp (2.6):
|
||||
|
||||
1. Disable CD checking
|
||||
2. Add CVS tag to version string
|
||||
|
||||
2002-08-13 03:32 penguin
|
||||
|
||||
* code/globalincs/version.h (2.2):
|
||||
|
||||
Bumped to version 3.2
|
||||
|
||||
2002-08-07 00:45 DTP
|
||||
|
||||
* code/graphics/grd3drender.cpp (2.3):
|
||||
|
||||
Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
|
||||
|
||||
2002-08-07 00:44 DTP
|
||||
|
||||
* code/cmdline/: cmdline.cpp (2.4), cmdline.h (2.3):
|
||||
|
||||
Implented -GF4FIX commandline switch
|
||||
|
||||
2002-08-06 16:50 phreak
|
||||
|
||||
* code/hud/hudtargetbox.cpp (2.2):
|
||||
|
||||
added wireframe targetbox feature
|
||||
|
||||
2002-08-06 16:50 phreak
|
||||
|
||||
* code/hud/hudtargetbox.h (2.1):
|
||||
|
||||
added Targetbox_wire variable to check what mode the hud targetbox
|
||||
uses
|
||||
|
||||
2002-08-06 16:49 phreak
|
||||
|
||||
* code/io/keycontrol.cpp (2.2):
|
||||
|
||||
added keybing for wireframe hud, fixed previous missile cheat
|
||||
|
||||
2002-08-06 04:39 penguin
|
||||
|
||||
* code/hud/hudwingmanstatus.cpp (2.2):
|
||||
|
||||
Use text strings for wingmen names instead of ANI
|
||||
|
||||
2002-08-06 03:50 penguin
|
||||
|
||||
* code/ui/ui.h (2.2):
|
||||
|
||||
inserted "class" keyword on "friend" definitions (ANSI C++ )
|
||||
|
||||
2002-08-06 02:42 penguin
|
||||
|
||||
* Freespace2.dsp (1.7), code/code.dsp (1.6):
|
||||
|
||||
Fixed problem w/ compile options for Debug mode
|
||||
|
||||
2002-08-06 01:49 penguin
|
||||
|
||||
* code/Makefile (2.4):
|
||||
|
||||
Removed a couple more include dirs I missed
|
||||
|
||||
2002-08-06 01:49 penguin
|
||||
|
||||
* code/: globalincs/pstypes.h (2.4), render/3dclipper.cpp (2.2),
|
||||
render/3ddraw.cpp (2.2):
|
||||
|
||||
Renamed ccode members to cc_or and cc_and
|
||||
|
||||
2002-08-04 05:43 penguin
|
||||
|
||||
* ChangeLog (1.1), code/ChangeLog (1.3):
|
||||
|
||||
Moved ChangeLog to top-level directory
|
||||
|
||||
2002-08-04 05:13 penguin
|
||||
|
||||
RELEASED: fs2_open 3.1 (tag: fs2_open3_1)
|
||||
|
||||
2002-08-04 05:13 penguin
|
||||
|
||||
* code/network/stand_gui.cpp (2.3):
|
||||
|
||||
Change version display
|
||||
|
||||
* code/menuui/playermenu.cpp (2.2):
|
||||
|
||||
Display fs2_open version instead of "Freespace 2"
|
||||
|
||||
* code/menuui/mainhallmenu.cpp (2.3):
|
||||
|
||||
Change version display location
|
||||
|
||||
* code/globalincs/version.h (2.1):
|
||||
|
||||
Update version number to 3.1
|
||||
|
||||
* code/freespace2/freespace.cpp (2.5):
|
||||
|
||||
Don't write version to registry; change way version string is
|
||||
formatted
|
||||
|
||||
* code/ChangeLog (1.1), ChangeLog (1.2):
|
||||
|
||||
Moved ChangeLog to top-level directory
|
||||
|
||||
2002-08-03 19:42 randomtiger
|
||||
|
||||
* code/graphics/grd3drender.cpp (2.2):
|
||||
|
||||
Fixed Geforce 4 bug that caused font and hall video distortion.
|
||||
Very small change in 'gr_d3d_aabitmap_ex_internal'
|
||||
|
||||
Tested and works on the following systems
|
||||
|
||||
OUTSIDER Voodoo 3 win98 OUTSIDER Geforce 2 win2000 Me Geforce 4 PNY
|
||||
4600 XP JBX-Phoenix Geforce 4 PNY XP Mehrunes GeForce 3 XP
|
||||
WMCoolmon nVidia TNT2 M64 win2000 Orange GeForce 4 4200 XP
|
||||
ShadowWolf_IH Monster2 win98 ShadowWolf_IH voodoo 2 win98
|
||||
|
||||
2002-08-03 18:34 wmcoolmon
|
||||
|
||||
* code/code.dsp (1.5), Freespace2.dsp (1.6):
|
||||
|
||||
Fixed Win32 debug configuration
|
||||
|
||||
2002-08-03 17:42 wmcoolmon
|
||||
|
||||
* Freespace2.dsp (1.5), code/code.dsp (1.4):
|
||||
|
||||
Sync with makefile 1.4
|
||||
|
||||
2002-08-01 04:04 penguin
|
||||
|
||||
* code/ChangeLog (1.2):
|
||||
|
||||
updated
|
||||
|
||||
2002-08-01 02:00 penguin
|
||||
|
||||
* fs2_open.w32.mak (1.4):
|
||||
|
||||
The big include file move
|
||||
|
||||
====
|
||||
NOTE:
|
||||
====
|
||||
below this point, all files are relative to the 'code' directory
|
||||
|
||||
|
||||
2002-08-01 01:41 penguin
|
||||
|
||||
* Makefile (2.3), anim/animplay.cpp (2.1), anim/animplay.h (2.1),
|
||||
@@ -1107,3 +1865,4 @@
|
||||
|
||||
|
||||
# generated by cvs2cl.pl
|
||||
# cvs2cl.pl -r -S --utc -f ChangeLog2
|
||||
Binary file not shown.
+15
-6
@@ -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 "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /U "_DEBUG" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "USE_OPENGL" /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 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"
|
||||
# SUBTRACT LINK32 /debug
|
||||
# Begin Custom Build
|
||||
InputPath=c:\games\Freespace2\fs2_open_r.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"c:\games\freespace2\fs2_open_r.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) c:\games\freespace2
|
||||
|
||||
# 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 "." /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /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 "DBUGFILE_ACTIVE" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /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,13 +88,13 @@ 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.exe" /libpath:"debug"
|
||||
# ADD LINK32 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"
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no /map
|
||||
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
|
||||
InputPath=.\Debug\fs2_open.exe
|
||||
InputPath=C:\games\Freespace2\fs2_open_d.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"c:\games\freespace2\fs2_open.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"c:\games\freespace2\fs2_open_d.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) c:\games\freespace2
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
This is still in pretty rough form.
|
||||
|
||||
|
||||
=== for people building fs2_open:
|
||||
|
||||
Win32-MSVC:
|
||||
Use the Freespace2.dsw workspace and build within the IDE.
|
||||
|
||||
|
||||
Win32-MinGW:
|
||||
make
|
||||
|
||||
|
||||
Linux and other unix variants (NOT YET COMPLETE)
|
||||
./configure [options] (options tbd)
|
||||
make -f makefile.linux
|
||||
|
||||
|
||||
|
||||
=== for the project maintainers (people who need to
|
||||
=== keep the makefiles up to date):
|
||||
|
||||
aclocal
|
||||
autoconf
|
||||
automake
|
||||
./configure
|
||||
make
|
||||
@@ -0,0 +1,5 @@
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = code
|
||||
@@ -0,0 +1,506 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DX8_INCLUDE = @DX8_INCLUDE@
|
||||
DX8_LIB = @DX8_LIB@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EXEEXT = @EXEEXT@
|
||||
FS2_GRSOFT_FALSE = @FS2_GRSOFT_FALSE@
|
||||
FS2_GRSOFT_TRUE = @FS2_GRSOFT_TRUE@
|
||||
FS2_JOYSTICK_FALSE = @FS2_JOYSTICK_FALSE@
|
||||
FS2_JOYSTICK_TRUE = @FS2_JOYSTICK_TRUE@
|
||||
FS2_NETWORKING_FALSE = @FS2_NETWORKING_FALSE@
|
||||
FS2_NETWORKING_TRUE = @FS2_NETWORKING_TRUE@
|
||||
FS2_OS_UNIX_FALSE = @FS2_OS_UNIX_FALSE@
|
||||
FS2_OS_UNIX_TRUE = @FS2_OS_UNIX_TRUE@
|
||||
FS2_OS_WIN32_FALSE = @FS2_OS_WIN32_FALSE@
|
||||
FS2_OS_WIN32_TRUE = @FS2_OS_WIN32_TRUE@
|
||||
FS2_SOUND_FALSE = @FS2_SOUND_FALSE@
|
||||
FS2_SOUND_TRUE = @FS2_SOUND_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
||||
SUBDIRS = code
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
ps-recursive install-info-recursive uninstall-info-recursive \
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
|
||||
configure.in depcomp install-sh missing mkinstalldirs
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf autom4te.cache
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-generic clean-recursive ctags ctags-recursive dist \
|
||||
dist-all dist-gzip distcheck distclean distclean-generic \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
|
||||
info-recursive install install-am install-data install-data-am \
|
||||
install-data-recursive install-exec install-exec-am \
|
||||
install-exec-recursive install-info install-info-am \
|
||||
install-info-recursive install-man install-recursive \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am installdirs-recursive maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-recursive pdf pdf-am \
|
||||
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-info-recursive uninstall-recursive
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,3 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog for what's new.
|
||||
+3
-80
@@ -1,81 +1,4 @@
|
||||
README for fs2_open, Release 0.1
|
||||
|
||||
WARNINGS:
|
||||
========
|
||||
This is very much an pre-alpha build. Don't expect too much from it!
|
||||
|
||||
In particular, do not run this in the same directory as existing pilot
|
||||
files or anything else that you don't want to get destroyed...
|
||||
|
||||
I have tried to modify as little code as possible to keep the existing
|
||||
Windows code from breaking, but I have not verified that this code
|
||||
will still work on Windows. Some changes may be necessary.
|
||||
|
||||
There are occasional crashes and segfaults from time to time.
|
||||
|
||||
All of this was tested on my system only. I don't know if any
|
||||
assumptions about my hardware have crept into the code. I guess it
|
||||
goes without saying that this will only work on x86-based Linux
|
||||
systems :-)
|
||||
|
||||
|
||||
STATUS:
|
||||
=======
|
||||
Most 2D graphics appear to be working, although very slowly.
|
||||
Improving the performance of the 2D graphic system is a high priority.
|
||||
|
||||
3D graphics are in a very primitive state right now. No texturing is
|
||||
done, so all objects (ships, lasers, explosions, etc.) look "ghostly."
|
||||
|
||||
Nebula missions do not work at all.
|
||||
|
||||
Sound, joystick, and network are all disabled.
|
||||
|
||||
|
||||
REQUIREMENTS:
|
||||
=============
|
||||
The only "non-standard" package that you will need (as far as I can
|
||||
tell) is the SDL library, available at http://www.libsdl.org I think
|
||||
SDL requires XFree86 release 4 or higher.
|
||||
|
||||
|
||||
INSTALLING:
|
||||
===========
|
||||
There is no configure script, no options, etc. -- just a Makefile. It
|
||||
is likely that you will need to adjust it to match your configuration,
|
||||
in particular the location of the SDL files.
|
||||
|
||||
If everything is right, you should be able to run 'make' from the
|
||||
fs2_open/code directory and create an 'fs2' executable.
|
||||
|
||||
|
||||
RUNNING:
|
||||
========
|
||||
The fs2 executable should be copied (or symlinked) to the same
|
||||
directory as the *.VP files. All the *.VP files that you need should
|
||||
be here -- the code isn't smart enough to look in your CD for command
|
||||
brief ANIs, etc.
|
||||
|
||||
It only runs in windowed mode, no full screen.
|
||||
|
||||
I have never run it in high-resolution mode (1024x768), so all bets
|
||||
are off if you try it.
|
||||
|
||||
There seems to be a bug in some of the 'glob' routines that scan for
|
||||
files in the 'data' directory, so you will have better results if you:
|
||||
1. Keep everything in the *.VP file (i.e., no mods)
|
||||
2. Only have one player file
|
||||
|
||||
I recommend that background graphics be turned off via the "Options"
|
||||
screen or it will look very odd. Your in-game framerate will be
|
||||
significantly higher if you turn off (or set to 'popup') as many HUD
|
||||
gauges as possible.
|
||||
|
||||
Due to the painful slowness of the 2D UI, you might need to hold the
|
||||
mouse button down a little longer to get buttons to activate.
|
||||
|
||||
===
|
||||
|
||||
Mike Harris (HLP penguin)
|
||||
02 June 2002
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -1,701 +0,0 @@
|
||||
TARGET = fs2
|
||||
|
||||
ifeq ($(USE_SOUND), 1)
|
||||
SOUND_DEF=
|
||||
SOUND_OBJS= \
|
||||
gamesnd/eventmusic.o \
|
||||
gamesnd/gamesnd.o \
|
||||
object/objectsnd.o \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o \
|
||||
vcodec/codec1.o
|
||||
else
|
||||
SOUND_DEF=-DNO_SOUND
|
||||
SOUND_OBJS=
|
||||
endif # USE_SOUND
|
||||
|
||||
|
||||
ifeq ($(USE_JOYSTICK), 1)
|
||||
JOYSTICK_DEF=
|
||||
JOYSTICK_OBJS= \
|
||||
io/joy.o \
|
||||
io/joy_ff.o \
|
||||
io/swff_lib.o
|
||||
else
|
||||
JOYSTICK_DEF=-DNO_JOYSTICK
|
||||
JOYSTICK_OBJS=
|
||||
endif # USE_JOYSTICK
|
||||
|
||||
|
||||
ifeq ($(USE_NETWORK), 1)
|
||||
# no support for standalone server yet... (UI is Win32 specific)
|
||||
NETWORK_DEF=-DNO_STANDALONE
|
||||
NETWORK_OBJS= \
|
||||
hud/hudobserver.o \
|
||||
network/multi.o \
|
||||
network/multimsgs.o \
|
||||
network/multiteamselect.o \
|
||||
network/multiui.o \
|
||||
network/multiutil.o \
|
||||
network/multi_campaign.o \
|
||||
network/multi_data.o \
|
||||
network/multi_dogfight.o \
|
||||
network/multi_endgame.o \
|
||||
network/multi_ingame.o \
|
||||
network/multi_kick.o \
|
||||
network/multi_log.o \
|
||||
network/multi_obj.o \
|
||||
network/multi_observer.o \
|
||||
network/multi_options.o \
|
||||
network/multi_pause.o \
|
||||
network/multi_pinfo.o \
|
||||
network/multi_ping.o \
|
||||
network/multi_pmsg.o \
|
||||
network/multi_rate.o \
|
||||
network/multi_respawn.o \
|
||||
network/multi_team.o \
|
||||
network/multi_voice.o \
|
||||
network/multi_xfer.o \
|
||||
network/psnet.o \
|
||||
network/psnet2.o \
|
||||
menuui/optionsmenumulti.o \
|
||||
missionui/chatbox.o
|
||||
#
|
||||
# Network/stand_gui.o
|
||||
#
|
||||
else
|
||||
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
|
||||
NETWORK_OBJS=
|
||||
endif # USE_NETWORK
|
||||
|
||||
|
||||
ifeq ($(USE_OPENGL), 0)
|
||||
OPENGL_DEF=
|
||||
else
|
||||
OPENGL_DEF=-DUSE_OPENGL
|
||||
endif # USE_OPENGL
|
||||
|
||||
|
||||
LDFLAGS = -g
|
||||
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-I. -Iwindows_stub \
|
||||
-fno-exceptions \
|
||||
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
|
||||
|
||||
ANIM_OBJFILES = \
|
||||
anim/animplay.o \
|
||||
anim/packunpack.o
|
||||
|
||||
ASTEROID_OBJFILES = \
|
||||
asteroid/asteroid.o
|
||||
|
||||
BMPMAN_OBJFILES = \
|
||||
bmpman/bmpman.o
|
||||
|
||||
CFILE_OBJFILES = \
|
||||
cfile/cfile.o \
|
||||
cfile/cfilearchive.o \
|
||||
cfile/cfilelist.o \
|
||||
cfile/cfilesystem.o
|
||||
|
||||
CMDLINE_OBJFILES = \
|
||||
cmdline/cmdline.o
|
||||
|
||||
CMEASURE_OBJFILES = \
|
||||
cmeasure/cmeasure.o
|
||||
|
||||
CONTROLCONFIG_OBJFILES = \
|
||||
controlconfig/controlsconfig.o \
|
||||
controlconfig/controlsconfigcommon.o
|
||||
|
||||
CUTSCENE_OBJFILES = \
|
||||
cutscene/cutscenes.o
|
||||
|
||||
DEBRIS_OBJFILES = \
|
||||
debris/debris.o
|
||||
|
||||
DEBUGCONSOLE_OBJFILES = \
|
||||
debugconsole/console.o
|
||||
|
||||
DEMO_OBJFILES = \
|
||||
demo/demo.o
|
||||
|
||||
EXCEPTIONHANDLER_OBJFILES = \
|
||||
exceptionhandler/exceptionhandler.o
|
||||
|
||||
FIREBALL_OBJFILES = \
|
||||
fireball/fireballs.o \
|
||||
fireball/warpineffect.o
|
||||
|
||||
GAMEHELP_OBJFILES = \
|
||||
gamehelp/contexthelp.o \
|
||||
gamehelp/gameplayhelp.o
|
||||
|
||||
GAMESEQUENCE_OBJFILES = \
|
||||
gamesequence/gamesequence.o
|
||||
|
||||
# gamesnd/eventmusic.o
|
||||
# gamesnd/gamesnd.o
|
||||
GAMESND_OBJFILES =
|
||||
|
||||
# glide/glide.o
|
||||
GLIDE_OBJFILES =
|
||||
|
||||
# globalincs/windebug.o
|
||||
GLOBALINCS_OBJFILES = \
|
||||
globalincs/alphacolors.o \
|
||||
globalincs/crypt.o \
|
||||
globalincs/systemvars.o \
|
||||
globalincs/version.o
|
||||
|
||||
# graphics/grd3d.o
|
||||
# graphics/grd3drender.o
|
||||
# graphics/grd3dtexture.o
|
||||
# graphics/grdirectdraw.o
|
||||
# graphics/grglide.o
|
||||
# graphics/grglidetexture.o
|
||||
# graphics/grsoft.o
|
||||
# graphics/scaler.o
|
||||
# graphics/tmapgenericscans.o
|
||||
# graphics/tmapscantiled128x128.o
|
||||
# graphics/tmapscantiled16x16.o
|
||||
# graphics/tmapscantiled256x256.o
|
||||
# graphics/tmapscantiled32x32.o
|
||||
# graphics/tmapscantiled64x64.o
|
||||
# graphics/tmapscanline.o
|
||||
# graphics/tmapper.o
|
||||
GRAPHICS_OBJFILES = \
|
||||
graphics/2d.o \
|
||||
graphics/aaline.o \
|
||||
graphics/bitblt.o \
|
||||
graphics/circle.o \
|
||||
graphics/colors.o \
|
||||
graphics/font.o \
|
||||
graphics/gradient.o \
|
||||
graphics/gropengl.o \
|
||||
graphics/grzbuffer.o \
|
||||
graphics/line.o \
|
||||
graphics/pixel.o \
|
||||
graphics/rect.o \
|
||||
graphics/shade.o
|
||||
|
||||
# hud/hudobserver.o
|
||||
HUD_OBJFILES = \
|
||||
hud/hud.o \
|
||||
hud/hudartillery.o \
|
||||
hud/hudbrackets.o \
|
||||
hud/hudconfig.o \
|
||||
hud/hudescort.o \
|
||||
hud/hudets.o \
|
||||
hud/hudlock.o \
|
||||
hud/hudmessage.o \
|
||||
hud/hudreticle.o \
|
||||
hud/hudshield.o \
|
||||
hud/hudsquadmsg.o \
|
||||
hud/hudtarget.o \
|
||||
hud/hudtargetbox.o \
|
||||
hud/hudwingmanstatus.o
|
||||
|
||||
INETFILE_OBJFILES = \
|
||||
inetfile/cftp.o \
|
||||
inetfile/chttpget.o \
|
||||
inetfile/inetgetfile.o
|
||||
|
||||
# io/joy.o
|
||||
# io/joy_ff.o
|
||||
# io/swff_lib.o
|
||||
IO_OBJFILES = \
|
||||
io/key.o \
|
||||
io/keycontrol.o \
|
||||
io/mouse.o \
|
||||
io/timer.o \
|
||||
io/xmouse.o
|
||||
|
||||
JUMPNODE_OBJFILES = \
|
||||
jumpnode/jumpnode.o
|
||||
|
||||
LIGHTING_OBJFILES = \
|
||||
lighting/lighting.o
|
||||
|
||||
LOCALIZATION_OBJFILES = \
|
||||
localization/fhash.o \
|
||||
localization/localize.o
|
||||
|
||||
MATH_OBJFILES = \
|
||||
math/fix.o \
|
||||
math/floating.o \
|
||||
math/fvi.o \
|
||||
math/spline.o \
|
||||
math/staticrand.o \
|
||||
math/vecmat.o
|
||||
|
||||
# menuui/optionsmenumulti.o
|
||||
MENUUI_OBJFILES = \
|
||||
menuui/barracks.o \
|
||||
menuui/credits.o \
|
||||
menuui/fishtank.o \
|
||||
menuui/mainhallmenu.o \
|
||||
menuui/mainhalltemp.o \
|
||||
menuui/optionsmenu.o \
|
||||
menuui/playermenu.o \
|
||||
menuui/readyroom.o \
|
||||
menuui/snazzyui.o \
|
||||
menuui/techmenu.o \
|
||||
menuui/trainingmenu.o
|
||||
|
||||
MISSION_OBJFILES = \
|
||||
mission/missionbriefcommon.o \
|
||||
mission/missioncampaign.o \
|
||||
mission/missiongoals.o \
|
||||
mission/missiongrid.o \
|
||||
mission/missionhotkey.o \
|
||||
mission/missionload.o \
|
||||
mission/missionlog.o \
|
||||
mission/missionmessage.o \
|
||||
mission/missionparse.o \
|
||||
mission/missiontraining.o
|
||||
|
||||
# missionui/chatbox.o
|
||||
MISSIONUI_OBJFILES = \
|
||||
missionui/missionbrief.o \
|
||||
missionui/missioncmdbrief.o \
|
||||
missionui/missiondebrief.o \
|
||||
missionui/missionloopbrief.o \
|
||||
missionui/missionpause.o \
|
||||
missionui/missionrecommend.o \
|
||||
missionui/missionscreencommon.o \
|
||||
missionui/missionshipchoice.o \
|
||||
missionui/missionstats.o \
|
||||
missionui/missionweaponchoice.o \
|
||||
missionui/redalert.o
|
||||
|
||||
MODEL_OBJFILES = \
|
||||
model/modelcollide.o \
|
||||
model/modelinterp.o \
|
||||
model/modeloctant.o \
|
||||
model/modelread.o
|
||||
|
||||
NEBULA_OBJFILES = \
|
||||
nebula/neb.o \
|
||||
nebula/neblightning.o
|
||||
|
||||
# network/multi.o
|
||||
# network/multi_campaign.o
|
||||
# network/multi_data.o
|
||||
# network/multi_dogfight.o
|
||||
# network/multi_endgame.o
|
||||
# network/multi_ingame.o
|
||||
# network/multi_kick.o
|
||||
# network/multi_log.o
|
||||
# network/multimsgs.o
|
||||
# network/multi_obj.o
|
||||
# network/multi_observer.o
|
||||
# network/multi_oo.o
|
||||
# network/multi_options.o
|
||||
# network/multi_pause.o
|
||||
# network/multi_pinfo.o
|
||||
# network/multi_ping.o
|
||||
# network/multi_pmsg.o
|
||||
# network/multi_rate.o
|
||||
# network/multi_respawn.o
|
||||
# network/multi_team.o
|
||||
# network/multi_update.o
|
||||
# network/multi_voice.o
|
||||
# network/multi_xfer.o
|
||||
# network/multilag.o
|
||||
# network/multiteamselect.o
|
||||
# network/multiui.o
|
||||
# network/psnet.o
|
||||
# network/psnet2.o
|
||||
# network/stand_gui.o
|
||||
NETWORK_OBJFILES = \
|
||||
network/multiutil.o
|
||||
|
||||
# object/objectsnd.o
|
||||
OBJECT_OBJFILES = \
|
||||
object/collidedebrisship.o \
|
||||
object/collidedebrisweapon.o \
|
||||
object/collideshipship.o \
|
||||
object/collideshipweapon.o \
|
||||
object/collideweaponweapon.o \
|
||||
object/objcollide.o \
|
||||
object/object.o \
|
||||
object/objectsort.o
|
||||
|
||||
OBSERVER_OBJFILES = \
|
||||
observer/observer.o
|
||||
|
||||
OSAPI_OBJFILES = \
|
||||
osapi/osapi_unix.o \
|
||||
osapi/osregistry_unix.o \
|
||||
osapi/outwnd_unix.o
|
||||
|
||||
PALMAN_OBJFILES = \
|
||||
palman/palman.o
|
||||
|
||||
PARSE_OBJFILES = \
|
||||
parse/encrypt.o \
|
||||
parse/parselo.o \
|
||||
parse/sexp.o
|
||||
|
||||
PARTICLE_OBJFILES = \
|
||||
particle/particle.o
|
||||
|
||||
PCXUTILS_OBJFILES = \
|
||||
pcxutils/pcxutils.o
|
||||
|
||||
PHYSICS_OBJFILES = \
|
||||
physics/physics.o
|
||||
|
||||
PLAYERMAN_OBJFILES = \
|
||||
playerman/managepilot.o \
|
||||
playerman/playercontrol.o
|
||||
|
||||
POPUP_OBJFILES = \
|
||||
popup/popup.o \
|
||||
popup/popupdead.o
|
||||
|
||||
RADAR_OBJFILES = \
|
||||
radar/radar.o
|
||||
|
||||
RENDER_OBJFILES = \
|
||||
render/3dclipper.o \
|
||||
render/3ddraw.o \
|
||||
render/3dlaser.o \
|
||||
render/3dmath.o \
|
||||
render/3dsetup.o
|
||||
|
||||
SHIP_OBJFILES = \
|
||||
ship/afterburner.o \
|
||||
ship/ai.o \
|
||||
ship/aibig.o \
|
||||
ship/aicode.o \
|
||||
ship/aigoals.o \
|
||||
ship/awacs.o \
|
||||
ship/shield.o \
|
||||
ship/ship.o \
|
||||
ship/shipcontrails.o \
|
||||
ship/shipfx.o \
|
||||
ship/shiphit.o
|
||||
|
||||
SOUND_OBJFILES = \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o
|
||||
|
||||
STARFIELD_OBJFILES = \
|
||||
starfield/nebula.o \
|
||||
starfield/starfield.o \
|
||||
starfield/supernova.o
|
||||
|
||||
STATS_OBJFILES = \
|
||||
stats/medals.o \
|
||||
stats/scoring.o \
|
||||
stats/stats.o
|
||||
|
||||
TGAUTILS_OBJFILES = \
|
||||
tgautils/tgautils.o
|
||||
|
||||
UI_OBJFILES = \
|
||||
ui/button.o \
|
||||
ui/checkbox.o \
|
||||
ui/gadget.o \
|
||||
ui/icon.o \
|
||||
ui/inputbox.o \
|
||||
ui/keytrap.o \
|
||||
ui/listbox.o \
|
||||
ui/radio.o \
|
||||
ui/scroll.o \
|
||||
ui/slider.o \
|
||||
ui/slider2.o \
|
||||
ui/uidraw.o \
|
||||
ui/uimouse.o \
|
||||
ui/window.o
|
||||
|
||||
VCODEC_OBJFILES = \
|
||||
vcodec/codec1.o
|
||||
|
||||
WEAPON_OBJFILES = \
|
||||
weapon/beam.o \
|
||||
weapon/corkscrew.o \
|
||||
weapon/emp.o \
|
||||
weapon/flak.o \
|
||||
weapon/muzzleflash.o \
|
||||
weapon/shockwave.o \
|
||||
weapon/swarm.o \
|
||||
weapon/trails.o \
|
||||
weapon/weapons.o
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
OBJFILES = \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CFILE_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
NETWORK_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
LIB_OBJFILES = \
|
||||
$(ANIM_OBJFILES) \
|
||||
$(ASTEROID_OBJFILES) \
|
||||
$(BMPMAN_OBJFILES) \
|
||||
$(CFILE_OBJFILES) \
|
||||
$(CMDLINE_OBJFILES) \
|
||||
$(CMEASURE_OBJFILES) \
|
||||
$(CONTROLCONFIG_OBJFILES) \
|
||||
$(CUTSCENE_OBJFILES) \
|
||||
$(DEBRIS_OBJFILES) \
|
||||
$(DEBUGCONSOLE_OBJFILES) \
|
||||
$(FIREBALL_OBJFILES) \
|
||||
$(GAMEHELP_OBJFILES) \
|
||||
$(GAMESEQUENCE_OBJFILES) \
|
||||
$(GAMESND_OBJFILES) \
|
||||
$(GLIDE_OBJFILES) \
|
||||
$(GLOBALINCS_OBJFILES) \
|
||||
$(GRAPHICS_OBJFILES) \
|
||||
$(HUD_OBJFILES) \
|
||||
$(IO_OBJFILES) \
|
||||
$(JUMPNODE_OBJFILES) \
|
||||
$(LIGHTING_OBJFILES) \
|
||||
$(MATH_OBJFILES) \
|
||||
$(MENUUI_OBJFILES) \
|
||||
$(MISSION_OBJFILES) \
|
||||
$(MISSIONUI_OBJFILES) \
|
||||
$(MODEL_OBJFILES) \
|
||||
$(NETWORK_OBJFILES) \
|
||||
$(OBJECT_OBJFILES) \
|
||||
$(OBSERVER_OBJFILES) \
|
||||
$(OSAPI_OBJFILES) \
|
||||
$(PALMAN_OBJFILES) \
|
||||
$(PARSE_OBJFILES) \
|
||||
$(PARTICLE_OBJFILES) \
|
||||
$(PCXUTILS_OBJFILES) \
|
||||
$(PHYSICS_OBJFILES) \
|
||||
$(PLAYERMAN_OBJFILES) \
|
||||
$(POPUP_OBJFILES) \
|
||||
$(RADAR_OBJFILES) \
|
||||
$(RENDER_OBJFILES) \
|
||||
$(SHIP_OBJFILES) \
|
||||
$(STARFIELD_OBJFILES) \
|
||||
$(STATS_OBJFILES) \
|
||||
$(UI_OBJFILES) \
|
||||
$(VCODEC_OBJFILES) \
|
||||
$(WEAPON_OBJFILES) \
|
||||
$(NEBULA_OBJFILES) \
|
||||
$(LOCALIZATION_OBJFILES) \
|
||||
$(TGAUTILS_OBJFILES) \
|
||||
$(DEMO_OBJFILES) \
|
||||
$(SOUND_OBJS) \
|
||||
$(JOYSTICK_OBJS) \
|
||||
$(NETWORK_OBJS)
|
||||
|
||||
FREESPACE2_OBJFILES = \
|
||||
freespace2/freespace.o \
|
||||
freespace2/levelpaging.o
|
||||
|
||||
STUB_OBJFILES = \
|
||||
windows_stub/stubs.o
|
||||
|
||||
# ==============================
|
||||
.PHONY: all clean code \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
SOUND_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES \
|
||||
INETFILE_OBJFILES \
|
||||
EXCEPTIONHANDLER_OBJFILES \
|
||||
NETWORK_OBJFILES
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) libcode.a core *.o *~
|
||||
find -name *.o -exec rm {} \;
|
||||
find -name *~ -exec rm {} \;
|
||||
|
||||
code: libcode.a
|
||||
|
||||
|
||||
# ==============================
|
||||
libcode.a: $(LIB_OBJFILES)
|
||||
$(AR) -r $@ $(LIB_OBJFILES)
|
||||
# $(CXX) -o $@ $(LIB_OBJFILES)
|
||||
|
||||
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
|
||||
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
|
||||
|
||||
|
||||
# exceptions to the rule...
|
||||
freespace2/freespace.o: freespace2/freespace.cpp
|
||||
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
|
||||
|
||||
ANIM_OBJFILES: $(ANIM_OBJFILES)
|
||||
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
|
||||
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
|
||||
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
|
||||
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
|
||||
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
|
||||
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
|
||||
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
|
||||
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
|
||||
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
|
||||
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
|
||||
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
|
||||
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
|
||||
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
|
||||
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
|
||||
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
|
||||
HUD_OBJFILES: $(HUD_OBJFILES)
|
||||
IO_OBJFILES: $(IO_OBJFILES)
|
||||
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
|
||||
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
|
||||
MATH_OBJFILES: $(MATH_OBJFILES)
|
||||
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
|
||||
MISSION_OBJFILES: $(MISSION_OBJFILES)
|
||||
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
|
||||
MODEL_OBJFILES: $(MODEL_OBJFILES)
|
||||
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
|
||||
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
|
||||
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
|
||||
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
|
||||
PARSE_OBJFILES: $(PARSE_OBJFILES)
|
||||
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
|
||||
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
|
||||
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
|
||||
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
|
||||
POPUP_OBJFILES: $(POPUP_OBJFILES)
|
||||
RADAR_OBJFILES: $(RADAR_OBJFILES)
|
||||
RENDER_OBJFILES: $(RENDER_OBJFILES)
|
||||
SHIP_OBJFILES: $(SHIP_OBJFILES)
|
||||
SOUND_OBJFILES: $(SOUND_OBJFILES)
|
||||
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
|
||||
STATS_OBJFILES: $(STATS_OBJFILES)
|
||||
UI_OBJFILES: $(UI_OBJFILES)
|
||||
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
|
||||
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
|
||||
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
|
||||
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
|
||||
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
|
||||
DEMO_OBJFILES: $(DEMO_OBJFILES)
|
||||
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
|
||||
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
|
||||
NETWORK_OBJFILES: $(NETWORK_OBJFILES)
|
||||
@@ -0,0 +1,305 @@
|
||||
# code/Makefile.am for fs2_open
|
||||
#
|
||||
# $Id: Makefile.am,v 1.2 2003-03-11 19:00:05 penguin Exp $
|
||||
|
||||
noinst_PROGRAMS = fs2
|
||||
|
||||
fs2_SOURCES = \
|
||||
anim/animplay.cpp \
|
||||
anim/packunpack.cpp \
|
||||
asteroid/asteroid.cpp \
|
||||
bmpman/bmpman.cpp \
|
||||
cfile/cfile.cpp \
|
||||
cfile/cfilearchive.cpp \
|
||||
cfile/cfilelist.cpp \
|
||||
cfile/cfilesystem.cpp \
|
||||
cmdline/cmdline.cpp \
|
||||
cmeasure/cmeasure.cpp \
|
||||
controlconfig/controlsconfig.cpp \
|
||||
controlconfig/controlsconfigcommon.cpp \
|
||||
cutscene/cutscenes.cpp \
|
||||
debris/debris.cpp \
|
||||
debugconsole/console.cpp \
|
||||
decals/decals.cpp \
|
||||
demo/demo.cpp \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/warpineffect.cpp \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/levelpaging.cpp \
|
||||
gamehelp/contexthelp.cpp \
|
||||
gamehelp/gameplayhelp.cpp \
|
||||
gamesequence/gamesequence.cpp \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/crypt.cpp \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/version.cpp \
|
||||
graphics/2d.cpp \
|
||||
graphics/aaline.cpp \
|
||||
graphics/bitblt.cpp \
|
||||
graphics/circle.cpp \
|
||||
graphics/colors.cpp \
|
||||
graphics/font.cpp \
|
||||
graphics/gradient.cpp \
|
||||
graphics/gropengl.cpp \
|
||||
graphics/grzbuffer.cpp \
|
||||
graphics/line.cpp \
|
||||
graphics/pixel.cpp \
|
||||
graphics/rect.cpp \
|
||||
graphics/scaler.cpp \
|
||||
graphics/shade.cpp \
|
||||
hud/hud.cpp \
|
||||
hud/hudartillery.cpp \
|
||||
hud/hudbrackets.cpp \
|
||||
hud/hudconfig.cpp \
|
||||
hud/hudescort.cpp \
|
||||
hud/hudets.cpp \
|
||||
hud/hudlock.cpp \
|
||||
hud/hudmessage.cpp \
|
||||
hud/hudreticle.cpp \
|
||||
hud/hudshield.cpp \
|
||||
hud/hudsquadmsg.cpp \
|
||||
hud/hudtarget.cpp \
|
||||
hud/hudtargetbox.cpp \
|
||||
hud/hudwingmanstatus.cpp \
|
||||
io/key.cpp \
|
||||
io/keycontrol.cpp \
|
||||
io/mouse.cpp \
|
||||
io/timer.cpp \
|
||||
jumpnode/jumpnode.cpp \
|
||||
lighting/lighting.cpp \
|
||||
localization/fhash.cpp \
|
||||
localization/localize.cpp \
|
||||
math/fix.cpp \
|
||||
math/floating.cpp \
|
||||
math/fvi.cpp \
|
||||
math/spline.cpp \
|
||||
math/staticrand.cpp \
|
||||
math/vecmat.cpp \
|
||||
menuui/barracks.cpp \
|
||||
menuui/credits.cpp \
|
||||
menuui/fishtank.cpp \
|
||||
menuui/mainhallmenu.cpp \
|
||||
menuui/mainhalltemp.cpp \
|
||||
menuui/optionsmenu.cpp \
|
||||
menuui/playermenu.cpp \
|
||||
menuui/readyroom.cpp \
|
||||
menuui/snazzyui.cpp \
|
||||
menuui/techmenu.cpp \
|
||||
menuui/trainingmenu.cpp \
|
||||
mission/missionbriefcommon.cpp \
|
||||
mission/missioncampaign.cpp \
|
||||
mission/missiongoals.cpp \
|
||||
mission/missiongrid.cpp \
|
||||
mission/missionhotkey.cpp \
|
||||
mission/missionload.cpp \
|
||||
mission/missionlog.cpp \
|
||||
mission/missionmessage.cpp \
|
||||
mission/missionparse.cpp \
|
||||
mission/missiontraining.cpp \
|
||||
missionui/missionbrief.cpp \
|
||||
missionui/missioncmdbrief.cpp \
|
||||
missionui/missiondebrief.cpp \
|
||||
missionui/missionloopbrief.cpp \
|
||||
missionui/missionpause.cpp \
|
||||
missionui/missionrecommend.cpp \
|
||||
missionui/missionscreencommon.cpp \
|
||||
missionui/missionshipchoice.cpp \
|
||||
missionui/missionstats.cpp \
|
||||
missionui/missionweaponchoice.cpp \
|
||||
missionui/redalert.cpp \
|
||||
model/modelcollide.cpp \
|
||||
model/modelinterp.cpp \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neblightning.cpp \
|
||||
object/collidedebrisship.cpp \
|
||||
object/collidedebrisweapon.cpp \
|
||||
object/collideshipship.cpp \
|
||||
object/collideshipweapon.cpp \
|
||||
object/collideweaponweapon.cpp \
|
||||
object/objcollide.cpp \
|
||||
object/object.cpp \
|
||||
object/objectsort.cpp \
|
||||
observer/observer.cpp \
|
||||
palman/palman.cpp \
|
||||
parse/encrypt.cpp \
|
||||
parse/parselo.cpp \
|
||||
parse/sexp.cpp \
|
||||
particle/particle.cpp \
|
||||
pcxutils/pcxutils.cpp \
|
||||
physics/physics.cpp \
|
||||
playerman/managepilot.cpp \
|
||||
playerman/playercontrol.cpp \
|
||||
popup/popup.cpp \
|
||||
popup/popupdead.cpp \
|
||||
radar/radar.cpp \
|
||||
render/3dclipper.cpp \
|
||||
render/3ddraw.cpp \
|
||||
render/3dlaser.cpp \
|
||||
render/3dmath.cpp \
|
||||
render/3dsetup.cpp \
|
||||
ship/afterburner.cpp \
|
||||
ship/ai.cpp \
|
||||
ship/aibig.cpp \
|
||||
ship/aicode.cpp \
|
||||
ship/aigoals.cpp \
|
||||
ship/awacs.cpp \
|
||||
ship/shield.cpp \
|
||||
ship/ship.cpp \
|
||||
ship/shipcontrails.cpp \
|
||||
ship/shipfx.cpp \
|
||||
ship/shiphit.cpp \
|
||||
starfield/nebula.cpp \
|
||||
starfield/starfield.cpp \
|
||||
starfield/supernova.cpp \
|
||||
stats/medals.cpp \
|
||||
stats/scoring.cpp \
|
||||
stats/stats.cpp \
|
||||
tgautils/tgautils.cpp \
|
||||
ui/button.cpp \
|
||||
ui/checkbox.cpp \
|
||||
ui/gadget.cpp \
|
||||
ui/icon.cpp \
|
||||
ui/inputbox.cpp \
|
||||
ui/keytrap.cpp \
|
||||
ui/listbox.cpp \
|
||||
ui/radio.cpp \
|
||||
ui/scroll.cpp \
|
||||
ui/slider.cpp \
|
||||
ui/slider2.cpp \
|
||||
ui/uidraw.cpp \
|
||||
ui/uimouse.cpp \
|
||||
ui/window.cpp \
|
||||
weapon/beam.cpp \
|
||||
weapon/corkscrew.cpp \
|
||||
weapon/emp.cpp \
|
||||
weapon/flak.cpp \
|
||||
weapon/muzzleflash.cpp \
|
||||
weapon/shockwave.cpp \
|
||||
weapon/swarm.cpp \
|
||||
weapon/trails.cpp \
|
||||
weapon/weapons.cpp
|
||||
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_JOYSTICK
|
||||
fs2_SOURCES += \
|
||||
io/joy.cpp \
|
||||
io/joy_ff.cpp \
|
||||
io/swff_lib.cpp
|
||||
endif # FS2_JOYSTICK
|
||||
|
||||
## networking support sources
|
||||
if FS2_NETWORKING
|
||||
fs2_SOURCES += \
|
||||
hud/hudobserver.cpp \
|
||||
network/multi.cpp \
|
||||
network/multimsgs.cpp \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiui.cpp \
|
||||
network/multiutil.cpp \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_data.cpp \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_log.cpp \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_options.cpp \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_team.cpp \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_xfer.cpp \
|
||||
network/psnet.cpp \
|
||||
network/psnet2.cpp \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
missionui/chatbox.cpp
|
||||
endif # FS2_NETWORKING
|
||||
|
||||
## sound support sources
|
||||
if FS2_SOUND
|
||||
fs2_SOURCES += \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/gamesnd.cpp \
|
||||
object/objectsnd.cpp \
|
||||
sound/acm.cpp \
|
||||
sound/audiostr.cpp \
|
||||
sound/ds.cpp \
|
||||
sound/ds3d.cpp \
|
||||
sound/dscap.cpp \
|
||||
sound/midifile.cpp \
|
||||
sound/rbaudio.cpp \
|
||||
sound/rtvoice.cpp \
|
||||
sound/sound.cpp \
|
||||
sound/winmidi.cpp \
|
||||
sound/winmidi_base.cpp \
|
||||
vcodec/codec1.cpp
|
||||
endif # FS2_SOUND
|
||||
|
||||
## software-rendering support sources
|
||||
if FS2_GRSOFT
|
||||
fs2_SOURCES += \
|
||||
graphics/grsoft.cpp \
|
||||
graphics/tmapper.cpp
|
||||
endif # FS2_GRSOFT
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
fs2_SOURCES += \
|
||||
cutscene/movie.cpp \
|
||||
directx/dx8show.cpp \
|
||||
ddsutils/ddsutils.cpp \
|
||||
globalincs/windebug.cpp \
|
||||
glide/glide.cpp \
|
||||
graphics/grd3d.cpp \
|
||||
graphics/grd3drender.cpp \
|
||||
graphics/grd3dtexture.cpp \
|
||||
graphics/grdirectdraw.cpp \
|
||||
graphics/grglide.cpp \
|
||||
graphics/grglidetexture.cpp \
|
||||
network/stand_gui.cpp \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/outwnd.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
fs2_SOURCES += \
|
||||
io/xmouse.cpp \
|
||||
osapi/osapi_unix.cpp \
|
||||
osapi/osregistry_unix.cpp \
|
||||
osapi/outwnd_unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
|
||||
## compiler flags
|
||||
# INCLUDES = -I.
|
||||
AM_CXXFLAGS = -fno-exceptions @DX8_INCLUDE@
|
||||
AM_LDFLAGS = -L/c/dx8/lib @DX8_LIB@
|
||||
|
||||
LDADD =
|
||||
|
||||
if FS2_OS_WIN32
|
||||
## Win32 libraries needed
|
||||
LDADD += \
|
||||
-lgdi32 -lole32 -lwsock32 -lwinmm -lmsacm32 -lopengl32 \
|
||||
-lcomctl32 -lstrmiids -ldxguid -lddraw -ldinput
|
||||
endif
|
||||
|
||||
|
||||
if FS2_OS_UNIX
|
||||
## Unix libraries needed
|
||||
## -- TODO --
|
||||
endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:00 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -191,6 +209,8 @@
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
static color Color_xparent;
|
||||
|
||||
@@ -448,6 +468,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 +486,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;
|
||||
@@ -891,7 +913,11 @@ anim *anim_load(char *real_filename, int file_mapped)
|
||||
int count,idx;
|
||||
char name[_MAX_PATH];
|
||||
|
||||
// file_mapped = 0;
|
||||
// Unless told otherwise in D3D everything is loaded for speed, lets make use of all that memory
|
||||
// people have
|
||||
if(gr_screen.mode == GR_DIRECT3D && Cmdline_d3dlowmem == 0) {
|
||||
file_mapped = 0;
|
||||
}
|
||||
|
||||
Assert ( real_filename != NULL );
|
||||
|
||||
|
||||
@@ -9,15 +9,33 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:00 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* 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.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
|
||||
*
|
||||
@@ -158,6 +176,7 @@
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
int packer_code = PACKER_CODE;
|
||||
int transparent_code = 254;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-04-29 01:03:22 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $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
|
||||
*
|
||||
@@ -644,7 +647,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) );
|
||||
@@ -2022,7 +2025,7 @@ void asteroid_parse_section()
|
||||
stuff_float(&asip->blast);
|
||||
|
||||
required_string("$Hitpoints:");
|
||||
stuff_float(&asip->initial_hull_strength);
|
||||
stuff_float(&asip->initial_asteroid_strength);
|
||||
}
|
||||
|
||||
// read in data from asteroid.tbl into Asteroid_info[] array
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-04-29 01:03:22 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $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
|
||||
*
|
||||
@@ -182,7 +185,7 @@ typedef struct asteroid_info {
|
||||
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;
|
||||
|
||||
+366
-104
@@ -9,13 +9,92 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* $Revision: 2.15 $
|
||||
* $Date: 2003-08-16 03:52:22 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code to load and manage all bitmaps for the game
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14 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.13 2003/06/07 21:08:09 phreak
|
||||
* bmp_gfx_get_components now works with 32 bit opengl
|
||||
*
|
||||
* Revision 2.12 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.11 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.10 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.9 2003/01/09 22:23:38 inquisitor
|
||||
* Rollback to 2.7 to fix glow code issue that phreak noticed.
|
||||
* -Quiz
|
||||
*
|
||||
* Revision 2.7 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.6 2002/12/02 23:26:08 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.5 2002/12/02 20:46:41 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.4 2002/11/22 20:55:27 phreak
|
||||
* changed around some page-in functions to work with opengl
|
||||
* changed bm_set_components_opengl
|
||||
* -phreak
|
||||
*
|
||||
* Revision 2.3 2002/11/18 21:27:13 phreak
|
||||
* added bm_select_components functions for OpenGL -phreak
|
||||
*
|
||||
*
|
||||
* Revision 2.2.2.12 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.2.2.11 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.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
|
||||
*
|
||||
@@ -250,7 +329,7 @@
|
||||
* Added code to print the number of bitmap slots in use between levels.
|
||||
*
|
||||
* 82 2/16/98 3:54p John
|
||||
* Changed a bunch of mprintfs to catagorize to BmpInfo
|
||||
* Changed a bunch of mprintfs to categorize to BmpInfo
|
||||
*
|
||||
* 81 2/13/98 5:00p John
|
||||
* Made user bitmaps not get wrote to level cache file.
|
||||
@@ -491,11 +570,20 @@
|
||||
#include "graphics/grinternal.h"
|
||||
#include "tgautils/tgautils.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ddsutils/ddsutils.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
int GLOWMAP = -1;
|
||||
int SPECMAP = -1;
|
||||
int ENVMAP = -1;
|
||||
|
||||
#define MAX_BMAP_SECTION_SIZE 256
|
||||
|
||||
// keep this defined to use per-ship nondarkening pixels
|
||||
#define BMPMAN_SPECIAL_NONDARK
|
||||
|
||||
@@ -506,52 +594,9 @@ int bm_inited = 0;
|
||||
#define BM_TYPE_USER 2
|
||||
#define BM_TYPE_ANI 3 // in-house ANI format
|
||||
#define BM_TYPE_TGA 4 // 16 bit targa
|
||||
|
||||
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.
|
||||
|
||||
// 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;
|
||||
#define BM_TYPE_DXT1 5 // 24 bit with switchable alpha (compressed)
|
||||
#define BM_TYPE_DXT3 6 // 32 bit with 4 bit alpha (compressed)
|
||||
#define BM_TYPE_DXT5 7 // 32 bit with 8 bit alpha (compressed)
|
||||
|
||||
uint Bm_next_signature = 0x1234;
|
||||
|
||||
@@ -599,7 +644,7 @@ void bm_set_low_mem( int mode )
|
||||
}
|
||||
|
||||
|
||||
static int bm_get_next_handle()
|
||||
int bm_gfx_get_next_handle()
|
||||
{
|
||||
int n = bm_next_handle;
|
||||
bm_next_handle++;
|
||||
@@ -713,7 +758,7 @@ static void *bm_malloc( int n, int size )
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void bm_close()
|
||||
void bm_gfx_close()
|
||||
{
|
||||
int i;
|
||||
if ( bm_inited ) {
|
||||
@@ -725,7 +770,7 @@ void bm_close()
|
||||
}
|
||||
|
||||
|
||||
void bm_init()
|
||||
void bm_gfx_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -751,8 +796,6 @@ void bm_init()
|
||||
#endif
|
||||
bm_free_data(i); // clears flags, bbp, data, etc
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
@@ -760,7 +803,7 @@ void bm_init()
|
||||
// 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)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -780,7 +823,7 @@ void bm_get_frame_usage(int *ntotal, int *nnew)
|
||||
|
||||
}
|
||||
#else
|
||||
void bm_get_frame_usage(int *ntotal, int *nnew)
|
||||
void bm_gfx_get_frame_usage(int *ntotal, int *nnew)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -815,7 +858,7 @@ void bm_calc_sections(bitmap *be)
|
||||
// bpp you can pass in is 32 or 8. On success, it returns the
|
||||
// bitmap number. You cannot free that RAM until bm_release
|
||||
// is called on that bitmap.
|
||||
int bm_create( int bpp, int w, int h, void * data, int flags )
|
||||
int bm_gfx_create( int bpp, int w, int h, void * data, int flags )
|
||||
{
|
||||
int i, n, first_slot = MAX_BITMAPS;
|
||||
|
||||
@@ -899,16 +942,15 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
|
||||
}
|
||||
|
||||
// try and find the file
|
||||
/*
|
||||
CFILE *test = cfopen(filename, "rb");
|
||||
if(test != NULL){
|
||||
cfclose(test);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// could not be found
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// This loads a bitmap so we can draw with it later.
|
||||
@@ -916,14 +958,16 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number. Function doesn't acutally load the data, only
|
||||
// width, height, and possibly flags.
|
||||
int bm_load( char * real_filename )
|
||||
int bm_gfx_load( char * real_filename )
|
||||
{
|
||||
int i, n, first_slot = MAX_BITMAPS;
|
||||
int w, h, bpp;
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int tga = 0;
|
||||
int dds = 0;
|
||||
int handle;
|
||||
int found = 0;
|
||||
unsigned char type;
|
||||
|
||||
if ( !bm_inited ) bm_init();
|
||||
|
||||
@@ -940,23 +984,51 @@ int bm_load( char * real_filename )
|
||||
//Int3();
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
// try and find a compressed tex first
|
||||
// unless we're cant do so
|
||||
if (Texture_compression_enabled)
|
||||
{
|
||||
switch(bm_load_sub(filename, ".dds", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
dds=1;
|
||||
strcat(filename, ".dds");
|
||||
break;
|
||||
|
||||
// found as pre-existing
|
||||
case 1:
|
||||
found = 1;
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
// try and find the pcx file
|
||||
switch(bm_load_sub(filename, ".pcx", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
if (!found)
|
||||
{
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
strcat(filename, ".pcx");
|
||||
break;
|
||||
// try and find the pcx file
|
||||
switch(bm_load_sub(filename, ".pcx", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
strcat(filename, ".pcx");
|
||||
break;
|
||||
|
||||
// found as pre-existing
|
||||
|
||||
// found as pre-existing
|
||||
case 1:
|
||||
found = 1;
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
if(!found){
|
||||
@@ -979,13 +1051,45 @@ int bm_load( char * real_filename )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (dds)
|
||||
{
|
||||
int ct;
|
||||
int dds_error=dds_read_header ( filename, &w, &h, &bpp, &ct);
|
||||
if (dds_error != DDS_ERROR_NONE)
|
||||
{
|
||||
mprintf(("Couldn't open '%s -- error description %s\n", filename, dds_error_string(dds_error)));
|
||||
return -1;
|
||||
}
|
||||
mprintf(("Found a .dds file! %s\n", filename));
|
||||
switch (ct)
|
||||
{
|
||||
case DDS_DXT1:
|
||||
type=BM_TYPE_DXT1;
|
||||
break;
|
||||
|
||||
case DDS_DXT3:
|
||||
type=BM_TYPE_DXT3;
|
||||
break;
|
||||
|
||||
case DDS_DXT5:
|
||||
type=BM_TYPE_DXT5;
|
||||
break;
|
||||
|
||||
default:
|
||||
Error(LOCATION, "bad DDS file compression. Not using DXT1,3,5 %s", filename);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// if its a tga file
|
||||
if(tga){
|
||||
else if(tga){
|
||||
int tga_error=targa_read_header( filename, &w, &h, &bpp, NULL );
|
||||
if ( tga_error != TARGA_ERROR_NONE ) {
|
||||
mprintf(( "Couldn't open '%s'\n", filename ));
|
||||
return -1;
|
||||
}
|
||||
type = BM_TYPE_TGA;
|
||||
}
|
||||
// if its a pcx file
|
||||
else {
|
||||
@@ -994,6 +1098,7 @@ int bm_load( char * real_filename )
|
||||
mprintf(( "Couldn't open '%s'\n", filename ));
|
||||
return -1;
|
||||
}
|
||||
type=BM_TYPE_PCX;
|
||||
}
|
||||
|
||||
// Error( LOCATION, "Unknown bitmap type %s\n", filename );
|
||||
@@ -1019,7 +1124,7 @@ int bm_load( char * real_filename )
|
||||
|
||||
// Mark the slot as filled, because cf_read might load a new bitmap
|
||||
// into this slot.
|
||||
bm_bitmaps[n].type = tga ? (ubyte)BM_TYPE_TGA : (ubyte)BM_TYPE_PCX;
|
||||
bm_bitmaps[n].type = type;
|
||||
bm_bitmaps[n].signature = Bm_next_signature++;
|
||||
Assert ( strlen(filename) < MAX_FILENAME_LEN );
|
||||
strncpy(bm_bitmaps[n].filename, filename, MAX_FILENAME_LEN-1 );
|
||||
@@ -1044,7 +1149,7 @@ int bm_load( char * real_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)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -1128,7 +1233,7 @@ static int find_block_of(int n)
|
||||
//
|
||||
// returns: bitmap number of first frame in the animation
|
||||
//
|
||||
int bm_load_animation( char *real_filename, int *nframes, int *fps, int can_drop_frames)
|
||||
int bm_gfx_load_animation( char *real_filename, int *nframes, int *fps, int can_drop_frames)
|
||||
{
|
||||
int i, n;
|
||||
anim the_anim;
|
||||
@@ -1237,7 +1342,7 @@ int bm_load_animation( char *real_filename, int *nframes, int *fps, int can_drop
|
||||
}
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
void bm_get_info( int handle, int *w, int * h, ubyte * flags, int *nframes, int *fps, bitmap_section_info **sections )
|
||||
void bm_gfx_get_info( int handle, int *w, int * h, ubyte * flags, int *nframes, int *fps, bitmap_section_info **sections )
|
||||
{
|
||||
bitmap * bmp;
|
||||
|
||||
@@ -1670,6 +1775,35 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
|
||||
bm_convert_format( bitmapnum, bmp, bpp, flags );
|
||||
}
|
||||
|
||||
//lock a dds file
|
||||
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
|
||||
{
|
||||
uint data;
|
||||
int size;
|
||||
int error;
|
||||
|
||||
Assert(Texture_compression_enabled);
|
||||
Assert(&be->bm == bmp);
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
Assert( be->data_size > 0 );
|
||||
#endif
|
||||
|
||||
//data is malloc'ed in the function
|
||||
error=dds_read_bitmap( be->filename, &size, &data );
|
||||
if (error != DDS_ERROR_NONE)
|
||||
{
|
||||
Error(LOCATION, "error loading %s -- %s", be->filename, dds_error_string(error));
|
||||
}
|
||||
|
||||
bmp->bpp=bpp;
|
||||
bmp->data=data;
|
||||
bmp->flags =0;
|
||||
be->mem_taken=size;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
MONITOR( NumBitmapPage );
|
||||
MONITOR( SizeBitmapPage );
|
||||
|
||||
@@ -1677,7 +1811,7 @@ MONITOR( SizeBitmapPage );
|
||||
// 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.
|
||||
bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
bitmap * bm_gfx_lock( int handle, ubyte bpp, ubyte flags )
|
||||
{
|
||||
bitmap *bmp;
|
||||
bitmap_entry *be;
|
||||
@@ -1703,9 +1837,19 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
} else {
|
||||
if(flags & BMP_AABITMAP){
|
||||
Assert( bpp == 8 );
|
||||
} else {
|
||||
} else if ((flags & BMP_TEX_NONCOMP) && (!(flags & BMP_TEX_COMP))) {
|
||||
Assert( bpp == 16 );
|
||||
}
|
||||
else if (flags & BMP_TEX_DXT1){
|
||||
Assert(bpp==24);
|
||||
}
|
||||
else if (flags & (BMP_TEX_DXT3 | BMP_TEX_DXT5)){
|
||||
Assert(bpp==32);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(0); //?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1788,6 +1932,12 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
bm_lock_tga( handle, bitmapnum, be, bmp, bpp, flags );
|
||||
break;
|
||||
|
||||
case BM_TYPE_DXT1:
|
||||
case BM_TYPE_DXT3:
|
||||
case BM_TYPE_DXT5:
|
||||
bm_lock_dds( handle, bitmapnum, be, bmp, bpp, flags );
|
||||
break;
|
||||
|
||||
default:
|
||||
Warning(LOCATION, "Unsupported type in bm_lock -- %d\n", be->type );
|
||||
return NULL;
|
||||
@@ -1829,7 +1979,7 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
// Decrements the ref_count member of the bitmap_entry struct. A bitmap can only be unloaded
|
||||
// when the ref_count is 0.
|
||||
//
|
||||
void bm_unlock( int handle )
|
||||
void bm_gfx_unlock( int handle )
|
||||
{
|
||||
bitmap_entry *be;
|
||||
bitmap *bmp;
|
||||
@@ -1862,7 +2012,7 @@ char *bm_get_filename(int handle)
|
||||
return bm_bitmaps[n].filename;
|
||||
}
|
||||
|
||||
void bm_get_palette(int handle, ubyte *pal, char *name)
|
||||
void bm_gfx_get_palette(int handle, ubyte *pal, char *name)
|
||||
{
|
||||
char *filename;
|
||||
int w,h;
|
||||
@@ -1889,7 +2039,7 @@ void bm_get_palette(int handle, ubyte *pal, char *name)
|
||||
//
|
||||
// returns: nothing
|
||||
|
||||
void bm_release(int handle)
|
||||
void bm_gfx_release(int handle)
|
||||
{
|
||||
bitmap_entry *be;
|
||||
|
||||
@@ -1960,7 +2110,7 @@ void bm_release(int handle)
|
||||
// returns: 0 => unload failed
|
||||
// 1 => unload successful
|
||||
//
|
||||
int bm_unload( int handle )
|
||||
int bm_gfx_unload( int handle )
|
||||
{
|
||||
bitmap_entry *be;
|
||||
bitmap *bmp;
|
||||
@@ -1991,7 +2141,7 @@ int bm_unload( int handle )
|
||||
|
||||
|
||||
// unload all used bitmaps
|
||||
void bm_unload_all()
|
||||
void bm_gfx_unload_all()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2050,8 +2200,10 @@ DCF(bmpman,"Shows/changes bitmap caching parameters and usage")
|
||||
}
|
||||
}
|
||||
|
||||
extern int OGL_inited;
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
void bm_page_in_texture( int bitmapnum, int nframes )
|
||||
void bm_gfx_page_in_texture( int bitmapnum, int nframes )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<nframes;i++ ) {
|
||||
@@ -2059,7 +2211,27 @@ void bm_page_in_texture( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 1;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
//check if its compressed
|
||||
if (OGL_inited)
|
||||
{
|
||||
switch (bm_bitmaps[n+i].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT3:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT5:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_OTHER;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2069,7 +2241,7 @@ void bm_page_in_texture( int bitmapnum, int nframes )
|
||||
|
||||
// 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 bitmapnum, int nframes )
|
||||
void bm_gfx_page_in_nondarkening_texture( int bitmapnum, int nframes )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<nframes;i++ ) {
|
||||
@@ -2077,7 +2249,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 4;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_NONDARK;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2088,7 +2260,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
|
||||
// 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 nframes)
|
||||
void bm_gfx_page_in_xparent_texture( int bitmapnum, int nframes)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<nframes;i++ ) {
|
||||
@@ -2096,7 +2268,26 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 3;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
//check if its compressed
|
||||
if (OGL_inited)
|
||||
{
|
||||
switch (bm_bitmaps[n+i].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT3:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT5:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
// bm_bitmaps[n+i].used_flags = BMP_NO_PALETTE_MAP;
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_XPARENT;
|
||||
} else {
|
||||
@@ -2106,7 +2297,7 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
|
||||
}
|
||||
|
||||
// Marks an aabitmap as being used for this level
|
||||
void bm_page_in_aabitmap( int bitmapnum, int nframes )
|
||||
void bm_gfx_page_in_aabitmap( int bitmapnum, int nframes )
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2115,7 +2306,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 2;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_AABITMAP;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2126,7 +2317,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
|
||||
|
||||
|
||||
// Tell the bitmap manager to start keeping track of what bitmaps are used where.
|
||||
void bm_page_in_start()
|
||||
void bm_gfx_page_in_start()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2151,7 +2342,7 @@ extern void gr_d3d_preload_init();
|
||||
extern int gr_d3d_preload(int bitmap_num, int is_aabitmap );
|
||||
#endif
|
||||
|
||||
void bm_page_in_stop()
|
||||
void bm_gfx_page_in_stop()
|
||||
{
|
||||
int i;
|
||||
int ship_info_index;
|
||||
@@ -2234,11 +2425,14 @@ void bm_page_in_stop()
|
||||
Bm_paging = 0;
|
||||
}
|
||||
|
||||
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
|
||||
int bm_gfx_get_cache_slot( int bitmap_id, int separate_ani_frames )
|
||||
{
|
||||
int n = bitmap_id % MAX_BITMAPS;
|
||||
|
||||
Assert( bm_bitmaps[n].handle == bitmap_id ); // INVALID BITMAP HANDLE
|
||||
if( bm_bitmaps[n].handle != bitmap_id ){//this should rightfully squash the invalid bitmap handel bug for the glow mapping
|
||||
mprintf(("bitmap handel %d is not equil to bitmap id %d",bm_bitmaps[n].handle,bitmap_id));
|
||||
return -1; // INVALID BITMAP HANDLE
|
||||
}
|
||||
|
||||
bitmap_entry *be = &bm_bitmaps[n];
|
||||
|
||||
@@ -2251,7 +2445,7 @@ int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
|
||||
}
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void bm_24_to_16(int bit_24, ushort *bit_16)
|
||||
void bm_gfx_24_to_16(int bit_24, ushort *bit_16)
|
||||
{
|
||||
ubyte *pixel = (ubyte*)&bit_24;
|
||||
ubyte alpha = 1;
|
||||
@@ -2334,6 +2528,22 @@ void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte
|
||||
}
|
||||
}
|
||||
|
||||
void bm_set_components_opengl(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
|
||||
{
|
||||
// rgba
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*rv / Gr_current_red->scale ) << Gr_current_red->shift);
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*gv / Gr_current_green->scale ) << Gr_current_green->shift);
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*bv / Gr_current_blue->scale ) << Gr_current_blue->shift);
|
||||
*((ushort*)pixel) &= ~(0x8000);
|
||||
if (*((ushort*)pixel) == (ushort)Gr_current_green->mask) {
|
||||
*((ushort*)pixel) = 0;
|
||||
} else {
|
||||
if(*av){
|
||||
*((ushort*)pixel) |= 0x8000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for selecting pixel formats
|
||||
void BM_SELECT_SCREEN_FORMAT()
|
||||
{
|
||||
@@ -2361,6 +2571,13 @@ void BM_SELECT_SCREEN_FORMAT()
|
||||
#endif // ifndef NO_DIRECT3D
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_screen;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2392,6 +2609,12 @@ void BM_SELECT_TEX_FORMAT()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2423,6 +2646,12 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2503,16 +2732,14 @@ void bm_set_components(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
|
||||
*/
|
||||
|
||||
// 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)
|
||||
{
|
||||
int bit_32 = 0;
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
// pick a byte size - 32 bits only if 32 bit mode d3d and screen format
|
||||
if(D3D_32bit && (Gr_current_red == &Gr_red)){
|
||||
if((gr_screen.bits_per_pixel==32) && (Gr_current_red == &Gr_red)){
|
||||
bit_32 = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if(r != NULL){
|
||||
if(bit_32){
|
||||
@@ -2593,7 +2820,7 @@ void bm_get_filename(int bitmapnum, char *filename)
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
int bw, bh;
|
||||
bitmap_section_info *sections;
|
||||
@@ -2611,3 +2838,38 @@ void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
|
||||
*w = sx < (sections->num_x - 1) ? MAX_BMAP_SECTION_SIZE : bw - sections->sx[sx];
|
||||
*h = sy < (sections->num_y - 1) ? MAX_BMAP_SECTION_SIZE : bh - sections->sy[sy];
|
||||
}
|
||||
|
||||
int bm_is_compressed(int num)
|
||||
{
|
||||
int n=num % MAX_BITMAPS;
|
||||
|
||||
//duh
|
||||
if (!Texture_compression_enabled)
|
||||
return 0;
|
||||
|
||||
Assert(num==bm_bitmaps[n].handle);
|
||||
|
||||
switch (bm_bitmaps[n].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
return 1;
|
||||
case BM_TYPE_DXT3:
|
||||
return 2;
|
||||
case BM_TYPE_DXT5:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//needed only for compressed bitmaps
|
||||
int bm_get_size(int num)
|
||||
{
|
||||
int n=num % MAX_BITMAPS;
|
||||
|
||||
if (!bm_is_compressed(num))
|
||||
return 0;
|
||||
|
||||
Assert(num==bm_bitmaps[n].handle);
|
||||
|
||||
return bm_bitmaps[n].mem_taken;
|
||||
}
|
||||
+185
-31
@@ -9,13 +9,95 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-08-16 03:52:22 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.1 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.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
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -154,17 +236,82 @@
|
||||
#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
|
||||
#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!
|
||||
|
||||
#define BM_TYPE_NONE 0
|
||||
#define BM_TYPE_PCX 1
|
||||
#define BM_TYPE_USER 2
|
||||
#define BM_TYPE_ANI 3 // in-house ANI format
|
||||
#define BM_TYPE_TGA 4 // 16 bit targa
|
||||
|
||||
/// 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
|
||||
|
||||
// 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;
|
||||
|
||||
@@ -177,12 +324,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
|
||||
@@ -192,29 +339,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 );
|
||||
|
||||
// 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
|
||||
@@ -222,32 +369,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
|
||||
@@ -294,28 +441,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
|
||||
@@ -330,7 +477,7 @@ 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);
|
||||
void bm_gfx_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);
|
||||
@@ -342,13 +489,20 @@ 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);
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,50 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2003-08-27 01:36:22 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.5 2002/10/30 06:31:05 DTP
|
||||
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
|
||||
*
|
||||
* Revision 2.4 2002/10/27 23:59:28 DTP
|
||||
* 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
|
||||
*
|
||||
* Revision 2.2 2002/07/29 19:04:48 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -206,6 +243,7 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/encrypt.h"
|
||||
@@ -610,8 +648,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];
|
||||
|
||||
@@ -623,9 +661,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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -653,8 +703,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;
|
||||
@@ -762,18 +813,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));
|
||||
@@ -1768,3 +1813,4 @@ int cflush(CFILE *cfile)
|
||||
|
||||
|
||||
|
||||
|
||||
+48
-31
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $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.
|
||||
*
|
||||
* Revision 2.4 2002/11/02 23:04:46 DTP
|
||||
* DOh, fixed that define, learn to count DTP :)
|
||||
*
|
||||
* Revision 2.3 2002/10/27 23:59:28 DTP
|
||||
* 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.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
|
||||
*
|
||||
@@ -378,44 +394,45 @@ typedef struct {
|
||||
|
||||
#define CF_TYPE_ANY -1 // Used to check in any directory
|
||||
|
||||
#define CF_TYPE_INVALID 0
|
||||
#define CF_TYPE_ROOT 1 // Root must be 1!!
|
||||
#define CF_TYPE_DATA 2
|
||||
#define CF_TYPE_MAPS 3
|
||||
#define CF_TYPE_TEXT 4
|
||||
#define CF_TYPE_MISSIONS 5
|
||||
#define CF_TYPE_MODELS 6
|
||||
#define CF_TYPE_TABLES 7
|
||||
#define CF_TYPE_SOUNDS 8
|
||||
#define CF_TYPE_SOUNDS_8B22K 9
|
||||
#define CF_TYPE_SOUNDS_16B11K 10
|
||||
#define CF_TYPE_VOICE 11
|
||||
#define CF_TYPE_INVALID 0
|
||||
#define CF_TYPE_ROOT 1 // Root must be 1!!
|
||||
#define CF_TYPE_DATA 2
|
||||
#define CF_TYPE_MAPS 3
|
||||
#define CF_TYPE_TEXT 4
|
||||
#define CF_TYPE_MISSIONS 5
|
||||
#define CF_TYPE_MODELS 6
|
||||
#define CF_TYPE_TABLES 7
|
||||
#define CF_TYPE_SOUNDS 8
|
||||
#define CF_TYPE_SOUNDS_8B22K 9
|
||||
#define CF_TYPE_SOUNDS_16B11K 10
|
||||
#define CF_TYPE_VOICE 11
|
||||
#define CF_TYPE_VOICE_BRIEFINGS 12
|
||||
#define CF_TYPE_VOICE_CMD_BRIEF 13
|
||||
#define CF_TYPE_VOICE_DEBRIEFINGS 14
|
||||
#define CF_TYPE_VOICE_PERSONAS 15
|
||||
#define CF_TYPE_VOICE_SPECIAL 16
|
||||
#define CF_TYPE_VOICE_SPECIAL 16
|
||||
#define CF_TYPE_VOICE_TRAINING 17
|
||||
#define CF_TYPE_MUSIC 18
|
||||
#define CF_TYPE_MOVIES 19
|
||||
#define CF_TYPE_INTERFACE 20
|
||||
#define CF_TYPE_FONT 21
|
||||
#define CF_TYPE_EFFECTS 22
|
||||
#define CF_TYPE_HUD 23
|
||||
#define CF_TYPE_MUSIC 18
|
||||
#define CF_TYPE_MOVIES 19
|
||||
#define CF_TYPE_INTERFACE 20
|
||||
#define CF_TYPE_FONT 21
|
||||
#define CF_TYPE_EFFECTS 22
|
||||
#define CF_TYPE_HUD 23
|
||||
#define CF_TYPE_PLAYER_MAIN 24
|
||||
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
|
||||
#define CF_TYPE_CACHE 26
|
||||
#define CF_TYPE_PLAYERS 27
|
||||
#define CF_TYPE_CACHE 26
|
||||
#define CF_TYPE_PLAYERS 27
|
||||
#define CF_TYPE_SINGLE_PLAYERS 28
|
||||
#define CF_TYPE_MULTI_PLAYERS 29
|
||||
#define CF_TYPE_MULTI_PLAYERS 29
|
||||
#define CF_TYPE_MULTI_CACHE 30
|
||||
#define CF_TYPE_CONFIG 31
|
||||
#define CF_TYPE_CONFIG 31
|
||||
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
|
||||
#define CF_TYPE_DEMOS 33
|
||||
#define CF_TYPE_CBANIMS 34
|
||||
#define CF_TYPE_DEMOS 33
|
||||
#define CF_TYPE_CBANIMS 34
|
||||
#define CF_TYPE_INTEL_ANIMS 35
|
||||
|
||||
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
|
||||
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
|
||||
|
||||
|
||||
// TRUE if type is specified and valid
|
||||
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
|
||||
@@ -465,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,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-19 09:05:25 $
|
||||
* $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.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
|
||||
*
|
||||
@@ -119,7 +122,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 +155,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 +187,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 +237,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 +284,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.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-09-14 18:32:41 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* 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,21 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.4 2002/10/30 06:26:11 DTP
|
||||
* DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 19:52:48 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -123,6 +138,7 @@
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
@@ -248,10 +264,11 @@ int cf_get_packfile_count(cf_root *root)
|
||||
packfile_count = 0;
|
||||
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
|
||||
strcpy( filespec, root->path );
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
// }
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
@@ -337,11 +354,13 @@ void cf_build_pack_list( cf_root *root )
|
||||
root_index = 0;
|
||||
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
|
||||
strcpy( filespec, root->path );
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined _WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
@@ -362,12 +381,13 @@ void cf_build_pack_list( cf_root *root )
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy(rptr_sort->path, root->path);
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
|
||||
strcat(rptr_sort->path, find.name );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
@@ -434,12 +454,17 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
|
||||
cf_root *root;
|
||||
|
||||
//======================================================
|
||||
// First, check the current directory.
|
||||
// strcpy( root->path, "d:\\projects\\freespace\\" );
|
||||
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);
|
||||
}
|
||||
|
||||
root = cf_create_root();
|
||||
|
||||
|
||||
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
|
||||
Error(LOCATION, "Can't get current working directory -- %d", errno );
|
||||
}
|
||||
@@ -448,6 +473,8 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
//======================================================
|
||||
@@ -500,7 +527,7 @@ void cf_search_root_path(int root_index)
|
||||
|
||||
strcpy( search_path, root->path );
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
strcat( search_path, Pathtypes[i].path );
|
||||
strcat( search_path, DIR_SEPARATOR_STR );
|
||||
}
|
||||
@@ -593,15 +620,12 @@ typedef struct VP_FILE {
|
||||
} VP_FILE;
|
||||
|
||||
void cf_search_root_pack(int root_index)
|
||||
{
|
||||
int i;
|
||||
|
||||
{
|
||||
cf_root *root = cf_get_root(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) {
|
||||
@@ -621,6 +645,7 @@ void cf_search_root_pack(int root_index)
|
||||
strcpy( search_path, "" );
|
||||
|
||||
// Go through all the files
|
||||
int i;
|
||||
for (i=0; i<VP_header.num_files; i++ ) {
|
||||
VP_FILE find;
|
||||
|
||||
@@ -644,38 +669,35 @@ void cf_search_root_pack(int root_index)
|
||||
//mprintf(( "Current dir = '%s'\n", search_path ));
|
||||
} else {
|
||||
|
||||
int j;
|
||||
int j;
|
||||
|
||||
for (j=CF_TYPE_ROOT; j<CF_MAX_PATH_TYPES; j++ ) {
|
||||
|
||||
|
||||
if ( !stricmp( search_path, Pathtypes[j].path )) {
|
||||
|
||||
char *ext = strchr( find.filename, '.' );
|
||||
if ( ext ) {
|
||||
if ( is_ext_in_list( Pathtypes[j].extensions, ext ) ) {
|
||||
// Found a file!!!!
|
||||
cf_file *file = cf_create_file();
|
||||
|
||||
strcpy( file->name_ext, find.filename );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = j;
|
||||
file->write_time = find.write_time;
|
||||
file->size = find.size;
|
||||
file->pack_offset = find.offset; // Mark as a non-packed file
|
||||
|
||||
file->pack_offset = find.offset; // Mark as a packed file
|
||||
//mprintf(( "Found pack file '%s'\n", file->name_ext ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cf_build_file_list()
|
||||
{
|
||||
int i;
|
||||
@@ -705,7 +727,7 @@ void cf_build_secondary_filelist(char *cdrom_dir)
|
||||
|
||||
// Init the path types
|
||||
for (i=0; i<CF_MAX_PATH_TYPES; i++ ) {
|
||||
Assert( Pathtypes[i].index == i );
|
||||
//Assert( Pathtypes[i].index == i );
|
||||
// [mharris] can't modify constant strings, why do this anyhow???
|
||||
// just need to make sure exts are all lc in the definition...
|
||||
// if ( Pathtypes[i].extensions ) {
|
||||
@@ -815,29 +837,70 @@ 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));
|
||||
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, longname );
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Search the pak files and CD-ROM.
|
||||
@@ -868,8 +931,8 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
// restore original filespec
|
||||
strcpy(filespec, temp);
|
||||
@@ -892,12 +955,13 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -953,6 +1017,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
|
||||
if (max < 1) {
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -973,6 +1038,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (num_files >= max)
|
||||
|
||||
break;
|
||||
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
@@ -1047,8 +1113,9 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
}
|
||||
|
||||
if (num_files >= max)
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
if ( !cf_matches_spec( filter,f->name_ext)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1091,6 +1158,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return num_files;
|
||||
}
|
||||
|
||||
@@ -1124,6 +1192,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
|
||||
if (max < 1) {
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1154,7 +1223,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (num_files >= max)
|
||||
if (num_files >= max)
|
||||
break;
|
||||
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
@@ -1229,6 +1298,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
}
|
||||
|
||||
if (num_files >= max)
|
||||
|
||||
break;
|
||||
|
||||
if ( !cf_matches_spec( filter,f->name_ext)) {
|
||||
@@ -1269,6 +1339,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return num_files;
|
||||
}
|
||||
|
||||
@@ -1301,7 +1372,7 @@ void cf_create_default_path_string( char *path, int pathtype, char *filename, bo
|
||||
|
||||
// Don't add slash for root directory
|
||||
if (Pathtypes[pathtype].path[0] != '\0') {
|
||||
strcat(path, DIR_SEPARATOR_STR);
|
||||
strcat(path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
// add filename
|
||||
|
||||
@@ -9,11 +9,141 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.29.2.1 $
|
||||
* $Date: 2003-09-18 23:40:16 $
|
||||
* $Author: argv $
|
||||
* $Revision: 2.29.2.1 $
|
||||
* $Date: 2003-09-18 23:40:16 $
|
||||
* $Author: argv $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.29 2003/09/14 19:00:02 wmcoolmon
|
||||
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
|
||||
*
|
||||
* Revision 2.28 2003/09/14 18:32:24 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.27 2003/09/13 06:02:05 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.25 2003/09/09 17:10:54 matt
|
||||
* Added -nospec cmd line param to disable specular -Sticks
|
||||
*
|
||||
* Revision 2.24 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.23 2003/08/21 20:54:37 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.22 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.21 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.20 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.19 2003/03/20 08:24:45 unknownplayer
|
||||
* Modified the command line options so they are all in lower-case characters.
|
||||
* Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/12/14 17:09:08 phreak
|
||||
* added a command line that displays frames per second when enabled.
|
||||
* use "-fps"
|
||||
*
|
||||
* Revision 2.11 2002/11/10 16:32:42 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.10 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.9 2002/10/27 23:55:36 DTP
|
||||
* 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.8 2002/10/22 23:02:39 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.7 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.6 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.4.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.4.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.4.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.4.2.1 2002/08/27 13:19:02 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.5 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.4 2002/08/07 00:44:13 DTP
|
||||
* Implented -GF4FIX commandline switch
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
@@ -251,8 +381,29 @@ cmdline_parm mouse_coords("-coords", NULL);
|
||||
cmdline_parm timeout("-timeout", NULL);
|
||||
cmdline_parm d3d_window("-window", NULL);
|
||||
cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
|
||||
cmdline_parm gf4fix_arg("-gf4fix", NULL); //DTP for random tigers GF4fix
|
||||
cmdline_parm allslev_arg("-allslev", NULL); //Give access to all single player missions
|
||||
cmdline_parm phreak_arg("-phreak", NULL); // Change to phreaks options including new targetting code
|
||||
cmdline_parm dnoshowvid_arg("-dnoshowvid", NULL); // Allows video streaming
|
||||
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
|
||||
cmdline_parm fps_arg("-fps", NULL);
|
||||
cmdline_parm d3dlowmem_arg("-d3dlowmem", NULL); //DTP for random tigers GF4fix
|
||||
cmdline_parm d3dmipmap_arg("-d3dmipmap", NULL);
|
||||
cmdline_parm beams_no_pierce_shields_arg("-nobeampierce", NULL); // beams do not pierce shields - Goober5000
|
||||
cmdline_parm fov_arg("-fov", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_exp_arg("-spec_exp", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_point_arg("-spec_point", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_static_arg("-spec_static", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm spec_tube_arg("-spec_tube", NULL); // comand line FOV -Bobboau
|
||||
cmdline_parm safeloading_arg("-safeloading", NULL); //Uses old loading method -C
|
||||
cmdline_parm nospec_arg("-nospec", NULL); // skip specular highlighting -Sticks
|
||||
cmdline_parm auto_ets_arg("-auto-ets", NULL); // _argv[-1] - auto ETS.
|
||||
cmdline_parm no_implicit_disable_auto_target("-no-implicit-disable-auto-target", NULL); // _argv[-1] - don't disable auto targeting when 'target nothing' command is used.
|
||||
cmdline_parm no_auto_target_turret("-no-auto-target-turret", NULL); // _argv[-1] - don't auto-target turrets.
|
||||
cmdline_parm sound_from_own_turrets("-sound-from-own-turrets", NULL); // _argv[-1] - play sounds when own turrets fire.
|
||||
cmdline_parm singular_shields("-singular-shields", NULL); // _argv[-1] - turn on singular shields for all ships.
|
||||
|
||||
|
||||
cmdline_parm cell_arg("-cell", NULL);
|
||||
|
||||
int Cmdline_multi_stream_chat_to_file = 0;
|
||||
int Cmdline_freespace_no_sound = 0;
|
||||
@@ -270,7 +421,8 @@ char *Cmdline_game_password = NULL;
|
||||
char *Cmdline_rank_above= NULL;
|
||||
char *Cmdline_rank_below = NULL;
|
||||
char *Cmdline_connect_addr = NULL;
|
||||
char *Cmdline_almission = NULL; //DTP FOR AUTO-LOAD Multi MISSION
|
||||
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
|
||||
char *Cmdline_mod = NULL; //DTP for mod arguement
|
||||
int Cmdline_multi_log = 0;
|
||||
int Cmdline_server_firing = 0;
|
||||
int Cmdline_client_dodamage = 0;
|
||||
@@ -280,10 +432,29 @@ int Cmdline_mouse_coords = 0;
|
||||
int Cmdline_timeout = -1;
|
||||
|
||||
int Cmdline_window = 0;
|
||||
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
|
||||
int Cmdline_allslev = 0;
|
||||
int Cmdline_phreak = 0;
|
||||
int Cmdline_dnoshowvid = 0;
|
||||
int Cmdline_show_fps = 0;
|
||||
int Cmdline_safeloading = 0;
|
||||
int Cmdline_nospec = 0;
|
||||
|
||||
int Cmdline_d3dlowmem = 0;
|
||||
int Cmdline_d3dmipmap = 0;
|
||||
|
||||
int Cmdline_beams_no_pierce_shields = 0; // Goober5000
|
||||
|
||||
struct argv_options Argv_options; // _argv[-1] - options struct for my stuff, and maybe other people's too.
|
||||
|
||||
static cmdline_parm Parm_list(NULL, NULL);
|
||||
static int Parm_list_inited = 0;
|
||||
|
||||
float Cmdline_fov = 0.75f;
|
||||
extern float VIEWER_ZOOM_DEFAULT;
|
||||
extern float Viewer_zoom;
|
||||
|
||||
int Cmdline_cell = 0;
|
||||
|
||||
// Return true if this character is an extra char (white space and quotes)
|
||||
int is_extra_space(char ch)
|
||||
@@ -643,6 +814,104 @@ int parse_cmdline(int argc, char *argv[])
|
||||
Cmdline_use_last_pilot = 1;
|
||||
Cmdline_start_netgame = 1;
|
||||
}
|
||||
if (gf4fix_arg.found() ) {
|
||||
Cmdline_gf4fix = 1;
|
||||
}
|
||||
|
||||
if (allslev_arg.found() ) {
|
||||
Cmdline_allslev = 1;
|
||||
}
|
||||
|
||||
if(phreak_arg.found() ) {
|
||||
Cmdline_phreak = 1;
|
||||
}
|
||||
|
||||
if(dnoshowvid_arg.found() ) {
|
||||
Cmdline_dnoshowvid = 1;
|
||||
}
|
||||
|
||||
if(mod_arg.found() ) {
|
||||
Cmdline_mod = mod_arg.str();
|
||||
}
|
||||
|
||||
|
||||
if (fps_arg.found())
|
||||
{
|
||||
Cmdline_show_fps = 1;
|
||||
}
|
||||
|
||||
if ( safeloading_arg.found() ) {
|
||||
Cmdline_safeloading = 1;
|
||||
}
|
||||
|
||||
if( d3dlowmem_arg.found() ) {
|
||||
Cmdline_d3dlowmem = 1;
|
||||
}
|
||||
|
||||
if( d3dmipmap_arg.found() ) {
|
||||
Cmdline_d3dmipmap = 1;
|
||||
}
|
||||
|
||||
if ( beams_no_pierce_shields_arg.found() ) {
|
||||
Cmdline_beams_no_pierce_shields = 1;
|
||||
}
|
||||
|
||||
memset(&Argv_options, 0, sizeof(Argv_options));
|
||||
|
||||
// _argv[-1] - auto ETS.
|
||||
if ( auto_ets_arg.found() ) {
|
||||
Argv_options.auto_ets = 1;
|
||||
}
|
||||
|
||||
// _argv[-1] - don't disable auto targeting when 'target nothing' command is used.
|
||||
if ( no_implicit_disable_auto_target.found() ) {
|
||||
Argv_options.no_implicit_disable_auto_target = 1;
|
||||
}
|
||||
|
||||
// _argv[-1] - don't auto-target turrets.
|
||||
if ( no_auto_target_turret.found() ) {
|
||||
Argv_options.no_auto_target_turret = 1;
|
||||
}
|
||||
|
||||
// _argv[-1] - play sounds when own turrets fire.
|
||||
if ( sound_from_own_turrets.found() ) {
|
||||
Argv_options.sound_from_own_turrets = 1;
|
||||
}
|
||||
|
||||
// _argv[-1] - turn on singular shields for all ships.
|
||||
if ( singular_shields.found() ) {
|
||||
Argv_options.singular_shields = 1;
|
||||
}
|
||||
|
||||
if ( fov_arg.found() ) {
|
||||
Viewer_zoom = VIEWER_ZOOM_DEFAULT = Cmdline_fov = fov_arg.get_float();
|
||||
}
|
||||
|
||||
|
||||
//specular comand lines
|
||||
if ( spec_exp_arg.found() ) {
|
||||
specular_exponent_value = spec_exp_arg.get_float();
|
||||
}
|
||||
|
||||
if ( spec_point_arg.found() ) {
|
||||
static_point_factor = spec_point_arg.get_float();
|
||||
}
|
||||
|
||||
if ( spec_static_arg.found() ) {
|
||||
static_light_factor = spec_static_arg.get_float();
|
||||
}
|
||||
|
||||
if ( spec_tube_arg.found() ) {
|
||||
static_tube_factor = spec_tube_arg.get_float();
|
||||
}
|
||||
|
||||
if ( cell_arg.found() ) {
|
||||
Cmdline_cell = 1;
|
||||
}
|
||||
|
||||
if ( nospec_arg.found() ) {
|
||||
Cmdline_nospec = 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5,15 +5,131 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-07-29 06:35:15 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.27.2.1 $
|
||||
* $Date: 2003-09-18 23:40:16 $
|
||||
* $Author: argv $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.11 2002/10/31 21:14:16 DTP
|
||||
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
|
||||
*
|
||||
* Revision 2.10 2002/10/30 20:22:30 inquisitor
|
||||
* Bad Committ, Rolling back
|
||||
*
|
||||
* Revision 2.7 2002/10/22 23:02:39 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.6 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -198,6 +314,39 @@ extern int Cmdline_timeout;
|
||||
|
||||
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_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_safeloading;
|
||||
extern int Cmdline_nospec;
|
||||
|
||||
extern int Cmdline_d3dlowmem;
|
||||
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;
|
||||
|
||||
// _argv[-1] - use a struct with bitfields to avoid wasting memory.
|
||||
// Yes, I know this deviates from the usual Volition #define flags.
|
||||
// This is intentional. Structs with bitfields waste less memory and are easier to understand.
|
||||
// Also, the ':1' etc is not an initializer; it is a specification of how many bits to use.
|
||||
struct argv_options {
|
||||
int auto_ets:1;
|
||||
int no_implicit_disable_auto_target:1;
|
||||
int no_auto_target_turret:1;
|
||||
int sound_from_own_turrets:1;
|
||||
int singular_shields:1;
|
||||
};
|
||||
extern struct argv_options Argv_options;
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:00 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -243,27 +252,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;
|
||||
|
||||
|
||||
+198
-106
@@ -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 "_WINDOWS" /D "WIN32" /D "NDEBUG" /U "_DEBUG" /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" /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 "." /FI"PSTypes.h" /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_DX81" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "DBUGFILE_ACTIVE" /D "USE_OPENGL" /U "NDEBUG" /FR /YX /FD /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 ""
|
||||
@@ -207,6 +195,14 @@ SOURCE=.\Cutscene\Cutscenes.cpp
|
||||
|
||||
SOURCE=.\Cutscene\Cutscenes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene\movie.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene\movie.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Debris"
|
||||
|
||||
@@ -227,32 +223,44 @@ SOURCE=.\Debris\Debris.h
|
||||
|
||||
SOURCE=.\DebugConsole\Console.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\debugconsole\dbugfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\debugconsole\dbugfile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\debugconsole\timerbar.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\debugconsole\timerbar.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "DirectX"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dx8show.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dx8show.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
@@ -265,10 +273,6 @@ 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
|
||||
@@ -301,10 +305,6 @@ SOURCE=.\DirectX\vdvp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDdraw.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDinput.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -313,7 +313,15 @@ SOURCE=.\DirectX\vDsound.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDxguid.lib
|
||||
SOURCE=.\directx\ddraw.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\strmiids.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dxguid.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Fireball"
|
||||
@@ -475,18 +483,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
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Bitblt.cpp
|
||||
@@ -529,62 +528,6 @@ 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
|
||||
@@ -641,10 +584,6 @@ SOURCE=.\Graphics\Shade.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapGenericScans.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\Tmapper.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -680,6 +619,107 @@ SOURCE=.\Graphics\TmapScanTiled32x32.cpp
|
||||
SOURCE=.\Graphics\TmapScanTiled64x64.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "GlideGr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# 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
|
||||
# End Group
|
||||
# Begin Group "D3D8Gr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# 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\GrD3DBmpman.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrD3DBmpman.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\graphics\GrD3DCalls.cpp
|
||||
# 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
|
||||
# End Group
|
||||
# Begin Group "DDrawGr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrDirectDraw.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrDirectDraw.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "OpenGLGr"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrOpenGL.h
|
||||
# End Source File
|
||||
# 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\aaline.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\GrInternal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphics\TmapGenericScans.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Hud"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
@@ -1859,6 +1899,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
|
||||
@@ -1895,6 +1943,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
|
||||
@@ -2475,5 +2531,41 @@ SOURCE=.\Network\stand_gui.cpp
|
||||
SOURCE=.\Network\stand_gui.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Decals"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\decals\decals.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\decals\decals.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "ddsutils"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddsutils\ddsutils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-04-05 11:09:21 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $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
|
||||
*
|
||||
@@ -326,6 +338,7 @@
|
||||
#include "popup/popup.h"
|
||||
#include "ui/uidefs.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multi_pmsg.h"
|
||||
@@ -415,7 +428,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,13 +9,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-12-02 23:52:02 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.1 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -292,7 +305,7 @@
|
||||
typedef struct config_item {
|
||||
short key_default; // default key bound to action
|
||||
short joy_default; // default joystick button bound to action
|
||||
char tab; // what tab (catagory) it belongs in
|
||||
char tab; // what tab (category) it belongs in
|
||||
char *text; // describes the action in the config screen
|
||||
char type; // manner control should be checked in
|
||||
short key_id; // actual key bound to action
|
||||
@@ -445,8 +458,15 @@ typedef struct config_item {
|
||||
|
||||
#define MULTI_SELF_DESTRUCT 106
|
||||
|
||||
#define TOGGLE_HUD 107
|
||||
#define RIGHT_SLIDE_THRUST 108
|
||||
#define LEFT_SLIDE_THRUST 109
|
||||
#define UP_SLIDE_THRUST 110
|
||||
#define DOWN_SLIDE_THRUST 111
|
||||
|
||||
|
||||
// this should be the total number of control action defines above (or last define + 1)
|
||||
#define CCFG_MAX 107
|
||||
#define CCFG_MAX 112
|
||||
|
||||
extern int Failed_key_index;
|
||||
extern int Invert_heading;
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-10-19 19:29:27 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -536,6 +543,13 @@ config_item Control_config[CCFG_MAX + 1] = {
|
||||
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, "(Multiplayer) Toggle network info"},
|
||||
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, "(Multiplayer) Self destruct"},
|
||||
|
||||
// Misc
|
||||
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, "Toggle HUD"},
|
||||
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, "Right Thrust", CC_TYPE_CONTINUOUS},
|
||||
{ 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},
|
||||
|
||||
{ -1, -1, -1, "" }
|
||||
};
|
||||
|
||||
|
||||
@@ -9,13 +9,53 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2003-08-21 20:54:38 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2003-08-21 20:54:38 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -158,11 +198,12 @@
|
||||
#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 "debugconsole/dbugfile.h"
|
||||
|
||||
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage",
|
||||
@@ -422,7 +463,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;
|
||||
@@ -433,30 +474,40 @@ 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"));
|
||||
|
||||
// no soup for you!
|
||||
/*
|
||||
int rval = movie_play(full_name);
|
||||
if(gr_screen.mode != GR_DIRECT3D )
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
int rval = movie_play(name);
|
||||
|
||||
if(gr_screen.mode != GR_DIRECT3D )
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
#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_dnoshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
char full_name[MAX_PATH];
|
||||
GetCurrentDirectory(MAX_PATH, full_name);
|
||||
strcat(full_name, "\\");
|
||||
strcat(full_name, name);
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
// Ok - this should be replaced with FS2 cfopen or something - UP
|
||||
FILE *fp = fopen(full_name,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",full_name);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s",full_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup(0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
os_app_activate_set(false);
|
||||
|
||||
dx8show_set_hwnd((void *) os_get_window());
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_HIDE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_MINIMIZE);
|
||||
|
||||
dx8show_play_cutscene(name);
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_RESTORE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_SHOW);
|
||||
|
||||
os_app_activate_set(true);
|
||||
|
||||
|
||||
/*
|
||||
// Comment this back in if the freespace window isnt coming back after the movie ends
|
||||
|
||||
if((HWND) os_get_window() != NULL)
|
||||
{
|
||||
if(GetForegroundWindow() != (HWND) os_get_window())
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("Using SetForegroundWindow last");
|
||||
SetForegroundWindow((HWND) os_get_window());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
// This should not be uncommented
|
||||
if(Cmdline_dnoshowvid)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#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);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,175 @@
|
||||
#include "ddsutils/ddsutils.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
int Texture_compression_enabled=0;
|
||||
|
||||
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
{
|
||||
char code[5];
|
||||
CFILE *ddsfile;
|
||||
char real_name[MAX_FILENAME_LEN];
|
||||
char *p;
|
||||
int retval=DDS_ERROR_NONE;
|
||||
int ct;
|
||||
int bits=0;
|
||||
|
||||
//this better not happen.. ever
|
||||
Assert(filename!=NULL);
|
||||
|
||||
//make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
p=strchr(real_name, '.');
|
||||
if (p) *p=0;
|
||||
strcat(real_name, ".dds");
|
||||
|
||||
memset(code,0,sizeof(code));
|
||||
//try to open the file
|
||||
ddsfile = cfopen(real_name, "rb");
|
||||
|
||||
//file not found
|
||||
if (!ddsfile)
|
||||
{
|
||||
return DDS_ERROR_INVALID_FILENAME;
|
||||
}
|
||||
|
||||
//read the code
|
||||
cfread(code,1,4,ddsfile);
|
||||
code[4]=0;
|
||||
|
||||
//check it
|
||||
if (strncmp(code,DDS_FILECODE,4)!=0)
|
||||
{
|
||||
return DDS_ERROR_BAD_HEADER;
|
||||
}
|
||||
|
||||
//read the header
|
||||
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
|
||||
|
||||
//stuff important info
|
||||
if (width) *width=lpddsd->dwWidth;
|
||||
if (height) *height=lpddsd->dwHeight;
|
||||
|
||||
switch(lpddsd->ddpfPixelFormat.dwFourCC)
|
||||
{
|
||||
case FOURCC_DXT1:
|
||||
bits=24;
|
||||
ct=DDS_DXT1;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT3:
|
||||
bits=32;
|
||||
ct=DDS_DXT3;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT5:
|
||||
bits=32;
|
||||
ct=DDS_DXT5;
|
||||
break;
|
||||
|
||||
//dxt2 and dxt4 aren't supported
|
||||
case FOURCC_DXT2:
|
||||
case FOURCC_DXT4:
|
||||
retval=DDS_ERROR_INVALID_FORMAT;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
|
||||
//none of the above
|
||||
default:
|
||||
retval=DDS_ERROR_UNCOMPRESSED;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bpp) *bpp=bits;
|
||||
if (compression_type) *compression_type=ct;
|
||||
|
||||
//close file and return
|
||||
cfclose(ddsfile);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type);
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data)
|
||||
{
|
||||
int retval;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int w,h,ct,bpp;
|
||||
CFILE *cfp;
|
||||
ubyte* tmp;
|
||||
|
||||
//this must be set
|
||||
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);
|
||||
Assert(retval==DDS_ERROR_NONE);
|
||||
|
||||
//get some more info from the surface
|
||||
*size=ddsd.dwMipMapCount > 1 ? ddsd.dwLinearSize * 2 : ddsd.dwLinearSize;
|
||||
|
||||
//open it up and go to the data section
|
||||
cfp=cfopen(filename,"rb");
|
||||
cfseek(cfp,DDS_OFFSET, CF_SEEK_SET);
|
||||
|
||||
//get the data
|
||||
tmp=(ubyte*)malloc(*size);
|
||||
|
||||
if (!tmp)
|
||||
{
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NO_MEM; //barf
|
||||
}
|
||||
|
||||
cfread(tmp,1,*size,cfp);
|
||||
|
||||
*data=(uint)tmp;
|
||||
//we look done here
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NONE;
|
||||
}
|
||||
|
||||
//returns string representation of DDS_** error code
|
||||
const char *dds_error_string(int code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case DDS_ERROR_NONE:
|
||||
return "No error";
|
||||
|
||||
case DDS_ERROR_NO_MEM:
|
||||
return "Insufficient memory";
|
||||
|
||||
case DDS_ERROR_INVALID_FILENAME:
|
||||
return "File not found";
|
||||
|
||||
case DDS_ERROR_BAD_HEADER:
|
||||
return "Filecode did not equal \"DDS \"";
|
||||
|
||||
case DDS_ERROR_INVALID_FORMAT:
|
||||
return "File was compressed, but it was DXT2 or DXT4";
|
||||
|
||||
case DDS_ERROR_UNCOMPRESSED:
|
||||
return "*.DDS files must be compressed and use DXT1, DXT3, or DXT5 compression";
|
||||
|
||||
default:
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
//get a warning otherwise
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
//header file to load .dds files
|
||||
//these use dxtc texture compression
|
||||
|
||||
#ifndef __DDS_H
|
||||
#define __DDS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#define DDS_ERROR_NONE 0 //everything went fine
|
||||
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
|
||||
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
|
||||
#define DDS_ERROR_UNCOMPRESSED 3 //not using dxtc compression
|
||||
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
|
||||
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
|
||||
|
||||
|
||||
#define DDS_DXT_INVALID -1
|
||||
#define DDS_DXT1 1
|
||||
#define DDS_DXT3 3
|
||||
#define DDS_DXT5 5
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
|
||||
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
|
||||
#endif //defined(MAKEFOURCC)
|
||||
|
||||
// FOURCC codes for DX compressed-texture pixel formats
|
||||
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
|
||||
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
|
||||
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
|
||||
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
|
||||
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
|
||||
|
||||
#define DDS_FILECODE "DDS "
|
||||
|
||||
#ifndef DUMMYUNIONNAMEN
|
||||
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
|
||||
#define DUMMYUNIONNAMEN(n)
|
||||
#else
|
||||
#define DUMMYUNIONNAMEN(n) u##n
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//these structures are the headers for a dds file
|
||||
typedef struct _DDSCAPS2
|
||||
{
|
||||
DWORD dwCaps; // capabilities of surface wanted
|
||||
DWORD dwCaps2;
|
||||
DWORD dwCaps3;
|
||||
union
|
||||
{
|
||||
DWORD dwCaps4;
|
||||
DWORD dwVolumeDepth;
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
} DDSCAPS2;
|
||||
|
||||
typedef struct _DDSURFACEDESC2
|
||||
{
|
||||
DWORD dwSize; // size of the DDSURFACEDESC structure
|
||||
DWORD dwFlags; // determines what fields are valid
|
||||
DWORD dwHeight; // height of surface to be created
|
||||
DWORD dwWidth; // width of input surface
|
||||
union
|
||||
{
|
||||
LONG lPitch; // distance to start of next line (return value only)
|
||||
DWORD dwLinearSize; // Formless late-allocated optimized surface size
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
union
|
||||
{
|
||||
DWORD dwBackBufferCount; // number of back buffers requested
|
||||
DWORD dwDepth; // the depth if this is a volume texture
|
||||
} DUMMYUNIONNAMEN(5);
|
||||
union
|
||||
{
|
||||
DWORD dwMipMapCount; // number of mip-map levels requestde
|
||||
// dwZBufferBitDepth removed, use ddpfPixelFormat one instead
|
||||
DWORD dwRefreshRate; // refresh rate (used when display mode is described)
|
||||
DWORD dwSrcVBHandle; // The source used in VB::Optimize
|
||||
} DUMMYUNIONNAMEN(2);
|
||||
DWORD dwAlphaBitDepth; // depth of alpha buffer requested
|
||||
DWORD dwReserved; // reserved
|
||||
LPVOID lpSurface; // pointer to the associated surface memory
|
||||
union
|
||||
{
|
||||
DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use
|
||||
DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces
|
||||
} DUMMYUNIONNAMEN(3);
|
||||
DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
|
||||
DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
|
||||
DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
|
||||
union
|
||||
{
|
||||
DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface
|
||||
DWORD dwFVF; // vertex format description of vertex buffers
|
||||
} DUMMYUNIONNAMEN(4);
|
||||
DDSCAPS2 ddsCaps; // direct draw surface capabilities
|
||||
DWORD dwTextureStage; // stage in multitexture cascade
|
||||
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
|
||||
|
||||
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
|
||||
|
||||
//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);
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data);
|
||||
|
||||
//returns a string from a DDS error code
|
||||
const char* dds_error_string(int code);
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
#endif //__DDS_H
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-04-29 01:03:22 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -235,6 +242,7 @@
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "io/timer.h"
|
||||
#include "fireball/fireballs.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "network/multi.h"
|
||||
@@ -803,7 +811,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;
|
||||
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:01 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -112,6 +121,7 @@
|
||||
#include "io/key.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
#define MAX_COMMANDS 300
|
||||
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
#include "dbugfile.h"
|
||||
|
||||
int dbugfile_counters[MAX_COUNTERS];
|
||||
bool dbugfile_init_var = false;
|
||||
|
||||
char dbugfile_filename[512];
|
||||
|
||||
void dbugfile_output(char *buffer)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FILE *fp = fopen(dbugfile_filename, "a");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
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
|
||||
{
|
||||
unsigned long len = 512;
|
||||
GetUserName(temp_buff, &len);
|
||||
|
||||
strcat(dbugfile_filename, temp_buff);
|
||||
strcat(big_buffer, temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, "-");
|
||||
strcat(big_buffer, " ");
|
||||
}
|
||||
#endif
|
||||
|
||||
_tzset();
|
||||
|
||||
// Display operating system-style date and time.
|
||||
_strdate( temp_buff);
|
||||
strcat(dbugfile_filename, "D(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ") T(");
|
||||
strcat(big_buffer, " ");
|
||||
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ").txt");
|
||||
strcat(big_buffer, "\n");
|
||||
|
||||
// Remove invalid slash chars
|
||||
int len = strlen(dbugfile_filename);
|
||||
while(len >= 2)
|
||||
{
|
||||
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
|
||||
{
|
||||
dbugfile_filename[len] = '-';
|
||||
}
|
||||
len--;
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// detect OS type
|
||||
|
||||
OSVERSIONINFO version_info;
|
||||
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
if(GetVersionEx(&version_info) != false)
|
||||
{
|
||||
char *error = "Error in detecting OS version";
|
||||
char *version = error;
|
||||
|
||||
switch(version_info.dwMajorVersion)
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 95";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 10)
|
||||
{
|
||||
version = "Windows 98";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 90)
|
||||
{
|
||||
version = "Windows Me";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 2000";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 1)
|
||||
{
|
||||
version = "Windows XP";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char *release_type = NULL;
|
||||
#ifdef _DEBUG
|
||||
release_type = "Debug";
|
||||
#else
|
||||
release_type = "Release";
|
||||
#endif
|
||||
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);
|
||||
|
||||
dbugfile_init_var = true;
|
||||
}
|
||||
|
||||
void dbugfile_deinit()
|
||||
{
|
||||
dbugfile_output("Normal end");
|
||||
dbugfile_init_var = false;
|
||||
}
|
||||
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
|
||||
|
||||
va_list ap;
|
||||
char *p, *sval;
|
||||
long ival;
|
||||
double dval;
|
||||
|
||||
// Add each extra parameter to string
|
||||
va_start(ap, format);
|
||||
|
||||
for(p = (char *) format; *p; p++)
|
||||
{
|
||||
if(*p != '%')
|
||||
{
|
||||
*(buffer + i) = *p;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
p++;
|
||||
|
||||
switch(*p)
|
||||
{
|
||||
case 'd':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%d", ival);
|
||||
break;
|
||||
}
|
||||
case 'c':
|
||||
{
|
||||
ival = va_arg(ap, char);
|
||||
buffer[i] = (char) ival;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
case 'x':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%x", ival);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'f':
|
||||
{
|
||||
dval = va_arg(ap, double);
|
||||
i += sprintf(buffer+i,"%f", dval);
|
||||
break;
|
||||
}
|
||||
case 's':
|
||||
{
|
||||
for(sval = va_arg(ap, char *); *sval; sval++)
|
||||
{
|
||||
*(buffer + i++) = *sval;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
i += sprintf(buffer+i,"N/A: %%%c", *p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
|
||||
i += sprintf(buffer + i, "\n");
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#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
|
||||
|
||||
#define DBUGFILE_INIT() dbugfile_init();
|
||||
#define DBUGFILE_DEINIT() dbugfile_deinit();
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
|
||||
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
|
||||
#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_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
|
||||
#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
|
||||
|
||||
#define DBUGFILE_INIT() ;
|
||||
#define DBUGFILE_DEINIT() ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) ;
|
||||
#define DBUGFILE_OUTPUT_1(t,a) ;
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) ;
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
|
||||
#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_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
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
||||
#include "dbugfile.h"
|
||||
#include "timerbar.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LARGE_INTEGER start_value;
|
||||
LARGE_INTEGER total_value;
|
||||
|
||||
LARGE_INTEGER average;
|
||||
LARGE_INTEGER frame_total;
|
||||
|
||||
} timerbar_profile;
|
||||
|
||||
timerbar_profile profiles[TIMERBAR_COLOUR_MAX];
|
||||
int timerbar_current_profile = 0;
|
||||
|
||||
LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
|
||||
|
||||
void timerbar_start_frame()
|
||||
{
|
||||
timerbar_current_profile = 0;
|
||||
|
||||
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
draw_func_ptr = NULL;
|
||||
}
|
||||
|
||||
timerbar_last_start_value = timerbar_ultimate_start_value;
|
||||
|
||||
}
|
||||
|
||||
const int WIDTH = 480;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.05f;
|
||||
|
||||
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,
|
||||
fxwidth / WIDTHF,
|
||||
0.005f);
|
||||
}
|
||||
|
||||
void timerbar_end_frame()
|
||||
{
|
||||
// Now we want to draw the bars
|
||||
if(draw_func_ptr == NULL)
|
||||
{
|
||||
// we have not been given a draw function so we are going to have to quit
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(-1);
|
||||
|
||||
int last_xpos = 0;
|
||||
int y_pos = 0;
|
||||
|
||||
|
||||
for(int i = 0; i < TIMERBAR_COLOUR_MAX; i++)
|
||||
{
|
||||
// Nothing to render this frame
|
||||
if(profiles[i].frame_total.QuadPart == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
|
||||
|
||||
// break condition in else
|
||||
for (;;)
|
||||
{
|
||||
// if bar runs over
|
||||
if(last_xpos + xsize > WIDTH)
|
||||
{
|
||||
int rem_len = WIDTH - last_xpos;
|
||||
|
||||
// Draw from current position to the end of the bar
|
||||
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
|
||||
|
||||
xsize -= rem_len;
|
||||
last_xpos = 0;
|
||||
y_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw whats left and break for the next bar
|
||||
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
|
||||
|
||||
last_xpos += xsize;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// reset for next frame
|
||||
profiles[i].frame_total.QuadPart = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void timerbar_switch_type(int num)
|
||||
{
|
||||
if(num >= TIMERBAR_COLOUR_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calculate old profile's total
|
||||
LARGE_INTEGER now;
|
||||
if(QueryPerformanceCounter(&now) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
|
||||
profiles[timerbar_current_profile].frame_total.QuadPart =
|
||||
(now.QuadPart - timerbar_last_start_value.QuadPart);
|
||||
|
||||
if(num != -1)
|
||||
{
|
||||
// Switch to new profile
|
||||
timerbar_current_profile = num;
|
||||
}
|
||||
|
||||
// Update time to count from
|
||||
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
enum
|
||||
{
|
||||
TIMERBAR_COLOUR_RED,
|
||||
TIMERBAR_COLOUR_GREEN,
|
||||
TIMERBAR_COLOUR_BLUE,
|
||||
TIMERBAR_COLOUR_MAX,
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
#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);
|
||||
|
||||
#else
|
||||
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) ;
|
||||
#define TIMERBAR_START_FRAME() ;
|
||||
#define TIMERBAR_END_FRAME() ;
|
||||
#define TIMERBAR_SWITCH_TYPE(n) ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,830 @@
|
||||
//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"
|
||||
#include "io/timer.h"
|
||||
#include "math/fvi.h"
|
||||
#include "lighting/lighting.h"
|
||||
|
||||
//#define DECALS_ENABLED
|
||||
|
||||
int decal_intersect_seg_with_cube(vector * poly_point, vector start, vector end, vector cube_point[8], matrix orient, int ints=1);
|
||||
|
||||
int decal_intersect_poly_with_cube(vector * poly_point, vector point[3], vector cube_point[8], int ints);
|
||||
|
||||
decal_model d_model;
|
||||
|
||||
int poly_num = 0;
|
||||
|
||||
static vector decal_cube_point[8];
|
||||
static vector decal_cube_plane[6][2];
|
||||
static vector decal_hit_point;
|
||||
static vector decal_hit_vect;
|
||||
static float decal_hit_radius;
|
||||
|
||||
static matrix decal_orient;
|
||||
|
||||
static vector * decal_point_list[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static int decal_poly[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static decal * new_decal;
|
||||
|
||||
static int nverts;
|
||||
|
||||
static float min_rad;
|
||||
|
||||
static int back_faceing;
|
||||
|
||||
/*
|
||||
vector uvec, rvec;
|
||||
vector temp;
|
||||
|
||||
temp = *pos;
|
||||
|
||||
vm_vec_sub( &rvec, Eyeposition, &temp );
|
||||
vm_vec_normalize( &rvec );
|
||||
|
||||
vm_vec_crossprod(&uvec,fvec,&rvec);
|
||||
vm_vec_normalize(&uvec);
|
||||
|
||||
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){
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
int oldest = shipp->decals[0].timestamp;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].is_valid != 1){ //use up all the unused decals first
|
||||
return i%MAX_SHIP_DECALS;
|
||||
}
|
||||
}
|
||||
for(i = 1; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].timestamp > oldest){ //then get the oldest one
|
||||
oldest = i;
|
||||
}
|
||||
}
|
||||
return oldest%MAX_SHIP_DECALS;
|
||||
}
|
||||
|
||||
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return 0;
|
||||
}
|
||||
// vertex vert[1][2];
|
||||
// vector vec[4];
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 10;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
|
||||
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
|
||||
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
mprintf(("\n"));
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *dec = shipp->decals;
|
||||
|
||||
vm_vec_scale_add( &dec[0].vert[0], ¢er, &plain_point[0], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[1], ¢er, &plain_point[2], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[2], ¢er, &plain_point[1], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[3], ¢er, &plain_point[3], rad );
|
||||
|
||||
dec[dinx].poly[0].point[0] = 0;
|
||||
dec[dinx].poly[0].point[1] = 1;
|
||||
dec[dinx].poly[0].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[1].point[0] = 0;
|
||||
dec[dinx].poly[1].point[1] = 3;
|
||||
dec[0].poly[1].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[0].uv[0].u = 0; dec[0].poly[0].uv[0].v = 0;
|
||||
dec[dinx].poly[0].uv[1].u = 0; dec[0].poly[0].uv[1].v = 1;
|
||||
dec[dinx].poly[0].uv[2].u = 1; dec[0].poly[0].uv[2].v = 1;
|
||||
|
||||
dec[dinx].poly[1].uv[0].u = 0; dec[0].poly[1].uv[0].v = 0;
|
||||
dec[dinx].poly[1].uv[1].u = 1; dec[0].poly[1].uv[1].v = 0;
|
||||
dec[dinx].poly[1].uv[2].u = 1; dec[0].poly[1].uv[2].v = 1;
|
||||
|
||||
dec[dinx].texture = texture;
|
||||
dec[dinx].n_poly = 2;
|
||||
dec[dinx].is_valid = 1;
|
||||
dec[dinx].timestamp = timestamp();
|
||||
|
||||
mprintf(("a decal should have been made at %0.2f %0.2f %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
//Int3();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define duw(p) (*((uint *) (p)))
|
||||
#define dw(p) (*((int *) (p)))
|
||||
#define dwp(p) ((int *) (p))
|
||||
#define dvp(p) ((vector *) (p))
|
||||
#define dfl(p) (*((float *) (p)))
|
||||
|
||||
|
||||
//creates a decal, returns decal index on succes, -1 on failure
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture){
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return -1;
|
||||
}
|
||||
if(texture == -1)return -1;
|
||||
if(point->radius <= 0)return -1;
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 1;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
vector cube_point[8];
|
||||
//define the decals dimentions
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
vector topcenter;
|
||||
vector bvec = point->orient.vec.fvec;
|
||||
vm_vec_negate(&bvec);
|
||||
vm_vec_scale_add(&topcenter, ¢er, &bvec, rad);
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
vm_vec_scale_add( &cube_point[i], &topcenter, &plain_point[i], rad );
|
||||
vm_vec_scale_add( &cube_point[i+4], &cube_point[i], &point->orient.vec.fvec, rad*2);
|
||||
}
|
||||
|
||||
float max_rad = vm_vec_dist_quick(¢er, &cube_point[0]); //the cube points are all equidistant, right?
|
||||
min_rad = fl_sqrt((rad * rad)/2); //the cube points are all equidistant, right?
|
||||
mprintf(("decal defined\n"));
|
||||
|
||||
//define the decals dimentions
|
||||
|
||||
//set up the decal model
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *sdec = shipp->decals;
|
||||
|
||||
polymodel *pm = model_get(shipp->modelnum);
|
||||
bsp_info * sm;
|
||||
sm = &pm->submodel[subobject];
|
||||
// decal_model dmod = pm->submodel[subobject].dec_model;// sm->dec_model;
|
||||
// decal_model tdec; //temporary decal model for holding the culled down part of the decal
|
||||
|
||||
//setting up the decal cube
|
||||
vector test_vec, temp1, temp2;
|
||||
for(i = 0; i<8; i++)decal_cube_point[i] = cube_point[i];
|
||||
|
||||
decal_orient = point->orient;
|
||||
|
||||
decal_cube_plane[0][0] = cube_point[5];
|
||||
|
||||
temp1 = decal_orient.vec.uvec;
|
||||
temp2 = decal_orient.vec.rvec;
|
||||
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[0][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[1][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[1][1] = test_vec;
|
||||
// mprintf(("plane 1 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][0].xyz.x, decal_cube_plane[1][0].xyz.y, decal_cube_plane[1][0].xyz.z));
|
||||
// mprintf(("plane 1 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][1].xyz.x, decal_cube_plane[1][1].xyz.y, decal_cube_plane[1][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[2][0] = cube_point[5];
|
||||
|
||||
vm_vec_negate(&temp2);
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[2][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 2 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][0].xyz.x, decal_cube_plane[2][0].xyz.y, decal_cube_plane[2][0].xyz.z));
|
||||
// mprintf(("plane 2 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][1].xyz.x, decal_cube_plane[2][1].xyz.y, decal_cube_plane[2][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[3][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[3][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 3 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][0].xyz.x, decal_cube_plane[3][0].xyz.y, decal_cube_plane[3][0].xyz.z));
|
||||
// mprintf(("plane 3 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][1].xyz.x, decal_cube_plane[3][1].xyz.y, decal_cube_plane[3][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
test_vec = decal_orient.vec.fvec;
|
||||
|
||||
decal_cube_plane[4][0] = cube_point[0];
|
||||
|
||||
decal_cube_plane[4][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 4 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][0].xyz.x, decal_cube_plane[4][0].xyz.y, decal_cube_plane[4][0].xyz.z));
|
||||
// mprintf(("plane 4 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][1].xyz.x, decal_cube_plane[4][1].xyz.y, decal_cube_plane[4][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
decal_cube_plane[5][0] = cube_point[5];
|
||||
|
||||
decal_cube_plane[5][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 5 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][0].xyz.x, decal_cube_plane[5][0].xyz.y, decal_cube_plane[5][0].xyz.z));
|
||||
// mprintf(("plane 5 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][1].xyz.x, decal_cube_plane[5][1].xyz.y, decal_cube_plane[5][1].xyz.z));
|
||||
//setting up the decal cube
|
||||
|
||||
mprintf(("cube set up\n"));
|
||||
|
||||
decal_hit_point = point->pnt;
|
||||
decal_hit_radius = max_rad;
|
||||
decal_hit_vect = point->orient.vec.fvec;
|
||||
poly_num = 0;
|
||||
nverts = 0;
|
||||
|
||||
//go and find decals for each submodel
|
||||
// for(int z = 0; z<pm->n_models;z++){
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
mprintf(("decal is number %d\n", dinx));
|
||||
|
||||
sdec[dinx].is_valid = 0;
|
||||
|
||||
new_decal = &shipp->decals[dinx];
|
||||
|
||||
if(backfaced_texture != -1){
|
||||
back_faceing = 1;
|
||||
}else{
|
||||
back_faceing = 0;
|
||||
}
|
||||
decal_create_sub((ubyte *)pm->submodel[subobject].bsp_data);
|
||||
|
||||
mprintf(("deacal defined\n"));
|
||||
|
||||
sdec[dinx].texture = texture;
|
||||
sdec[dinx].backfaced_texture = backfaced_texture;
|
||||
sdec[dinx].is_valid = 1;
|
||||
sdec[dinx].timestamp = timestamp();
|
||||
sdec[dinx].n_poly = poly_num;
|
||||
sdec[dinx].state = 1;
|
||||
sdec[dinx].lifetime = 3000;
|
||||
sdec[dinx].frames = 1;
|
||||
sdec[dinx].importance = 0;
|
||||
sdec[dinx].radius = max_rad;
|
||||
sdec[dinx].position = point->pnt;
|
||||
|
||||
mprintf(("a decal should have been made with %d polys\n",sdec[0].n_poly));
|
||||
|
||||
|
||||
return dinx;
|
||||
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
//decal_model d_model;
|
||||
|
||||
// Point list
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 int n_verts
|
||||
// +12 int n_norms
|
||||
// +16 int offset from start of chunk to vertex data
|
||||
// +20 n_verts*char norm_counts
|
||||
// +offset vertex data. Each vertex n is a point followed by norm_counts[n] normals.
|
||||
void decal_create_defpoints(ubyte * p )
|
||||
{
|
||||
// mprintf(("entering decal decal_create_defpoints\n"));
|
||||
|
||||
|
||||
int n;
|
||||
nverts = dw(p+8);
|
||||
int offset = dw(p+16);
|
||||
|
||||
mprintf(("%d verts\n",nverts));
|
||||
ubyte * normcount = p+20;
|
||||
vector *src = dvp(p+offset);
|
||||
|
||||
Assert( nverts < 1200 );
|
||||
|
||||
|
||||
|
||||
for (n=0; n<nverts; n++ ) {
|
||||
|
||||
|
||||
decal_point_list[n] = src;
|
||||
new_decal->vert[n].xyz = src->xyz;
|
||||
src += normcount[n]+1;
|
||||
// mprintf(("defpoint %d, x %0.2f, y %0.2f, z %0.2f\n",n,d_model.vert[n].xyz.x,d_model.vert[n].xyz.y,d_model.vert[n].xyz.z));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Sortnorms
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector center
|
||||
// +32 float radius
|
||||
// 36 int front offset
|
||||
// 40 int back offset
|
||||
// 44 int prelist offset
|
||||
// 48 int postlist offset
|
||||
// 52 int online offset
|
||||
|
||||
void decal_create_sortnorm(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_sortnorm\n"));
|
||||
int frontlist = dw(p+36);
|
||||
int backlist = dw(p+40);
|
||||
int prelist = dw(p+44);
|
||||
int postlist = dw(p+48);
|
||||
int onlist = dw(p+52);
|
||||
|
||||
vector min, max;
|
||||
min.xyz = dvp(p+56)->xyz;
|
||||
max.xyz = dvp(p+68)->xyz;
|
||||
min.xyz.x += decal_hit_radius;
|
||||
min.xyz.y += decal_hit_radius;
|
||||
min.xyz.z += decal_hit_radius;
|
||||
max.xyz.x += decal_hit_radius;
|
||||
max.xyz.y += decal_hit_radius;
|
||||
max.xyz.z += decal_hit_radius;
|
||||
|
||||
/* 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);
|
||||
if (frontlist) decal_create_sub(p+frontlist);
|
||||
if (postlist) decal_create_sub(p+postlist);
|
||||
}
|
||||
|
||||
/*
|
||||
typedef struct model_tmap_vert {
|
||||
short vertnum;
|
||||
short normnum;
|
||||
float u,v;
|
||||
} model_tmap_vert;
|
||||
*/
|
||||
//int poly_num = 0;
|
||||
// Textured Poly
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector normal_point
|
||||
// +32 int tmp = 0
|
||||
// +36 int nverts
|
||||
// +40 int tmap_num
|
||||
// +44 nverts*(model_tmap_vert) vertlist (n,u,v)
|
||||
void decal_create_tmappoly(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_tmappoly\n"));
|
||||
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int i;
|
||||
int nv;
|
||||
// uv_pair uvlist[TMAP_MAX_VERTS];
|
||||
// vector points[TMAP_MAX_VERTS];
|
||||
model_tmap_vert *verts;
|
||||
|
||||
nv = dw(p+36);
|
||||
if ( nv < 0 ) return;
|
||||
|
||||
// int tmap_num = dw(p+40);
|
||||
/*
|
||||
if ( (!(Mc->flags & MC_CHECK_INVISIBLE_FACES)) && (Mc_pm->textures[tmap_num] < 0) ) {
|
||||
// Don't check invisible polygons.
|
||||
return;
|
||||
}
|
||||
*/
|
||||
verts = (model_tmap_vert *)(p+44);
|
||||
vector temppoly[820];
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
decal_poly[i] = (int)verts[i].vertnum;
|
||||
temppoly[i].xyz = decal_point_list[decal_poly[i]]->xyz;
|
||||
}
|
||||
|
||||
vector pnorm;
|
||||
vm_vec_perp(&pnorm, decal_point_list[decal_poly[0]], decal_point_list[decal_poly[1]], decal_point_list[decal_poly[2]]);
|
||||
|
||||
float back = vm_vec_dot(&decal_cube_plane[4][1], &pnorm);
|
||||
|
||||
if( (back_faceing == 0) && (back >= 0) )return;
|
||||
|
||||
//poly culling
|
||||
vector pcenter;
|
||||
vm_vec_avg_n(&pcenter, nv, temppoly);
|
||||
float pradius = 0;
|
||||
float dist = 0;
|
||||
for (i=0;i<nv;i++) {
|
||||
dist = vm_vec_dist(decal_point_list[decal_poly[i]], &pcenter);
|
||||
if(dist>pradius){
|
||||
pradius = dist;
|
||||
}
|
||||
}
|
||||
|
||||
//if it's too far to posably get near the cube get out
|
||||
if(vm_vec_dist_quick(&pcenter, &decal_hit_point) >= (pradius + decal_hit_radius)){
|
||||
// mprintf(("leaveing becase poly is too far away\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
//this is for faster testing, I'm not sure if it's realy makeing it faster or not
|
||||
int k;
|
||||
for(k = 0; k<6; k++){
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//poly culling
|
||||
int temp_poly[820];
|
||||
|
||||
int skip = 0, numv = 0, valid = 0;
|
||||
|
||||
// mprintf(("starting to test the poly, with %d verts in it\n",nv));
|
||||
for(k = 0; k<6; k++){
|
||||
//find the first point in front of the plain
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
// mprintf(("testing point %d with plane %d\n", i, k));
|
||||
// mprintf(("point's position is x %0.2f y %0.2f z %0.2f\n", decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z));
|
||||
// mprintf(("plane's position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][0].xyz.x, decal_cube_plane[k][0].xyz.y, decal_cube_plane[k][0].xyz.z));
|
||||
// mprintf(("plane's normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][1].xyz.x, decal_cube_plane[k][1].xyz.y, decal_cube_plane[k][1].xyz.z));
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
// mprintf(("%d is the first good point\n", i));
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}else{
|
||||
valid = 1;
|
||||
}
|
||||
|
||||
//first point in front of the plane is good of corse
|
||||
// temp_poly[0] = decal_poly[(first_good + nv)%nv];
|
||||
numv = 0;
|
||||
//go through each point and see if there is an intersection between it the next point and the current plane
|
||||
//if there is then make the intersection point the next point in the poly
|
||||
//ignor all points untill there is another intersection
|
||||
//other wise make the next point the next point in the poly
|
||||
// if(k==1)Int3();
|
||||
int is_infront = 1, is_infront2 = 1;
|
||||
for(i = first_good; i < (nv + first_good); i++){
|
||||
// mprintf(("looking for intersections between point %d and point %d, with plane %d\n", i%nv, (i + 1)%nv, k));
|
||||
// mprintf((" point %d, is at, x %0.2f y %0.2f z %0.2f and point %d, is at, x %0.2f y %0.2f z %0.2f\n", i%nv, decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z, (i + 1)%nv, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.x, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.y, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.z));
|
||||
is_infront2 = is_infront;
|
||||
float is_in = fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[(i + 1)%nv]]);
|
||||
if(is_in > 0){
|
||||
is_infront = 1;
|
||||
}else{
|
||||
is_infront= 0;
|
||||
}
|
||||
if(is_infront != is_infront2){
|
||||
if(fvi_segment_plane(&new_decal->vert[nverts], &decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i%nv]], decal_point_list[decal_poly[(i + 1)%nv]], 0)){
|
||||
// mprintf(("segment %d %d has an an itersection\n", i%nv, (i + 1)%nv));
|
||||
decal_point_list[nverts] = &new_decal->vert[nverts];
|
||||
// mprintf(("new decal defpoint has been added as number %d at x %0.2f y %0.2f z %0.2f\n",nverts, new_decal->vert[nverts].xyz.x, new_decal->vert[nverts].xyz.y, new_decal->vert[nverts].xyz.z));
|
||||
temp_poly[numv] = nverts++;
|
||||
// mprintf(("temp_poly point %d, should have been set to defpoint %d, it was set to %d\n",numv, nverts-1, temp_poly[numv]));
|
||||
skip = (skip+1)%2;
|
||||
// mprintf(("skip has been set to %d\n",skip));
|
||||
numv++;
|
||||
if((skip == 0)){
|
||||
// mprintf(("adding point, becase it is after an intersection point\n", (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}
|
||||
}else{
|
||||
// mprintf(("there sould have been an intersection but there wasnt"));
|
||||
}
|
||||
|
||||
}else{
|
||||
if((skip == 0)){//don't copy the first point
|
||||
// mprintf(("segment %d %d has no itersection, copying\n", i%nv, (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}else{
|
||||
// mprintf(("skipping segment %d %d becase it isn't in front of the plane\n", i%nv, (i + 1)%nv));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mprintf(("temp poly has %d points\n", numv));
|
||||
for(int h = 0; h < numv; h++){
|
||||
decal_poly[h] = temp_poly[h];
|
||||
mprintf(("seting decal_poly point %d to %d\n",h,temp_poly[h]));
|
||||
}
|
||||
nv = numv;
|
||||
numv=0;
|
||||
// mprintf(("decal_poly now has has %d points\n", nv));
|
||||
if(nv < 3)return; //if at any time we get fewer than three points this poly is dead
|
||||
}
|
||||
|
||||
|
||||
// mprintf(("copying the poly to the decal\n"));
|
||||
//copy a triangulated version of the poly to the new decal
|
||||
if((valid == 1) && (nv > 2)){
|
||||
/* for (i=1;i<(nv-1);i++) {
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[0] = decal_poly[0];
|
||||
new_decal->poly[poly_num].point[1] = decal_poly[i];
|
||||
new_decal->poly[poly_num].point[2] = decal_poly[i+1];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
for (k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
}
|
||||
// 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"));
|
||||
return;
|
||||
}
|
||||
if(i >= MAX_DECAL_POLY_POINT){
|
||||
mprintf(("bugging out becase there are too many points in the poly\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[i] = decal_poly[i];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[i].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[i].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
// 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++;
|
||||
}else{
|
||||
// mprintf(("no poly, all points are out side of planes"));
|
||||
}
|
||||
mprintf(("there are now %d polys in the current decal\n", poly_num));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int decal_create_sub(void *model_ptr )
|
||||
{
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
// mprintf(("entering decal_create_sub\n"));
|
||||
|
||||
ubyte *p = (ubyte *)model_ptr;
|
||||
int chunk_type, chunk_size;
|
||||
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
while (chunk_type != DP_EOF) {
|
||||
|
||||
// mprintf(( "Processing chunk type %d, len=%d\n", chunk_type, chunk_size ));
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
switch (chunk_type) {
|
||||
case DP_EOF: return 1;
|
||||
case DP_DEFPOINTS: decal_create_defpoints(p); break;
|
||||
case DP_FLATPOLY: break;// I don't want any of these anyway-Bobboau decal_create_flatpoly(p); break;
|
||||
case DP_TMAPPOLY: decal_create_tmappoly(p); break;
|
||||
case DP_SORTNORM: decal_create_sortnorm(p); break;
|
||||
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 ));
|
||||
Int3(); // Bad chunk type!
|
||||
return 0;
|
||||
}
|
||||
// mprintf(( "current chunk offset %d\n", (int)p ));
|
||||
|
||||
p += chunk_size;
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int decal_make_model(polymodel * pm){
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
void decal_render_all(object * obj){
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
}
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
g3_rotate_vertex(&vecs[j], &dec->vert[dec->poly[i].point[j]]);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT );
|
||||
gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void decal_render_all(object * obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
polymodel *pm = model_get( shipp->modelnum );
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
// vector g_pos;
|
||||
// vm_vec_add(&g_pos, &dec->position, &obj->pos);
|
||||
float dist = vm_vec_dist(&dec->position, &View_position);
|
||||
if(dist < (dec->radius*10)){
|
||||
mprintf(("decal %d too far away to be drawn %0.2f\n", h, dist));
|
||||
// HUD_printf("decal %d too far away to be drawn %0.2f\n", h, dist);
|
||||
continue;
|
||||
}
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
// if((pm->submodel[dec->submodel_parent].blown_off != 0) && (dec->submodel_parent > 0))continue;
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
vector pnt = dec->vert[dec->poly[i].point[j]];
|
||||
if(dec->submodel_parent != pm->detail[0]){
|
||||
matrix m;
|
||||
angles angs = pm->submodel[dec->submodel_parent].angs;
|
||||
angs.b = PI2 - angs.b;
|
||||
angs.p = PI2 - angs.p;
|
||||
angs.h = PI2 - angs.h;
|
||||
mprintf(("decal is child of a submodel, who's angles are b %0.2f p %0.2f h %0.2f, it should be rotateing with it\n", angs.b, angs.p, angs.h));
|
||||
|
||||
vector offset = pm->submodel[dec->submodel_parent].offset;
|
||||
vm_angles_2_matrix(&m, &angs);
|
||||
|
||||
vector p = pnt;
|
||||
vm_vec_rotate(&pnt, &p, &m);
|
||||
|
||||
vm_vec_add2(&pnt, &offset);
|
||||
}
|
||||
|
||||
g3_rotate_vertex(&vecs[j], &pnt);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
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;
|
||||
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture > -1)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->backfaced_texture));
|
||||
}else{
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
}
|
||||
|
||||
// gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD );
|
||||
// gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//header file for makeing decals-Bobboau
|
||||
|
||||
#ifndef _DECAL_H
|
||||
#define _DECAL_H
|
||||
|
||||
#define MAX_DECAL_POLY 20
|
||||
#define MAX_DECAL_POLY_POINT 10
|
||||
#define MAX_DECAL_DEFPOINTS 1000
|
||||
#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
|
||||
#define DP_FLATPOLY 2
|
||||
#define DP_TMAPPOLY 3
|
||||
#define DP_SORTNORM 4
|
||||
#define DP_BOUNDBOX 5
|
||||
|
||||
typedef struct decal_model{ //this will store a triangulated version of the ships polygons
|
||||
struct{
|
||||
int point[3]; //an index to the vert list-Bobboau
|
||||
vector center; //the center of the poly
|
||||
float radius; //the max radius of the poly
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector vert[MAX_DECAL_DEFPOINTS]; //the defpoints-Bobboau
|
||||
int n_polys;
|
||||
}decal_model;
|
||||
|
||||
//extern decal_model d_model;
|
||||
|
||||
typedef struct decal{
|
||||
struct{
|
||||
int backfaced; //flag that this poly uses the backfaced texture
|
||||
uv_pair uv[MAX_DECAL_POLY_POINT]; //uv coordanants
|
||||
int point[MAX_DECAL_POLY_POINT]; //an index to the vert list-Bobboau
|
||||
int n_poly;
|
||||
vector norm; //the normal used for lighting
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector position;
|
||||
float radius;
|
||||
int submodel_parent; //the submodel this is part of
|
||||
vector vert[1000]; //the defpoints-Bobboau
|
||||
int frames; //number of frames in an animation
|
||||
int fps; //frames per second
|
||||
int starting_keyframe; //the frame that indicates the end of the inital nonlooped portion and the start of the middle looped part
|
||||
int ending_keyframe; //the frame that indicates the end of the loopable portion and the start of the end part
|
||||
int texture; //the texture to be used, first in animation
|
||||
int backfaced_texture; //the texture to be used by backfaced polys, first in animation
|
||||
int is_valid; //this means it is a good decal that should be rendered-Bobboau
|
||||
int n_poly; //the number of polys
|
||||
int timestamp; //this is when the decal was made-Bobboau
|
||||
int lifetime; //this is how long the decal should be alive for-Bobboau
|
||||
int importance; //this is for big things large beam marks and bomb craters should last longer than the odd laser impacts-Bobboau
|
||||
int state; //1 starting, 2 looping(mostly for beams), 3 ending, 4 static
|
||||
}decal;
|
||||
|
||||
typedef struct decal_point{
|
||||
vector pnt;
|
||||
matrix orient;
|
||||
float radius;
|
||||
}decal_point;
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1);//makes the decal
|
||||
|
||||
#endif
|
||||
|
||||
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
|
||||
|
||||
void decal_render_all(object * obj); //renders all decals
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture);//makes the decal
|
||||
|
||||
int decal_create_sub(void *model_ptr);
|
||||
|
||||
/*
|
||||
|
||||
int decal_is_in_face(int n, vertex vertlist[n]);//sees if a poly is inside a decal: 0 is yes, 1 is sort of, -1 is no
|
||||
*/
|
||||
Binary file not shown.
@@ -0,0 +1,236 @@
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
const int KEYBOARD_SAMPLE_FREQ = 200; // Sample user input on an interval
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IMediaEvent *pME = NULL;
|
||||
|
||||
//
|
||||
// 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)
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
void dx8show_set_hwnd(void *hwnd)
|
||||
{
|
||||
internal_hwnd = (HWND) hwnd;
|
||||
}
|
||||
|
||||
bool dx8show_play_cutscene(char *movie_file)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Get DirectShow interfaces
|
||||
RUN_FUNCTION_ROF(get_interfaces());
|
||||
|
||||
if(internal_hwnd == NULL)
|
||||
{
|
||||
internal_hwnd = (HWND) os_get_window();
|
||||
}
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OATRUE));
|
||||
RUN_FUNCTION(pVW->put_Owner((OAHWND) internal_hwnd));
|
||||
#endif
|
||||
|
||||
// Play the movie / cutscene
|
||||
play_media(movie_file);
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OAFALSE));
|
||||
RUN_FUNCTION(pVW->put_Owner(NULL));
|
||||
#endif
|
||||
|
||||
// Release DirectShow interfaces
|
||||
cleanup_interfaces();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT get_interfaces(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
// 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));
|
||||
|
||||
// Get interface to allow the app to wait for completion of playback
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
void cleanup_interfaces(void)
|
||||
{
|
||||
// Release the DirectShow interfaces
|
||||
RELEASE(pMC);
|
||||
RELEASE(pVW);
|
||||
RELEASE(pME);
|
||||
RELEASE(pGB);
|
||||
}
|
||||
|
||||
bool play_media(LPTSTR movie_filename)
|
||||
{
|
||||
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
|
||||
|
||||
// Allow DirectShow to create the FilterGraph for this media file
|
||||
RUN_FUNCTION_ROF(pGB->RenderFile(file_name, NULL));
|
||||
|
||||
// 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(set_fullscreen() == false)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
bool set_fullscreen(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
LONG mode;
|
||||
HWND drain=0;
|
||||
|
||||
if (!pVW)
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
// Read current state
|
||||
RUN_FUNCTION_ROF(pVW->get_FullScreenMode(&mode));
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool dx8show_play_cutscene(char *filename);
|
||||
void dx8show_set_hwnd(void *hwnd);
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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,
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-02 05:10:42 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -139,7 +142,9 @@ static void PrintTime(char *output, FILETIME TimeToPrint)
|
||||
static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
|
||||
{
|
||||
char ModName[MAX_PATH];
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
if (GetModuleFileName(ModuleHandle, ModName, sizeof(ModName)) > 0) {
|
||||
// If GetModuleFileName returns greater than zero then this must
|
||||
// be a valid code module address. Therefore we can try to walk
|
||||
@@ -174,11 +179,13 @@ static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
|
||||
ModName, ModuleHandle, FileSize,
|
||||
NTHeader->FileHeader.TimeDateStamp, TimeBuffer);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
// Handle any exceptions by continuing from this point.
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Scan memory looking for code modules (DLLs or EXEs). VirtualQuery is used
|
||||
@@ -436,15 +443,19 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
// exception handler will print '??'.
|
||||
unsigned char *code = (unsigned char*)Context->Eip;
|
||||
for (int codebyte = 0; codebyte < NumCodeBytes; codebyte++) {
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
hprintf(LogFile, "%02x ", code[codebyte]);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "?? ");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Time to print part or all of the stack to the error log. This allows
|
||||
// us to figure out the call stack, parameters, local variables, etc.
|
||||
hprintf(LogFile, "\r\n"
|
||||
@@ -500,6 +511,7 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "Exception encountered during stack dump.\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
RecordModuleList(LogFile);
|
||||
|
||||
|
||||
@@ -9,13 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2003-03-19 06:23:27 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* 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,7 +136,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
|
||||
@@ -343,38 +361,12 @@
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#define WARPHOLE_GROW_TIME (1.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
int wm;
|
||||
|
||||
#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];
|
||||
@@ -407,12 +399,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
|
||||
}
|
||||
@@ -428,10 +424,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;
|
||||
}
|
||||
|
||||
@@ -508,7 +506,9 @@ void fireball_load_data()
|
||||
|
||||
if ( Warp_glow_bitmap == -1 ) {
|
||||
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
|
||||
}
|
||||
}
|
||||
|
||||
// polymodel Warp_pm;
|
||||
|
||||
}
|
||||
|
||||
@@ -537,6 +537,11 @@ void fireball_init()
|
||||
Fireballs[i].objnum = -1;
|
||||
}
|
||||
|
||||
mprintf(("loading warp model"));
|
||||
wm = -1;
|
||||
wm = model_load("warp.pof", 0, NULL, 0);
|
||||
mprintf((" %d\n", wm));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -630,9 +635,10 @@ void fireball_render(object * obj)
|
||||
//rad = (fb->total_time - t )*obj->radius/WARPHOLE_GROW_TIME;
|
||||
}
|
||||
//rad = obj->radius;
|
||||
// obj->alt_rad = rad;
|
||||
|
||||
|
||||
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius );
|
||||
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius, (Fireballs[num].flags & FBF_WARP_FORCE_OLD) );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -977,7 +983,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;
|
||||
@@ -1046,7 +1052,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;
|
||||
|
||||
@@ -5,17 +5,29 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-19 06:23:27 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -175,6 +187,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 );
|
||||
@@ -184,7 +230,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();
|
||||
@@ -203,7 +249,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(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;
|
||||
|
||||
#endif /* _FIREBALLS_H */
|
||||
@@ -7,15 +7,44 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-08-31 06:00:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -135,6 +164,10 @@
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "mission/missionparse.h"
|
||||
|
||||
extern int wm;
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
@@ -164,7 +197,11 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
|
||||
}
|
||||
|
||||
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius )
|
||||
#define wSTUFF_VERTICES() do { verts[0]->u = 0.5f; verts[0]->v = 0.0f; verts[1]->u = 1.0f; verts[1]->v = 0.0f; verts[2]->u = 1.0f; verts[2]->v = 1.0f; verts[3]->u = 0.5f; verts[3]->v = 1.0f; } while(0);
|
||||
#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, int force_old)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -172,7 +209,6 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
|
||||
// gr_zbuffering = 0;
|
||||
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
@@ -180,43 +216,109 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
// Warp_Map = texture_bitmap_num;//sets the warp map, and thus sets the interp flag for this being a warpin effect
|
||||
vector vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
|
||||
if(wm > -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 = radius /20;
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
|
||||
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 );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
gr_set_cull(0);
|
||||
model_render( wm, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
gr_set_cull(1);
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
// Warp_Map = -1;//un sets the warp map
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
model_Interp_scale_x = 1.0f;
|
||||
model_Interp_scale_y = 1.0f;
|
||||
model_Interp_scale_z = 1.0f;
|
||||
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, 0.0f);
|
||||
|
||||
gr_set_cull(0);
|
||||
/*
|
||||
//this is that half done effect that was pissing people off-Bobboau
|
||||
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
|
||||
float angle = ANG_TO_RAD(135.0f);
|
||||
if(life_percent < 0.2f){
|
||||
angle = ANG_TO_RAD(135.0f * (life_percent * 5.0f));
|
||||
}
|
||||
for(int idx=0; idx<1; idx++){
|
||||
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
|
||||
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
|
||||
vector p_temp = *pos;
|
||||
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
|
||||
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
verts[1].u = 0.99f; verts[1].v = 0.01f;
|
||||
verts[2].u = 0.99f; verts[2].v = 0.99f;
|
||||
verts[3].u = 0.01f; verts[3].v = 0.99f;
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
vertex h1[4]; // halves of a beam section
|
||||
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
|
||||
vector top1, bottom1, top2, bottom2;
|
||||
|
||||
for (i=0; i<5; i++ ) {
|
||||
g3_rotate_vertex( &verts[i], &vecs[i] );
|
||||
beam_calc_facing_pts(&top1, &bottom1, &ray_dir, pos, 1.0f, 1.0f);
|
||||
beam_calc_facing_pts(&top2, &bottom2, &ray_dir, &p_temp, 1.0f, 1.0f);
|
||||
|
||||
mprintf(( "top1 %f %f %f, botom1 %f %f %f, \n",top1.xyz.x, top1.xyz.y, top1.xyz.z, bottom1.xyz.x, bottom1.xyz.y, bottom1.xyz.z));
|
||||
mprintf(( "top2 %f %f %f, botom2 %f %f %f, \n",top2.xyz.x, top2.xyz.y, top2.xyz.z, bottom2.xyz.x, bottom2.xyz.y, bottom2.xyz.z));
|
||||
wR_VERTICES(); // rotate and project the vertices
|
||||
wP_VERTICES();
|
||||
wSTUFF_VERTICES(); // stuff the beam with creamy goodness (texture coords)
|
||||
|
||||
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;
|
||||
g3_rotate_vertex( &verts[4], &vecs[4] );
|
||||
|
||||
}else{
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
verts[1].u = 0.99f; verts[1].v = 0.01f;
|
||||
verts[2].u = 0.99f; verts[2].v = 0.99f;
|
||||
verts[3].u = 0.01f; verts[3].v = 0.99f;
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
|
||||
for (i=0; i<5; i++ ) {
|
||||
g3_rotate_vertex( &verts[i], &vecs[i] );
|
||||
}
|
||||
|
||||
draw_face( &verts[0], &verts[4], &verts[1] );
|
||||
draw_face( &verts[1], &verts[4], &verts[2] );
|
||||
draw_face( &verts[4], &verts[3], &verts[2] );
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
}
|
||||
|
||||
draw_face( &verts[0], &verts[4], &verts[1] );
|
||||
draw_face( &verts[1], &verts[4], &verts[2] );
|
||||
draw_face( &verts[4], &verts[3], &verts[2] );
|
||||
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 );
|
||||
|
||||
@@ -265,9 +367,3 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
gr_zbuffer_set( saved_gr_zbuffering );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "freespaceresource.h"
|
||||
#include "FreespaceResource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#define IDB_GOAL_FAIL 122
|
||||
#define IDI_APP_ICON 124
|
||||
#define IDD_GEN 127
|
||||
#define IDD_RT_VSELECT 128
|
||||
#define IDC_LIST_DEBUG 1000
|
||||
#define IDC_DEBUG_TEXT1 1001
|
||||
#define IDC_DEBUG_TEXT2 1002
|
||||
@@ -73,6 +74,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 +91,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 129
|
||||
#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,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:02 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Module for displaying in-game help
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -134,6 +143,7 @@
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
// text positioning constats
|
||||
#define TITLE_Y 35
|
||||
|
||||
@@ -9,13 +9,28 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2003-08-25 04:46:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -172,6 +187,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;
|
||||
@@ -204,8 +220,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
|
||||
};
|
||||
|
||||
@@ -222,8 +240,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
|
||||
};
|
||||
|
||||
@@ -239,8 +259,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] =
|
||||
@@ -256,7 +278,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)
|
||||
};
|
||||
|
||||
|
||||
@@ -275,7 +299,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
|
||||
};
|
||||
|
||||
|
||||
@@ -297,6 +323,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()
|
||||
//
|
||||
@@ -353,8 +415,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;
|
||||
@@ -364,8 +429,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;
|
||||
}
|
||||
@@ -373,6 +438,9 @@ void event_music_force_switch()
|
||||
}
|
||||
}
|
||||
|
||||
// set up switching
|
||||
new_pattern = maybe_cycle_nrml(new_pattern);
|
||||
|
||||
if ( new_pattern == -1 ) {
|
||||
return;
|
||||
}
|
||||
@@ -386,6 +454,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;
|
||||
}
|
||||
|
||||
@@ -467,7 +537,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) {
|
||||
@@ -516,6 +586,7 @@ void event_music_level_init(int force_soundtrack)
|
||||
return;
|
||||
|
||||
Current_pattern = -1;
|
||||
Current_nrml = SONG_NRML_1;
|
||||
|
||||
if ( Event_music_inited == FALSE )
|
||||
return;
|
||||
@@ -731,7 +802,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 )
|
||||
@@ -749,8 +820,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;
|
||||
}
|
||||
@@ -821,7 +892,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 )
|
||||
@@ -838,16 +909,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 is greater than 6 (all the FS2 tracks are 0-6)
|
||||
|
||||
// don't overlay
|
||||
if (Current_soundtrack_num > 6) {
|
||||
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);
|
||||
@@ -1038,10 +1114,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;
|
||||
|
||||
// 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();
|
||||
@@ -1146,7 +1232,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 ) {
|
||||
@@ -1240,11 +1326,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;
|
||||
@@ -1415,6 +1505,30 @@ int event_music_next_soundtrack(int delta)
|
||||
return Current_soundtrack_num;
|
||||
}
|
||||
|
||||
// Goober5000 - along the same lines; this is for the sexp
|
||||
void event_sexp_change_soundtrack(char *name)
|
||||
{
|
||||
Assert(name);
|
||||
|
||||
int i, new_soundtrack = -1;
|
||||
|
||||
if ( Event_music_enabled == FALSE || Event_music_level_inited == FALSE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<Num_soundtracks; i++)
|
||||
{
|
||||
if (!stricmp(name, Soundtracks[i].name))
|
||||
{
|
||||
new_soundtrack = i;
|
||||
}
|
||||
}
|
||||
|
||||
event_music_level_close();
|
||||
event_music_level_init(new_soundtrack);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// event_music_get_soundtrack_name()
|
||||
//
|
||||
|
||||
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2003-08-25 04:46:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -143,8 +159,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
|
||||
@@ -173,7 +191,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;
|
||||
@@ -185,13 +203,17 @@ typedef struct tagSOUNDTRACK_INFO {
|
||||
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
|
||||
} SOUNDTRACK_INFO;
|
||||
|
||||
#define MAX_SOUNDTRACKS 10
|
||||
#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);
|
||||
@@ -217,6 +239,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_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);
|
||||
@@ -227,6 +250,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,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-20 22:58:43 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -93,7 +103,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
|
||||
@@ -530,6 +540,10 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
// copilot
|
||||
#define SND_COPILOT 162
|
||||
|
||||
// added for ballistic primaries - Goober5000
|
||||
#define SND_BALLISTIC_START_LOAD 171
|
||||
#define SND_BALLISTIC_LOAD 172
|
||||
|
||||
// supernova 1 and supernova 2
|
||||
#define SND_SUPERNOVA_1 173
|
||||
#define SND_SUPERNOVA_2 174
|
||||
@@ -538,7 +552,6 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
#define SND_LIGHTNING_1 180
|
||||
#define SND_LIGHTNING_2 181
|
||||
|
||||
|
||||
//---------------------------------------------------
|
||||
// Interface sounds
|
||||
//---------------------------------------------------
|
||||
|
||||
@@ -62,6 +62,9 @@ typedef struct { float r, g, b, a; } FxColor4;
|
||||
#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
|
||||
|
||||
@@ -9,13 +9,71 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2003-08-16 03:52:23 $
|
||||
* $Author: bobboau $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2003-08-16 03:52:23 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Header file containg global typedefs, constants and macros
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.6 2002/12/02 23:56:12 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/22 01:04:37 penguin
|
||||
* took out GAME_CD_CHECK define
|
||||
*
|
||||
@@ -269,7 +327,7 @@ typedef unsigned int uint;
|
||||
|
||||
//Stucture to store clipping codes in a word
|
||||
typedef struct ccodes {
|
||||
ubyte or,and; //or is low byte, and is high byte
|
||||
ubyte cc_or, cc_and; //or is low byte, and is high byte
|
||||
} ccodes;
|
||||
|
||||
typedef struct vector {
|
||||
@@ -316,27 +374,49 @@ 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;
|
||||
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
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
|
||||
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
|
||||
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
|
||||
#define BMP_TEX_DXT1 (1<<4) // dxt1 compressed 8r8g8b1a (24bit)
|
||||
#define BMP_TEX_DXT3 (1<<5) // dxt3 compressed 8r8g8b4a (32bit)
|
||||
#define BMP_TEX_DXT5 (1<<6) // dxt5 compressed 8r8g8b8a (32bit)
|
||||
|
||||
//compressed texture types
|
||||
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
|
||||
|
||||
//non compressed textures
|
||||
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
|
||||
|
||||
// any texture type
|
||||
#define BMP_TEX_ANY ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
|
||||
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
|
||||
|
||||
// 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
|
||||
@@ -380,12 +460,12 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
|
||||
// or,
|
||||
// Error( LOCATION, "Error opening %s", filename );
|
||||
|
||||
#if defined(NDEBUG)
|
||||
//#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
|
||||
|
||||
//#define Int3() _asm { int 3 }
|
||||
|
||||
@@ -413,8 +493,12 @@ void gr_activate(int);
|
||||
#endif // NDEBUG && DEMO
|
||||
#endif // INTERPLAYQA
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define PI 3.141592654f
|
||||
#define PI2 (3.141592654f*2.0f) // PI*2
|
||||
@@ -494,7 +578,7 @@ extern float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is th
|
||||
void dc_printf( char *format, ... );
|
||||
|
||||
// Each dc_arg_type can have one or more of these flags set.
|
||||
// This is because some things can fit into two catagories.
|
||||
// This is because some things can fit into two categories.
|
||||
// Like 1 can be an integer, a float, a string, or a true boolean
|
||||
// value.
|
||||
#define ARG_NONE (1<<0) // no argument
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-11-22 20:56:15 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Variables and constants common to FreeSpace and Fred.
|
||||
*
|
||||
* $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
|
||||
*
|
||||
@@ -233,7 +236,9 @@ int Fred_found_unknown_ship_during_parsing = 0;
|
||||
|
||||
// If true, then we are using Direct3D hardware. This is used for game type stuff
|
||||
// that changes when you're using hardware.
|
||||
int D3D_enabled = 0;
|
||||
int D3D_enabled = 0;
|
||||
|
||||
int OGL_inited=0;
|
||||
|
||||
// Values used for noise for thruster animations
|
||||
float Noise[NOISE_NUM_FRAMES] = {
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-10-05 16:46:09 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* Variables and constants common to FreeSpace and Fred.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/15 04:41:17 penguin
|
||||
* Added #include, needed for FRED
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -192,6 +198,7 @@
|
||||
#ifndef _SYSTEMVARS_H
|
||||
#define _SYSTEMVARS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "math.h"
|
||||
|
||||
#define GM_MULTIPLAYER (1 << 0)
|
||||
@@ -346,4 +353,10 @@ int current_detail_level();
|
||||
extern int TotalRam;
|
||||
void windebug_memwatch_init();
|
||||
|
||||
enum
|
||||
{
|
||||
TIMERBAR_DEFAULT,
|
||||
TIMERBAR_D3DCODE,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -9,12 +9,32 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-04 05:11:36 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2003-08-30 20:55:09 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2003/02/05 07:04:31 Goober5000
|
||||
* fixed version bumpage... the version is 3.5.0, not 3.50.0 ;)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/01/30 23:24:34 phreak
|
||||
* bumped to 3.50
|
||||
*
|
||||
* Revision 2.4 2002/12/31 20:09:14 Goober5000
|
||||
* bumped to 3.4
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/11/10 20:40:02 inquisitor
|
||||
* Bumped to 3.3
|
||||
*
|
||||
* Revision 2.2 2002/08/13 03:32:25 penguin
|
||||
* Bumped to version 3.2
|
||||
*
|
||||
* Revision 2.1 2002/08/04 05:11:36 penguin
|
||||
* Update version number to 3.1
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -123,8 +143,8 @@
|
||||
// Major.Minor.Bugfix
|
||||
|
||||
#define FS_VERSION_MAJOR 3 // major version
|
||||
#define FS_VERSION_MINOR 1 // increase by 1 for minor revs
|
||||
#define FS_VERSION_BUILD 0 // bugfix release
|
||||
#define FS_VERSION_MINOR 5 // increase by 1 for minor revs
|
||||
#define FS_VERSION_BUILD 5 // bugfix release
|
||||
|
||||
#define VERSION_LOC_FNAME "version.nfo"
|
||||
#define MOTD_LOC_FNAME "motd.txt"
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/WinDebug.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-02 05:30:26 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Debug stuff
|
||||
*
|
||||
* $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
|
||||
*
|
||||
@@ -116,12 +119,26 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
|
||||
//Uncomment SHOW_CALL_STACK to show the call stack in Asserts, Warnings, and Errors
|
||||
#define SHOW_CALL_STACK
|
||||
#endif // _MSC_VER
|
||||
|
||||
|
||||
#ifndef __ASSERT
|
||||
#ifndef _DEBUG
|
||||
#define _ASSERT(expr) ((void)0)
|
||||
#else
|
||||
#define _ASSERT(expr) (assert(expr))
|
||||
// #error _ASSERT is not defined yet for debug mode with non-MSVC compilers
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SHOW_CALL_STACK
|
||||
|
||||
@@ -1006,8 +1023,6 @@ void getmem()
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#include <crtdbg.h>
|
||||
|
||||
int TotalRam = 0;
|
||||
|
||||
#define nNoMansLandSize 4
|
||||
@@ -1030,6 +1045,9 @@ typedef struct _CrtMemBlockHeader
|
||||
|
||||
#define pHdr(pbData) (((_CrtMemBlockHeader *)pbData)-1)
|
||||
|
||||
|
||||
// this block of code is never referenced...
|
||||
#if 0
|
||||
int __cdecl MyAllocHook(
|
||||
int nAllocType,
|
||||
void * pvData,
|
||||
@@ -1067,6 +1085,9 @@ int __cdecl MyAllocHook(
|
||||
|
||||
return( TRUE ); // Allow the memory operation to proceed
|
||||
}
|
||||
#endif // #if 0
|
||||
|
||||
|
||||
|
||||
void windebug_memwatch_init()
|
||||
{
|
||||
@@ -1120,7 +1141,7 @@ void *vm_malloc( int size, char *filename, int line )
|
||||
void *vm_malloc( int size )
|
||||
#endif
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && defined(_MSC_VER)
|
||||
if ( !Heap ) {
|
||||
TotalRam += size;
|
||||
|
||||
@@ -1179,27 +1200,23 @@ void vm_free( void *ptr )
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && defined(_MSC_VER)
|
||||
if ( !Heap ) {
|
||||
#ifndef NDEBUG
|
||||
_CrtMemBlockHeader *phd = pHdr(ptr);
|
||||
int nSize = phd->nDataSize;
|
||||
|
||||
TotalRam -= nSize;
|
||||
#endif
|
||||
|
||||
_free_dbg(ptr,_NORMAL_BLOCK);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
|
||||
if ( Watch_malloc ) {
|
||||
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
|
||||
}
|
||||
TotalRam -= actual_size;
|
||||
#endif
|
||||
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
|
||||
if ( Watch_malloc ) {
|
||||
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
|
||||
}
|
||||
TotalRam -= actual_size;
|
||||
#endif
|
||||
HeapFree( Heap, HEAP_FLAG, ptr );
|
||||
HeapCompact(Heap, HEAP_FLAG);
|
||||
}
|
||||
|
||||
+178
-118
@@ -9,13 +9,53 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/2d.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-03-18 10:07:02 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Main file for 2d primitives.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2003/03/02 05:41:52 penguin
|
||||
* Added some #ifndef NO_SOFTWARE_RENDERING
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.4 2002/11/18 21:32:11 phreak
|
||||
* added some ogl functionality - phreak
|
||||
*
|
||||
* Revision 2.3.2.9 2002/11/09 19:28:15 randomtiger
|
||||
*
|
||||
* Fixed small gfx initialisation bug that wasnt actually causing any problems.
|
||||
* Tided DX code, shifted stuff around, removed some stuff and documented some stuff.
|
||||
*
|
||||
* Revision 2.3.2.8 2002/10/16 00:41:38 randomtiger
|
||||
* Fixed small bug that was stopping unactive text from displaying greyed out
|
||||
* Also added ability to run FS2 DX8 in 640x480, however I needed to make a small change to 2d.cpp
|
||||
* which invloved calling the resolution processing code after initialising the device for D3D only.
|
||||
* This is because D3D8 for the moment has its own internal launcher.
|
||||
* Also I added a fair bit of documentation and tidied some stuff up. - RT
|
||||
*
|
||||
* Revision 2.3.2.7 2002/10/11 18:50:54 randomtiger
|
||||
* Checked in fix for 16 bit problem, thanks to Righteous1
|
||||
* Removed a fair bit of code that was used by the 16 bit code path which no longer exists.
|
||||
* 32 bit and 16 bit should now work in exactly the same way. - RT
|
||||
*
|
||||
* Revision 2.3.2.6 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.3.2.5 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.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/30 14:29:15 unknownplayer
|
||||
*
|
||||
* Started work on DX8.1 implementation. Updated the project files to encompass
|
||||
@@ -464,6 +504,7 @@
|
||||
#include "graphics/grinternal.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
// 3dnow stuff
|
||||
// #include "amd3d.h"
|
||||
@@ -513,9 +554,6 @@ void gr_close()
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_cleanup();
|
||||
@@ -528,6 +566,12 @@ void gr_close()
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_cleanup();
|
||||
@@ -869,68 +913,12 @@ void gr_detect_cpu(int *cpu, int *mmx, int *amd3d, int *katmai )
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
// RT Created because D3D8 resolution is chosen in the D3D init function not from the launcher
|
||||
// Everything but D3D calls this before device initialisation
|
||||
void gr_init_res(int res, int mode, int fred_x, int fred_y)
|
||||
{
|
||||
int first_time = 0;
|
||||
int max_w, max_h;
|
||||
|
||||
gr_detect_cpu(&Gr_cpu, &Gr_mmx, &Gr_amd3d, &Gr_katmai );
|
||||
|
||||
mprintf(( "GR_CPU: Family %d, MMX=%s\n", Gr_cpu, (Gr_mmx?"Yes":"No") ));
|
||||
|
||||
// gr_test();
|
||||
|
||||
if ( !Gr_inited )
|
||||
atexit(gr_close);
|
||||
|
||||
// If already inited, shutdown the previous graphics
|
||||
if ( Gr_inited ) {
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_cleanup();
|
||||
break;
|
||||
case GR_DIRECT3D:
|
||||
#ifdef USE_DX81
|
||||
// TODO: Add Dx8.1 clean up call here - unknownplayer
|
||||
#else
|
||||
gr_d3d_cleanup();
|
||||
#endif // USE_DX81 //
|
||||
break;
|
||||
case GR_GLIDE:
|
||||
gr_glide_cleanup();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_cleanup();
|
||||
break;
|
||||
#endif // USE_OPENGL
|
||||
|
||||
default:
|
||||
Int3(); // Invalid graphics mode
|
||||
}
|
||||
} else {
|
||||
first_time = 1;
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_ONLY) && defined(_WIN32)
|
||||
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
|
||||
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D)){
|
||||
mprintf(("Forcing glide startup!\n"));
|
||||
mode = GR_GLIDE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
D3D_enabled = 0;
|
||||
Gr_inited = 1;
|
||||
|
||||
max_w = -1;
|
||||
max_h = -1;
|
||||
if(!Fred_running && !Pofview_running){
|
||||
@@ -952,15 +940,13 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
} else {
|
||||
max_w = fred_x;
|
||||
max_h = fred_y;
|
||||
|
||||
// Make w a multiple of 8
|
||||
max_w = ( max_w / 8 )*8;
|
||||
if ( max_w < 8 ) max_w = 8;
|
||||
if ( max_h < 8 ) max_h = 8;
|
||||
}
|
||||
|
||||
// Make w a multiple of 8
|
||||
max_w = ( max_w / 8 )*8;
|
||||
if ( max_w < 8 ) max_w = 8;
|
||||
if ( max_h < 8 ) max_h = 8;
|
||||
|
||||
memset( &gr_screen, 0, sizeof(screen) );
|
||||
|
||||
gr_screen.signature = Gr_signature++;
|
||||
gr_screen.mode = mode;
|
||||
gr_screen.res = res;
|
||||
@@ -975,13 +961,75 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
gr_screen.clip_bottom = gr_screen.max_h - 1;
|
||||
gr_screen.clip_width = gr_screen.max_w;
|
||||
gr_screen.clip_height = gr_screen.max_h;
|
||||
}
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
{
|
||||
int first_time = 0;
|
||||
|
||||
gr_detect_cpu(&Gr_cpu, &Gr_mmx, &Gr_amd3d, &Gr_katmai );
|
||||
|
||||
mprintf(( "GR_CPU: Family %d, MMX=%s\n", Gr_cpu, (Gr_mmx?"Yes":"No") ));
|
||||
|
||||
if ( !Gr_inited )
|
||||
atexit(gr_close);
|
||||
|
||||
// If already inited, shutdown the previous graphics
|
||||
if ( Gr_inited ) {
|
||||
DBUGFILE_OUTPUT_0("Shutting dwon previous gfx system");
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
|
||||
gr_soft_init();
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_cleanup();
|
||||
break;
|
||||
case GR_DIRECT3D:
|
||||
gr_d3d_cleanup();
|
||||
break;
|
||||
case GR_GLIDE:
|
||||
gr_glide_cleanup();
|
||||
break;
|
||||
#endif // ifdef _WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_cleanup();
|
||||
break;
|
||||
#endif // USE_OPENGL
|
||||
|
||||
default:
|
||||
Int3(); // Invalid graphics mode
|
||||
}
|
||||
} else {
|
||||
first_time = 1;
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_ONLY) && defined(_WIN32)
|
||||
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
|
||||
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D) && (mode != GR_OPENGL)){
|
||||
mprintf(("Forcing glide startup!\n"));
|
||||
mode = GR_GLIDE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
D3D_enabled = 0;
|
||||
Gr_inited = 1;
|
||||
|
||||
// Moved memset to out here so its not all scrubbed when D3D8 needs to call it again to revise
|
||||
// the mode selection through its own launcher
|
||||
memset( &gr_screen, 0, sizeof(screen) );
|
||||
gr_init_res(res, mode, fred_x, fred_y);
|
||||
|
||||
DBUGFILE_OUTPUT_1("About to init %d", mode);
|
||||
switch( mode ) {
|
||||
#ifdef _WIN32
|
||||
// directdraw, direct3d,
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
@@ -990,9 +1038,6 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
case GR_DIRECT3D:
|
||||
// Check if we want to use the DX8.1 routines - unknownplayer
|
||||
// This is here so we can revert to the old ones if necessary
|
||||
#ifdef USE_DX81
|
||||
// TODO: Insert new initialization for DX8.1 here - unknownplayer
|
||||
#else
|
||||
// we only care about possible 32 bit stuff here
|
||||
Cmdline_force_32bit = 0;
|
||||
if(depth == 32)
|
||||
@@ -1000,16 +1045,12 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
Cmdline_force_32bit = 1;
|
||||
}
|
||||
|
||||
gr_d3d_init();
|
||||
|
||||
// bad startup - stupid D3D
|
||||
extern int D3D_inited;
|
||||
if(!D3D_inited)
|
||||
if(gr_d3d_init() == false)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("Bad startup");
|
||||
Gr_inited = 0;
|
||||
return 1;
|
||||
}
|
||||
#endif // USE_DX81 //
|
||||
break;
|
||||
case GR_GLIDE:
|
||||
// if we're in high-res. force polygon interface
|
||||
@@ -1020,8 +1061,18 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
|
||||
gr_soft_init();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
Gr_bitmap_poly=1;
|
||||
gr_screen.bits_per_pixel=depth;
|
||||
gr_screen.bytes_per_pixel=depth/8;
|
||||
gr_opengl_init();
|
||||
break;
|
||||
#endif // ifdef USE_OPENGL
|
||||
@@ -1063,12 +1114,6 @@ void gr_force_windowed()
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_force_windowed();
|
||||
gr_soft_force_windowed();
|
||||
}
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
{
|
||||
Int3();
|
||||
@@ -1086,8 +1131,19 @@ void gr_force_windowed()
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_force_windowed();
|
||||
gr_soft_force_windowed();
|
||||
}
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
extern void opengl_minimize();
|
||||
opengl_minimize();
|
||||
break;
|
||||
|
||||
#endif // ifdef USE_OPENGL
|
||||
@@ -1107,13 +1163,6 @@ void gr_activate(int active)
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_activate(int active);
|
||||
gr_soft_activate(active);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
{
|
||||
Int3();
|
||||
@@ -1138,8 +1187,20 @@ void gr_activate(int active)
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_activate(int active);
|
||||
gr_soft_activate(active);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
extern void gr_opengl_activate(int active);
|
||||
gr_opengl_activate(active);
|
||||
break;
|
||||
#endif // ifdef USE_OPENGL
|
||||
|
||||
@@ -1203,19 +1264,22 @@ void gr_bitmap(int x, int y)
|
||||
int x_line, y_line;
|
||||
int w, h;
|
||||
|
||||
// d3d and glide support texture poly shiz
|
||||
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE)) && Gr_bitmap_poly){
|
||||
// d3d and glide support texture poly shiz, ogl does too
|
||||
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE) || (gr_screen.mode== GR_OPENGL)) && Gr_bitmap_poly){
|
||||
int idx, s_idx;
|
||||
// float u_scale, v_scale;
|
||||
bitmap_section_info *sections;
|
||||
|
||||
// render all sections
|
||||
bm_get_info(gr_screen.current_bitmap, &w, &h, NULL, NULL, NULL, §ions);
|
||||
|
||||
y_line = 0;
|
||||
section_y = 0;
|
||||
|
||||
for(idx=0; idx<sections->num_y; idx++){
|
||||
x_line = 0;
|
||||
for(s_idx=0; s_idx<sections->num_x; s_idx++){
|
||||
|
||||
// get the section as a texture in vram
|
||||
gr_set_bitmap(gr_screen.current_bitmap, gr_screen.current_alphablend_mode, gr_screen.current_bitblt_mode, gr_screen.current_alpha, s_idx, idx);
|
||||
|
||||
@@ -1223,7 +1287,8 @@ void gr_bitmap(int x, int y)
|
||||
bm_get_section_size(gr_screen.current_bitmap, s_idx, idx, §ion_x, §ion_y);
|
||||
|
||||
// draw as a poly
|
||||
g3_draw_2d_poly_bitmap(x + x_line, y + y_line, section_x, section_y, TMAP_FLAG_BITMAP_SECTION);
|
||||
// RT draws all hall interface stuff
|
||||
g3_draw_2d_poly_bitmap(x + x_line, y + y_line, section_x, section_y, TMAP_FLAG_BITMAP_SECTION);
|
||||
x_line += section_x;
|
||||
}
|
||||
y_line += section_y;
|
||||
@@ -1236,24 +1301,21 @@ void gr_bitmap(int x, int y)
|
||||
// old school bitmaps
|
||||
switch(gr_screen.mode){
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
|
||||
case GR_DIRECT3D:
|
||||
gr_d3d_bitmap(x, y);
|
||||
break;
|
||||
|
||||
case GR_GLIDE:
|
||||
gr_glide_bitmap(x, y);
|
||||
break;
|
||||
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap(x, y);
|
||||
@@ -1267,23 +1329,21 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
{
|
||||
switch(gr_screen.mode){
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
|
||||
case GR_DIRECT3D:
|
||||
gr_d3d_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
|
||||
case GR_GLIDE:
|
||||
gr_glide_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap_ex(x, y, w, h, sx, sy);
|
||||
|
||||
+118
-6
@@ -9,13 +9,55 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/2d.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-07-04 02:27:48 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Header file for 2d primitives.
|
||||
*
|
||||
* $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.5 2002/11/09 19:28:15 randomtiger
|
||||
*
|
||||
* Fixed small gfx initialisation bug that wasnt actually causing any problems.
|
||||
* Tided DX code, shifted stuff around, removed some stuff and documented some stuff.
|
||||
*
|
||||
* Revision 2.1.2.4 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.1.2.3 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.1.2.2 2002/10/16 00:41:38 randomtiger
|
||||
* Fixed small bug that was stopping unactive text from displaying greyed out
|
||||
* Also added ability to run FS2 DX8 in 640x480, however I needed to make a small change to 2d.cpp
|
||||
* which invloved calling the resolution processing code after initialising the device for D3D only.
|
||||
* This is because D3D8 for the moment has its own internal launcher.
|
||||
* Also I added a fair bit of documentation and tidied some stuff up. - RT
|
||||
*
|
||||
* Revision 2.1.2.1 2002/10/11 18:50:54 randomtiger
|
||||
* Checked in fix for 16 bit problem, thanks to Righteous1
|
||||
* Removed a fair bit of code that was used by the 16 bit code path which no longer exists.
|
||||
* 32 bit and 16 bit should now work in exactly the same way. - RT
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -556,6 +598,41 @@ typedef struct screen {
|
||||
|
||||
// set the color to be used when clearing the background
|
||||
void (*gf_set_clear_color)(int r, int g, int b);
|
||||
|
||||
// Here be the bitmap functions
|
||||
void (*gf_bm_set_max_bitmap_size)(int size);
|
||||
int (*gf_bm_get_next_handle)();
|
||||
void (*gf_bm_close)();
|
||||
void (*gf_bm_init)();
|
||||
void (*gf_bm_get_frame_usage)(int *ntotal, int *nnew);
|
||||
int (*gf_bm_create)( int bpp, int w, int h, void * data, int flags = 0);
|
||||
int (*gf_bm_load)( char * real_filename );
|
||||
int (*gf_bm_load_duplicate)(char *filename);
|
||||
int (*gf_bm_load_animation)( char *real_filename, int *nframes, int *fps = NULL, int can_drop_frames = 0);
|
||||
void (*gf_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);
|
||||
bitmap * (*gf_bm_lock)( int handle, ubyte bpp, ubyte flags );
|
||||
void (*gf_bm_unlock)( int handle );
|
||||
void (*gf_bm_get_palette)(int handle, ubyte *pal, char *name);
|
||||
void (*gf_bm_release)(int handle);
|
||||
int (*gf_bm_unload)( int handle );
|
||||
void (*gf_bm_unload_all)();
|
||||
void (*gf_bm_page_in_texture)( int bitmapnum, int nframes = 1);
|
||||
void (*gf_bm_page_in_start)();
|
||||
void (*gf_bm_page_in_stop)();
|
||||
int (*gf_bm_get_cache_slot)( int bitmap_id, int separate_ani_frames );
|
||||
void (*gf_bm_24_to_16)(int bit_24, ushort *bit_16);
|
||||
void (*gf_bm_get_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void (*gf_bm_get_section_size)(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
|
||||
void (*gf_bm_page_in_nondarkening_texture)( int bitmapnum, int nframes = 1);
|
||||
void (*gf_bm_page_in_xparent_texture)( int bitmapnum, int nframes = 1);
|
||||
void (*gf_bm_page_in_aabitmap)( int bitmapnum, int nframes = 1);
|
||||
|
||||
void (*gf_translate_texture_matrix)(int unit, vector *shift);
|
||||
void (*gf_push_texture_matrix)(int unit);
|
||||
void (*gf_pop_texture_matrix)(int unit);
|
||||
|
||||
|
||||
} screen;
|
||||
|
||||
// cpu types
|
||||
@@ -629,6 +706,9 @@ extern int Web_cursor_bitmap;
|
||||
// Called by OS when application gets/looses focus
|
||||
extern void gr_activate(int active);
|
||||
|
||||
// Sets up resolution
|
||||
void gr_init_res(int res, int mode, int fredx = -1, int fredy = -1);
|
||||
|
||||
#define GR_CALL(x) (*x)
|
||||
|
||||
// These macros make the function indirection look like the
|
||||
@@ -654,8 +734,6 @@ extern void gr_activate(int active);
|
||||
#define gr_create_shader GR_CALL(gr_screen.gf_create_shader)
|
||||
#define gr_set_shader GR_CALL(gr_screen.gf_set_shader)
|
||||
#define gr_clear GR_CALL(gr_screen.gf_clear)
|
||||
// #define gr_bitmap GR_CALL(gr_screen.gf_bitmap)
|
||||
// #define gr_bitmap_ex GR_CALL(gr_screen.gf_bitmap_ex)
|
||||
#define gr_aabitmap GR_CALL(gr_screen.gf_aabitmap)
|
||||
#define gr_aabitmap_ex GR_CALL(gr_screen.gf_aabitmap_ex)
|
||||
#define gr_rect GR_CALL(gr_screen.gf_rect)
|
||||
@@ -711,7 +789,41 @@ extern void gr_activate(int active);
|
||||
|
||||
#define gr_set_clear_color GR_CALL(gr_screen.gf_set_clear_color)
|
||||
|
||||
// new bitmap functions
|
||||
#define gr_translate_texture_matrix GR_CALL(gr_screen.gf_translate_texture_matrix)
|
||||
#define gr_push_texture_matrix GR_CALL(gr_screen.gf_push_texture_matrix)
|
||||
#define gr_pop_texture_matrix GR_CALL(gr_screen.gf_pop_texture_matrix)
|
||||
|
||||
|
||||
// Here be the bitmap functions
|
||||
#define bm_set_max_bitmap_size GR_CALL(*gr_screen.gf_bm_set_max_bitmap_size)
|
||||
#define bm_get_next_handle GR_CALL(*gr_screen.gf_bm_get_next_handle)
|
||||
#define bm_close GR_CALL(*gr_screen.gf_bm_close)
|
||||
#define bm_init GR_CALL(*gr_screen.gf_bm_init)
|
||||
#define bm_get_frame_usage GR_CALL(*gr_screen.gf_bm_get_frame_usage)
|
||||
#define bm_create GR_CALL(*gr_screen.gf_bm_create)
|
||||
#define bm_load GR_CALL(*gr_screen.gf_bm_load)
|
||||
#define bm_load_duplicate GR_CALL(*gr_screen.gf_bm_load_duplicate)
|
||||
#define bm_load_animation GR_CALL(*gr_screen.gf_bm_load_animation)
|
||||
#define bm_get_info GR_CALL(*gr_screen.gf_bm_get_info)
|
||||
#define bm_lock GR_CALL(*gr_screen.gf_bm_lock)
|
||||
#define bm_unlock GR_CALL(*gr_screen.gf_bm_unlock)
|
||||
#define bm_get_palette GR_CALL(*gr_screen.gf_bm_get_palette)
|
||||
#define bm_release GR_CALL(*gr_screen.gf_bm_release)
|
||||
#define bm_unload GR_CALL(*gr_screen.gf_bm_unload)
|
||||
#define bm_unload_all GR_CALL(*gr_screen.gf_bm_unload_all)
|
||||
#define bm_page_in_texture GR_CALL(*gr_screen.gf_bm_page_in_texture)
|
||||
#define bm_page_in_start GR_CALL(*gr_screen.gf_bm_page_in_start)
|
||||
#define bm_page_in_stop GR_CALL(*gr_screen.gf_bm_page_in_stop)
|
||||
#define bm_get_cache_slot GR_CALL(*gr_screen.gf_bm_get_cache_slot)
|
||||
#define bm_24_to_16 GR_CALL(*gr_screen.gf_bm_24_to_16)
|
||||
#define bm_get_components GR_CALL(*gr_screen.gf_bm_get_components)
|
||||
#define bm_get_section_size GR_CALL(*gr_screen.gf_bm_get_section_size)
|
||||
|
||||
#define bm_page_in_nondarkening_texture GR_CALL(*gr_screen.gf_bm_page_in_nondarkening_texture)
|
||||
#define bm_page_in_xparent_texture GR_CALL(*gr_screen.gf_bm_page_in_xparent_texture)
|
||||
#define bm_page_in_aabitmap GR_CALL(*gr_screen.gf_bm_page_in_aabitmap)
|
||||
|
||||
// new bitmap functions
|
||||
extern int Gr_bitmap_poly;
|
||||
void gr_bitmap(int x, int y);
|
||||
void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/aaline.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:42:25 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to draw antialiased lines
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -246,11 +249,12 @@ void aaline_init_tables()
|
||||
// less than 1.0 and less total bits are sufficient.
|
||||
// Some of the steps here are not needed. This was originally
|
||||
// written to simulate exact hardware behavior.
|
||||
#if defined( _WIN32 ) && defined( _MSC_VER )
|
||||
#if defined _WIN32
|
||||
long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
{
|
||||
int retval;
|
||||
|
||||
#if defined _MSC_VER
|
||||
_asm {
|
||||
mov edx, oa
|
||||
mov eax, ob
|
||||
@@ -258,11 +262,26 @@ long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
shrd eax,edx,20
|
||||
mov retval, eax
|
||||
}
|
||||
#elif defined __GNUC__
|
||||
asm(
|
||||
"mov %1,%%edx;"
|
||||
"mov %2,%%eax;"
|
||||
"imul %%edx;"
|
||||
"shrd $20,%%eax,%%edx;"
|
||||
"mov %%eax,%0"
|
||||
: "=g" (retval) // outputs
|
||||
: "g" (oa), "g" (ob) // inputs
|
||||
: "eax", "edx" // clobbered registers
|
||||
);
|
||||
#else
|
||||
#error unknown compiler
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
#else
|
||||
#error unknown OS
|
||||
long int fix_xy_mult(long int oa, fix_xy ob);
|
||||
#endif // if defined( _WIN32 ) && defined( _MSC_VER )
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Bitblt.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-18 10:07:02 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Code to do software bitblt type stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -338,9 +347,6 @@ void gr8_bitmap_ex(int x,int y,int w,int h,int sx,int sy)
|
||||
bmp = bm_lock( gr_screen.current_bitmap, 8, 0 );
|
||||
sptr = (ubyte *)( bmp->data + (sy*bmp->w+sx) );
|
||||
|
||||
//mprintf(( "x=%d, y=%d, w=%d, h=%d\n", x, y, w, h ));
|
||||
//mprintf(( "sx=%d, sy=%d, bw=%d, bh=%d\n", sx, sy, bmp->w, bmp->h ));
|
||||
|
||||
if ( bmp->flags & BMP_XPARENT ) {
|
||||
for (i=0; i<h; i++ ) {
|
||||
int j;
|
||||
|
||||
@@ -21,126 +21,676 @@
|
||||
##UnknownPlayer##
|
||||
*/
|
||||
|
||||
// Commented out includes are those awaiting rewriting
|
||||
#include <math.h>
|
||||
|
||||
#include "graphics/directx8/grd3d81internal.h" // Updated to point to the correct include file
|
||||
|
||||
#include "graphics/directx8/grd3d81.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "io/key.h"
|
||||
#include "math/floating.h"
|
||||
#include "palman/palman.h"
|
||||
#include "osapi/osregistry.h"
|
||||
#include "grd3d81.h" // Updated to point to the include for this file
|
||||
#include "graphics/line.h"
|
||||
#include "graphics/font.h"
|
||||
#include "graphics/grinternal.h"
|
||||
#include "io/mouse.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
bool D3D8_inited = false;
|
||||
|
||||
void gr_d3d8_init()
|
||||
{
|
||||
|
||||
int depth;
|
||||
// Initialize the D3DRENDER object and InitD3D
|
||||
if (Cmdline_force_32bit)
|
||||
{
|
||||
depth = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
depth = 16;
|
||||
}
|
||||
if (FAILED((D3D8RENDER::Instance())->InitD3D(gr_screen.max_w, gr_screen.max_h, depth ))
|
||||
{
|
||||
D3D8_inited = false;
|
||||
gr_d3d8_cleanup();
|
||||
return;
|
||||
}
|
||||
D3D8_inited = true;
|
||||
(D3D8RENDER::Instance())->AssignFunctions(); // Fill out the gr_screen structure with function pointers
|
||||
}
|
||||
|
||||
void gr_d3d8_cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void gr_d3d8_get_tex_format(int alpha)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void gr_d3d8_bitmap(int x, int y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void gr_d3d8_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int gr_d3d8_create_rendering_objects(int clear)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void gr_d3d8_release_rendering_objects()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void gr_d3d8_set_initial_render_state()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
char* d3d8_error_string(HRESULT error)
|
||||
{
|
||||
switch(error)
|
||||
if (!D3D8_inited)
|
||||
{
|
||||
case D3DERR_BADMAJORVERSION:
|
||||
return "D3DERR_BADMAJORVERSION\0";
|
||||
case D3DERR_BADMINORVERSION:
|
||||
return "D3DERR_BADMINORVERSION\0";
|
||||
case D3DERR_EXECUTE_LOCKED:
|
||||
return "D3DERR_EXECUTE_LOCKED\0";
|
||||
case D3DERR_EXECUTE_NOT_LOCKED:
|
||||
return "D3DERR_EXECUTE_NOT_LOCKED\0";
|
||||
case D3DERR_EXECUTE_CREATE_FAILED:
|
||||
return "D3DERR_EXECUTE_CREATE_FAILED\0";
|
||||
case D3DERR_EXECUTE_DESTROY_FAILED:
|
||||
return "D3DERR_EXECUTE_DESTROY_FAILED\0";
|
||||
case D3DERR_EXECUTE_LOCK_FAILED:
|
||||
return "D3DERR_EXECUTE_LOCK_FAILED\0";
|
||||
case D3DERR_EXECUTE_UNLOCK_FAILED:
|
||||
return "D3DERR_EXECUTE_UNLOCK_FAILED\0";
|
||||
case D3DERR_EXECUTE_FAILED:
|
||||
return "D3DERR_EXECUTE_FAILED\0";
|
||||
case D3DERR_EXECUTE_CLIPPED_FAILED:
|
||||
return "D3DERR_EXECUTE_CLIPPED_FAILED\0";
|
||||
case D3DERR_TEXTURE_NO_SUPPORT:
|
||||
return "D3DERR_TEXTURE_NO_SUPPORT\0";
|
||||
case D3DERR_TEXTURE_NOT_LOCKED:
|
||||
return "D3DERR_TEXTURE_NOT_LOCKED\0";
|
||||
case D3DERR_TEXTURE_LOCKED:
|
||||
return "D3DERR_TEXTURELOCKED\0";
|
||||
case D3DERR_TEXTURE_CREATE_FAILED:
|
||||
return "D3DERR_TEXTURE_CREATE_FAILED\0";
|
||||
case D3DERR_TEXTURE_DESTROY_FAILED:
|
||||
return "D3DERR_TEXTURE_DESTROY_FAILED\0";
|
||||
case D3DERR_TEXTURE_LOCK_FAILED:
|
||||
return "D3DERR_TEXTURE_LOCK_FAILED\0";
|
||||
case D3DERR_TEXTURE_UNLOCK_FAILED:
|
||||
return "D3DERR_TEXTURE_UNLOCK_FAILED\0";
|
||||
case D3DERR_TEXTURE_LOAD_FAILED:
|
||||
return "D3DERR_TEXTURE_LOAD_FAILED\0";
|
||||
case D3DERR_MATRIX_CREATE_FAILED:
|
||||
return "D3DERR_MATRIX_CREATE_FAILED\0";
|
||||
case D3DERR_MATRIX_DESTROY_FAILED:
|
||||
return "D3DERR_MATRIX_DESTROY_FAILED\0";
|
||||
case D3DERR_MATRIX_SETDATA_FAILED:
|
||||
return "D3DERR_MATRIX_SETDATA_FAILED\0";
|
||||
case D3DERR_SETVIEWPORTDATA_FAILED:
|
||||
return "D3DERR_SETVIEWPORTDATA_FAILED\0";
|
||||
case D3DERR_MATERIAL_CREATE_FAILED:
|
||||
return "D3DERR_MATERIAL_CREATE_FAILED\0";
|
||||
case D3DERR_MATERIAL_DESTROY_FAILED:
|
||||
return "D3DERR_MATERIAL_DESTROY_FAILED\0";
|
||||
case D3DERR_MATERIAL_SETDATA_FAILED:
|
||||
return "D3DERR_MATERIAL_SETDATA_FAILED\0";
|
||||
case D3DERR_LIGHT_SET_FAILED:
|
||||
return "D3DERR_LIGHT_SET_FAILED\0";
|
||||
default:
|
||||
return "Unrecognized error value.\0";
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Go ahead and delete the singleton - this must be invoked or we're going to get funkiness
|
||||
D3D8RENDER* prender = (D3D8RENDER::Instance());
|
||||
delete prender;
|
||||
D3D8_inited = false;
|
||||
}
|
||||
|
||||
D3D8RENDER* D3D8RENDER::pInstance = 0; // Initialize pointer
|
||||
D3D8RENDER* D3D8RENDER::Instance()
|
||||
{
|
||||
if (pInstance == 0) // Is this the first call?
|
||||
{
|
||||
pInstance = new D3D8RENDER; // Make a new object then.
|
||||
}
|
||||
return pInstance; // Return a pointer to the object
|
||||
}
|
||||
|
||||
D3D8RENDER::D3D8RENDER()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
D3D8RENDER::~D3D8RENDER()
|
||||
{
|
||||
lpD3DDevice->Release();
|
||||
lpD3D->Release();
|
||||
}
|
||||
|
||||
/*
|
||||
* This function initializes D3D - it is the equivalent of gr_d3d_initdevice
|
||||
* This is the function in which to initialize features of D3D.
|
||||
* For example, if we add an option for anti-aliasing, initialize it here.
|
||||
* I have made some assumptions about what formats freespace expects and
|
||||
* this code will explicitely search for formats with equal pixel allocation
|
||||
*/
|
||||
HRESULT D3D8RENDER::InitD3D(int screenx, int screeny, int depth)
|
||||
{
|
||||
if (D3D8_inited)
|
||||
{
|
||||
return D3D_OK;
|
||||
}
|
||||
HWND hwnd; // Stores the main window handle
|
||||
hwnd = (HWND)os_get_window();
|
||||
|
||||
// Create the D3D8 object
|
||||
if (NULL == (lpD3D = Direct3DCreate8(D3D_SDK_VERSION)))
|
||||
{
|
||||
MessageBox(NULL, "Failed to create a D3D object", "##UnknownPlayer##", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Check for windowed mode
|
||||
if (D3D_window)
|
||||
{
|
||||
// SetWindowPos(hwnd, HWND_TOP, 0, 0, gr_screen.max_w, gr_screen.max_h, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_DRAWFRAME);
|
||||
SetForegroundWindow(hwnd);
|
||||
SetActiveWindow(hwnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLong( hwnd, GWL_EXSTYLE, 0 );
|
||||
SetWindowLong( hwnd, GWL_STYLE, WS_POPUP );
|
||||
ShowWindow(hwnd, SW_SHOWNORMAL );
|
||||
// The next line seems to hang my debugger, so its out for now
|
||||
// SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, gr_screen.max_w, gr_screen.max_h, 0 );
|
||||
SetActiveWindow(hwnd);
|
||||
SetForegroundWindow(hwnd);
|
||||
}
|
||||
|
||||
// Maybe delete this ???
|
||||
D3D_cursor_clip_rect.left = 0;
|
||||
D3D_cursor_clip_rect.top = 0;
|
||||
D3D_cursor_clip_rect.right = gr_screen.max_w-1;
|
||||
D3D_cursor_clip_rect.bottom = gr_screen.max_h-1;
|
||||
|
||||
D3DDISPLAYMODE d3ddm; // D3D display mode structure
|
||||
D3DPRESENT_PARAMETERS d3dpp; // Used to set the way D3D will display what we render
|
||||
ZeroMemory(&d3dpp, sizeof(d3dpp));
|
||||
|
||||
// It's here that we setup what type of display we want using d3dpp
|
||||
if (D3D_window)
|
||||
{
|
||||
// We must grab the current display settings here if we render to a window
|
||||
lpD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);
|
||||
|
||||
d3dpp.Windowed = true;
|
||||
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
d3dpp.hDeviceWindow = hwnd;
|
||||
d3dpp.BackBufferFormat = d3ddm.Format;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: This needs some way of setting the window to be fullscreen I think
|
||||
|
||||
// Here we need to enumerate modes and find a match for the type of mode we want
|
||||
// Currently we look for matches to screenx, screeny, depth and then get the fastest refresh rate
|
||||
uint modecount = lpD3D->GetAdapterModeCount(D3DADAPTER_DEFAULT);
|
||||
uint goodmode = NULL; // Stores the mode we want to use in the end
|
||||
|
||||
if (depth == 32)
|
||||
{
|
||||
// Search for a mode that's above 60hz and 32 bit
|
||||
for (uint i = 0; i < modecount; i++)
|
||||
{
|
||||
lpD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &d3ddm);
|
||||
if ((d3ddm.Height == screeny) && (d3ddm.Width == screenx) && (d3ddm.RefreshRate > 60) && (d3ddm.Format = D3DFMT_A8R8B8G8)
|
||||
{
|
||||
goodmode = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Just try and get a mode then...
|
||||
if (goodmode == NULL)
|
||||
{
|
||||
for (uint i = 0; i < modecount; i++)
|
||||
{
|
||||
lpD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &d3ddm);
|
||||
if ((d3ddm.Height == screeny) && (d3ddm.Width == screenx) && (d3ddm.Format = D3DFMT_A8R8B8G8)
|
||||
{
|
||||
goodmode = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Search for a mode that's above 60hz and 32 bit
|
||||
for (uint i = 0; i < modecount; i++)
|
||||
{
|
||||
lpD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &d3ddm);
|
||||
if ((d3ddm.Height == screeny) && (d3ddm.Width == screenx) && (d3ddm.RefreshRate > 60) && (d3ddm.Format = D3DFMT_A4R4G4B4)
|
||||
{
|
||||
goodmode = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Just try and get a mode then...
|
||||
if (goodmode == NULL)
|
||||
{
|
||||
for (uint i = 0; i < modecount; i++)
|
||||
{
|
||||
lpD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, i, &d3ddm);
|
||||
if ((d3ddm.Height == screeny) && (d3ddm.Width == screenx) && (d3ddm.Format = D3DFMT_A4R4G4B4)
|
||||
{
|
||||
goodmode = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Did we fail to find a mode at all?
|
||||
if (goodmode == NULL)
|
||||
{
|
||||
MessageBox(NULL, "Could not find an appropriate full screen mode!", "Unknown Player", MB_OK);
|
||||
return D3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
// Get the properties of the mode we settled on
|
||||
lpD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, goodmode, &d3ddm);
|
||||
|
||||
// Assign the mode to the properties it should be
|
||||
d3dpp.BackBufferFormat = d3ddm.Format;
|
||||
d3dpp.FullScreen_RefreshRateInHz = d3ddm.RefreshRate;
|
||||
d3dpp.Windowed = false;
|
||||
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
d3dpp.hDeviceWindow = hwnd;
|
||||
}
|
||||
// Let D3D manage the depth and stencil buffers
|
||||
d3dpp.AutoDepthStencilFormat = D3DFMT_16; // 16-bit z-buffer
|
||||
d3dpp.EnableAutoDepthStencil = true;
|
||||
|
||||
// Create the D3D device here
|
||||
lpD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp,
|
||||
&lpD3DDevice);
|
||||
|
||||
lpD3DDevice->GetDeviceCaps(&D3DCaps); // Grab the device capabilities now
|
||||
|
||||
// Viewport Stuff
|
||||
|
||||
// Old Viewport Code
|
||||
/*
|
||||
this sets up W data so the fogging can work
|
||||
extern float z_mult;
|
||||
set_wbuffer_planes(lpD3DDevice, 0.0f, z_mult);
|
||||
|
||||
viewdata.dwSize = sizeof( viewdata );
|
||||
viewdata.dwX = viewdata.dwY = 0;
|
||||
viewdata.dwWidth = gr_screen.max_w;
|
||||
viewdata.dwHeight = gr_screen.max_h;
|
||||
viewdata.dvScaleX = largest_side / 2.0f;
|
||||
viewdata.dvScaleY = largest_side / 2.0f;
|
||||
viewdata.dvMaxX = ( float ) ( viewdata.dwWidth / ( 2.0F * viewdata.dvScaleX ) );
|
||||
viewdata.dvMaxY = ( float ) ( viewdata.dwHeight / ( 2.0F * viewdata.dvScaleY ) );
|
||||
viewdata.dvMinZ = 0.0f;
|
||||
viewdata.dvMaxZ = 1.0f; // choose something appropriate here!
|
||||
*/
|
||||
ZeroMemory(&viewdata, sizeof(viewdata));
|
||||
viewdata.MaxZ = 1.0f;
|
||||
viewdata.MinZ = 0.0f;
|
||||
viewdata.Height = gr_screen.max_h;
|
||||
viewdata.Width = gr_screen.max_w;
|
||||
|
||||
lpD3DDevice->SetViewport(&viewdata);
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
void D3D8RENDER::AssignFunctions()
|
||||
{
|
||||
// All functions here should be encapsulated into the D3D8RENDER class as public
|
||||
// You need these stubs though to access them properly through the normal channels
|
||||
|
||||
Gr_current_red = &Gr_red;
|
||||
Gr_current_blue = &Gr_blue;
|
||||
Gr_current_green = &Gr_green;
|
||||
Gr_current_alpha = &Gr_alpha;
|
||||
|
||||
gr_screen.gf_flip = gr_d3d8e_flip;
|
||||
gr_screen.gf_flip_window = gr_d3d8e_flip_window;
|
||||
gr_screen.gf_set_clip = gr_d3d8e_set_clip;
|
||||
gr_screen.gf_reset_clip = gr_d3d8e_reset_clip;
|
||||
gr_screen.gf_set_font = grx_set_font;
|
||||
|
||||
gr_screen.gf_get_color = gr_d3d8e_get_color;
|
||||
gr_screen.gf_init_color = gr_d3d8e_init_color;
|
||||
gr_screen.gf_set_color_fast = gr_d3d8e_set_color_fast;
|
||||
gr_screen.gf_set_color = gr_d3d8e_set_color;
|
||||
gr_screen.gf_init_color = gr_d3d8e_init_color;
|
||||
gr_screen.gf_init_alphacolor = gr_d3d8e_init_alphacolor;
|
||||
|
||||
gr_screen.gf_set_bitmap = gr_d3d8e_set_bitmap;
|
||||
gr_screen.gf_create_shader = gr_d3d8e_create_shader;
|
||||
gr_screen.gf_set_shader = gr_d3d8e_set_shader;
|
||||
gr_screen.gf_clear = gr_d3d8e_clear;
|
||||
// gr_screen.gf_bitmap = gr_d3d8e_bitmap;
|
||||
// gr_screen.gf_bitmap_ex = gr_d3d8e_bitmap_ex;
|
||||
gr_screen.gf_aabitmap = gr_d3d8e_aabitmap;
|
||||
gr_screen.gf_aabitmap_ex = gr_d3d8e_aabitmap_ex;
|
||||
|
||||
gr_screen.gf_rect = gr_d3d8e_rect;
|
||||
gr_screen.gf_shade = gr_d3d8e_shade;
|
||||
gr_screen.gf_string = gr_d3d8e_string;
|
||||
gr_screen.gf_circle = gr_d3d8e_circle;
|
||||
|
||||
gr_screen.gf_line = gr_d3d8e_line;
|
||||
gr_screen.gf_aaline = gr_d3d8e_aaline;
|
||||
gr_screen.gf_pixel = gr_d3d8e_pixel;
|
||||
gr_screen.gf_scaler = gr_d3d8e_scaler;
|
||||
gr_screen.gf_aascaler = gr_d3d8e_aascaler;
|
||||
gr_screen.gf_tmapper = gr_d3d8e_tmapper;
|
||||
|
||||
gr_screen.gf_gradient = gr_d3d8e_gradient;
|
||||
|
||||
gr_screen.gf_set_palette = gr_d3d8e_set_palette;
|
||||
gr_screen.gf_print_screen = gr_d3d8e_print_screen;
|
||||
|
||||
gr_screen.gf_fade_in = gr_d3d8e_fade_in;
|
||||
gr_screen.gf_fade_out = gr_d3d8e_fade_out;
|
||||
gr_screen.gf_flash = gr_d3d8e_flash;
|
||||
|
||||
gr_screen.gf_zbuffer_get = gr_d3d8e_zbuffer_get;
|
||||
gr_screen.gf_zbuffer_set = gr_d3d8e_zbuffer_set;
|
||||
gr_screen.gf_zbuffer_clear = gr_d3d8e_zbuffer_clear;
|
||||
|
||||
gr_screen.gf_save_screen = gr_d3d8e_save_screen;
|
||||
gr_screen.gf_restore_screen = gr_d3d8e_restore_screen;
|
||||
gr_screen.gf_free_screen = gr_d3d8e_free_screen;
|
||||
|
||||
// Screen dumping stuff
|
||||
gr_screen.gf_dump_frame_start = gr_d3d8e_dump_frame_start;
|
||||
gr_screen.gf_dump_frame_stop = gr_d3d8e_dump_frame_stop;
|
||||
gr_screen.gf_dump_frame = gr_d3d8e_dump_frame;
|
||||
|
||||
gr_screen.gf_set_gamma = gr_d3d8e_set_gamma;
|
||||
|
||||
// Lock/unlock stuff
|
||||
gr_screen.gf_lock = gr_d3d8e_lock;
|
||||
gr_screen.gf_unlock = gr_d3d8e_unlock;
|
||||
|
||||
// screen region
|
||||
gr_screen.gf_get_region = gr_d3d8e_get_region;
|
||||
|
||||
// fog stuff
|
||||
gr_screen.gf_fog_set = gr_d3d8e_fog_set;
|
||||
|
||||
// pixel get
|
||||
gr_screen.gf_get_pixel = gr_d3d8e_get_pixel;
|
||||
|
||||
// poly culling
|
||||
gr_screen.gf_set_cull = gr_d3d8e_set_cull;
|
||||
|
||||
// cross fade
|
||||
gr_screen.gf_cross_fade = gr_d3d8e_cross_fade;
|
||||
|
||||
// filtering
|
||||
gr_screen.gf_filter_set = gr_d3d8e_filter_set;
|
||||
|
||||
// texture cache
|
||||
gr_screen.gf_tcache_set = d3d8e_tcache_set;
|
||||
|
||||
// set clear color
|
||||
gr_screen.gf_set_clear_color = gr_d3d8e_set_clear_color;
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_flash(int r, int g, int b)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_zbuffer_clear(int mode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int D3D8RENDER::gr_d3d8_zbuffer_get()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int D3D8RENDER::gr_d3d8_zbuffer_set(int mode)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_tmapper( int nverts, vertex **verts, uint flags )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_scaler(vertex *va, vertex *vb )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_aascaler(vertex *va, vertex *vb )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_pixel(int x, int y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_clear()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_clip(int x,int y,int w,int h)
|
||||
{
|
||||
|
||||
}
|
||||
void D3D8RENDER::gr_d3d8_reset_clip()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_init_color(color *c, int r, int g, int b)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_color( int r, int g, int b )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_get_color( int * r, int * g, int * b )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_color_fast(color *dst)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx, int sy )
|
||||
{
|
||||
|
||||
}
|
||||
void D3D8RENDER::gr_d3d8_bitmap_ex(int x,int y,int w,int h,int sx,int sy)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_bitmap(int x, int y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_aabitmap_ex(int x,int y,int w,int h,int sx,int sy)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_aabitmap(int x, int y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_rect(int x,int y,int w,int h)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_create_shader(shader * shade, float r, float g, float b, float c )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_shader( shader * shade )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_shade(int x,int y,int w,int h)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_create_font_bitmap()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_char(int x,int y,int letter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_string( int sx, int sy, char *s )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_circle( int xc, int yc, int d )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_line(int x1,int y1,int x2,int y2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_aaline(vertex *v1, vertex *v2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_gradient(int x1,int y1,int x2,int y2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_palette(ubyte *new_palette, int restrict_alphacolor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_diamond(int x, int y, int width, int height)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_print_screen(char *filename)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_tcache_init(int use_sections)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_tcache_cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_tcache_flush()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_tcache_frame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_flush()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int D3D8RENDER::d3d8_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full, int sx, int sy, int force )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void D3D8RENDER::d3d8_dump_frame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_flip()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_flip_cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_flip_window(uint _hdc, int x, int y, int w, int h)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_fade_out(int instantaneous)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_fade_in(int instantaneous)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int D3D8RENDER::gr_d3d8_save_screen()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_restore_screen(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_free_screen(int id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_dump_frame_start(int first_frame, int frames_between_dumps)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_dump_frame_stop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_gamma(float gamma)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
uint D3D8RENDER::gr_d3d8_lock()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_unlock()
|
||||
{/* VOID FUNCTION */}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_get_region(int front, int w, int h, ubyte *data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_get_pixel(int x, int y, int *r, int *g, int *b)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_cull(int cull)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_filter_set(int filter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::gr_d3d8_set_clear_color(int r, int g, int b)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void D3D8RENDER::StartD3D8Frame()
|
||||
{
|
||||
if (!D3D8_inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (in_frame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lpD3DDevice->BeginScene();
|
||||
}
|
||||
|
||||
void D3D8RENDER::EndD3D8Frame()
|
||||
{
|
||||
if (!D3D8_inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!in_frame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lpD3DDevice->EndScene();
|
||||
}
|
||||
@@ -1,27 +1,199 @@
|
||||
/*
|
||||
Main header file for the DX8.1 graphics routines.
|
||||
See the .cpp for more info.
|
||||
This is going to essentially resemble the original [V] one.
|
||||
|
||||
This class is in fact a singleton pattern, but it depends upon being manually destroyed
|
||||
through the destroyer god function. For safety's sake, we need to ensure this isn't invoked
|
||||
before it should be, and is owned before we try to create some other graphics interface.
|
||||
|
||||
As such used gr_d3d8_init() as the first time its called, and gr_d3d8_cleanup to destroy it.
|
||||
|
||||
Access to the class is through Instance() - i.e. (D3D8RENDER::Instance)-><whatever you want>
|
||||
is acceptable to get to it.
|
||||
*/
|
||||
|
||||
#ifndef _GRD3D81_H
|
||||
#define _GRD3D81_H
|
||||
|
||||
void gr_d3d8_init();
|
||||
void gr_d3d8_cleanup();
|
||||
// DX8.1 header files
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
|
||||
// call this to safely fill in the texture shift and scale values for the specified texture type (Gr_t_*)
|
||||
void gr_d3d8_get_tex_format(int alpha);
|
||||
void gr_d3d8_init(); // Creation god function
|
||||
void gr_d3d8_cleanup(); // Destruction god function
|
||||
|
||||
// bitmap functions
|
||||
void gr_d3d8_bitmap(int x, int y);
|
||||
void gr_d3d8_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
|
||||
extern int D3D_window;
|
||||
extern int Cmdline_force_32bit;
|
||||
|
||||
// create all rendering objects (surfaces, d3d device, viewport, etc)
|
||||
int gr_d3d8_create_rendering_objects(int clear);
|
||||
void gr_d3d8_release_rendering_objects();
|
||||
extern color_gun *Gr_current_red, *Gr_current_green, *Gr_current_blue, *Gr_current_alpha;
|
||||
extern color_gun Gr_red, Gr_green, Gr_blue, Gr_alpha;
|
||||
|
||||
extern bool D3D8_init;
|
||||
|
||||
// Officially C++'d!
|
||||
class D3D8RENDER
|
||||
{
|
||||
public:
|
||||
static D3D8RENDER* Instance(); // Accessor Function
|
||||
|
||||
~D3D8RENDER();
|
||||
|
||||
HRESULT InitD3D(int screenx, int screeny, int depth); // Self-explanatory
|
||||
void AssignFunctions(void); // Fill out the gr_screen structure with function pointers
|
||||
void StartD3D8Frame(); // Starts a frame
|
||||
void EndD3D8Frame();
|
||||
|
||||
// Public D3D8 Structures
|
||||
LPDIRECT3D8 lpD3D;
|
||||
LPDIRECT3DDEVICE8 lpD3DDevice;
|
||||
D3DCAPS8 D3DCaps; // Holds info about the D3D device
|
||||
D3DVIEWPORT8 viewdata; // Holds info about the current device viewport
|
||||
|
||||
// gr_screen functions - the way I do this is probably inefficient, but it is consistent
|
||||
// we'll fix it up later
|
||||
void gr_d3d8_flash(int r, int g, int b);
|
||||
void gr_d3d8_zbuffer_clear(int mode);
|
||||
int gr_d3d8_zbuffer_get();
|
||||
int gr_d3d8_zbuffer_set(int mode);
|
||||
void gr_d3d8_tmapper( int nverts, vertex **verts, uint flags );
|
||||
void gr_d3d8_scaler(vertex *va, vertex *vb );
|
||||
void gr_d3d8_aascaler(vertex *va, vertex *vb );
|
||||
void gr_d3d8_pixel(int x, int y);
|
||||
void gr_d3d8_clear();
|
||||
void gr_d3d8_set_clip(int x,int y,int w,int h);
|
||||
void gr_d3d8_reset_clip();
|
||||
void gr_d3d8_init_color(color *c, int r, int g, int b);
|
||||
void gr_d3d8_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type );
|
||||
void gr_d3d8_set_color( int r, int g, int b );
|
||||
void gr_d3d8_get_color( int * r, int * g, int * b );
|
||||
void gr_d3d8_set_color_fast(color *dst);
|
||||
void gr_d3d8_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx=-1, int sy=-1 );
|
||||
void gr_d3d8_bitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d8_bitmap(int x, int y);
|
||||
void gr_d3d8_aabitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d8_aabitmap(int x, int y);
|
||||
void gr_d3d8_rect(int x,int y,int w,int h);
|
||||
void gr_d3d8_create_shader(shader * shade, float r, float g, float b, float c );
|
||||
void gr_d3d8_set_shader( shader * shade );
|
||||
void gr_d3d8_shade(int x,int y,int w,int h);
|
||||
void gr_d3d8_create_font_bitmap();
|
||||
void gr_d3d8_char(int x,int y,int letter);
|
||||
void gr_d3d8_string( int sx, int sy, char *s );
|
||||
void gr_d3d8_circle( int xc, int yc, int d );
|
||||
void gr_d3d8_line(int x1,int y1,int x2,int y2);
|
||||
void gr_d3d8_aaline(vertex *v1, vertex *v2);
|
||||
void gr_d3d8_gradient(int x1,int y1,int x2,int y2);
|
||||
void gr_d3d8_set_palette(ubyte *new_palette, int restrict_alphacolor);
|
||||
void gr_d3d8_diamond(int x, int y, int width, int height);
|
||||
void gr_d3d8_print_screen(char *filename);
|
||||
|
||||
void d3d8_tcache_init(int use_sections);
|
||||
void d3d8_tcache_cleanup();
|
||||
void d3d8_tcache_flush();
|
||||
void d3d8_tcache_frame();
|
||||
void d3d8_flush();
|
||||
int d3d8_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full=0, int sx = -1, int sy = -1, int force = 0);
|
||||
|
||||
void d3d8_dump_frame();
|
||||
void gr_d3d8_flip();
|
||||
void gr_d3d8_flip_cleanup();
|
||||
void gr_d3d8_flip_window(uint _hdc, int x, int y, int w, int h);
|
||||
void gr_d3d8_fade_out(int instantaneous);
|
||||
void gr_d3d8_fade_in(int instantaneous);
|
||||
int gr_d3d8_save_screen();
|
||||
void gr_d3d8_restore_screen(int id);
|
||||
void gr_d3d8_free_screen(int id);
|
||||
void gr_d3d8_dump_frame_start(int first_frame, int frames_between_dumps);
|
||||
void gr_d3d8_dump_frame_stop();
|
||||
void gr_d3d8_set_gamma(float gamma);
|
||||
uint gr_d3d8_lock();
|
||||
void gr_d3d8_unlock();
|
||||
void gr_d3d8_get_region(int front, int w, int h, ubyte *data);
|
||||
void gr_d3d8_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
|
||||
void gr_d3d8_get_pixel(int x, int y, int *r, int *g, int *b);
|
||||
void gr_d3d8_set_cull(int cull);
|
||||
void gr_d3d8_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
|
||||
void gr_d3d8_filter_set(int filter);
|
||||
void gr_d3d8_set_clear_color(int r, int g, int b);
|
||||
|
||||
protected:
|
||||
D3D8RENDER(); // Constructor function - called by the Instance function
|
||||
|
||||
private:
|
||||
static D3D8RENDER* pInstance; // Singleton pointer
|
||||
RECT D3D_cursor_clip_rect; // Area where the cursor is clipped - possibly quite pointless right now
|
||||
bool in_frame; // Are we rendering a frame currently?
|
||||
|
||||
};
|
||||
|
||||
// Stub Functions which call the in class functions
|
||||
// This is because I don't want to edit gr_screen, but if we do more replacementr of the functions
|
||||
// then these will probably become obsolete
|
||||
void gr_d3d8e_flash(int r, int g, int b);
|
||||
void gr_d3d8e_zbuffer_clear(int mode);
|
||||
int gr_d3d8e_zbuffer_get();
|
||||
int gr_d3d8e_zbuffer_set(int mode);
|
||||
void gr_d3d8e_tmapper( int nverts, vertex **verts, uint flags );
|
||||
void gr_d3d8e_scaler(vertex *va, vertex *vb );
|
||||
void gr_d3d8e_aascaler(vertex *va, vertex *vb );
|
||||
void gr_d3d8e_pixel(int x, int y);
|
||||
void gr_d3d8e_clear();
|
||||
void gr_d3d8e_set_clip(int x,int y,int w,int h);
|
||||
void gr_d3d8e_reset_clip();
|
||||
void gr_d3d8e_init_color(color *c, int r, int g, int b);
|
||||
void gr_d3d8e_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type );
|
||||
void gr_d3d8e_set_color( int r, int g, int b );
|
||||
void gr_d3d8e_get_color( int * r, int * g, int * b );
|
||||
void gr_d3d8e_set_color_fast(color *dst);
|
||||
void gr_d3d8e_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx=-1, int sy=-1 );
|
||||
void gr_d3d8e_bitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d8e_bitmap(int x, int y);
|
||||
void gr_d3d8e_aabitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d8e_aabitmap(int x, int y);
|
||||
void gr_d3d8e_rect(int x,int y,int w,int h);
|
||||
void gr_d3d8e_create_shader(shader * shade, float r, float g, float b, float c );
|
||||
void gr_d3d8e_set_shader( shader * shade );
|
||||
void gr_d3d8e_shade(int x,int y,int w,int h);
|
||||
void gr_d3d8e_create_font_bitmap();
|
||||
void gr_d3d8e_char(int x,int y,int letter);
|
||||
void gr_d3d8e_string( int sx, int sy, char *s );
|
||||
void gr_d3d8e_circle( int xc, int yc, int d );
|
||||
void gr_d3d8e_line(int x1,int y1,int x2,int y2);
|
||||
void gr_d3d8e_aaline(vertex *v1, vertex *v2);
|
||||
void gr_d3d8e_gradient(int x1,int y1,int x2,int y2);
|
||||
void gr_d3d8e_set_palette(ubyte *new_palette, int restrict_alphacolor);
|
||||
void gr_d3d8e_diamond(int x, int y, int width, int height);
|
||||
void gr_d3d8e_print_screen(char *filename);
|
||||
|
||||
void d3d8e_tcache_init(int use_sections);
|
||||
void d3d8e_tcache_cleanup();
|
||||
void d3d8e_tcache_flush();
|
||||
void d3d8e_tcache_frame();
|
||||
void d3d8e_flush();
|
||||
int d3d8e_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full=0, int sx = -1, int sy = -1, int force = 0);
|
||||
|
||||
void gr_d3d8e_dump_frame();
|
||||
void gr_d3d8e_flip();
|
||||
void gr_d3d8e_flip_cleanup();
|
||||
void gr_d3d8e_flip_window(uint _hdc, int x, int y, int w, int h);
|
||||
void gr_d3d8e_fade_out(int instantaneous);
|
||||
void gr_d3d8e_fade_in(int instantaneous);
|
||||
int gr_d3d8e_save_screen();
|
||||
void gr_d3d8e_restore_screen(int id);
|
||||
void gr_d3d8e_free_screen(int id);
|
||||
void gr_d3d8e_dump_frame_start(int first_frame, int frames_between_dumps);
|
||||
void gr_d3d8e_dump_frame_stop();
|
||||
void gr_d3d8e_set_gamma(float gamma);
|
||||
uint gr_d3d8e_lock();
|
||||
void gr_d3d8e_unlock();
|
||||
void gr_d3d8e_get_region(int front, int w, int h, ubyte *data);
|
||||
void gr_d3d8e_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far);
|
||||
void gr_d3d8e_get_pixel(int x, int y, int *r, int *g, int *b);
|
||||
void gr_d3d8e_set_cull(int cull);
|
||||
void gr_d3d8e_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct);
|
||||
void gr_d3d8e_filter_set(int filter);
|
||||
void gr_d3d8e_set_clear_color(int r, int g, int b);
|
||||
|
||||
void gr_d3d8_set_initial_render_state();
|
||||
|
||||
#endif // _GRD3D81_H
|
||||
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
Stores stub functions for the D3D8RENDER class so we can access it through gr_screen
|
||||
*/
|
||||
|
||||
#include "graphics/directx8/grd3d81.h"
|
||||
|
||||
#define d3d8 (D3D8RENDER::Instance())
|
||||
|
||||
void gr_d3d8e_flash(int r, int g, int b)
|
||||
{
|
||||
d3d8->gr_d3d8_flash(r, g, b);
|
||||
}
|
||||
|
||||
void gr_d3d8e_zbuffer_clear(int mode)
|
||||
{
|
||||
d3d8->gr_d3d8_zbuffer_clear(mode);
|
||||
}
|
||||
|
||||
int gr_d3d8e_zbuffer_get()
|
||||
{
|
||||
return d3d8->gr_d3d8_zbuffer_get();
|
||||
}
|
||||
|
||||
int gr_d3d8e_zbuffer_set(int mode)
|
||||
{
|
||||
return d3d8->gr_d3d8_zbuffer_set(mode);
|
||||
}
|
||||
|
||||
void gr_d3d8e_tmapper( int nverts, vertex **verts, uint flags )
|
||||
{
|
||||
d3d8->gr_d3d8_tmapper( nverts, verts, flags );
|
||||
}
|
||||
|
||||
void gr_d3d8e_scaler(vertex *va, vertex *vb )
|
||||
{
|
||||
d3d8->gr_d3d8_scaler(va, vb );
|
||||
}
|
||||
|
||||
void gr_d3d8e_aascaler(vertex *va, vertex *vb )
|
||||
{
|
||||
d3d8->gr_d3d8_aascaler(va, vb );
|
||||
}
|
||||
|
||||
void gr_d3d8e_pixel(int x, int y)
|
||||
{
|
||||
d3d8->gr_d3d8_pixel(x, y);
|
||||
}
|
||||
|
||||
void gr_d3d8e_clear()
|
||||
{
|
||||
d3d8->gr_d3d8_clear();
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_clip(int x,int y,int w,int h)
|
||||
{
|
||||
d3d8->gr_d3d8_set_clip(x, y, w, h);
|
||||
}
|
||||
void gr_d3d8e_reset_clip()
|
||||
{
|
||||
d3d8->gr_d3d8_reset_clip();
|
||||
}
|
||||
|
||||
void gr_d3d8e_init_color(color *c, int r, int g, int b)
|
||||
{
|
||||
d3d8->gr_d3d8_init_color(c, r, g, b);
|
||||
}
|
||||
|
||||
void gr_d3d8e_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type )
|
||||
{
|
||||
d3d8->gr_d3d8_init_alphacolor( clr, r, g, b, alpha, type );
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_color( int r, int g, int b )
|
||||
{
|
||||
d3d8->gr_d3d8_set_color( r, g, b );
|
||||
}
|
||||
|
||||
void gr_d3d8e_get_color( int * r, int * g, int * b )
|
||||
{
|
||||
d3d8->gr_d3d8_get_color(r, g, b );
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_color_fast(color *dst)
|
||||
{
|
||||
d3d8->gr_d3d8_set_color_fast(dst);
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx, int sy )
|
||||
{
|
||||
d3d8->gr_d3d8_set_bitmap( bitmap_num, alphablend_mode, bitblt_mode, alpha, sx, sy );
|
||||
}
|
||||
|
||||
void gr_d3d8e_bitmap_ex(int x,int y,int w,int h,int sx,int sy)
|
||||
{
|
||||
d3d8->gr_d3d8_bitmap_ex( x, y, w, h, sx,sy);
|
||||
}
|
||||
|
||||
void gr_d3d8e_bitmap( int x, int y)
|
||||
{
|
||||
d3d8->gr_d3d8_bitmap( x, y);
|
||||
}
|
||||
|
||||
void gr_d3d8e_aabitmap_ex(int x,int y,int w,int h,int sx,int sy)
|
||||
{
|
||||
d3d8->gr_d3d8_aabitmap_ex(x, y, w, h, sx, sy);
|
||||
}
|
||||
|
||||
void gr_d3d8e_aabitmap(int x, int y)
|
||||
{
|
||||
d3d8->gr_d3d8_aabitmap( x, y);
|
||||
}
|
||||
|
||||
void gr_d3d8e_rect(int x,int y,int w,int h)
|
||||
{
|
||||
d3d8->gr_d3d8_rect( x, y, w, h);
|
||||
}
|
||||
|
||||
void gr_d3d8e_create_shader(shader * shade, float r, float g, float b, float c )
|
||||
{
|
||||
d3d8->gr_d3d8_create_shader(shade, r, g, b, c );
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_shader( shader * shade )
|
||||
{
|
||||
d3d8->gr_d3d8_set_shader( shade );
|
||||
}
|
||||
|
||||
void gr_d3d8e_shade(int x,int y,int w,int h)
|
||||
{
|
||||
d3d8->gr_d3d8_shade(x, y, w, h);
|
||||
}
|
||||
|
||||
void gr_d3d8e_create_font_bitmap()
|
||||
{
|
||||
d3d8->gr_d3d8_create_font_bitmap();
|
||||
}
|
||||
|
||||
void gr_d3d8e_char(int x,int y,int letter)
|
||||
{
|
||||
d3d8->gr_d3d8_char( x, y, letter);
|
||||
}
|
||||
|
||||
void gr_d3d8e_string( int sx, int sy, char *s )
|
||||
{
|
||||
d3d8->gr_d3d8_string( sx, sy, s );
|
||||
}
|
||||
|
||||
void gr_d3d8e_circle( int xc, int yc, int d )
|
||||
{
|
||||
d3d8->gr_d3d8_circle( xc, yc, d );
|
||||
}
|
||||
|
||||
void gr_d3d8e_line(int x1,int y1,int x2,int y2)
|
||||
{
|
||||
d3d8->gr_d3d8_line( x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
void gr_d3d8e_aaline(vertex *v1, vertex *v2)
|
||||
{
|
||||
d3d8->gr_d3d8_aaline(v1,v2);
|
||||
}
|
||||
|
||||
void gr_d3d8e_gradient(int x1,int y1,int x2,int y2)
|
||||
{
|
||||
d3d8->gr_d3d8_gradient(x1,y1,x2,y2);
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_palette(ubyte *new_palette, int restrict_alphacolor)
|
||||
{
|
||||
d3d8->gr_d3d8_set_palette(new_palette, restrict_alphacolor);
|
||||
}
|
||||
|
||||
void gr_d3d8e_diamond(int x, int y, int width, int height)
|
||||
{
|
||||
d3d8->gr_d3d8_diamond(x, y, width, height);
|
||||
}
|
||||
|
||||
void gr_d3d8e_print_screen(char *filename)
|
||||
{
|
||||
d3d8->gr_d3d8_print_screen(filename);
|
||||
}
|
||||
|
||||
void d3d8e_tcache_init(int use_sections)
|
||||
{
|
||||
d3d8->d3d8_tcache_init(use_sections);
|
||||
}
|
||||
|
||||
void d3d8e_tcache_cleanup()
|
||||
{
|
||||
d3d8->d3d8_tcache_cleanup();
|
||||
}
|
||||
|
||||
void d3d8e_tcache_flush()
|
||||
{
|
||||
d3d8->d3d8_tcache_flush();
|
||||
}
|
||||
|
||||
void d3d8e_tcache_frame()
|
||||
{
|
||||
d3d8->d3d8_tcache_frame();
|
||||
}
|
||||
|
||||
void d3d8e_flush()
|
||||
{
|
||||
d3d8->d3d8_flush();
|
||||
}
|
||||
|
||||
int d3d8e_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full, int sx, int sy, int force)
|
||||
{
|
||||
return d3d8->d3d8_tcache_set(bitmap_id, bitmap_type, u_ratio, v_ratio, fail_on_full, sx, sy, force);
|
||||
}
|
||||
|
||||
void gr_d3d8e_dump_frame()
|
||||
{
|
||||
d3d8->d3d8_dump_frame();
|
||||
}
|
||||
|
||||
void gr_d3d8e_flip()
|
||||
{
|
||||
d3d8->gr_d3d8_flip();
|
||||
}
|
||||
|
||||
void gr_d3d8e_flip_cleanup()
|
||||
{
|
||||
d3d8->gr_d3d8_flip_cleanup();
|
||||
}
|
||||
|
||||
void gr_d3d8e_flip_window(uint _hdc, int x, int y, int w, int h)
|
||||
{
|
||||
d3d8->gr_d3d8_flip_window(_hdc, x, y, w, h);
|
||||
}
|
||||
|
||||
void gr_d3d8e_fade_out(int instantaneous)
|
||||
{
|
||||
d3d8->gr_d3d8_fade_out(instantaneous);
|
||||
}
|
||||
|
||||
void gr_d3d8e_fade_in(int instantaneous)
|
||||
{
|
||||
d3d8->gr_d3d8_fade_in(instantaneous);
|
||||
}
|
||||
|
||||
int gr_d3d8e_save_screen()
|
||||
{
|
||||
return d3d8->gr_d3d8_save_screen();
|
||||
}
|
||||
|
||||
void gr_d3d8e_restore_screen(int id)
|
||||
{
|
||||
d3d8->gr_d3d8_restore_screen(id);
|
||||
}
|
||||
|
||||
void gr_d3d8e_free_screen(int id)
|
||||
{
|
||||
d3d8->gr_d3d8_free_screen(id);
|
||||
}
|
||||
|
||||
void gr_d3d8e_dump_frame_start(int first_frame, int frames_between_dumps)
|
||||
{
|
||||
d3d8->gr_d3d8_dump_frame_start(first_frame, frames_between_dumps);
|
||||
}
|
||||
|
||||
void gr_d3d8e_dump_frame_stop()
|
||||
{
|
||||
d3d8->gr_d3d8_dump_frame_stop();
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_gamma(float gamma)
|
||||
{
|
||||
d3d8->gr_d3d8_set_gamma(gamma);
|
||||
}
|
||||
|
||||
uint gr_d3d8e_lock()
|
||||
{
|
||||
return d3d8->gr_d3d8_lock();
|
||||
}
|
||||
|
||||
void gr_d3d8e_unlock()
|
||||
{
|
||||
d3d8->gr_d3d8_unlock();
|
||||
}
|
||||
|
||||
void gr_d3d8e_get_region(int front, int w, int h, ubyte *data)
|
||||
{
|
||||
d3d8->gr_d3d8_get_region(front, w, h, data);
|
||||
}
|
||||
|
||||
void gr_d3d8e_fog_set(int fog_mode, int r, int g, int b, float fog_near, float fog_far)
|
||||
{
|
||||
d3d8->gr_d3d8_fog_set(fog_mode, r, g, b, fog_near, fog_far);
|
||||
}
|
||||
|
||||
void gr_d3d8e_get_pixel(int x, int y, int *r, int *g, int *b)
|
||||
{
|
||||
d3d8->gr_d3d8_get_pixel(x, y, r, g, b);
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_cull(int cull)
|
||||
{
|
||||
d3d8->gr_d3d8_set_cull(cull);
|
||||
}
|
||||
|
||||
void gr_d3d8e_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct)
|
||||
{
|
||||
d3d8->gr_d3d8_cross_fade(bmap1, bmap2, x1, y1, x2, y2, pct);
|
||||
}
|
||||
|
||||
void gr_d3d8e_filter_set(int filter)
|
||||
{
|
||||
d3d8->gr_d3d8_filter_set(filter);
|
||||
}
|
||||
|
||||
void gr_d3d8e_set_clear_color(int r, int g, int b)
|
||||
{
|
||||
d3d8->gr_d3d8_set_clear_color(r, g, b);
|
||||
}
|
||||
|
||||
#undef d3d
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h> // This is the Dx8.1 utility library. Automates some functions and
|
||||
#include "d3d8.h"
|
||||
#include "d3dx8.h" // This is the Dx8.1 utility library. Automates some functions and
|
||||
// provides the D3D_OVERLOADS functionality
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
@@ -38,9 +38,11 @@ extern LPD3DDEVICEDESC lpDevDesc;
|
||||
extern DDCAPS DD_driver_caps;
|
||||
extern DDCAPS DD_hel_caps;
|
||||
*/
|
||||
extern int D3D8_texture_divider;
|
||||
|
||||
extern int D3D8_32bit;
|
||||
extern LPDIRECT3D8 lpd3d;
|
||||
extern LPDIRECT3DDEVICE8 lpd3ddevice;
|
||||
|
||||
extern int D3D_32bit;
|
||||
|
||||
extern char* d3d8_error_string(HRESULT error);
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Font.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-02 05:41:52 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* source file for font stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 20:12:31 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -644,6 +647,7 @@ void gr8_string(int sx, int sy, char *s )
|
||||
gr_unlock();
|
||||
}
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
#ifdef _WIN32
|
||||
HFONT MyhFont = NULL;
|
||||
extern HDC hDibDC;
|
||||
@@ -733,7 +737,8 @@ void gr_get_string_size_win(int *w, int *h, char *text)
|
||||
if (h)
|
||||
*h += size.cy;
|
||||
}
|
||||
#endif
|
||||
#endif // ifdef _WIN32
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
char grx_printf_text[2048];
|
||||
|
||||
|
||||
@@ -0,0 +1,373 @@
|
||||
/*++ BUILD Version: 0004 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) 1985-95, Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
glaux.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Procedure declarations, constant definitions and macros for the OpenGL
|
||||
Auxiliary Library.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __GLAUX_H__
|
||||
#define __GLAUX_H__
|
||||
|
||||
/*
|
||||
* (c) Copyright 1993, Silicon Graphics, Inc.
|
||||
* ALL RIGHTS RESERVED
|
||||
* Permission to use, copy, modify, and distribute this software for
|
||||
* any purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both the copyright notice
|
||||
* and this permission notice appear in supporting documentation, and that
|
||||
* the name of Silicon Graphics, Inc. not be used in advertising
|
||||
* or publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission.
|
||||
*
|
||||
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
|
||||
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
|
||||
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
|
||||
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
|
||||
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* US Government Users Restricted Rights
|
||||
* Use, duplication, or disclosure by the Government is subject to
|
||||
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
|
||||
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
|
||||
* clause at DFARS 252.227-7013 and/or in similar or successor
|
||||
* clauses in the FAR or the DOD or NASA FAR Supplement.
|
||||
* Unpublished-- rights reserved under the copyright laws of the
|
||||
* United States. Contractor/manufacturer is Silicon Graphics,
|
||||
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
|
||||
*
|
||||
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** ToolKit Window Types
|
||||
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
|
||||
*/
|
||||
|
||||
#define AUX_RGB 0
|
||||
#define AUX_RGBA AUX_RGB
|
||||
#define AUX_INDEX 1
|
||||
#define AUX_SINGLE 0
|
||||
#define AUX_DOUBLE 2
|
||||
#define AUX_DIRECT 0
|
||||
#define AUX_INDIRECT 4
|
||||
|
||||
#define AUX_ACCUM 8
|
||||
#define AUX_ALPHA 16
|
||||
#define AUX_DEPTH24 32 /* 24-bit depth buffer */
|
||||
#define AUX_STENCIL 64
|
||||
#define AUX_AUX 128
|
||||
#define AUX_DEPTH16 256 /* 16-bit depth buffer */
|
||||
#define AUX_FIXED_332_PAL 512
|
||||
#define AUX_DEPTH AUX_DEPTH16 /* default is 16-bit depth buffer */
|
||||
|
||||
/*
|
||||
** Window Masks
|
||||
*/
|
||||
|
||||
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
|
||||
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
|
||||
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
|
||||
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
|
||||
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
|
||||
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
|
||||
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
|
||||
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
|
||||
#define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
|
||||
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
|
||||
#define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
|
||||
|
||||
/*
|
||||
** ToolKit Event Structure
|
||||
*/
|
||||
|
||||
typedef struct _AUX_EVENTREC {
|
||||
GLint event;
|
||||
GLint data[4];
|
||||
} AUX_EVENTREC;
|
||||
|
||||
/*
|
||||
** ToolKit Event Types
|
||||
*/
|
||||
#define AUX_EXPOSE 1
|
||||
#define AUX_CONFIG 2
|
||||
#define AUX_DRAW 4
|
||||
#define AUX_KEYEVENT 8
|
||||
#define AUX_MOUSEDOWN 16
|
||||
#define AUX_MOUSEUP 32
|
||||
#define AUX_MOUSELOC 64
|
||||
|
||||
/*
|
||||
** Toolkit Event Data Indices
|
||||
*/
|
||||
#define AUX_WINDOWX 0
|
||||
#define AUX_WINDOWY 1
|
||||
#define AUX_MOUSEX 0
|
||||
#define AUX_MOUSEY 1
|
||||
#define AUX_MOUSESTATUS 3
|
||||
#define AUX_KEY 0
|
||||
#define AUX_KEYSTATUS 1
|
||||
|
||||
/*
|
||||
** ToolKit Event Status Messages
|
||||
*/
|
||||
#define AUX_LEFTBUTTON 1
|
||||
#define AUX_RIGHTBUTTON 2
|
||||
#define AUX_MIDDLEBUTTON 4
|
||||
#define AUX_SHIFT 1
|
||||
#define AUX_CONTROL 2
|
||||
|
||||
/*
|
||||
** ToolKit Key Codes
|
||||
*/
|
||||
#define AUX_RETURN 0x0D
|
||||
#define AUX_ESCAPE 0x1B
|
||||
#define AUX_SPACE 0x20
|
||||
#define AUX_LEFT 0x25
|
||||
#define AUX_UP 0x26
|
||||
#define AUX_RIGHT 0x27
|
||||
#define AUX_DOWN 0x28
|
||||
#define AUX_A 'A'
|
||||
#define AUX_B 'B'
|
||||
#define AUX_C 'C'
|
||||
#define AUX_D 'D'
|
||||
#define AUX_E 'E'
|
||||
#define AUX_F 'F'
|
||||
#define AUX_G 'G'
|
||||
#define AUX_H 'H'
|
||||
#define AUX_I 'I'
|
||||
#define AUX_J 'J'
|
||||
#define AUX_K 'K'
|
||||
#define AUX_L 'L'
|
||||
#define AUX_M 'M'
|
||||
#define AUX_N 'N'
|
||||
#define AUX_O 'O'
|
||||
#define AUX_P 'P'
|
||||
#define AUX_Q 'Q'
|
||||
#define AUX_R 'R'
|
||||
#define AUX_S 'S'
|
||||
#define AUX_T 'T'
|
||||
#define AUX_U 'U'
|
||||
#define AUX_V 'V'
|
||||
#define AUX_W 'W'
|
||||
#define AUX_X 'X'
|
||||
#define AUX_Y 'Y'
|
||||
#define AUX_Z 'Z'
|
||||
#define AUX_a 'a'
|
||||
#define AUX_b 'b'
|
||||
#define AUX_c 'c'
|
||||
#define AUX_d 'd'
|
||||
#define AUX_e 'e'
|
||||
#define AUX_f 'f'
|
||||
#define AUX_g 'g'
|
||||
#define AUX_h 'h'
|
||||
#define AUX_i 'i'
|
||||
#define AUX_j 'j'
|
||||
#define AUX_k 'k'
|
||||
#define AUX_l 'l'
|
||||
#define AUX_m 'm'
|
||||
#define AUX_n 'n'
|
||||
#define AUX_o 'o'
|
||||
#define AUX_p 'p'
|
||||
#define AUX_q 'q'
|
||||
#define AUX_r 'r'
|
||||
#define AUX_s 's'
|
||||
#define AUX_t 't'
|
||||
#define AUX_u 'u'
|
||||
#define AUX_v 'v'
|
||||
#define AUX_w 'w'
|
||||
#define AUX_x 'x'
|
||||
#define AUX_y 'y'
|
||||
#define AUX_z 'z'
|
||||
#define AUX_0 '0'
|
||||
#define AUX_1 '1'
|
||||
#define AUX_2 '2'
|
||||
#define AUX_3 '3'
|
||||
#define AUX_4 '4'
|
||||
#define AUX_5 '5'
|
||||
#define AUX_6 '6'
|
||||
#define AUX_7 '7'
|
||||
#define AUX_8 '8'
|
||||
#define AUX_9 '9'
|
||||
|
||||
/*
|
||||
** ToolKit Gets and Sets
|
||||
*/
|
||||
#define AUX_FD 1 /* return fd (long) */
|
||||
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
|
||||
#define AUX_GREYSCALEMAP 4
|
||||
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
|
||||
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
|
||||
|
||||
/*
|
||||
** Color Macros
|
||||
*/
|
||||
|
||||
#define AUX_BLACK 0
|
||||
#define AUX_RED 13
|
||||
#define AUX_GREEN 14
|
||||
#define AUX_YELLOW 15
|
||||
#define AUX_BLUE 16
|
||||
#define AUX_MAGENTA 17
|
||||
#define AUX_CYAN 18
|
||||
#define AUX_WHITE 19
|
||||
|
||||
extern float auxRGBMap[20][3];
|
||||
|
||||
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
|
||||
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
|
||||
|
||||
/*
|
||||
** RGB Image Structure
|
||||
*/
|
||||
|
||||
typedef struct _AUX_RGBImageRec {
|
||||
GLint sizeX, sizeY;
|
||||
unsigned char *data;
|
||||
} AUX_RGBImageRec;
|
||||
|
||||
/*
|
||||
** Prototypes
|
||||
*/
|
||||
|
||||
void APIENTRY auxInitDisplayMode(GLenum);
|
||||
void APIENTRY auxInitPosition(int, int, int, int);
|
||||
|
||||
/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxInitWindow auxInitWindowW
|
||||
#else
|
||||
#define auxInitWindow auxInitWindowA
|
||||
#endif
|
||||
GLenum APIENTRY auxInitWindowA(LPCSTR);
|
||||
GLenum APIENTRY auxInitWindowW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxCloseWindow(void);
|
||||
void APIENTRY auxQuit(void);
|
||||
void APIENTRY auxSwapBuffers(void);
|
||||
|
||||
typedef void (CALLBACK* AUXMAINPROC)(void);
|
||||
void APIENTRY auxMainLoop(AUXMAINPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
|
||||
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
|
||||
void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXIDLEPROC)(void);
|
||||
void APIENTRY auxIdleFunc(AUXIDLEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXKEYPROC)(void);
|
||||
void APIENTRY auxKeyFunc(int, AUXKEYPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
|
||||
void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
|
||||
|
||||
int APIENTRY auxGetColorMapSize(void);
|
||||
void APIENTRY auxGetMouseLoc(int *, int *);
|
||||
void APIENTRY auxSetOneColor(int, float, float, float);
|
||||
void APIENTRY auxSetFogRamp(int, int);
|
||||
void APIENTRY auxSetGreyRamp(void);
|
||||
void APIENTRY auxSetRGBMap(int, float *);
|
||||
|
||||
/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxRGBImageLoad auxRGBImageLoadW
|
||||
#else
|
||||
#define auxRGBImageLoad auxRGBImageLoadA
|
||||
#endif
|
||||
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
|
||||
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define auxDIBImageLoad auxDIBImageLoadW
|
||||
#else
|
||||
#define auxDIBImageLoad auxDIBImageLoadA
|
||||
#endif
|
||||
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
|
||||
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxCreateFont(void);
|
||||
/* void APIENTRY auxDrawStr(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxDrawStr auxDrawStrW
|
||||
#else
|
||||
#define auxDrawStr auxDrawStrA
|
||||
#endif
|
||||
void APIENTRY auxDrawStrA(LPCSTR);
|
||||
void APIENTRY auxDrawStrW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxWireSphere(GLdouble);
|
||||
void APIENTRY auxSolidSphere(GLdouble);
|
||||
void APIENTRY auxWireCube(GLdouble);
|
||||
void APIENTRY auxSolidCube(GLdouble);
|
||||
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
|
||||
void APIENTRY auxWireTorus(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireIcosahedron(GLdouble);
|
||||
void APIENTRY auxSolidIcosahedron(GLdouble);
|
||||
void APIENTRY auxWireOctahedron(GLdouble);
|
||||
void APIENTRY auxSolidOctahedron(GLdouble);
|
||||
void APIENTRY auxWireTetrahedron(GLdouble);
|
||||
void APIENTRY auxSolidTetrahedron(GLdouble);
|
||||
void APIENTRY auxWireDodecahedron(GLdouble);
|
||||
void APIENTRY auxSolidDodecahedron(GLdouble);
|
||||
void APIENTRY auxWireCone(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidCone(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireTeapot(GLdouble);
|
||||
void APIENTRY auxSolidTeapot(GLdouble);
|
||||
|
||||
/*
|
||||
** Window specific functions
|
||||
** hwnd, hdc, and hglrc valid after auxInitWindow()
|
||||
*/
|
||||
HWND APIENTRY auxGetHWND(void);
|
||||
HDC APIENTRY auxGetHDC(void);
|
||||
HGLRC APIENTRY auxGetHGLRC(void);
|
||||
|
||||
/*
|
||||
** Viewperf support functions and constants
|
||||
*/
|
||||
/* Display Mode Selection Criteria */
|
||||
enum {
|
||||
AUX_USE_ID = 1,
|
||||
AUX_EXACT_MATCH,
|
||||
AUX_MINIMUM_CRITERIA
|
||||
};
|
||||
void APIENTRY auxInitDisplayModePolicy(GLenum);
|
||||
GLenum APIENTRY auxInitDisplayModeID(GLint);
|
||||
GLenum APIENTRY auxGetDisplayModePolicy(void);
|
||||
GLint APIENTRY auxGetDisplayModeID(void);
|
||||
GLenum APIENTRY auxGetDisplayMode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLAUX_H__ */
|
||||
@@ -0,0 +1,584 @@
|
||||
/*++ BUILD Version: 0004 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) 1985-95, Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
glu.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Procedure declarations, constant definitions and macros for the OpenGL
|
||||
Utility Library.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#ifndef __GLU_H__
|
||||
|
||||
#define __glu_h__
|
||||
#define __GLU_H__
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 1991-1993, Silicon Graphics, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
|
||||
** the contents of this file may not be disclosed to third parties, copied or
|
||||
** duplicated in any form, in whole or in part, without the prior written
|
||||
** permission of Silicon Graphics, Inc.
|
||||
**
|
||||
** RESTRICTED RIGHTS LEGEND:
|
||||
** Use, duplication or disclosure by the Government is subject to restrictions
|
||||
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
|
||||
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
|
||||
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
|
||||
** rights reserved under the Copyright Laws of the United States.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Return the error string associated with a particular error code.
|
||||
** This will return 0 for an invalid error code.
|
||||
**
|
||||
** The generic function prototype that can be compiled for ANSI or Unicode
|
||||
** is defined as follows:
|
||||
**
|
||||
** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
|
||||
*/
|
||||
#ifdef UNICODE
|
||||
#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
|
||||
#else
|
||||
#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
|
||||
#endif
|
||||
|
||||
const GLubyte* APIENTRY gluErrorString (
|
||||
GLenum errCode);
|
||||
|
||||
const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
|
||||
GLenum errCode);
|
||||
|
||||
const GLubyte* APIENTRY gluGetString (
|
||||
GLenum name);
|
||||
|
||||
void APIENTRY gluOrtho2D (
|
||||
GLdouble left,
|
||||
GLdouble right,
|
||||
GLdouble bottom,
|
||||
GLdouble top);
|
||||
|
||||
void APIENTRY gluPerspective (
|
||||
GLdouble fovy,
|
||||
GLdouble aspect,
|
||||
GLdouble zNear,
|
||||
GLdouble zFar);
|
||||
|
||||
void APIENTRY gluPickMatrix (
|
||||
GLdouble x,
|
||||
GLdouble y,
|
||||
GLdouble width,
|
||||
GLdouble height,
|
||||
GLint viewport[4]);
|
||||
|
||||
void APIENTRY gluLookAt (
|
||||
GLdouble eyex,
|
||||
GLdouble eyey,
|
||||
GLdouble eyez,
|
||||
GLdouble centerx,
|
||||
GLdouble centery,
|
||||
GLdouble centerz,
|
||||
GLdouble upx,
|
||||
GLdouble upy,
|
||||
GLdouble upz);
|
||||
|
||||
int APIENTRY gluProject (
|
||||
GLdouble objx,
|
||||
GLdouble objy,
|
||||
GLdouble objz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *winx,
|
||||
GLdouble *winy,
|
||||
GLdouble *winz);
|
||||
|
||||
int APIENTRY gluUnProject (
|
||||
GLdouble winx,
|
||||
GLdouble winy,
|
||||
GLdouble winz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *objx,
|
||||
GLdouble *objy,
|
||||
GLdouble *objz);
|
||||
|
||||
|
||||
int APIENTRY gluScaleImage (
|
||||
GLenum format,
|
||||
GLint widthin,
|
||||
GLint heightin,
|
||||
GLenum typein,
|
||||
const void *datain,
|
||||
GLint widthout,
|
||||
GLint heightout,
|
||||
GLenum typeout,
|
||||
void *dataout);
|
||||
|
||||
|
||||
int APIENTRY gluBuild1DMipmaps (
|
||||
GLenum target,
|
||||
GLint components,
|
||||
GLint width,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const void *data);
|
||||
|
||||
int APIENTRY gluBuild2DMipmaps (
|
||||
GLenum target,
|
||||
GLint components,
|
||||
GLint width,
|
||||
GLint height,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
|
||||
/* backwards compatibility: */
|
||||
typedef class GLUnurbs GLUnurbsObj;
|
||||
typedef class GLUquadric GLUquadricObj;
|
||||
typedef class GLUtesselator GLUtesselatorObj;
|
||||
typedef class GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
|
||||
/* backwards compatibility: */
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUtesselator GLUtesselatorObj;
|
||||
typedef struct GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
GLUquadric* APIENTRY gluNewQuadric (void);
|
||||
void APIENTRY gluDeleteQuadric (
|
||||
GLUquadric *state);
|
||||
|
||||
void APIENTRY gluQuadricNormals (
|
||||
GLUquadric *quadObject,
|
||||
GLenum normals);
|
||||
|
||||
void APIENTRY gluQuadricTexture (
|
||||
GLUquadric *quadObject,
|
||||
GLboolean textureCoords);
|
||||
|
||||
void APIENTRY gluQuadricOrientation (
|
||||
GLUquadric *quadObject,
|
||||
GLenum orientation);
|
||||
|
||||
void APIENTRY gluQuadricDrawStyle (
|
||||
GLUquadric *quadObject,
|
||||
GLenum drawStyle);
|
||||
|
||||
void APIENTRY gluCylinder (
|
||||
GLUquadric *qobj,
|
||||
GLdouble baseRadius,
|
||||
GLdouble topRadius,
|
||||
GLdouble height,
|
||||
GLint slices,
|
||||
GLint stacks);
|
||||
|
||||
void APIENTRY gluDisk (
|
||||
GLUquadric *qobj,
|
||||
GLdouble innerRadius,
|
||||
GLdouble outerRadius,
|
||||
GLint slices,
|
||||
GLint loops);
|
||||
|
||||
void APIENTRY gluPartialDisk (
|
||||
GLUquadric *qobj,
|
||||
GLdouble innerRadius,
|
||||
GLdouble outerRadius,
|
||||
GLint slices,
|
||||
GLint loops,
|
||||
GLdouble startAngle,
|
||||
GLdouble sweepAngle);
|
||||
|
||||
void APIENTRY gluSphere (
|
||||
GLUquadric *qobj,
|
||||
GLdouble radius,
|
||||
GLint slices,
|
||||
GLint stacks);
|
||||
|
||||
void APIENTRY gluQuadricCallback (
|
||||
GLUquadric *qobj,
|
||||
GLenum which,
|
||||
void (CALLBACK* fn)());
|
||||
|
||||
GLUtesselator* APIENTRY gluNewTess(
|
||||
void );
|
||||
|
||||
void APIENTRY gluDeleteTess(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessBeginPolygon(
|
||||
GLUtesselator *tess,
|
||||
void *polygon_data );
|
||||
|
||||
void APIENTRY gluTessBeginContour(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessVertex(
|
||||
GLUtesselator *tess,
|
||||
GLdouble coords[3],
|
||||
void *data );
|
||||
|
||||
void APIENTRY gluTessEndContour(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessEndPolygon(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessProperty(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
GLdouble value );
|
||||
|
||||
void APIENTRY gluTessNormal(
|
||||
GLUtesselator *tess,
|
||||
GLdouble x,
|
||||
GLdouble y,
|
||||
GLdouble z );
|
||||
|
||||
void APIENTRY gluTessCallback(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
void (CALLBACK *fn)());
|
||||
|
||||
void APIENTRY gluGetTessProperty(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
GLdouble *value );
|
||||
|
||||
GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
|
||||
|
||||
void APIENTRY gluDeleteNurbsRenderer (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginSurface (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginCurve (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndCurve (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndSurface (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginTrim (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndTrim (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluPwlCurve (
|
||||
GLUnurbs *nobj,
|
||||
GLint count,
|
||||
GLfloat *array,
|
||||
GLint stride,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY gluNurbsCurve (
|
||||
GLUnurbs *nobj,
|
||||
GLint nknots,
|
||||
GLfloat *knot,
|
||||
GLint stride,
|
||||
GLfloat *ctlarray,
|
||||
GLint order,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsSurface(
|
||||
GLUnurbs *nobj,
|
||||
GLint sknot_count,
|
||||
float *sknot,
|
||||
GLint tknot_count,
|
||||
GLfloat *tknot,
|
||||
GLint s_stride,
|
||||
GLint t_stride,
|
||||
GLfloat *ctlarray,
|
||||
GLint sorder,
|
||||
GLint torder,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY
|
||||
gluLoadSamplingMatrices (
|
||||
GLUnurbs *nobj,
|
||||
const GLfloat modelMatrix[16],
|
||||
const GLfloat projMatrix[16],
|
||||
const GLint viewport[4] );
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsProperty (
|
||||
GLUnurbs *nobj,
|
||||
GLenum property,
|
||||
GLfloat value );
|
||||
|
||||
void APIENTRY
|
||||
gluGetNurbsProperty (
|
||||
GLUnurbs *nobj,
|
||||
GLenum property,
|
||||
GLfloat *value );
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsCallback (
|
||||
GLUnurbs *nobj,
|
||||
GLenum which,
|
||||
void (CALLBACK* fn)() );
|
||||
|
||||
|
||||
/**** Callback function prototypes ****/
|
||||
|
||||
/* gluQuadricCallback */
|
||||
typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
|
||||
|
||||
/* gluTessCallback */
|
||||
typedef void (CALLBACK* GLUtessBeginProc) (GLenum);
|
||||
typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
|
||||
typedef void (CALLBACK* GLUtessVertexProc) (void *);
|
||||
typedef void (CALLBACK* GLUtessEndProc) (void);
|
||||
typedef void (CALLBACK* GLUtessErrorProc) (GLenum);
|
||||
typedef void (CALLBACK* GLUtessCombineProc) (GLdouble[3],
|
||||
void*[4],
|
||||
GLfloat[4],
|
||||
void** );
|
||||
typedef void (CALLBACK* GLUtessBeginDataProc) (GLenum, void *);
|
||||
typedef void (CALLBACK* GLUtessEdgeFlagDataProc) (GLboolean, void *);
|
||||
typedef void (CALLBACK* GLUtessVertexDataProc) (void *, void *);
|
||||
typedef void (CALLBACK* GLUtessEndDataProc) (void *);
|
||||
typedef void (CALLBACK* GLUtessErrorDataProc) (GLenum, void *);
|
||||
typedef void (CALLBACK* GLUtessCombineDataProc) (GLdouble[3],
|
||||
void*[4],
|
||||
GLfloat[4],
|
||||
void**,
|
||||
void* );
|
||||
|
||||
/* gluNurbsCallback */
|
||||
typedef void (CALLBACK* GLUnurbsErrorProc) (GLenum);
|
||||
|
||||
|
||||
/**** Generic constants ****/
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
|
||||
/* Errors: (return value 0 = no error) */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_TRUE GL_TRUE
|
||||
#define GLU_FALSE GL_FALSE
|
||||
|
||||
|
||||
/**** Quadric constants ****/
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* Callback types: */
|
||||
/* GLU_ERROR 100103 */
|
||||
|
||||
|
||||
/**** Tesselation constants ****/
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
|
||||
#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
|
||||
#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
|
||||
#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
|
||||
#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
|
||||
#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
|
||||
void *data[4],
|
||||
GLfloat weight[4],
|
||||
void **dataOut) */
|
||||
#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
|
||||
#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
|
||||
void *data[4],
|
||||
GLfloat weight[4],
|
||||
void **dataOut,
|
||||
void *polygon_data) */
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
|
||||
#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
|
||||
#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
|
||||
#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
|
||||
|
||||
/**** NURBS constants ****/
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL 100012 */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
/* GLU_ERROR 100103 */
|
||||
|
||||
/* NurbsErrors */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/**** Backwards compatibility for old tesselator ****/
|
||||
|
||||
void APIENTRY gluBeginPolygon( GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluNextContour( GLUtesselator *tess,
|
||||
GLenum type );
|
||||
|
||||
void APIENTRY gluEndPolygon( GLUtesselator *tess );
|
||||
|
||||
/* Contours types -- obsolete! */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* Names without "TESS_" prefix */
|
||||
#define GLU_BEGIN GLU_TESS_BEGIN
|
||||
#define GLU_VERTEX GLU_TESS_VERTEX
|
||||
#define GLU_END GLU_TESS_END
|
||||
#define GLU_ERROR GLU_TESS_ERROR
|
||||
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLU_H__ */
|
||||
#endif /* __glu_h__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,582 @@
|
||||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2002/03/22 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 4
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
|
||||
extern void WINAPI wglFreeMemoryNV (void *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1511
-1710
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,46 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3D.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-18 10:07:02 $
|
||||
* $Author: unknownplayer $
|
||||
*
|
||||
* Include file for our Direct3D renderer
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0.2.5 2002/11/09 19:28:15 randomtiger
|
||||
*
|
||||
* Fixed small gfx initialisation bug that wasnt actually causing any problems.
|
||||
* Tided DX code, shifted stuff around, removed some stuff and documented some stuff.
|
||||
*
|
||||
* Revision 2.0.2.4 2002/10/16 00:41:38 randomtiger
|
||||
* Fixed small bug that was stopping unactive text from displaying greyed out
|
||||
* Also added ability to run FS2 DX8 in 640x480, however I needed to make a small change to 2d.cpp
|
||||
* which invloved calling the resolution processing code after initialising the device for D3D only.
|
||||
* This is because D3D8 for the moment has its own internal launcher.
|
||||
* Also I added a fair bit of documentation and tidied some stuff up. - RT
|
||||
*
|
||||
* Revision 2.0.2.3 2002/10/11 18:50:54 randomtiger
|
||||
* Checked in fix for 16 bit problem, thanks to Righteous1
|
||||
* Removed a fair bit of code that was used by the 16 bit code path which no longer exists.
|
||||
* 32 bit and 16 bit should now work in exactly the same way. - RT
|
||||
*
|
||||
* Revision 2.0.2.2 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.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.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
|
||||
*
|
||||
@@ -48,18 +81,11 @@
|
||||
#ifndef _GRD3D_H
|
||||
#define _GRD3D_H
|
||||
|
||||
void gr_d3d_init();
|
||||
bool gr_d3d_init();
|
||||
void gr_d3d_cleanup();
|
||||
|
||||
// call this to safely fill in the texture shift and scale values for the specified texture type (Gr_t_*)
|
||||
void gr_d3d_get_tex_format(int alpha);
|
||||
|
||||
// bitmap functions
|
||||
void gr_d3d_bitmap(int x, int y);
|
||||
void gr_d3d_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
|
||||
|
||||
// create all rendering objects (surfaces, d3d device, viewport, etc)
|
||||
int gr_d3d_create_rendering_objects(int clear);
|
||||
void gr_d3d_release_rendering_objects();
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GRD3DBMPMAN_H
|
||||
#define _GRD3DBMPMAN_H
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
|
||||
int bm_d3d_get_next_handle();
|
||||
|
||||
// 16 bit pixel formats
|
||||
extern int Bm_pixel_format;
|
||||
|
||||
#define BYTES_PER_PIXEL(x) ((x+7)/8)
|
||||
|
||||
void bm_d3d_init();
|
||||
|
||||
int bm_d3d_get_cache_slot( int bitmap_id, int separate_ani_frames );
|
||||
|
||||
// how many bytes of textures are used.
|
||||
extern int bm_d3d_texture_ram;
|
||||
|
||||
// This loads a bitmap 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.
|
||||
int bm_d3d_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_d3d_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
|
||||
// block of data. The data can be in the following formats:
|
||||
// 8 bpp (mapped into game palette)
|
||||
// 32 bpp
|
||||
// On success, it returns the bitmap number. You cannot
|
||||
// free that RAM until bm_d3d_release is called on that bitmap.
|
||||
// See example at bottom of this file
|
||||
int bm_d3d_create( int bpp, int w, int h, void * data, int flags = 0);
|
||||
|
||||
void bm_d3d_close();
|
||||
|
||||
// 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_d3d_unload( int n );
|
||||
|
||||
// Frees up a bitmap's data, and it's slot, so bitmap
|
||||
// number 'n' cannot be used anymore, and bm_d3d_load or
|
||||
// bm_d3d_create might reuse the slot.
|
||||
void bm_d3d_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_d3d_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0 );
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_d3d_unlock. Only lock
|
||||
// a bitmap when you need it! This will convert it into the
|
||||
// appropriate format also.
|
||||
extern bitmap * bm_d3d_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
|
||||
// will also change when the bitmap's data changes.
|
||||
extern uint bm_d3d_get_signature( int bitmapnum);
|
||||
|
||||
// Unlocks a bitmap
|
||||
extern void bm_d3d_unlock( int bitmapnum );
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
extern void bm_d3d_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
|
||||
|
||||
// call to load all data for all bitmaps that have been requested to be loaded
|
||||
extern void bm_d3d_load_all();
|
||||
extern void bm_d3d_unload_all();
|
||||
|
||||
// call to get the palette for a bitmap
|
||||
extern void bm_d3d_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_d3d_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_d3d_get_frame_usage(int *ntotal, int *nnew);
|
||||
|
||||
//============================================================================
|
||||
// Paging stuff
|
||||
//============================================================================
|
||||
|
||||
void bm_d3d_page_in_start();
|
||||
void bm_d3d_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_d3d_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_d3d_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_d3d_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_d3d_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
// 1 = Low memory ( every other frame of ani's)
|
||||
// 2 = Debug low memory ( only use first frame of each ani )
|
||||
void bm_d3d_set_low_mem( int mode );
|
||||
|
||||
// convert a 24 bit value to a 16 bit value
|
||||
void bm_d3d_24_to_16(int bit_24, ushort *bit_16);
|
||||
|
||||
// get the rgba components of a pixel, any of the parameters can be NULL
|
||||
void bm_d3d_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_d3d_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
void bm_d3d_set_max_bitmap_size(int size);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <d3d8.h>
|
||||
#include "graphics/grd3dinternal.h"
|
||||
|
||||
// Uncomment this to disable checking if states are already set, slower but useful for searching for bugs
|
||||
#define D3D_CALLS_CHECK 1
|
||||
|
||||
// Heres the internal vertex information that DX need to know to render them
|
||||
VertexTypeInfo vertex_types[D3DVT_MAX] =
|
||||
{
|
||||
(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX2), sizeof(D3DTLVERTEX),
|
||||
(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1), sizeof(D3DLVERTEX),
|
||||
(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1), sizeof(D3DVERTEX),
|
||||
};
|
||||
|
||||
// This is all stuff needed for set render state calls
|
||||
const float fone = 1.0f;
|
||||
const float fzero = 0.0f;
|
||||
const float fsixtyfour = 64.0f;
|
||||
|
||||
|
||||
DWORD *pfone = (DWORD *) &fone;
|
||||
DWORD *pfzero = (DWORD *) &fzero;
|
||||
DWORD *pfsixtyfour = (DWORD *) &fsixtyfour;
|
||||
|
||||
const int NUM_STATES = 174;
|
||||
unsigned long current_render_states[NUM_STATES];
|
||||
|
||||
// These are the default states that D3D8 starts with an returns to on a reset
|
||||
const unsigned long default_render_states[NUM_STATES] =
|
||||
{
|
||||
0,0,0,0,0,0,0, // not used
|
||||
D3DZB_TRUE, // D3DRS_ZENABLE = 7,
|
||||
D3DFILL_SOLID, // D3DRS_FILLMODE = 8,
|
||||
D3DSHADE_GOURAUD, // D3DRS_SHADEMODE = 9,
|
||||
0, // D3DRS_LINEPATTERN = 10,
|
||||
0,0,0,
|
||||
TRUE, // D3DRS_ZWRITEENABLE = 14,
|
||||
FALSE, // D3DRS_ALPHATESTENABLE = 15,
|
||||
TRUE, // D3DRS_LASTPIXEL = 16,
|
||||
0,0,
|
||||
D3DBLEND_ONE, // D3DRS_SRCBLEND = 19,
|
||||
D3DBLEND_ZERO, // D3DRS_DESTBLEND = 20,
|
||||
0,
|
||||
D3DCULL_CCW, // D3DRS_CULLMODE = 22,
|
||||
D3DCMP_LESSEQUAL, // D3DRS_ZFUNC = 23,
|
||||
0x00000000, // D3DRS_ALPHAREF = 24, ?????????????????????
|
||||
D3DCMP_ALWAYS, // D3DRS_ALPHAFUNC = 25,
|
||||
FALSE, // D3DRS_DITHERENABLE = 26,
|
||||
FALSE, // D3DRS_ALPHABLENDENABLE = 27,
|
||||
FALSE, // D3DRS_FOGENABLE = 28,
|
||||
FALSE, // D3DRS_SPECULARENABLE = 29,
|
||||
0, // D3DRS_ZVISIBLE (not supported) = 30,
|
||||
0,0,0,
|
||||
0, // D3DRS_FOGCOLOR = 34,
|
||||
D3DFOG_NONE, // D3DRS_FOGTABLEMODE = 35,
|
||||
*pfzero, // D3DRS_FOGSTART = 36,
|
||||
*pfone, // D3DRS_FOGEND = 37,
|
||||
*pfone, // D3DRS_FOGDENSITY = 38,
|
||||
0,
|
||||
FALSE, // D3DRS_EDGEANTIALIAS = 40,
|
||||
0,0,0,0,0,0,
|
||||
0, // D3DRS_ZBIAS = 47,
|
||||
FALSE, // D3DRS_RANGEFOGENABLE = 48,
|
||||
0,0,0,
|
||||
FALSE, // D3DRS_STENCILENABLE = 52,
|
||||
D3DSTENCILOP_KEEP, // D3DRS_STENCILFAIL = 53,
|
||||
D3DSTENCILOP_KEEP, // D3DRS_STENCILZFAIL = 54,
|
||||
D3DSTENCILOP_KEEP, // D3DRS_STENCILPASS = 55,
|
||||
D3DCMP_ALWAYS, // D3DRS_STENCILFUNC = 56,
|
||||
0, // D3DRS_STENCILREF = 57,
|
||||
0xFFFFFFFF, // D3DRS_STENCILMASK = 58,
|
||||
0xFFFFFFFF, // D3DRS_STENCILWRITEMASK = 59,
|
||||
0xFFFFFFFF, // D3DRS_TEXTUREFACTOR = 60,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,
|
||||
0, // D3DRS_WRAP0 = 128,
|
||||
0, // D3DRS_WRAP1 = 129,
|
||||
0, // D3DRS_WRAP2 = 130,
|
||||
0, // D3DRS_WRAP3 = 131,
|
||||
0, // D3DRS_WRAP4 = 132,
|
||||
0, // D3DRS_WRAP5 = 133,
|
||||
0, // D3DRS_WRAP6 = 134,
|
||||
0, // D3DRS_WRAP7 = 135,
|
||||
TRUE, // D3DRS_CLIPPING = 136,
|
||||
TRUE, // D3DRS_LIGHTING = 137,
|
||||
0,
|
||||
0, // D3DRS_AMBIENT = 139,
|
||||
0,
|
||||
D3DFOG_NONE, // D3DRS_FOGVERTEXMODE = 140,
|
||||
TRUE, // D3DRS_COLORVERTEX = 141,
|
||||
TRUE, // D3DRS_LOCALVIEWER = 142,
|
||||
FALSE, // D3DRS_NORMALIZENORMALS = 143,
|
||||
0,
|
||||
D3DMCS_COLOR1, // D3DRS_DIFFUSEMATERIALSOURCE = 145,
|
||||
D3DMCS_COLOR2, // D3DRS_SPECULARMATERIALSOURCE = 146,
|
||||
D3DMCS_COLOR2, // D3DRS_AMBIENTMATERIALSOURCE = 147,
|
||||
D3DMCS_MATERIAL, // D3DRS_EMISSIVEMATERIALSOURCE = 148,
|
||||
0,0,
|
||||
D3DVBF_DISABLE, // D3DRS_VERTEXBLEND = 151,
|
||||
0, // D3DRS_CLIPPLANEENABLE = 152,
|
||||
TRUE, // D3DRS_SOFTWAREVERTEXPROCESSING = 153, RT, never us this!
|
||||
*pfone, // D3DRS_POINTSIZE = 154,
|
||||
*pfzero, // D3DRS_POINTSIZE_MIN = 155,
|
||||
FALSE, // D3DRS_POINTSPRITEENABLE = 156,
|
||||
FALSE, // D3DRS_POINTSCALEENABLE = 157,
|
||||
*pfone, // D3DRS_POINTSCALE_A = 158,
|
||||
*pfzero, // D3DRS_POINTSCALE_B = 159,
|
||||
*pfzero, // D3DRS_POINTSCALE_C = 160,
|
||||
TRUE, // D3DRS_MULTISAMPLEANTIALIAS = 161,
|
||||
0xFFFFFFFF, // D3DRS_MULTISAMPLEMASK = 162,
|
||||
D3DPATCHEDGE_DISCRETE, // D3DRS_PATCHEDGESTYLE = 163,
|
||||
*pfone, // D3DRS_PATCHSEGMENTS = 164,
|
||||
D3DDMT_ENABLE, // D3DRS_DEBUGMONITORTOKEN = 165,
|
||||
*pfsixtyfour, // D3DRS_POINTSIZE_MAX = 166,
|
||||
FALSE, // D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
|
||||
0x0000000F, // D3DRS_COLORWRITEENABLE = 168,
|
||||
*pfzero, // D3DRS_TWEENFACTOR = 170,
|
||||
D3DBLENDOP_ADD, // D3DRS_BLENDOP = 171,
|
||||
D3DORDER_CUBIC, // D3DRS_POSITIONORDER = 172,
|
||||
D3DORDER_LINEAR // D3DRS_NORMALORDER = 173,
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets all render states to defaults,
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void d3d_reset_render_states()
|
||||
{
|
||||
memcpy(current_render_states, default_render_states, sizeof(unsigned long) * NUM_STATES);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a wrapper function for the D3D8.1 call SetRenderState,
|
||||
*
|
||||
* @param D3DRENDERSTATETYPE render_state_type - Check DX docs
|
||||
* @param DWORD render_state - Check DX docs
|
||||
*
|
||||
* @return HRESULT - directx error code
|
||||
*/
|
||||
HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE render_state_type, DWORD render_state )
|
||||
{
|
||||
Assert(render_state_type < NUM_STATES);
|
||||
|
||||
#ifdef D3D_CALLS_CHECK
|
||||
// If the state is already set to that parameter
|
||||
if(current_render_states[render_state_type] == render_state) {
|
||||
// Leave without setting
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT hr = lpD3DDevice->SetRenderState(render_state_type, render_state );
|
||||
|
||||
// A set render state should never fail because we should always know the caps.
|
||||
if(FAILED(hr)) {
|
||||
mprintf(("Failed set render state %d!", render_state_type));
|
||||
} else {
|
||||
current_render_states[render_state_type] = render_state;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
// This is all stuff needed for draw primitive call
|
||||
int D3D_vertex_type = -1;
|
||||
|
||||
/**
|
||||
* This is a wrapper function for the D3D8.1 call DrawPrimitveUP, it also handles the vertex shader
|
||||
*
|
||||
* @param int vertex_type - This should be one of D3DVT_TLVERTEX, D3DVT_LVERTEX or D3DVT_VERTEX,
|
||||
* @param D3DPRIMITIVETYPE prim_type - Look at DX docs
|
||||
* @param LPVOID pvertices - Pointer to the vertex data, must match the vertex_type chosen
|
||||
* @param DWORD vertex_count - Number of vertices in the array to render
|
||||
*
|
||||
* @return HRESULT - directx error code
|
||||
*/
|
||||
HRESULT d3d_DrawPrimitive(int vertex_type, D3DPRIMITIVETYPE prim_type, LPVOID pvertices, DWORD vertex_count)
|
||||
{
|
||||
HRESULT hr;
|
||||
Assert( vertex_type < D3DVT_MAX);
|
||||
int prim_count = 0;
|
||||
|
||||
switch( prim_type)
|
||||
{
|
||||
case D3DPT_POINTLIST:
|
||||
prim_count = vertex_count;
|
||||
break;
|
||||
case D3DPT_LINELIST:
|
||||
prim_count = vertex_count / 2;
|
||||
break;
|
||||
case D3DPT_LINESTRIP:
|
||||
prim_count = vertex_count - 1;
|
||||
break;
|
||||
case D3DPT_TRIANGLELIST:
|
||||
prim_count = vertex_count / 3;
|
||||
break;
|
||||
case D3DPT_TRIANGLESTRIP:
|
||||
case D3DPT_TRIANGLEFAN:
|
||||
prim_count = vertex_count - 2;
|
||||
break;
|
||||
default:
|
||||
mprintf(("Prim type not known, primitive will not be drawn"));
|
||||
return !S_OK;
|
||||
}
|
||||
|
||||
#ifdef D3D_CALLS_CHECK
|
||||
if(D3D_vertex_type != vertex_type)
|
||||
#endif
|
||||
{
|
||||
hr = lpD3DDevice->SetVertexShader( vertex_types[vertex_type].fvf );
|
||||
|
||||
if(FAILED(hr)) {
|
||||
mprintf(("Failed to set vertex shader"));
|
||||
return hr;
|
||||
}
|
||||
|
||||
D3D_vertex_type = vertex_type;
|
||||
}
|
||||
|
||||
hr = lpD3DDevice->DrawPrimitiveUP(prim_type, prim_count, pvertices, vertex_types[vertex_type].size);
|
||||
|
||||
if(FAILED(hr)) {
|
||||
mprintf(("Failed to draw primitive"));
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
// This is all stuff needed for set texture stage state
|
||||
const int NUM_STAGE_TYPES = 29;
|
||||
unsigned long current_stages_zero[NUM_STAGE_TYPES];
|
||||
const unsigned long default_stages_zero[NUM_STAGE_TYPES] =
|
||||
{
|
||||
0,
|
||||
D3DTOP_MODULATE, // D3DTSS_COLOROP = 1,
|
||||
D3DTA_TEXTURE, // D3DTSS_COLORARG1 = 2,
|
||||
D3DTA_CURRENT, // D3DTSS_COLORARG2 = 3,
|
||||
D3DTOP_SELECTARG1, // D3DTSS_ALPHAOP = 4,
|
||||
D3DTA_DIFFUSE, // D3DTSS_ALPHAARG1 = 5,
|
||||
D3DTA_CURRENT, // D3DTSS_ALPHAARG2 = 6,
|
||||
*pfzero, // D3DTSS_BUMPENVMAT00 = 7,
|
||||
*pfzero, // D3DTSS_BUMPENVMAT01 = 8,
|
||||
*pfzero, // D3DTSS_BUMPENVMAT10 = 9,
|
||||
*pfzero, // D3DTSS_BUMPENVMAT11 = 10,
|
||||
0, // D3DTSS_TEXCOORDINDEX = 11,
|
||||
0,
|
||||
D3DTADDRESS_WRAP, // D3DTSS_ADDRESSU = 13,
|
||||
D3DTADDRESS_WRAP, // D3DTSS_ADDRESSV = 14,
|
||||
0x00000000, // D3DTSS_BORDERCOLOR = 15,
|
||||
D3DTEXF_POINT, // D3DTSS_MAGFILTER = 16,
|
||||
D3DTEXF_POINT, // D3DTSS_MINFILTER = 17,
|
||||
D3DTEXF_NONE, // D3DTSS_MIPFILTER = 18,
|
||||
*pfzero, // D3DTSS_MIPMAPLODBIAS = 19,
|
||||
0, // D3DTSS_MAXMIPLEVEL = 20,
|
||||
1, // D3DTSS_MAXANISOTROPY = 21,
|
||||
*pfzero, // D3DTSS_BUMPENVLSCALE = 22,
|
||||
*pfzero, // D3DTSS_BUMPENVLOFFSET = 23,
|
||||
D3DTTFF_DISABLE, // D3DTSS_TEXTURETRANSFORMFLAGS = 24,
|
||||
D3DTADDRESS_WRAP, // D3DTSS_ADDRESSW = 25,
|
||||
D3DTA_CURRENT, // D3DTSS_COLORARG0 = 26,
|
||||
D3DTA_CURRENT, // D3DTSS_ALPHAARG0 = 27,
|
||||
D3DTA_CURRENT // D3DTSS_RESULTARG = 28,
|
||||
};
|
||||
|
||||
/**
|
||||
* Set current texture states to default, stage 0 only
|
||||
* @return void
|
||||
*/
|
||||
void d3d_reset_texture_stage_states()
|
||||
{
|
||||
memcpy( current_stages_zero, default_stages_zero, sizeof(unsigned long) * NUM_STAGE_TYPES);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a wrapper function for the D3D8.1 call SetTextureStageState, consult DX documentation
|
||||
* for parameter options
|
||||
*
|
||||
* @param DWORD stage - Texture state, currently only 0 is supported
|
||||
* @param D3DTEXTURESTAGESTATETYPE type - Type to attemp to change
|
||||
* @param DWORD value - New value to attempt to set
|
||||
*
|
||||
* @return HRESULT - DirectX error code
|
||||
*/
|
||||
HRESULT d3d_SetTextureStageState(DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
|
||||
{
|
||||
// Only for first stage because it has different default properties to the others but
|
||||
// since they are not even in use, who cares!
|
||||
#ifdef D3D_CALLS_CHECK
|
||||
if(stage == 0 && current_stages_zero[type] == value) {
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT hr = lpD3DDevice->SetTextureStageState(stage, type, value);
|
||||
|
||||
if(FAILED(hr)) {
|
||||
mprintf(("Failed to set TextureStageState %d for stage %d", type, stage));
|
||||
} else if (stage == 0) {
|
||||
current_stages_zero[type] = value;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Texture set call
|
||||
const int MAX_TSTAGES = 8;
|
||||
IDirect3DBaseTexture8 *tinterfaces[MAX_TSTAGES] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
|
||||
|
||||
/**
|
||||
* This should be called if the device is lost, this will ensure all state default are properly reset
|
||||
*
|
||||
* @param int stage - Can only be in range 0 - 7, only 0 is currently supported by vertex coords
|
||||
* @param IDirect3DBaseTexture8* texture_ptr - Pointer to texture to be used
|
||||
* @return HRESULT
|
||||
*
|
||||
*/
|
||||
HRESULT d3d_SetTexture(int stage, IDirect3DBaseTexture8* texture_ptr)
|
||||
{
|
||||
#ifdef D3D_CALLS_CHECK
|
||||
if( texture_ptr == tinterfaces[stage]) {
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT hr = lpD3DDevice->SetTexture(stage, texture_ptr);
|
||||
//changed from this -Bobboau
|
||||
// HRESULT hr = lpD3DDevice->SetTexture(0, texture_ptr);
|
||||
|
||||
if(FAILED(hr)) {
|
||||
mprintf(("Failed to set texture"));
|
||||
} else {
|
||||
tinterfaces[stage] = texture_ptr;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/**
|
||||
* This should be called if the device is lost, this will ensure all state default are properly reset
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
void d3d_lost_device()
|
||||
{
|
||||
// Set states to what they will be after reset
|
||||
gr_d3d_set_state(TEXTURE_SOURCE_NONE, ALPHA_BLEND_NONE, ZBUFFER_TYPE_DEFAULT);
|
||||
|
||||
// Calling Reset causes all texture memory surfaces to be lost, managed textures to be flushed
|
||||
// from video memory, and all state information to be lost. Before calling the Reset method for a
|
||||
// device, an application should release any explicit render targets, depth stencil surfaces,
|
||||
// additional swap chains and D3DPOOL_DEFAULT resources associated with the device.
|
||||
lpD3DDevice->Reset(&d3dpp);
|
||||
|
||||
d3d_reset_render_states();
|
||||
d3d_reset_texture_stage_states();
|
||||
|
||||
memset(tinterfaces, 0, sizeof(IDirect3DBaseTexture8 *) * MAX_TSTAGES);
|
||||
d3d_set_initial_render_state();
|
||||
|
||||
D3D_vertex_type = -1;
|
||||
}
|
||||
@@ -9,13 +9,85 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DInternal.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-08-22 07:35:08 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Prototypes for the variables used internally by the Direct3D renderer
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 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.4 2003/07/04 02:27:48 phreak
|
||||
* added support for cloaking.
|
||||
* i will need to contact someone who knows d3d to get this to work
|
||||
*
|
||||
* Revision 2.3 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.2 2002/10/05 16:46:09 randomtiger
|
||||
* Added us fs2_open people to the credits. Worth looking at just for that.
|
||||
* Added timer bar code, by default its not compiled in.
|
||||
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
|
||||
* Added the new timebar files with the new code.
|
||||
*
|
||||
* Revision 2.1.2.9 2002/11/11 21:26:04 randomtiger
|
||||
*
|
||||
* Tided up D3DX8 calls, did some documentation and add new file: grd3dcalls.cpp. - RT
|
||||
*
|
||||
* Revision 2.1.2.8 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.7 2002/10/30 22:57:21 randomtiger
|
||||
*
|
||||
* Changed DX8 code to not use set render and texture states if they are already set to that value.
|
||||
* Disabled buffer saving and restoring code when windowed to stop DX8 debug runs from crashing. - RT
|
||||
*
|
||||
* Revision 2.1.2.6 2002/10/21 16:33:41 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.1.2.5 2002/10/11 18:50:54 randomtiger
|
||||
* Checked in fix for 16 bit problem, thanks to Righteous1
|
||||
* Removed a fair bit of code that was used by the 16 bit code path which no longer exists.
|
||||
* 32 bit and 16 bit should now work in exactly the same way. - RT
|
||||
*
|
||||
* Revision 2.1.2.4 2002/10/04 00:48:42 randomtiger
|
||||
* Fixed video memory leaks
|
||||
* Added code to cope with lost device, not tested
|
||||
* Got rid of some DX5 stuff we definately dont need
|
||||
* Moved some enum's into internal,h because gr_d3d_set_state should be able to be called from any dx file
|
||||
* Cleaned up some stuff - RT
|
||||
*
|
||||
* Revision 2.1.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.1.2.2 2002/09/28 22:13:43 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: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
|
||||
*
|
||||
>>>>>>> 2.1.2.9
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -130,46 +202,37 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#define D3D_OVERLOADS
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
// To remove an otherwise well-lodged compiler error
|
||||
// 4201 nonstandard extension used : nameless struct/union (happens a lot in Windows include headers)
|
||||
#pragma warning(disable: 4201)
|
||||
|
||||
#include "directx/vd3d.h"
|
||||
#include <d3d8.h>
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
|
||||
|
||||
extern LPDIRECTDRAW lpDD1;
|
||||
extern LPDIRECTDRAW2 lpDD;
|
||||
extern LPDIRECT3D2 lpD3D;
|
||||
extern LPDIRECT3DDEVICE lpD3DDeviceEB;
|
||||
extern LPDIRECT3DDEVICE2 lpD3DDevice;
|
||||
extern LPDIRECTDRAWSURFACE lpBackBuffer;
|
||||
extern LPDIRECTDRAWSURFACE lpFrontBuffer;
|
||||
extern LPDIRECTDRAWSURFACE lpZBuffer;
|
||||
|
||||
extern LPDIRECT3DVIEWPORT2 lpViewport;
|
||||
extern LPDIRECTDRAWPALETTE lpPalette;
|
||||
|
||||
extern DDPIXELFORMAT AlphaTextureFormat;
|
||||
extern DDPIXELFORMAT NonAlphaTextureFormat;
|
||||
extern DDPIXELFORMAT ScreenFormat;
|
||||
|
||||
extern D3DDEVICEDESC D3DHWDevDesc, D3DHELDevDesc;
|
||||
extern LPD3DDEVICEDESC lpDevDesc;
|
||||
extern DDCAPS DD_driver_caps;
|
||||
extern DDCAPS DD_hel_caps;
|
||||
extern IDirect3D8 *lpD3D;
|
||||
extern IDirect3DDevice8 *lpD3DDevice;
|
||||
extern D3DVIEWPORT8 viewport;
|
||||
extern D3DCAPS8 d3d_caps;
|
||||
extern D3DPRESENT_PARAMETERS d3dpp;
|
||||
|
||||
extern int D3D_texture_divider;
|
||||
|
||||
extern int D3D_32bit;
|
||||
|
||||
extern char* d3d_error_string(HRESULT error);
|
||||
extern const char* d3d_error_string(HRESULT error);
|
||||
|
||||
void d3d_tcache_init(int use_sections);
|
||||
void set_stage_for_defuse();
|
||||
void set_stage_for_glow_mapped_defuse();
|
||||
void set_stage_for_defuse_and_non_mapped_spec();
|
||||
void set_stage_for_glow_mapped_defuse_and_non_mapped_spec();
|
||||
bool set_stage_for_spec_mapped();
|
||||
void set_stage_for_cell_shaded();
|
||||
void set_stage_for_cell_glowmapped_shaded();
|
||||
void set_stage_for_additive_glowmapped();
|
||||
|
||||
void d3d_tcache_init();
|
||||
void d3d_tcache_cleanup();
|
||||
void d3d_tcache_flush();
|
||||
void d3d_tcache_frame();
|
||||
@@ -178,9 +241,9 @@ void d3d_tcache_frame();
|
||||
void d3d_flush();
|
||||
|
||||
int d3d_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full=0, int sx = -1, int sy = -1, int force = 0);
|
||||
int d3d_tcache_set_internal(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full=0, int sx = -1, int sy = -1, int force = 0, int stage = 0);
|
||||
|
||||
// Functions in GrD3DRender.cpp stuffed into gr_screen structure
|
||||
|
||||
void gr_d3d_flash(int r, int g, int b);
|
||||
void gr_d3d_zbuffer_clear(int mode);
|
||||
int gr_d3d_zbuffer_get();
|
||||
@@ -198,7 +261,6 @@ void gr_d3d_set_color( int r, int g, int b );
|
||||
void gr_d3d_get_color( int * r, int * g, int * b );
|
||||
void gr_d3d_set_color_fast(color *dst);
|
||||
void gr_d3d_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx=-1, int sy=-1 );
|
||||
void gr_d3d_bitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d_bitmap(int x, int y);
|
||||
void gr_d3d_aabitmap_ex(int x,int y,int w,int h,int sx,int sy);
|
||||
void gr_d3d_aabitmap(int x, int y);
|
||||
@@ -216,10 +278,111 @@ void gr_d3d_gradient(int x1,int y1,int x2,int y2);
|
||||
void gr_d3d_set_palette(ubyte *new_palette, int restrict_alphacolor);
|
||||
void gr_d3d_diamond(int x, int y, int width, int height);
|
||||
void gr_d3d_print_screen(char *filename);
|
||||
void gr_d3d_push_texture_matrix(int unit);
|
||||
void gr_d3d_pop_texture_matrix(int unit);
|
||||
void gr_d3d_translate_texture_matrix(int unit, vector *shift);
|
||||
|
||||
void d3d_render_timer_bar(int colour, float x, float y, float w, float h);
|
||||
|
||||
// Functions used to render. Calls either DrawPrim or Execute buffer code
|
||||
HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState );
|
||||
HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, DWORD dwFlags );
|
||||
enum
|
||||
{
|
||||
D3DVT_TLVERTEX,
|
||||
D3DVT_LVERTEX,
|
||||
D3DVT_VERTEX,
|
||||
D3DVT_MAX
|
||||
};
|
||||
|
||||
// This vertex type tells D3D that it has already been transformed an lit
|
||||
// D3D will simply display the polygon with no extra processing
|
||||
typedef struct {
|
||||
float sx, sy, sz;
|
||||
float rhw;
|
||||
|
||||
DWORD color;
|
||||
DWORD specular;
|
||||
float tu, tv;
|
||||
float env_u, env_v;
|
||||
|
||||
} D3DTLVERTEX;
|
||||
|
||||
// This vertex type should be used for vertices that have already been lit
|
||||
// make sure lighting is set to off while these polygons are rendered
|
||||
typedef struct {
|
||||
float sx, sy, sz;
|
||||
|
||||
DWORD color;
|
||||
DWORD specular;
|
||||
float tu, tv;
|
||||
|
||||
} D3DLVERTEX;
|
||||
|
||||
// Renders a normal polygon that is to be transformed and lit by D3D
|
||||
typedef struct {
|
||||
float sx, sy, sz;
|
||||
float nx, ny, nz;
|
||||
|
||||
float tu, tv;
|
||||
|
||||
} D3DVERTEX;
|
||||
|
||||
typedef struct {
|
||||
int fvf;
|
||||
int size;
|
||||
|
||||
} VertexTypeInfo;
|
||||
|
||||
typedef float D3DVALUE;
|
||||
|
||||
// 32 bit formats, only for use in a 32 bit mode.
|
||||
extern D3DFORMAT default_32_non_alpha_tformat;
|
||||
extern D3DFORMAT default_32_alpha_tformat;
|
||||
|
||||
// 16 bit formats for pcx media
|
||||
extern D3DFORMAT default_non_alpha_tformat;
|
||||
extern D3DFORMAT default_alpha_tformat;
|
||||
|
||||
extern DDPIXELFORMAT AlphaTextureFormat;
|
||||
extern DDPIXELFORMAT NonAlphaTextureFormat;
|
||||
|
||||
typedef enum gr_texture_source {
|
||||
TEXTURE_SOURCE_NONE,
|
||||
TEXTURE_SOURCE_DECAL,
|
||||
TEXTURE_SOURCE_NO_FILTERING,
|
||||
} gr_texture_source;
|
||||
|
||||
typedef enum gr_alpha_blend {
|
||||
ALPHA_BLEND_NONE, // 1*SrcPixel + 0*DestPixel
|
||||
ALPHA_BLEND_ALPHA_ADDITIVE, // Alpha*SrcPixel + 1*DestPixel
|
||||
ALPHA_BLEND_ALPHA_BLEND_ALPHA, // Alpha*SrcPixel + (1-Alpha)*DestPixel
|
||||
ALPHA_BLEND_ALPHA_BLEND_SRC_COLOR, // Alpha*SrcPixel + (1-SrcPixel)*DestPixel
|
||||
} gr_alpha_blend;
|
||||
|
||||
typedef enum gr_zbuffer_type {
|
||||
ZBUFFER_TYPE_NONE,
|
||||
ZBUFFER_TYPE_READ,
|
||||
ZBUFFER_TYPE_WRITE,
|
||||
ZBUFFER_TYPE_FULL,
|
||||
ZBUFFER_TYPE_DEFAULT,
|
||||
} gr_zbuffer_type;
|
||||
|
||||
// INTERNAL D3D Functions
|
||||
|
||||
// GrD3D functions
|
||||
void d3d_set_initial_render_state();
|
||||
int d3d_get_mode_bit(D3DFORMAT type);
|
||||
|
||||
// GrD3DRender functions
|
||||
void gr_d3d_set_state( gr_texture_source ts, gr_alpha_blend ab, gr_zbuffer_type zt );
|
||||
|
||||
// GrD3DTexture functions
|
||||
|
||||
// GrD3DCall functions
|
||||
void d3d_reset_render_states();
|
||||
HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE render_state_type, DWORD render_state );
|
||||
HRESULT d3d_DrawPrimitive(int vertex_type, D3DPRIMITIVETYPE prim_type, LPVOID pvertices, DWORD vertex_count);
|
||||
void d3d_reset_texture_stage_states();
|
||||
HRESULT d3d_SetTextureStageState(DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value);
|
||||
void d3d_lost_device();
|
||||
HRESULT d3d_SetTexture(int stage, IDirect3DBaseTexture8* texture_ptr);
|
||||
|
||||
#endif //_GRD3DINTERNAL_H
|
||||
+1257
-541
File diff suppressed because it is too large.
Load diff
Loaded 100 of 288 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user