mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
391
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
af3b97aae5 | ||
|
|
c3c0b0e1f4 | ||
|
|
9d5863bc76 | ||
|
|
4b2d436b04 | ||
|
|
404195d389 | ||
|
|
df29aad213 | ||
|
|
026601e350 | ||
|
|
05a48addc6 | ||
|
|
a1e9e62b6e | ||
|
|
64ea61c93a | ||
|
|
a0bbf8fd54 | ||
|
|
15e9872bb5 | ||
|
|
a1f592ffef | ||
|
|
07de43ffc4 | ||
|
|
522fa4c906 | ||
|
|
7611e0a2d2 | ||
|
|
9290659edf | ||
|
|
3a88c2f9e3 | ||
|
|
a732686bf6 | ||
|
|
2ede27a557 | ||
|
|
8300b018f0 | ||
|
|
93aed25251 | ||
|
|
591563118c | ||
|
|
b59b5dd5d8 | ||
|
|
bb0bde6409 | ||
|
|
66a392ddae | ||
|
|
8bfc9fa709 | ||
|
|
ccbdeeff67 | ||
|
|
0f1176adaf | ||
|
|
b75fce3d5c | ||
|
|
ab68ad4855 | ||
|
|
426cf0b969 | ||
|
|
2d1f7ba50f | ||
|
|
69145e65f1 | ||
|
|
3dcb4b380a | ||
|
|
8e996fdf67 | ||
|
|
7367d8a31f | ||
|
|
d5fcfc773c | ||
|
|
5cdd3a676d | ||
|
|
fd95da4c0a | ||
|
|
1aa613e0f5 | ||
|
|
7d91a35878 | ||
|
|
fa2c566b3f | ||
|
|
f2b7f9718a | ||
|
|
08c0bd3aee | ||
|
|
3a39133e04 | ||
|
|
c3ec5825a4 | ||
|
|
baddd6703d | ||
|
|
0c3733d2cd | ||
|
|
c536d49afd | ||
|
|
b031aee73a | ||
|
|
c480e2c944 | ||
|
|
c7cd913df4 | ||
|
|
58a465e805 | ||
|
|
cf08ff0cd5 | ||
|
|
c839e8168a | ||
|
|
3257777c18 | ||
|
|
1028e14398 | ||
|
|
b733679875 | ||
|
|
723cbd5938 | ||
|
|
0e48ea11ac | ||
|
|
57ab92645c | ||
|
|
2431f5db2c | ||
|
|
34d960638a | ||
|
|
3bb26b10a3 | ||
|
|
3cdc511b2d | ||
|
|
4543d0c80c | ||
|
|
2a740ad2c8 | ||
|
|
7187da0233 | ||
|
|
ab43e4d987 | ||
|
|
8056476db1 | ||
|
|
4b471d6045 | ||
|
|
8b19d7c8eb | ||
|
|
90c6679f03 | ||
|
|
4c73e5fe20 | ||
|
|
dd3a3138a7 | ||
|
|
9e8a091172 | ||
|
|
5d72560a30 | ||
|
|
2a9c65bd3f | ||
|
|
6b4cca55be | ||
|
|
c18139e73f |
No files matched your search
@@ -11,3 +11,5 @@
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
|
||||
new_log_accum Error checking out/updating CVSROOT/new_log_accum
|
||||
@@ -13,3 +13,5 @@
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
|
||||
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
|
||||
@@ -24,3 +24,7 @@
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
|
||||
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to store the last visited directory for newlogaccum.pl.
|
||||
#
|
||||
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
|
||||
use strict;
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# This routine writes a single line to a file
|
||||
sub write_line ($$) {
|
||||
my ($fname, $line) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE "$line\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Create and empty the temporary directory
|
||||
my ($tmpdir) = (tmpdir(1));
|
||||
|
||||
# Store the directory name
|
||||
write_line("$tmpdir/lastdir", shift(@ARGV));
|
||||
Executable
+757
@@ -0,0 +1,757 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to accumulate log messages for an entire tree and send them along
|
||||
# with the diffs; deals correctly with all manner of branching (I hope)
|
||||
#
|
||||
# $Id: new_log_accum,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use MD5;
|
||||
|
||||
# Set this to the full path of a mailer that takes a list
|
||||
# of email addresses as arguments...
|
||||
$MAILER = "/usr/sbin/sendmail -oi -oeq";
|
||||
|
||||
# Set this to the path of the CVS binary responsible for this tree...
|
||||
$CVS = "/usr/bin/cvs";
|
||||
|
||||
# Don't touch this; use the -d command line option
|
||||
$debug = 0;
|
||||
|
||||
# This is initialized by build_mailheader()
|
||||
$boundary = '';
|
||||
|
||||
use POSIX qw(setsid);
|
||||
|
||||
# We have to dissociate from our parent, so that the CVS commit can
|
||||
# complete, before we try to extract the diffs
|
||||
sub daemonize {
|
||||
defined(my $pid = fork()) || die "Can't fork: $!";
|
||||
exit(0)
|
||||
if $pid;
|
||||
setsid() || die "Can't start a new session: $!";
|
||||
}
|
||||
|
||||
# Debugging output
|
||||
sub debug (@) {
|
||||
print STDERR @_
|
||||
if ($debug);
|
||||
}
|
||||
|
||||
# Constants used in the FSM below for parsing the log message
|
||||
sub STATE_NONE { 0 }
|
||||
sub STATE_MODIFIED { 1 }
|
||||
sub STATE_ADDED { 2 }
|
||||
sub STATE_REMOVED { 3 }
|
||||
sub STATE_LOG1 { 4 }
|
||||
sub STATE_LOG2 { 5 }
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# Routine to remove the temporary directory when done
|
||||
sub cleanup_dir ($) {
|
||||
# If we're debugging, we may want to look at the contents...
|
||||
return
|
||||
if ($debug);
|
||||
|
||||
clear_dir($_[0]);
|
||||
rmdir($_[0]);
|
||||
}
|
||||
|
||||
# Retrieve a single line from a specified file
|
||||
sub get_line ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
|
||||
my $line = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
# Chomp off the \n
|
||||
chomp $line;
|
||||
|
||||
return $line;
|
||||
}
|
||||
|
||||
# Routine that only allows one value to be pushed on the array;
|
||||
# implemented by making the first element of the array a hash-reference.
|
||||
# When we add a new value, we also increment the count of an element in
|
||||
# the hash with the key being the array value...
|
||||
sub push_once (\@@) {
|
||||
my ($array, @values) = @_;
|
||||
|
||||
# If the array is empty, create our hash ref
|
||||
push @{$array}, {}
|
||||
if (@{$array} == 0);
|
||||
|
||||
foreach my $value (@values) {
|
||||
push @{$array}, $value
|
||||
if (!exists($array->[0]{$value}));
|
||||
|
||||
$array->[0]{$value}++;
|
||||
}
|
||||
|
||||
return @{$array} - 1;
|
||||
}
|
||||
|
||||
# Filter //, /./, and remove leading ./ or / from filenames
|
||||
sub fname_filter ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
$fname =~ s,//,/,g;
|
||||
$fname =~ s,/\./,/,g;
|
||||
$fname =~ s,^\.?/,,g;
|
||||
|
||||
return $fname;
|
||||
}
|
||||
|
||||
# Store file data in a temporary file
|
||||
sub names_to_file ($$@) {
|
||||
my ($fname, $dir, @names) = @_;
|
||||
|
||||
if (@names > 0) {
|
||||
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
|
||||
|
||||
# Store the directory data
|
||||
print FILE "D $dir\n";
|
||||
|
||||
foreach my $name (@names) {
|
||||
# Mark record as a file...
|
||||
print FILE "F ";
|
||||
|
||||
# Store the tag, if there is one...
|
||||
print FILE "$name->{tag}"
|
||||
if (defined($name->{tag}));
|
||||
|
||||
# Then store old revision, new revision, and file name
|
||||
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
}
|
||||
}
|
||||
|
||||
# Retrieve file data from temporary file; updates branch tags with what it
|
||||
# reads
|
||||
sub file_to_names (\@$) {
|
||||
my ($btags, $fname) = @_;
|
||||
my ($dir) = (undef);
|
||||
my (@names) = ();
|
||||
|
||||
debug "Reading file names from $fname...\n";
|
||||
|
||||
# We may not have, say, added a file in this subdirectory...
|
||||
return ()
|
||||
if (!-e $fname);
|
||||
|
||||
open(FILE, "<$fname");
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
|
||||
# Get record type...
|
||||
my ($type, $data) = split(' ', $_, 2);
|
||||
|
||||
# ok, it's a directory, remember that...
|
||||
if ($type eq "D") {
|
||||
$dir = $data;
|
||||
|
||||
debug "Read directory $dir\n";
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
debug "Read file $data\n";
|
||||
|
||||
# Get all the information about the file
|
||||
my ($tag, $old, $new, $file) = split(':', $data);
|
||||
|
||||
# and store it all
|
||||
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
|
||||
dir => $dir, name => fname_filter("$dir/$file") });
|
||||
|
||||
# Remember the tags...
|
||||
push_once(@{$btags}, $tag)
|
||||
if (defined($tag) && $tag ne "");
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
return @names;
|
||||
}
|
||||
|
||||
# Create a text-formatted list of names
|
||||
sub name_to_list (\@@) {
|
||||
my ($btags, @names) = @_;
|
||||
my (@nlist, @nline) = ();
|
||||
|
||||
debug "Tags:", join(':', @{$btags}), "\n";
|
||||
|
||||
# We group them by tag
|
||||
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
|
||||
debug "Processing tag $tag...\n";
|
||||
|
||||
@nlist = ();
|
||||
|
||||
# Get a list of files by the tag...
|
||||
foreach my $name (@names) {
|
||||
debug "Processing $name->{file}...\n";
|
||||
|
||||
next
|
||||
if ($name->{tag} ne $tag);
|
||||
|
||||
debug "Pushing $name->{name} on \@nlist...\n";
|
||||
push(@nlist, $name->{name});
|
||||
}
|
||||
|
||||
# If the tag is not the empty string, list the tag...
|
||||
push(@nline, " Tag: $tag", " ")
|
||||
if ($tag ne "");
|
||||
|
||||
# Now list each file name
|
||||
foreach my $name (@nlist) {
|
||||
# indent if we run past the end of line limit
|
||||
push(@nline, " ")
|
||||
if (@nline == 0 || ($nline[$#nline] ne " " &&
|
||||
length($nline[$#nline]) + length($name) + 1 > 70));
|
||||
|
||||
# add the file name to the list
|
||||
debug "Adding $name to \@nline...\n";
|
||||
$nline[$#nline] .= " $name";
|
||||
}
|
||||
}
|
||||
|
||||
return @nline;
|
||||
}
|
||||
|
||||
# write the log message to a temporary file
|
||||
sub write_log ($@) {
|
||||
my ($fname, @text) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE join("\n", @text), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Build the header of the commit message: CVSROOT, module name, any
|
||||
# branch tags, and the commit time
|
||||
sub build_header ($@) {
|
||||
my ($module, $subject, $mailto, @branch_tags) = @_;
|
||||
my (@text, @mailto);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
my ($user, $dummy);
|
||||
my ($digest);
|
||||
|
||||
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
|
||||
|
||||
@mailto = @{$mailto};
|
||||
|
||||
# generate a unique boundary by calculating the md5sum of the
|
||||
# current time
|
||||
$digest = new MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, "From: $user");
|
||||
push(@text, "To: " . join(' ', @mailto));
|
||||
push(@text, "Subject: $subject");
|
||||
push(@text, "MIME-Version: 1.0");
|
||||
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
|
||||
push(@text, "");
|
||||
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
|
||||
push(@text, "");
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; charset=us-ascii");
|
||||
push(@text, "Content-Disposition: inline");
|
||||
push(@text, "");
|
||||
|
||||
# Build the commit message header
|
||||
push(@text, "Commiter : $user");
|
||||
push(@text, "CVSROOT : $ENV{CVSROOT}");
|
||||
push(@text, "Module : $module");
|
||||
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
|
||||
if (@branch_tags > 0);
|
||||
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
|
||||
|
||||
return @text, "";
|
||||
}
|
||||
|
||||
# Send the mail message
|
||||
sub send_mail {
|
||||
my ($mailto, $text) = @_;
|
||||
my (@mailto, @text);
|
||||
# I <heart> perl
|
||||
@mailto = @{$mailto};
|
||||
@text = @{$text};
|
||||
|
||||
open(MAIL, "|$MAILER " . join(' ', @mailto));
|
||||
push(@text, "--$boundary--", "");
|
||||
print MAIL join("\n", @text), "\n";
|
||||
close(MAIL);
|
||||
}
|
||||
|
||||
# Find the tmp directory
|
||||
my ($tmpdir) = (tmpdir());
|
||||
|
||||
my (@mailto) = ();
|
||||
my (@files) = ();
|
||||
my (@path) = ();
|
||||
my ($modname, $repdir, $dir) = (undef, undef, undef);
|
||||
|
||||
# Process command line arguments
|
||||
while (@ARGV > 0) {
|
||||
my ($arg) = (shift(@ARGV));
|
||||
|
||||
if ($arg eq '-d') {
|
||||
# Turn on debugging
|
||||
$debug++;
|
||||
} elsif ($arg eq '-M') {
|
||||
# Module name explicitly set -- XXX Not tested, use at your own risk
|
||||
die "Argument for -M missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
$modname = shift(@ARGV);
|
||||
} elsif ($arg eq '-m') {
|
||||
# An address to mail the notification to
|
||||
die "Argument for -m missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
push(@mailto, shift(@ARGV));
|
||||
} else {
|
||||
# the list of filenames passed by CVS--you *must* use %{sVv}!
|
||||
die "Too many arguments!"
|
||||
unless (@files == 0);
|
||||
|
||||
@files = split(" ", $arg);
|
||||
}
|
||||
}
|
||||
|
||||
die "Nobody to mail to"
|
||||
unless (@mailto > 0);
|
||||
|
||||
die "No files to process"
|
||||
unless (@files > 1);
|
||||
|
||||
# The repository directory
|
||||
$repdir = shift(@files);
|
||||
|
||||
# break it appart...
|
||||
@path = split("/", $repdir);
|
||||
|
||||
# Now we know the module name, if it wasn't explicitly set
|
||||
$modname = $path[0]
|
||||
unless (defined($modname));
|
||||
|
||||
# Figure out what our directory is
|
||||
if (@path == 1) {
|
||||
$dir = ".";
|
||||
} else {
|
||||
$dir = join("/", @path[1..$#path]);
|
||||
}
|
||||
|
||||
# append a / to it...
|
||||
$dir .= "/";
|
||||
|
||||
debug "module = $modname\n";
|
||||
debug "dir = $dir\n";
|
||||
debug "path = ", join(":", @path), "\n";
|
||||
debug "files = ", join(":", @files), "\n";
|
||||
debug "tmpdir = $tmpdir\n";
|
||||
|
||||
my (%fversions);
|
||||
|
||||
# Unless its a new directory or imported sources, create file records
|
||||
unless (defined($files[1]) && defined($files[2]) &&
|
||||
(($files[1] eq "New" && $files[2] eq "directory") ||
|
||||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
|
||||
|
||||
foreach my $fname (@files) {
|
||||
# You *must* use %{sVv} in the call in loginfo!
|
||||
die "Invalid filenames"
|
||||
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
|
||||
|
||||
$fversions{$1} = {
|
||||
old => ($2 eq "NONE" ? "0" : $2),
|
||||
new => ($3 eq "NONE" ? "0" : $3),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
# process log message
|
||||
my ($state, $tag) = (STATE_NONE, undef);
|
||||
|
||||
my (@modified, @added, @removed, @log, @branch_tags) = ();
|
||||
|
||||
while (<STDIN>) {
|
||||
chomp;
|
||||
|
||||
debug "State $state, line:$_\n";
|
||||
|
||||
# Ignore empty space at the beginning of the log message
|
||||
next
|
||||
if ($state == STATE_LOG1 && /^\s*$/);
|
||||
|
||||
# We're done ignoring empty space
|
||||
if ($state == STATE_LOG1) {
|
||||
$state = STATE_LOG2;
|
||||
}
|
||||
|
||||
if ($state == STATE_LOG2) {
|
||||
# Don't modify the lines at all if we're processing the log message
|
||||
push(@log, $_);
|
||||
next;
|
||||
} else {
|
||||
# Strip out leading and trailing space
|
||||
s/^\s*(.*?)\s*$/$1/;
|
||||
}
|
||||
|
||||
if (/^Modified Files/) {
|
||||
# Collect list of modified files
|
||||
debug "State switching to STATE_MODIFIED\n";
|
||||
|
||||
$state = STATE_MODIFIED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Added Files/) {
|
||||
# Collect list of added files
|
||||
debug "State switching to STATE_ADDED\n";
|
||||
|
||||
$state = STATE_ADDED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Removed Files/) {
|
||||
# Collect list of removed files
|
||||
debug "State switching to STATE_REMOVED\n";
|
||||
|
||||
$state = STATE_REMOVED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Log Message/) {
|
||||
# Collect log message
|
||||
debug "State switching to STATE_LOG1\n";
|
||||
|
||||
$state = STATE_LOG1;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Revision\/Branch/) {
|
||||
# Parse old-style Revision/Branch field
|
||||
debug "Found a branch tag\n";
|
||||
|
||||
/^[^:]+:\s*(.*)/;
|
||||
|
||||
push_once(@branch_tags, $1);
|
||||
|
||||
warn "Tag == $tag"
|
||||
if (defined($tag));
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
# Ignore the stuff at the top of the commit report
|
||||
next
|
||||
if ($state == STATE_NONE);
|
||||
|
||||
if (/^Tag:\s*(.*)$/) {
|
||||
# Remember the tag
|
||||
debug "Setting tag to $1\n";
|
||||
$tag = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
my (@tfiles) = ();
|
||||
|
||||
# Find the file in our command line list of files
|
||||
foreach my $file (split) {
|
||||
die "Nothing known about file $file!"
|
||||
unless (exists($fversions{$file}));
|
||||
|
||||
push @tfiles, {
|
||||
file => $file,
|
||||
tag => $tag,
|
||||
old => $fversions{$file}{old},
|
||||
new => $fversions{$file}{new},
|
||||
};
|
||||
}
|
||||
|
||||
# Store the file list in the correct array
|
||||
push(@modified, @tfiles)
|
||||
if ($state == STATE_MODIFIED);
|
||||
|
||||
push(@added, @tfiles)
|
||||
if ($state == STATE_ADDED);
|
||||
|
||||
push(@removed, @tfiles)
|
||||
if ($state == STATE_REMOVED);
|
||||
}
|
||||
|
||||
# Remove trailing blank lines from the log message
|
||||
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# If a new directory was added, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "New" && $files[2] eq "directory") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# If there was a sticky tag for the directory, make it a branch tag
|
||||
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
|
||||
push_once(@branch_tags, $1);
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: New directory $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# If an import was done, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "Imported" && $files[2] eq "sources") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: Imported $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
debug "Searching for log file index...";
|
||||
|
||||
my ($i);
|
||||
|
||||
# Look for an empty log file or one that matches our current log message
|
||||
for ($i = 0; ; $i++) {
|
||||
my (@text);
|
||||
|
||||
# found one that doesn't exist...
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read in the log file
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
# If the log file was empty, use it
|
||||
last
|
||||
if (@text == 0);
|
||||
|
||||
# If the log messages are identical, use that
|
||||
last
|
||||
if (join(' ', @log) eq join(' ', @text));
|
||||
}
|
||||
|
||||
debug "$tmpdir/logfile.$i\n";
|
||||
|
||||
# Store modified, added, and removed file lists, along with the log message
|
||||
names_to_file("$tmpdir/modified.$i", $dir, @modified);
|
||||
names_to_file("$tmpdir/added.$i", $dir, @added);
|
||||
names_to_file("$tmpdir/removed.$i", $dir, @removed);
|
||||
write_log("$tmpdir/logfile.$i", @log);
|
||||
|
||||
# Now check to see if we're at the end of our rope
|
||||
my ($lastdir) = (get_line("$tmpdir/lastdir"));
|
||||
|
||||
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
|
||||
|
||||
# Nope, exit instead of sending a message
|
||||
exit(0)
|
||||
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
|
||||
|
||||
debug "At last, we've reached the end\n";
|
||||
|
||||
# We have to daemonize and sleep so that there isn't any lock hanging
|
||||
# around when we get to the cvs rdiff below...
|
||||
daemonize();
|
||||
sleep(10);
|
||||
|
||||
# Build the mail message...
|
||||
my (@text) = ();
|
||||
@files = ();
|
||||
@branch_tags = ();
|
||||
|
||||
for ($i = 0; ; $i++) {
|
||||
# No more log files
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read and insert the log message
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
push(@text, "Log message:", "");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
push(@text, "");
|
||||
close(FILE);
|
||||
|
||||
# read modified list and list all modified files if non-empty
|
||||
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
|
||||
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
|
||||
if (@modified > 0);
|
||||
|
||||
# read added list and list all added files if non-empty
|
||||
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
|
||||
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
|
||||
if (@added > 0);
|
||||
|
||||
# read removed list and list all removed files if non-empty
|
||||
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
|
||||
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
|
||||
if (@removed > 0);
|
||||
|
||||
# remember all the files we looked at
|
||||
push(@files, @modified, @added, @removed);
|
||||
}
|
||||
|
||||
# Now that name_to_list has rebuilt our list of branch tags, we can build the
|
||||
# header and prepend it to the message
|
||||
unshift(@text, build_header($modname, "Module $modname: Change committed",
|
||||
\@mailto, @branch_tags));
|
||||
|
||||
# sort the files out for our diff
|
||||
@files = sort { $a->{name} cmp $b->{name} } @files;
|
||||
|
||||
my ($user, $filename);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
$user = getpwuid($<);
|
||||
|
||||
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
|
||||
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; name=\"$filename\"");
|
||||
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
|
||||
push(@text, "Content-Transfer-Encoding: 8bit");
|
||||
push(@text, "");
|
||||
|
||||
foreach my $file (@files) {
|
||||
debug "Diffing file $file->{name}...\n";
|
||||
|
||||
# Run cvs rdiff, extracting a diff between the old version and the new
|
||||
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
|
||||
"$modname/$file->{name}|");
|
||||
while (<DIFF>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(DIFF);
|
||||
}
|
||||
|
||||
# send the mail...
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# and clean up after ourselves
|
||||
cleanup_dir($tmpdir);
|
||||
+9
-4
@@ -1,4 +1,9 @@
|
||||
drevil:nNwcK94cKMqZI:fs2source
|
||||
inquisitor:Jh.dOjaiO2jHk:fs2source
|
||||
anonymous:EqQXnO5cz9yBA:fs2source
|
||||
|
||||
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
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
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,13 @@
|
||||
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.
|
||||
+1868
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,148 @@
|
||||
# Microsoft Developer Studio Project File - Name="Freespace2" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=Freespace2 - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Freespace2.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Freespace2.mak" CFG="Freespace2 - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Freespace2 - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Freespace2 - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Freespace2", RHWBAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Freespace2 - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release\Profile"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "_MBCS" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# 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"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Freespace2 - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug\Profile"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo /o"debug/profile/Freespace2.bsc" "./debug/profile/*.sbr"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"debug\fs2_open_debug.exe" /libpath:"debug"
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no /map
|
||||
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
|
||||
InputPath=.\debug\fs2_open_debug.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"c:\games\freespace2\fs2_open.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) c:\games\freespace2
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Freespace2 - Win32 Release"
|
||||
# Name "Freespace2 - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\app_icon.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\FreeSpace.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\FreeSpace.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\FreeSpace.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\FreespaceResource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\freespace2\goal_com.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\freespace2\goal_fail.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\freespace2\goal_inc.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\freespace2\goal_none.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\freespace2\goal_ord.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,44 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Freespace2"=".\Freespace2.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name code
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "code"=".\code\code.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -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
-79
@@ -1,80 +1,4 @@
|
||||
README for fs2_open, Release 0.1
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
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
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -1,621 +0,0 @@
|
||||
TARGET = fs2
|
||||
|
||||
LDFLAGS = -g
|
||||
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-Iwindows_stub \
|
||||
-IAnim -IAsteroid -IBmpman -ICFile -ICmdline -ICMeasure -IControlConfig \
|
||||
-ICutscene -IDebris -IDebugConsole -IDirectX -IFireball -IGameHelp -IFREESPACE2 \
|
||||
-IGameSequence -IGamesnd -IGlide -IGlobalIncs -IGraphics -IHud -IIo -IJumpNode \
|
||||
-ILighting -IMath -IMenuUI -IMission -IMissionUI -IModel -INetwork -IObject \
|
||||
-IObserver -IOsApi -IPalman -IParse -IParticle -IPcxUtils -IPhysics -IPlayerman \
|
||||
-IPopup -IRadar -IRender -IShip -ISound -IStarfield -IStats -ITgaUtils -IUI -IVCodec \
|
||||
-fno-exceptions \
|
||||
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D -DNO_SOUND -DNO_JOYSTICK -DNO_NETWORK
|
||||
|
||||
|
||||
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_OBJFILES =
|
||||
#GLIDE_OBJFILES = \
|
||||
# Glide/glide.o
|
||||
|
||||
# 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)
|
||||
|
||||
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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -178,16 +181,16 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "animplay.h"
|
||||
#include "linklist.h"
|
||||
#include "timer.h"
|
||||
#include "bmpman.h"
|
||||
#include "2d.h"
|
||||
#include "3d.h"
|
||||
#include "grinternal.h"
|
||||
#include "pcxutils.h"
|
||||
#include "packunpack.h"
|
||||
#include "cfile.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "graphics/grinternal.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
static color Color_xparent;
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -99,7 +102,7 @@
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct anim;
|
||||
struct anim_info;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
@@ -18,6 +18,9 @@
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -149,12 +152,12 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "grinternal.h"
|
||||
#include "bmpman.h"
|
||||
#include "palman.h"
|
||||
#include "2d.h"
|
||||
#include "animplay.h"
|
||||
#include "packunpack.h"
|
||||
#include "graphics/grinternal.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "palman/palman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "anim/packunpack.h"
|
||||
|
||||
int packer_code = PACKER_CODE;
|
||||
int transparent_code = 254;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
@@ -18,6 +18,9 @@
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -148,7 +151,7 @@
|
||||
#ifndef __PACKUNPACK_H__
|
||||
#define __PACKUNPACK_H__
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct CFILE;
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
@@ -263,29 +266,29 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "asteroid.h"
|
||||
#include "object.h"
|
||||
#include "objcollide.h"
|
||||
#include "freespace.h"
|
||||
#include "timer.h"
|
||||
#include "3d.h"
|
||||
#include "fireballs.h"
|
||||
#include "gamesnd.h"
|
||||
#include "bmpman.h"
|
||||
#include "particle.h"
|
||||
#include "linklist.h"
|
||||
#include "hudescort.h"
|
||||
#include "shiphit.h"
|
||||
#include "staticrand.h"
|
||||
#include "systemvars.h"
|
||||
#include "localize.h"
|
||||
#include "scoring.h"
|
||||
#include "hudtarget.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "object/object.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/timer.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "particle/particle.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "hud/hudescort.h"
|
||||
#include "ship/shiphit.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "localization/localize.h"
|
||||
#include "stats/scoring.h"
|
||||
#include "hud/hudtarget.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multiutil.h"
|
||||
#include "multimsgs.h"
|
||||
#include "multi.h"
|
||||
#include "network/multiutil.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multi.h"
|
||||
#endif
|
||||
|
||||
#ifndef FS2_DEMO
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -122,8 +125,8 @@
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
#include "ship.h"
|
||||
#include "parselo.h" // for NAME_LENGTH
|
||||
#include "ship/ship.h"
|
||||
#include "parse/parselo.h" // for NAME_LENGTH
|
||||
|
||||
struct object;
|
||||
struct polymodel;
|
||||
|
||||
+309
-45
@@ -9,13 +9,48 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2003-01-19 01:07:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code to load and manage all bitmaps for the game
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/21 15:36:25 mharris
|
||||
* Added ifdef WIN32
|
||||
*
|
||||
@@ -244,7 +279,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.
|
||||
@@ -471,25 +506,31 @@
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include "pstypes.h"
|
||||
#include "pcxutils.h"
|
||||
#include "bmpman.h"
|
||||
#include "palman.h"
|
||||
#include "2d.h"
|
||||
#include "animplay.h"
|
||||
#include "timer.h"
|
||||
#include "systemvars.h"
|
||||
#include "key.h"
|
||||
#include "packunpack.h"
|
||||
#include "cfile.h"
|
||||
#include "grinternal.h"
|
||||
#include "tgautils.h"
|
||||
#include "ship.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "pcxutils/pcxutils.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "palman/palman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "io/timer.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "io/key.h"
|
||||
#include "anim/packunpack.h"
|
||||
#include "cfile/cfile.h"
|
||||
#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;
|
||||
|
||||
|
||||
// keep this defined to use per-ship nondarkening pixels
|
||||
#define BMPMAN_SPECIAL_NONDARK
|
||||
|
||||
@@ -500,6 +541,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
|
||||
#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)
|
||||
|
||||
typedef union bm_extra_info {
|
||||
struct {
|
||||
@@ -538,6 +582,7 @@ typedef struct bitmap_entry {
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
|
||||
int mem_taken; //how much memory it takes up
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
@@ -745,8 +790,6 @@ void bm_init()
|
||||
#endif
|
||||
bm_free_data(i); // clears flags, bbp, data, etc
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
@@ -893,16 +936,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,8 +958,10 @@ int bm_load( char * real_filename )
|
||||
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();
|
||||
|
||||
@@ -934,23 +978,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){
|
||||
@@ -973,13 +1045,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 {
|
||||
@@ -988,6 +1092,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 );
|
||||
@@ -1013,7 +1118,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 );
|
||||
@@ -1664,6 +1769,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 );
|
||||
|
||||
@@ -1697,9 +1831,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); //?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1782,6 +1926,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;
|
||||
@@ -2044,6 +2194,8 @@ 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 )
|
||||
{
|
||||
@@ -2053,7 +2205,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;
|
||||
@@ -2071,7 +2243,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;
|
||||
@@ -2090,7 +2262,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 {
|
||||
@@ -2109,7 +2300,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;
|
||||
@@ -2232,7 +2423,10 @@ int bm_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];
|
||||
|
||||
@@ -2328,6 +2522,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()
|
||||
{
|
||||
@@ -2337,7 +2547,7 @@ void BM_SELECT_SCREEN_FORMAT()
|
||||
Gr_current_alpha = &Gr_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
@@ -2355,6 +2565,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
|
||||
@@ -2368,7 +2585,7 @@ void BM_SELECT_TEX_FORMAT()
|
||||
Gr_current_alpha = &Gr_t_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
@@ -2386,6 +2603,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
|
||||
@@ -2399,7 +2622,7 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
Gr_current_alpha = &Gr_ta_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
@@ -2417,6 +2640,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
|
||||
@@ -2605,3 +2834,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;
|
||||
}
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-19 01:07:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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
|
||||
*
|
||||
@@ -351,4 +362,9 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
// 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);
|
||||
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_size(int num);
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,35 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2002-11-10 16:29:53 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.7 2002/05/21 15:37:14 mharris
|
||||
* Cosmetics - reformat Pathtypes to line up again
|
||||
*
|
||||
@@ -182,11 +204,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <errno.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#ifdef unix
|
||||
#include <sys/stat.h>
|
||||
@@ -194,15 +219,16 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "cfile.h"
|
||||
#include "encrypt.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "parse/encrypt.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "cfilesystem.h"
|
||||
#include "cfilearchive.h"
|
||||
#include "osapi.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
|
||||
@@ -273,7 +299,7 @@ int cfget_cfile_block();
|
||||
CFILE *cf_open_fill_cfblock(FILE * fp, int type);
|
||||
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
|
||||
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
|
||||
#elif defined unix
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
|
||||
@@ -343,7 +369,7 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
|
||||
// are we in a root directory?
|
||||
if(cfile_in_root_dir(buf)){
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
MessageBox((HWND)NULL, "Freespace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error: Freespace2/Fred2 cannot be run from a drive root directory!\n");
|
||||
@@ -361,7 +387,7 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
buf[i] = 0;
|
||||
cfile_chdir(buf);
|
||||
} else {
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error trying to determine executable root directory!\n");
|
||||
@@ -397,7 +423,7 @@ void cfile_refresh()
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
// Changes to a drive if valid.. 1=A, 2=B, etc
|
||||
// If flag, then changes to it.
|
||||
// Returns 0 if not-valid, 1 if valid.
|
||||
@@ -443,7 +469,7 @@ int cfile_push_chdir(int type)
|
||||
Drive = strchr(dir, ':');
|
||||
|
||||
if (Drive) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
@@ -460,7 +486,7 @@ int cfile_push_chdir(int type)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#endif
|
||||
return 2;
|
||||
@@ -482,7 +508,7 @@ int cfile_chdir(char *dir)
|
||||
|
||||
Drive = strchr(dir, ':');
|
||||
if (Drive) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
@@ -499,7 +525,7 @@ int cfile_chdir(char *dir)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#endif
|
||||
return 2;
|
||||
@@ -531,7 +557,7 @@ int cfile_flush_dir(int dir_type)
|
||||
|
||||
// proceed to delete the files
|
||||
del_count = 0;
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
_finddata_t find;
|
||||
find_handle = _findfirst( "*", &find );
|
||||
if (find_handle != -1) {
|
||||
@@ -648,7 +674,7 @@ int cf_exist( char *filename, int dir_type )
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
void cf_attrib(char *filename, int set, int clear, int dir_type)
|
||||
{
|
||||
char longname[MAX_PATH_LEN];
|
||||
@@ -819,7 +845,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
|
||||
// Can't open memory mapped files out of pack files
|
||||
if ( offset == 0 ) {
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
HANDLE hFile;
|
||||
|
||||
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
@@ -922,7 +948,7 @@ int cfclose( CFILE * cfile )
|
||||
result = 0;
|
||||
if ( cb->data ) {
|
||||
// close memory mapped file
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
result = UnmapViewOfFile((void*)cb->data);
|
||||
Assert(result);
|
||||
result = CloseHandle(cb->hInFile);
|
||||
@@ -973,7 +999,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
cfbp->fp = fp;
|
||||
cfbp->dir_type = type;
|
||||
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
cf_init_lowlevel_read_code(cfp,0,filelength(fileno(fp)) );
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
@@ -1026,7 +1052,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
//
|
||||
// returns: ptr CFILE structure.
|
||||
//
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
#elif defined unix
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
@@ -1046,13 +1072,13 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
cfp = &Cfile_list[cfile_block_index];
|
||||
cfp->id = cfile_block_index;
|
||||
cfbp->fp = NULL;
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
cfbp->hInFile = hFile;
|
||||
#endif
|
||||
cfbp->dir_type = type;
|
||||
|
||||
cf_init_lowlevel_read_code(cfp,0 , 0 );
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
cfbp->hMapFile = CreateFileMapping(cfbp->hInFile, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
if (cfbp->hMapFile == NULL) {
|
||||
nprintf(("Error", "Could not create file-mapping object.\n"));
|
||||
@@ -1756,3 +1782,4 @@ int cflush(CFILE *cfile)
|
||||
|
||||
|
||||
|
||||
|
||||
+52
-32
@@ -9,13 +9,32 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-11-10 16:29:53 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.3 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
@@ -338,9 +357,9 @@
|
||||
#define __CFILE_H__
|
||||
|
||||
#include <time.h>
|
||||
#include "pstypes.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#define DIR_SEPARATOR_STR "\\"
|
||||
#elif defined unix
|
||||
@@ -372,44 +391,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))
|
||||
@@ -608,7 +628,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
// Functions to change directories
|
||||
int cfile_chdir(char *dir);
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
int cfile_chdrive(int DriveNum, int flag);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,14 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* 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.1 2002/07/29 19:17:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -79,17 +85,17 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "cfile.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "cfilearchive.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
|
||||
#define CHECK_POSITION
|
||||
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-07-07 19:55:58 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* External def's for CfileArchive.cpp. This should only be used
|
||||
* internally by cfile stuff.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
@@ -63,7 +66,7 @@ typedef struct Cfile_block {
|
||||
int dir_type; // directory location
|
||||
FILE *fp; // File pointer if opening an individual file
|
||||
void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
HANDLE hInFile; // Handle from CreateFile()
|
||||
HANDLE hMapFile; // Handle from CreateFileMapping()
|
||||
#else
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for doing directory lists and sorts
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/07/29 19:37:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -57,16 +63,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "cfile.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
|
||||
// n = number of filenames in list to sort
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-11-10 16:28:08 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* 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,24 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.6 2002/05/24 16:44:10 mharris
|
||||
* Fix unix "find files" operations so they return relative path
|
||||
*
|
||||
@@ -100,24 +118,25 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef unix
|
||||
#include <glob.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
//#include "outwnd.h"
|
||||
//#include "vecmat.h"
|
||||
//#include "timer.h"
|
||||
#include "cfile.h"
|
||||
#include "cfilesystem.h"
|
||||
#include "localize.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cfile/cfilesystem.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#define CF_ROOTTYPE_PATH 0
|
||||
#define CF_ROOTTYPE_PACK 1
|
||||
@@ -239,13 +258,14 @@ 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
|
||||
#if defined _WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
|
||||
int find_handle;
|
||||
@@ -328,13 +348,15 @@ 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
|
||||
|
||||
#if defined _WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
|
||||
int find_handle;
|
||||
@@ -353,12 +375,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;
|
||||
@@ -425,12 +448,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 );
|
||||
}
|
||||
@@ -439,6 +467,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;
|
||||
|
||||
//======================================================
|
||||
@@ -491,12 +521,12 @@ 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 );
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
strcat( search_path, "*.*" );
|
||||
|
||||
int find_handle;
|
||||
@@ -584,9 +614,7 @@ 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 ));
|
||||
@@ -612,6 +640,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;
|
||||
|
||||
@@ -635,38 +664,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;
|
||||
@@ -696,7 +722,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 ) {
|
||||
@@ -773,7 +799,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
FILE *fp = fopen(filespec, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) {
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
*size = filelength(fileno(fp));
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
@@ -814,7 +840,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
FILE *fp = fopen(longname, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) {
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
*size = filelength(fileno(fp));
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
@@ -859,8 +885,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);
|
||||
@@ -883,12 +909,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -944,6 +971,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;
|
||||
}
|
||||
|
||||
@@ -958,12 +986,13 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
|
||||
cf_create_default_path_string( filespec, pathtype, filter );
|
||||
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
_finddata_t find;
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (num_files >= max)
|
||||
|
||||
break;
|
||||
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
@@ -1038,8 +1067,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;
|
||||
}
|
||||
@@ -1082,6 +1112,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return num_files;
|
||||
}
|
||||
|
||||
@@ -1115,6 +1146,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;
|
||||
}
|
||||
|
||||
@@ -1138,14 +1170,14 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
pathtype, filter));
|
||||
|
||||
// Search the default directories
|
||||
#if defined WIN32
|
||||
#if defined _WIN32
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (num_files >= max)
|
||||
if (num_files >= max)
|
||||
break;
|
||||
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
@@ -1220,6 +1252,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)) {
|
||||
@@ -1260,6 +1293,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
}
|
||||
|
||||
Get_file_list_filter = NULL;
|
||||
|
||||
return num_files;
|
||||
}
|
||||
|
||||
@@ -1292,7 +1326,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,63 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2003-02-22 04:13:17 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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.
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.3 2002/05/08 17:29:17 mharris
|
||||
* more port tweaks
|
||||
*
|
||||
@@ -196,12 +248,12 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "pstypes.h"
|
||||
#include "cmdline.h"
|
||||
#include "linklist.h"
|
||||
#include "systemvars.h"
|
||||
#include "multi.h"
|
||||
#include "cfile.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "network/multi.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// variables
|
||||
class cmdline_parm {
|
||||
@@ -241,6 +293,13 @@ cmdline_parm d3d_32bit("-32bit", NULL);
|
||||
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 dshowvid_arg("-dshowvid", NULL); // Allows video streaming
|
||||
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
|
||||
cmdline_parm fps_arg("-fps", NULL);
|
||||
|
||||
int Cmdline_multi_stream_chat_to_file = 0;
|
||||
int Cmdline_freespace_no_sound = 0;
|
||||
@@ -258,6 +317,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 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;
|
||||
@@ -267,6 +328,14 @@ 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_dshowvid = 0;
|
||||
int Cmdline_show_fps = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
static cmdline_parm Parm_list(NULL, NULL);
|
||||
static int Parm_list_inited = 0;
|
||||
@@ -482,13 +551,13 @@ char *cmdline_parm::str()
|
||||
}
|
||||
|
||||
// external entry point into this modules
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
int parse_cmdline(char *cmdline)
|
||||
#else
|
||||
int parse_cmdline(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
os_init_cmdline(cmdline);
|
||||
#else
|
||||
if (argc > 1) {
|
||||
@@ -625,6 +694,37 @@ int parse_cmdline(int argc, char *argv[])
|
||||
if(d3d_window.found()){
|
||||
Cmdline_window = 1;
|
||||
}
|
||||
if(almission_arg.found()){//DTP for autoload mission // developer oritentated
|
||||
Cmdline_almission = almission_arg.str();
|
||||
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(dshowvid_arg.found() ) {
|
||||
Cmdline_dshowvid = 1;
|
||||
}
|
||||
|
||||
if(mod_arg.found() ) {
|
||||
Cmdline_mod = mod_arg.str();
|
||||
}
|
||||
|
||||
|
||||
if (fps_arg.found())
|
||||
{
|
||||
Cmdline_show_fps = 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5,15 +5,60 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2003-02-22 04:13:17 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/08 17:29:17 mharris
|
||||
* more port tweaks
|
||||
*
|
||||
@@ -154,7 +199,7 @@
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
int parse_cmdline(char *cmdline);
|
||||
#else
|
||||
int parse_cmdline(int argc, char *argv[]);
|
||||
@@ -191,5 +236,14 @@ extern int Cmdline_mouse_coords;
|
||||
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_dshowvid; //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.
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -205,26 +208,26 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "systemvars.h"
|
||||
#include "cmeasure.h"
|
||||
#include "freespace.h"
|
||||
#include "vecmat.h"
|
||||
#include "2d.h"
|
||||
#include "3d.h"
|
||||
#include "model.h"
|
||||
#include "physics.h"
|
||||
#include "floating.h"
|
||||
#include "model.h"
|
||||
#include "ship.h"
|
||||
#include "timer.h"
|
||||
#include "fireballs.h"
|
||||
#include "radar.h"
|
||||
#include "missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd.h"
|
||||
#include "objectsnd.h"
|
||||
#include "sound.h"
|
||||
#include "staticrand.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "model/model.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "ship/ship.h"
|
||||
#include "io/timer.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "sound/sound.h"
|
||||
#include "math/staticrand.h"
|
||||
|
||||
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
|
||||
cmeasure Cmeasures[MAX_CMEASURES];
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -112,8 +115,8 @@
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
#include "parselo.h"
|
||||
#include "object.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#define MAX_CMEASURES 64
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/16 06:06:23 mharris
|
||||
* ifndef NO_JOYSTICK
|
||||
*
|
||||
@@ -300,33 +303,33 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "freespace.h"
|
||||
#include "controlsconfig.h"
|
||||
#include "gamesequence.h"
|
||||
#include "player.h"
|
||||
#include "2d.h"
|
||||
#include "hudsquadmsg.h"
|
||||
#include "key.h"
|
||||
#include "timer.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "playerman/player.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "hud/hudsquadmsg.h"
|
||||
#include "io/key.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "mouse.h"
|
||||
#include "ui.h"
|
||||
#include "joy.h"
|
||||
#include "bmpman.h"
|
||||
#include "sound.h"
|
||||
#include "gamesnd.h"
|
||||
#include "missionscreencommon.h"
|
||||
#include "font.h"
|
||||
#include "hud.h"
|
||||
#include "managepilot.h"
|
||||
#include "contexthelp.h"
|
||||
#include "popup.h"
|
||||
#include "uidefs.h"
|
||||
#include "alphacolors.h"
|
||||
#include "io/mouse.h"
|
||||
#include "ui/ui.h"
|
||||
#include "io/joy.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "sound/sound.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "graphics/font.h"
|
||||
#include "hud/hud.h"
|
||||
#include "playerman/managepilot.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "popup/popup.h"
|
||||
#include "ui/uidefs.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multi_pmsg.h"
|
||||
#include "multiutil.h"
|
||||
#include "network/multi_pmsg.h"
|
||||
#include "network/multiutil.h"
|
||||
#endif
|
||||
|
||||
#define NUM_SYSTEM_KEYS 14
|
||||
|
||||
@@ -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,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $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
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -372,10 +382,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "controlsconfig.h"
|
||||
#include "key.h"
|
||||
#include "joy.h"
|
||||
#include "localize.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "io/key.h"
|
||||
#include "io/joy.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#define TARGET_TAB 0
|
||||
#define SHIP_TAB 1
|
||||
@@ -533,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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Applet for crypting strings.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -28,7 +31,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "crypt.h"
|
||||
#include "globalincs/crypt.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-08-27 13:38:57 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/16 00:39:47 mharris
|
||||
* Added ifdef WIN32 around cd stuff
|
||||
*
|
||||
@@ -144,19 +153,19 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "cutscenes.h"
|
||||
#include "ui.h"
|
||||
#include "cfile.h"
|
||||
#include "gamesnd.h"
|
||||
#include "gamesequence.h"
|
||||
#include "freespace.h"
|
||||
#include "key.h"
|
||||
#include "bmpman.h"
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
// #include "movie.h"
|
||||
#include "popup.h"
|
||||
#include "mainhallmenu.h"
|
||||
#include "alphacolors.h"
|
||||
#include "localize.h"
|
||||
#include "popup/popup.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage",
|
||||
@@ -223,7 +232,7 @@ void cutscene_init()
|
||||
// returns -1 on failure.
|
||||
int cutscenes_get_cd_num( char *filename )
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#if defined(OEM_BUILD)
|
||||
return 0; // only 1 cd for OEM
|
||||
#else
|
||||
@@ -357,7 +366,7 @@ static char *Text_lines[MAX_TEXT_LINES];
|
||||
|
||||
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
int cd_present = 0;
|
||||
int cd_drive_num;
|
||||
int cd_mve_is_on;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -50,7 +53,7 @@
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
#include "parselo.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
#define MAX_CUTSCENES 10
|
||||
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "movie.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/gropengl.h"
|
||||
|
||||
bool movie_shutdown_fgx = false;
|
||||
|
||||
void movie_set_shutdown_fgx(bool state)
|
||||
{
|
||||
movie_shutdown_fgx = state;
|
||||
}
|
||||
|
||||
bool movie_play(char *name, int unknown_value)
|
||||
{
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup(0);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name1,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name1);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
|
||||
/*
|
||||
** Check second file exists
|
||||
*/
|
||||
FILE *fp2 = fopen(name2,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name2);
|
||||
|
||||
if(fp2 == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp2);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup();
|
||||
}
|
||||
|
||||
os_app_activate_set(false);
|
||||
|
||||
dx8show_play_cutscene(name1);
|
||||
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
dx8show_play_cutscene(name2);
|
||||
|
||||
os_app_activate_set(true);
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/13 21:43:37 mharris
|
||||
* A little more network and sound cleanup
|
||||
*
|
||||
@@ -217,26 +220,26 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "3d.h"
|
||||
#include "bmpman.h"
|
||||
#include "object.h"
|
||||
#include "debris.h"
|
||||
#include "fireballs.h"
|
||||
#include "radar.h"
|
||||
#include "missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd.h"
|
||||
#include "objectsnd.h"
|
||||
#include "linklist.h"
|
||||
#include "systemvars.h"
|
||||
#include "particle.h"
|
||||
#include "freespace.h"
|
||||
#include "objcollide.h"
|
||||
#include "timer.h"
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "object/object.h"
|
||||
#include "debris/debris.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "radar/radar.h"
|
||||
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "object/objectsnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "particle/particle.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/objcollide.h"
|
||||
#include "io/timer.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multi.h"
|
||||
#include "multimsgs.h"
|
||||
#include "multiutil.h"
|
||||
#include "network/multi.h"
|
||||
#include "network/multimsgs.h"
|
||||
#include "network/multiutil.h"
|
||||
#endif
|
||||
|
||||
#define MAX_LIFE 10.0f
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -101,14 +104,14 @@
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "freespace.h"
|
||||
#include "font.h"
|
||||
#include "timer.h"
|
||||
#include "2d.h"
|
||||
#include "key.h"
|
||||
#include "alphacolors.h"
|
||||
#include "osapi.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/timer.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/key.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "osapi/osapi.h"
|
||||
|
||||
#define MAX_COMMANDS 300
|
||||
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
#include "dbugfile.h"
|
||||
|
||||
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()
|
||||
{
|
||||
char big_buffer[1000];
|
||||
char temp_buff[512];
|
||||
|
||||
strcpy(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.
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename, "(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ")-(");
|
||||
strcat(big_buffer, " ");
|
||||
_strdate( 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 >= 0)
|
||||
{
|
||||
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
|
||||
{
|
||||
dbugfile_filename[len] = '-';
|
||||
}
|
||||
len--;
|
||||
}
|
||||
|
||||
// open file
|
||||
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\n", version, release_type);
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef _DBUGFILE_HEADER_
|
||||
#define _DBUGFILE_HEADER_
|
||||
|
||||
void dbugfile_init();
|
||||
void dbugfile_deinit();
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
|
||||
#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_9(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
|
||||
|
||||
#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_9(t,a,b,c,d,e,f,g,h) ;
|
||||
|
||||
#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
|
||||
*/
|
||||
+23
-16
@@ -9,12 +9,18 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -41,20 +47,21 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "demo.h"
|
||||
#include "missionload.h"
|
||||
#include "ship.h"
|
||||
#include "linklist.h"
|
||||
#include "freespace.h"
|
||||
#include "object.h"
|
||||
#include "timer.h"
|
||||
#include "gamesequence.h"
|
||||
#include "systemvars.h"
|
||||
#include "cfile.h"
|
||||
#include "missionmessage.h"
|
||||
#include "missionparse.h"
|
||||
#include "shipfx.h"
|
||||
#include "shiphit.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "demo/demo.h"
|
||||
#include "mission/missionload.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "object/object.h"
|
||||
#include "io/timer.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "mission/missionmessage.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "ship/shiphit.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
// DEMO DEFINES/VARS
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,240 @@
|
||||
#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;
|
||||
|
||||
// Initialize COM
|
||||
RUN_FUNCTION_ROF(CoInitialize(NULL));
|
||||
|
||||
// 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();
|
||||
CoUninitialize();
|
||||
|
||||
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.
@@ -97,8 +97,8 @@ typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
|
||||
|
||||
#endif
|
||||
|
||||
#include "vd3dtypes.h"
|
||||
#include "vd3dcaps.h"
|
||||
#include "directx/vd3dtypes.h"
|
||||
#include "directx/vd3dcaps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*
|
||||
* Pull in DirectDraw include file automatically:
|
||||
*/
|
||||
#include "vddraw.h"
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Content: Direct3D internal include file
|
||||
*@@BEGIN_MSINTERNAL
|
||||
*
|
||||
* $Id: vd3di.h,v 2.0 2002-06-03 04:02:21 penguin Exp $
|
||||
* $Id: vd3di.h,v 2.2 2002-08-01 01:41:04 penguin Exp $
|
||||
*
|
||||
* History:
|
||||
* Date By Reason
|
||||
@@ -33,11 +33,11 @@
|
||||
#include "vddrawp.h"
|
||||
#if 0
|
||||
//@@END_MSINTERNAL
|
||||
#include "vddraw.h"
|
||||
#include "directx/vddraw.h"
|
||||
//@@BEGIN_MSINTERNAL
|
||||
#endif
|
||||
//@@END_MSINTERNAL
|
||||
#include "vd3d.h"
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
// @@BEGIN_MSINTERNAL
|
||||
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include "rlreg.h"
|
||||
#include "lists.h"
|
||||
#include "object.h"
|
||||
#include "object/object.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -383,7 +383,7 @@ typedef struct _DIRECT3DDEVICEI
|
||||
D3DVALUE perspective_tolerance;
|
||||
|
||||
/* Library information */
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
HINSTANCE hDrvDll;
|
||||
char dllname[MAXPATH];
|
||||
char base[256];
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#ifndef __D3DRM_H__
|
||||
#define __D3DRM_H__
|
||||
|
||||
#include "vddraw.h"
|
||||
#include "vd3drmobj.h"
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3drmobj.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#define __D3DRMDEFS_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include "vd3dtypes.h"
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#define D3DRMAPI __stdcall
|
||||
#else
|
||||
#define D3DRMAPI
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <objbase.h> /* Use Windows header files */
|
||||
#define VIRTUAL
|
||||
|
||||
#include "vd3drmdef.h"
|
||||
#include "vd3d.h"
|
||||
#include "directx/vd3drmdef.h"
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -10,13 +10,16 @@
|
||||
#ifndef __D3DRMWIN_H__
|
||||
#define __D3DRMWIN_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "vd3drm.h"
|
||||
#include "vddraw.h"
|
||||
#include "vd3d.h"
|
||||
|
||||
#include "directx/vd3drm.h"
|
||||
#include "directx/vddraw.h"
|
||||
#include "directx/vd3d.h"
|
||||
|
||||
/*
|
||||
* GUIDS used by Direct3DRM Windows interface
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
#ifndef _D3DTYPES_H_
|
||||
#define _D3DTYPES_H_
|
||||
|
||||
#if (! defined WIN32) && (! defined WIN95)
|
||||
#if (! defined _WIN32) && (! defined WIN95)
|
||||
#include "subwtype.h"
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include "vddraw.h"
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef __DPLOBBY_INCLUDED__
|
||||
#define __DPLOBBY_INCLUDED__
|
||||
|
||||
#include "vdplay.h"
|
||||
#include "directx/vdplay.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
#include "vd3dtypes.h"
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
|
||||
@@ -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,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-07-07 19:55:58 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for program exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/07 02:58:10 mharris
|
||||
* ifdef around pragma
|
||||
*
|
||||
@@ -32,7 +35,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef MSVC
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // Include this file only once
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-12-07 01:37:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -321,26 +332,28 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vecmat.h"
|
||||
#include "tmapper.h"
|
||||
#include "2d.h"
|
||||
#include "3d.h"
|
||||
#include "bmpman.h"
|
||||
#include "model.h"
|
||||
#include "key.h"
|
||||
#include "physics.h"
|
||||
#include "floating.h"
|
||||
#include "model.h"
|
||||
#include "lighting.h"
|
||||
#include "object.h"
|
||||
#include "ship.h"
|
||||
#include "systemvars.h"
|
||||
#include "fireballs.h"
|
||||
#include "linklist.h"
|
||||
#include "gamesnd.h"
|
||||
#include "localize.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "model/model.h"
|
||||
#include "io/key.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "lighting/lighting.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#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
|
||||
|
||||
@@ -505,7 +518,9 @@ void fireball_load_data()
|
||||
|
||||
if ( Warp_glow_bitmap == -1 ) {
|
||||
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
|
||||
}
|
||||
}
|
||||
|
||||
// polymodel Warp_pm;
|
||||
|
||||
}
|
||||
|
||||
@@ -534,6 +549,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));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -627,6 +647,7 @@ 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 );
|
||||
|
||||
@@ -5,17 +5,28 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:12:39 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -157,8 +168,8 @@
|
||||
#ifndef _FIREBALLS_H
|
||||
#define _FIREBALLS_H
|
||||
|
||||
#include "object.h"
|
||||
#include "cfile.h"
|
||||
#include "object/object.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// these values correspond to the fireball.tbl entries
|
||||
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
|
||||
@@ -203,4 +214,6 @@ float fireball_lifeleft_percent( object *obj );
|
||||
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
|
||||
extern int Warp_glow_bitmap; // Internal
|
||||
|
||||
extern int wm;
|
||||
|
||||
#endif /* _FIREBALLS_H */
|
||||
@@ -7,15 +7,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-05 23:41:50 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
@@ -114,24 +125,27 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "vecmat.h"
|
||||
#include "tmapper.h"
|
||||
#include "2d.h"
|
||||
#include "3d.h"
|
||||
#include "bmpman.h"
|
||||
#include "model.h"
|
||||
#include "key.h"
|
||||
#include "physics.h"
|
||||
#include "floating.h"
|
||||
#include "model.h"
|
||||
#include "lighting.h"
|
||||
#include "object.h"
|
||||
#include "ship.h"
|
||||
#include "systemvars.h"
|
||||
#include "animplay.h"
|
||||
#include "fireballs.h"
|
||||
#include "linklist.h"
|
||||
#include "timer.h"
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "render/3d.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "model/model.h"
|
||||
#include "io/key.h"
|
||||
#include "physics/physics.h"
|
||||
#include "math/floating.h"
|
||||
#include "model/model.h"
|
||||
#include "lighting/lighting.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "anim/animplay.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "Weapon/Beam.h"
|
||||
|
||||
extern int wm;
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
@@ -161,15 +175,19 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
|
||||
}
|
||||
|
||||
#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 i;
|
||||
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
|
||||
// gr_zbuffering = 0;
|
||||
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
@@ -177,43 +195,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){
|
||||
float model_Interp_scale_x = radius /20;
|
||||
float model_Interp_scale_y = radius /20;
|
||||
float model_Interp_scale_z = max_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_gloabals(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_gloabals(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 );
|
||||
|
||||
@@ -262,9 +346,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
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* FreeSpace, the game, not the project, header information.
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -147,9 +150,9 @@
|
||||
#define _FREESPACE_H
|
||||
#ifndef STAMPER_PROGRAM // because of all the dependancies, I have to do this...yuck!!! MWA 7/21/97
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "systemvars.h"
|
||||
#include "2d.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// FREESPACE DEFINES/VARS
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -53,9 +56,9 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "freespace.h"
|
||||
#include "bmpman.h"
|
||||
#include "levelpaging.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "freespace2/levelpaging.h"
|
||||
|
||||
// All the page in functions
|
||||
extern void ship_page_in();
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to drive the context-sensitive help
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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
|
||||
*
|
||||
@@ -107,21 +110,21 @@
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "contexthelp.h"
|
||||
#include "gamesequence.h"
|
||||
#include "freespace.h"
|
||||
#include "mainhallmenu.h"
|
||||
#include "key.h"
|
||||
#include "bmpman.h"
|
||||
#include "2d.h"
|
||||
#include "timer.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "mouse.h"
|
||||
#include "controlsconfig.h"
|
||||
#include "techmenu.h"
|
||||
#include "parselo.h"
|
||||
#include "localize.h"
|
||||
#include "alphacolors.h"
|
||||
#include "io/mouse.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "menuui/techmenu.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "localization/localize.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Module for displaying in-game help
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -115,22 +118,22 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "contexthelp.h"
|
||||
#include "gamesequence.h"
|
||||
#include "freespace.h"
|
||||
#include "key.h"
|
||||
#include "bmpman.h"
|
||||
#include "2d.h"
|
||||
#include "timer.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math.h"
|
||||
#include "mouse.h"
|
||||
#include "controlsconfig.h"
|
||||
#include "ui.h"
|
||||
#include "gamesnd.h"
|
||||
#include "missionscreencommon.h"
|
||||
#include "alphacolors.h"
|
||||
#include "beam.h"
|
||||
#include "audiostr.h"
|
||||
#include "io/mouse.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "ui/ui.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "missionui/missionscreencommon.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "weapon/beam.h"
|
||||
#include "sound/audiostr.h"
|
||||
|
||||
// text positioning constats
|
||||
#define TITLE_Y 35
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* File to control Game Sequencing
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -240,8 +243,8 @@
|
||||
* States should always be referred to using the macros.
|
||||
*/
|
||||
|
||||
#include "freespace.h"
|
||||
#include "gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
|
||||
// local defines
|
||||
#define MAX_GAMESEQ_EVENTS 20 // maximum number of events on the game sequencing queue
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for Game Sequencing items
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -331,7 +334,7 @@
|
||||
#ifndef __GAMESEQUENCE_H__
|
||||
#define __GAMESEQUENCE_H__
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
// defines for game sequencing events
|
||||
//
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for high-level control of event driven music
|
||||
*
|
||||
* $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
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -111,22 +117,22 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "eventmusic.h"
|
||||
#include "object.h"
|
||||
#include "ship.h"
|
||||
#include "linklist.h"
|
||||
#include "missionload.h" /* for Builtin_mission_names[] */
|
||||
#include "missionparse.h"
|
||||
#include "timer.h"
|
||||
#include "freespace.h"
|
||||
#include "audiostr.h"
|
||||
#include "missioncampaign.h"
|
||||
#include "sound.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "object/object.h"
|
||||
#include "ship/ship.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "mission/missionload.h" /* for Builtin_mission_names[] */
|
||||
#include "mission/missionparse.h"
|
||||
#include "io/timer.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "mission/missioncampaign.h"
|
||||
#include "sound/sound.h"
|
||||
#include "time.h"
|
||||
#include "cmdline.h"
|
||||
#include "missiongoals.h"
|
||||
#include "localize.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "mission/missiongoals.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#pragma optimize("", off)
|
||||
|
||||
@@ -1412,6 +1418,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_music(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,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for high-level control of event driven music
|
||||
*
|
||||
* $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
|
||||
*
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
@@ -124,7 +130,7 @@
|
||||
#ifndef __EVENT_MUSIC_H__
|
||||
#define __EVENT_MUSIC_H__
|
||||
|
||||
#include "parselo.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
// Identifies songs in the Soundtrack_filenames[] structure. The order matches up with
|
||||
// what is in music.tbl. Do not modify without synching music.tbl.
|
||||
@@ -182,7 +188,7 @@ typedef struct tagSOUNDTRACK_INFO {
|
||||
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
|
||||
} SOUNDTRACK_INFO;
|
||||
|
||||
#define MAX_SOUNDTRACKS 10
|
||||
#define MAX_SOUNDTRACKS 25
|
||||
|
||||
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
|
||||
extern int Num_soundtracks;
|
||||
@@ -214,6 +220,7 @@ void event_music_start_default();
|
||||
void event_music_get_info(char *outbuf);
|
||||
void event_music_get_soundtrack_name(char *outbuf);
|
||||
int event_music_next_soundtrack(int delta);
|
||||
void event_sexp_change_music(char *name);
|
||||
void event_music_set_soundtrack(char *name);
|
||||
void event_music_set_score(int score_index, char *name);
|
||||
int event_music_get_spooled_music_index(char *name);
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -167,11 +170,11 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "gamesnd.h"
|
||||
#include "sound.h"
|
||||
#include "parselo.h"
|
||||
#include "localize.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "sound/sound.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
// Global array that holds data about the gameplay sound effects.
|
||||
game_snd Snds[MAX_GAME_SOUNDS];
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-10 05:43:35 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $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
|
||||
*
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
@@ -320,8 +326,8 @@
|
||||
#ifndef __GAMESND_H__
|
||||
#define __GAMESND_H__
|
||||
|
||||
#include "sound.h"
|
||||
#include "missionparse.h"
|
||||
#include "sound/sound.h"
|
||||
#include "mission/missionparse.h"
|
||||
|
||||
#ifndef NO_SOUND
|
||||
|
||||
@@ -527,6 +533,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 165
|
||||
#define SND_BALLISTIC_LOAD 166
|
||||
|
||||
// supernova 1 and supernova 2
|
||||
#define SND_SUPERNOVA_1 173
|
||||
#define SND_SUPERNOVA_2 174
|
||||
@@ -535,7 +545,6 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
#define SND_LIGHTNING_1 180
|
||||
#define SND_LIGHTNING_2 181
|
||||
|
||||
|
||||
//---------------------------------------------------
|
||||
// Interface sounds
|
||||
//---------------------------------------------------
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef struct { float r, g, b, a; } FxColor4;
|
||||
** export macros
|
||||
*/
|
||||
|
||||
#if defined(__MSC__)
|
||||
#if defined(_MSC_VER)
|
||||
#if defined (MSVC16)
|
||||
#define FX_ENTRY
|
||||
#define FX_CALL
|
||||
@@ -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
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#if defined(FX_DLL_DEFINITION)
|
||||
#if defined(FX_DLL_ENABLE)
|
||||
#if defined(__MSC__)
|
||||
#if defined(_MSC_VER)
|
||||
#ifndef KERNEL
|
||||
#define FX_ENTRY __declspec( dllexport )
|
||||
#define FX_EXPORT __declspec( dllexport )
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
void sleep(int secs);
|
||||
#define gethostname fxGethostname
|
||||
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/glide/Glide.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for dynamically loading glide libraries
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -33,12 +39,11 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#define __MSC__
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "glide.h"
|
||||
#include "pstypes.h"
|
||||
#include "glide/glide.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
static HMODULE Glide_lib_handle;
|
||||
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
#ifndef __GLIDE_H__
|
||||
#define __GLIDE_H__
|
||||
|
||||
#define __MSC__
|
||||
#define FX_GLIDE_NO_FUNC_PROTO
|
||||
|
||||
#include "3dfx.h"
|
||||
#include "sst1vid.h"
|
||||
#include "glidesys.h"
|
||||
#include "glide/3dfx.h"
|
||||
#include "glide/sst1vid.h"
|
||||
#include "glide/glidesys.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -1089,7 +1088,7 @@ grHints(GrHint_t hintType, FxU32 hintMask);
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "glideutl.h"
|
||||
#include "glide/glideutl.h"
|
||||
|
||||
#endif /* __GLIDE_H__ */
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "2d.h"
|
||||
#include "alphacolors.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
// ALPHA DEFINES/VARS
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/crypt.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Files for cypting stuff
|
||||
*
|
||||
* $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:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -32,7 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "crypt.h"
|
||||
#include "globalincs/crypt.h"
|
||||
|
||||
char *jcrypt (char *plainstring)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,37 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-03-02 05:27:44 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file containg global typedefs, constants and macros
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* 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 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
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/09 13:50:20 mharris
|
||||
* define AsmInt3() to abort()
|
||||
*
|
||||
@@ -197,9 +221,9 @@
|
||||
// #define DVD_MESSAGE_HACK
|
||||
|
||||
|
||||
#if defined(MULTIPLAYER_BETA_BUILD) || defined(E3_BUILD) || defined(RELEASE_REAL)
|
||||
#define GAME_CD_CHECK
|
||||
#endif
|
||||
// #if defined(MULTIPLAYER_BETA_BUILD) || defined(E3_BUILD) || defined(RELEASE_REAL)
|
||||
// #define GAME_CD_CHECK
|
||||
// #endif
|
||||
|
||||
// 4127 is constant conditional (assert)
|
||||
// 4100 is unreferenced formal parameters,
|
||||
@@ -222,7 +246,8 @@
|
||||
#include <memory.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "windows_stub/config.h"
|
||||
|
||||
// value to represent an uninitialized state in any int or uint
|
||||
#define UNINITIALIZED 0x7f8e6d9c
|
||||
@@ -240,7 +265,7 @@
|
||||
|
||||
#define LOCAL static // make module local varilable static.
|
||||
|
||||
#if defined( WINDOWS ) && defined( MSVC )
|
||||
#if defined( _WIN32 ) && defined( _MSC_VER )
|
||||
typedef __int64 longlong;
|
||||
typedef unsigned __int64 ulonglong;
|
||||
#elif defined ( __GNUC__ )
|
||||
@@ -259,7 +284,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 {
|
||||
@@ -315,13 +340,22 @@ typedef struct vertex {
|
||||
ubyte pad[2]; // pad structure to be 4 byte aligned.
|
||||
} vertex;
|
||||
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
#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
|
||||
@@ -351,7 +385,7 @@ extern void _cdecl WinAssert(char * text,char *filename, int line);
|
||||
extern void _cdecl Error( char * filename, int line, char * format, ... );
|
||||
extern void _cdecl Warning( char * filename, int line, char * format, ... );
|
||||
|
||||
#include "outwnd.h"
|
||||
#include "osapi/outwnd.h"
|
||||
|
||||
// To debug printf do this:
|
||||
// mprintf(( "Error opening %s\n", filename ));
|
||||
@@ -370,12 +404,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 }
|
||||
|
||||
@@ -385,7 +419,7 @@ void gr_activate(int);
|
||||
|
||||
// define to call from Warning function above since it calls Int3, so without this, we
|
||||
// get put into infinite dialog boxes
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#define AsmInt3() _asm { int 3 }
|
||||
#else
|
||||
#define AsmInt3() abort()
|
||||
@@ -403,8 +437,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
|
||||
@@ -484,7 +522,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
|
||||
@@ -526,13 +564,14 @@ void dc_printf( char *format, ... );
|
||||
//======================================================================================
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "fix.h"
|
||||
#include "floating.h"
|
||||
#include "math/fix.h"
|
||||
#include "math/floating.h"
|
||||
|
||||
// Some constants for stuff
|
||||
// #define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
|
||||
// #define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
|
||||
#ifdef _WIN32
|
||||
#define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
|
||||
#define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
|
||||
#endif
|
||||
|
||||
// contants and defined for byteswapping routines (useful for mac)
|
||||
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $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
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -191,10 +197,10 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "systemvars.h"
|
||||
#include "timer.h"
|
||||
#include "neb.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "io/timer.h"
|
||||
#include "nebula/neb.h"
|
||||
|
||||
fix Missiontime;
|
||||
fix Frametime;
|
||||
@@ -230,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
|
||||
Loaded 100 of 459 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user