Compare commits

..
Author SHA1 Message Date
Goober5000 73218acbba revert the directory move 2008-02-09 21:33:46 +00:00
Goober5000 d0b88ca502 remove extraneous fs2_open folder from all branches and tags 2008-02-09 19:21:05 +00:00
(no author) ee9c853d55 This commit was manufactured by cvs2svn to create tag
'volition_import'.
2002-06-03 03:26:04 +00:00
522 changed files with 8086 additions and 31478 deletions

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
new_log_accum Error checking out/updating CVSROOT/new_log_accum
-17
View File
@@ -1,17 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-30
View File
@@ -1,30 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-104
View File
@@ -1,104 +0,0 @@
#!/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));
-757
View File
@@ -1,757 +0,0 @@
#!/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);
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-9
View File
@@ -1,9 +0,0 @@
drevil:f76FWdDTUBG5c:fs2source
mysterial:f7nJUwoIhmSrg:fs2source
wmcoolmon:f7JRB.js9Q1sE:fs2source
inquisitor:f7BVkOvwjDlWk:fs2source
penguin:Jh.dOjaiO2jHk:fs2source
DTP:f7M92Z/6/uep.:fs2source
unknownplayer:f79BgAn.IzJs6:fs2source
phreak:f7WQyGiT/jzlM:fs2source
anonymous:oIKtWP1q6GDt6:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-4
View File
@@ -1,4 +0,0 @@
drevil
inquisitor
mysterial
penguin
-1868
View File
File diff suppressed because it is too large. Load diff
-148
View File
@@ -1,148 +0,0 @@
# 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 "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /U "_DEBUG" /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" /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
-44
View File
@@ -1,44 +0,0 @@
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>
{{{
}}}
###############################################################################
+265 -680
View File
@@ -1,700 +1,285 @@
TARGET = fs2
TARGET = libcode.a
ifeq ($(USE_SOUND), 1)
SOUND_DEF=
SOUND_OBJS= \
gamesnd/eventmusic.o \
gamesnd/gamesnd.o \
object/objectsnd.o \
sound/acm.o \
sound/audiostr.o \
sound/ds.o \
sound/ds3d.o \
sound/dscap.o \
sound/midifile.o \
sound/rbaudio.o \
sound/rtvoice.o \
sound/sound.o \
sound/winmidi.o \
sound/winmidi_base.o \
vcodec/codec1.o
else
SOUND_DEF=-DNO_SOUND
SOUND_OBJS=
endif # USE_SOUND
CXXFLAGS = -DWIN32 -D_DEBUG \
-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 \
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG
# removed from OBJFILES
# CFile/cfile.o \
# CFile/CfileArchive.o \
# CFile/CfileList.o \
# CFile/CfileSystem.o \
ifeq ($(USE_JOYSTICK), 1)
JOYSTICK_DEF=
JOYSTICK_OBJS= \
io/joy.o \
io/joy_ff.o \
io/swff_lib.o
else
JOYSTICK_DEF=-DNO_JOYSTICK
JOYSTICK_OBJS=
endif # USE_JOYSTICK
ifeq ($(USE_NETWORK), 1)
# no support for standalone server yet... (UI is Win32 specific)
NETWORK_DEF=-DNO_STANDALONE
NETWORK_OBJS= \
hud/hudobserver.o \
network/multi.o \
network/multimsgs.o \
network/multiteamselect.o \
network/multiui.o \
network/multiutil.o \
network/multi_campaign.o \
network/multi_data.o \
network/multi_dogfight.o \
network/multi_endgame.o \
network/multi_ingame.o \
network/multi_kick.o \
network/multi_log.o \
network/multi_obj.o \
network/multi_observer.o \
network/multi_options.o \
network/multi_pause.o \
network/multi_pinfo.o \
network/multi_ping.o \
network/multi_pmsg.o \
network/multi_rate.o \
network/multi_respawn.o \
network/multi_team.o \
network/multi_voice.o \
network/multi_xfer.o \
network/psnet.o \
network/psnet2.o \
menuui/optionsmenumulti.o \
missionui/chatbox.o
#
# Network/stand_gui.o
#
else
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
NETWORK_OBJS=
endif # USE_NETWORK
ifeq ($(USE_OPENGL), 0)
OPENGL_DEF=
else
OPENGL_DEF=-DUSE_OPENGL
endif # USE_OPENGL
LDFLAGS = -g
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
CXXFLAGS = \
-g \
-I/usr/local/include/SDL \
-I. \
-fno-exceptions \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
ANIM_OBJFILES = \
anim/animplay.o \
anim/packunpack.o
ASTEROID_OBJFILES = \
asteroid/asteroid.o
BMPMAN_OBJFILES = \
bmpman/bmpman.o
CFILE_OBJFILES = \
cfile/cfile.o \
cfile/cfilearchive.o \
cfile/cfilelist.o \
cfile/cfilesystem.o
CMDLINE_OBJFILES = \
cmdline/cmdline.o
CMEASURE_OBJFILES = \
cmeasure/cmeasure.o
CONTROLCONFIG_OBJFILES = \
controlconfig/controlsconfig.o \
controlconfig/controlsconfigcommon.o
CUTSCENE_OBJFILES = \
cutscene/cutscenes.o
DEBRIS_OBJFILES = \
debris/debris.o
DEBUGCONSOLE_OBJFILES = \
debugconsole/console.o
DEMO_OBJFILES = \
demo/demo.o
EXCEPTIONHANDLER_OBJFILES = \
exceptionhandler/exceptionhandler.o
FIREBALL_OBJFILES = \
fireball/fireballs.o \
fireball/warpineffect.o
GAMEHELP_OBJFILES = \
gamehelp/contexthelp.o \
gamehelp/gameplayhelp.o
GAMESEQUENCE_OBJFILES = \
gamesequence/gamesequence.o
# gamesnd/eventmusic.o
# gamesnd/gamesnd.o
GAMESND_OBJFILES =
# glide/glide.o
GLIDE_OBJFILES =
# globalincs/windebug.o
GLOBALINCS_OBJFILES = \
globalincs/alphacolors.o \
globalincs/crypt.o \
globalincs/systemvars.o \
globalincs/version.o
# graphics/grd3d.o
# graphics/grd3drender.o
# graphics/grd3dtexture.o
# graphics/grdirectdraw.o
# graphics/grglide.o
# graphics/grglidetexture.o
# graphics/grsoft.o
# graphics/scaler.o
# graphics/tmapgenericscans.o
# graphics/tmapscantiled128x128.o
# graphics/tmapscantiled16x16.o
# graphics/tmapscantiled256x256.o
# graphics/tmapscantiled32x32.o
# graphics/tmapscantiled64x64.o
# graphics/tmapscanline.o
# graphics/tmapper.o
GRAPHICS_OBJFILES = \
graphics/2d.o \
graphics/aaline.o \
graphics/bitblt.o \
graphics/circle.o \
graphics/colors.o \
graphics/font.o \
graphics/gradient.o \
graphics/gropengl.o \
graphics/grzbuffer.o \
graphics/line.o \
graphics/pixel.o \
graphics/rect.o \
graphics/shade.o
# hud/hudobserver.o
HUD_OBJFILES = \
hud/hud.o \
hud/hudartillery.o \
hud/hudbrackets.o \
hud/hudconfig.o \
hud/hudescort.o \
hud/hudets.o \
hud/hudlock.o \
hud/hudmessage.o \
hud/hudreticle.o \
hud/hudshield.o \
hud/hudsquadmsg.o \
hud/hudtarget.o \
hud/hudtargetbox.o \
hud/hudwingmanstatus.o
INETFILE_OBJFILES = \
inetfile/cftp.o \
inetfile/chttpget.o \
inetfile/inetgetfile.o
# io/joy.o
# io/joy_ff.o
# io/swff_lib.o
IO_OBJFILES = \
io/key.o \
io/keycontrol.o \
io/mouse.o \
io/timer.o \
io/xmouse.o
JUMPNODE_OBJFILES = \
jumpnode/jumpnode.o
LIGHTING_OBJFILES = \
lighting/lighting.o
LOCALIZATION_OBJFILES = \
localization/fhash.o \
localization/localize.o
MATH_OBJFILES = \
math/fix.o \
math/floating.o \
math/fvi.o \
math/spline.o \
math/staticrand.o \
math/vecmat.o
# menuui/optionsmenumulti.o
MENUUI_OBJFILES = \
menuui/barracks.o \
menuui/credits.o \
menuui/fishtank.o \
menuui/mainhallmenu.o \
menuui/mainhalltemp.o \
menuui/optionsmenu.o \
menuui/playermenu.o \
menuui/readyroom.o \
menuui/snazzyui.o \
menuui/techmenu.o \
menuui/trainingmenu.o
MISSION_OBJFILES = \
mission/missionbriefcommon.o \
mission/missioncampaign.o \
mission/missiongoals.o \
mission/missiongrid.o \
mission/missionhotkey.o \
mission/missionload.o \
mission/missionlog.o \
mission/missionmessage.o \
mission/missionparse.o \
mission/missiontraining.o
# missionui/chatbox.o
MISSIONUI_OBJFILES = \
missionui/missionbrief.o \
missionui/missioncmdbrief.o \
missionui/missiondebrief.o \
missionui/missionloopbrief.o \
missionui/missionpause.o \
missionui/missionrecommend.o \
missionui/missionscreencommon.o \
missionui/missionshipchoice.o \
missionui/missionstats.o \
missionui/missionweaponchoice.o \
missionui/redalert.o
MODEL_OBJFILES = \
model/modelcollide.o \
model/modelinterp.o \
model/modeloctant.o \
model/modelread.o
NEBULA_OBJFILES = \
nebula/neb.o \
nebula/neblightning.o
# network/multi.o
# network/multi_campaign.o
# network/multi_data.o
# network/multi_dogfight.o
# network/multi_endgame.o
# network/multi_ingame.o
# network/multi_kick.o
# network/multi_log.o
# network/multimsgs.o
# network/multi_obj.o
# network/multi_observer.o
# network/multi_oo.o
# network/multi_options.o
# network/multi_pause.o
# network/multi_pinfo.o
# network/multi_ping.o
# network/multi_pmsg.o
# network/multi_rate.o
# network/multi_respawn.o
# network/multi_team.o
# network/multi_update.o
# network/multi_voice.o
# network/multi_xfer.o
# network/multilag.o
# network/multiteamselect.o
# network/multiui.o
# network/psnet.o
# network/psnet2.o
# network/stand_gui.o
NETWORK_OBJFILES = \
network/multiutil.o
# object/objectsnd.o
OBJECT_OBJFILES = \
object/collidedebrisship.o \
object/collidedebrisweapon.o \
object/collideshipship.o \
object/collideshipweapon.o \
object/collideweaponweapon.o \
object/objcollide.o \
object/object.o \
object/objectsort.o
OBSERVER_OBJFILES = \
observer/observer.o
OSAPI_OBJFILES = \
osapi/osapi_unix.o \
osapi/osregistry_unix.o \
osapi/outwnd_unix.o
PALMAN_OBJFILES = \
palman/palman.o
PARSE_OBJFILES = \
parse/encrypt.o \
parse/parselo.o \
parse/sexp.o
PARTICLE_OBJFILES = \
particle/particle.o
PCXUTILS_OBJFILES = \
pcxutils/pcxutils.o
PHYSICS_OBJFILES = \
physics/physics.o
PLAYERMAN_OBJFILES = \
playerman/managepilot.o \
playerman/playercontrol.o
POPUP_OBJFILES = \
popup/popup.o \
popup/popupdead.o
RADAR_OBJFILES = \
radar/radar.o
RENDER_OBJFILES = \
render/3dclipper.o \
render/3ddraw.o \
render/3dlaser.o \
render/3dmath.o \
render/3dsetup.o
SHIP_OBJFILES = \
ship/afterburner.o \
ship/ai.o \
ship/aibig.o \
ship/aicode.o \
ship/aigoals.o \
ship/awacs.o \
ship/shield.o \
ship/ship.o \
ship/shipcontrails.o \
ship/shipfx.o \
ship/shiphit.o
SOUND_OBJFILES = \
sound/acm.o \
sound/audiostr.o \
sound/ds.o \
sound/ds3d.o \
sound/dscap.o \
sound/midifile.o \
sound/rbaudio.o \
sound/rtvoice.o \
sound/sound.o \
sound/winmidi.o \
sound/winmidi_base.o
STARFIELD_OBJFILES = \
starfield/nebula.o \
starfield/starfield.o \
starfield/supernova.o
STATS_OBJFILES = \
stats/medals.o \
stats/scoring.o \
stats/stats.o
TGAUTILS_OBJFILES = \
tgautils/tgautils.o
UI_OBJFILES = \
ui/button.o \
ui/checkbox.o \
ui/gadget.o \
ui/icon.o \
ui/inputbox.o \
ui/keytrap.o \
ui/listbox.o \
ui/radio.o \
ui/scroll.o \
ui/slider.o \
ui/slider2.o \
ui/uidraw.o \
ui/uimouse.o \
ui/window.o
VCODEC_OBJFILES = \
vcodec/codec1.o
WEAPON_OBJFILES = \
weapon/beam.o \
weapon/corkscrew.o \
weapon/emp.o \
weapon/flak.o \
weapon/muzzleflash.o \
weapon/shockwave.o \
weapon/swarm.o \
weapon/trails.o \
weapon/weapons.o
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
OBJFILES = \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CFILE_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
NETWORK_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES
Anim/animplay.o \
Anim/packunpack.o \
Asteroid/asteroid.o \
Bmpman/bmpman.o \
Cmdline/cmdline.o \
CMeasure/cmeasure.o \
ControlConfig/controlsconfig.o \
ControlConfig/controlsconfigcommon.o \
Cutscene/cutscenes.o \
Debris/debris.o \
DebugConsole/console.o \
Fireball/fireballs.o \
Fireball/warpineffect.o \
GameHelp/contexthelp.o \
GameHelp/gameplayhelp.o \
GameSequence/gamesequence.o \
Gamesnd/eventmusic.o \
Gamesnd/gamesnd.o \
Glide/glide.o \
GlobalIncs/alphacolors.o \
GlobalIncs/crypt.o \
GlobalIncs/systemvars.o \
GlobalIncs/version.o \
GlobalIncs/windebug.o \
Graphics/2d.o \
Graphics/aaline.o \
Graphics/bitblt.o \
Graphics/circle.o \
Graphics/colors.o \
Graphics/font.o \
Graphics/gradient.o \
Graphics/grd3d.o \
Graphics/grd3drender.o \
Graphics/grd3dtexture.o \
Graphics/grdirectdraw.o \
Graphics/grglide.o \
Graphics/grglidetexture.o \
Graphics/gropengl.o \
Graphics/grsoft.o \
Graphics/grzbuffer.o \
Graphics/line.o \
Graphics/pixel.o \
Graphics/rect.o \
Graphics/scaler.o \
Graphics/shade.o \
Graphics/tmapgenericscans.o \
Graphics/tmapper.o \
Graphics/tmapscanline.o \
Graphics/tmapscantiled128x128.o \
Graphics/tmapscantiled16x16.o \
Graphics/tmapscantiled256x256.o \
Graphics/tmapscantiled32x32.o \
Graphics/tmapscantiled64x64.o \
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/hudobserver.o \
Hud/hudreticle.o \
Hud/hudshield.o \
Hud/hudsquadmsg.o \
Hud/hudtarget.o \
Hud/hudtargetbox.o \
Hud/hudwingmanstatus.o \
Io/joy.o \
Io/joy_ff.o \
Io/key.o \
Io/keycontrol.o \
Io/mouse.o \
Io/swff_lib.o \
Io/timer.o \
JumpNode/jumpnode.o \
Lighting/lighting.o \
Math/fix.o \
Math/floating.o \
Math/fvi.o \
Math/spline.o \
Math/staticrand.o \
Math/vecmat.o \
MenuUI/barracks.o \
MenuUI/credits.o \
MenuUI/fishtank.o \
MenuUI/mainhallmenu.o \
MenuUI/mainhalltemp.o \
MenuUI/optionsmenu.o \
MenuUI/optionsmenumulti.o \
MenuUI/playermenu.o \
MenuUI/readyroom.o \
MenuUI/snazzyui.o \
MenuUI/techmenu.o \
MenuUI/trainingmenu.o \
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/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/modelcollide.o \
Model/modelinterp.o \
Model/modeloctant.o \
Model/modelread.o \
Object/collidedebrisship.o \
Object/collidedebrisweapon.o \
Object/collideshipship.o \
Object/collideshipweapon.o \
Object/collideweaponweapon.o \
Object/objcollide.o \
Object/object.o \
Object/objectsnd.o \
Object/objectsort.o \
Observer/observer.o \
OsApi/osapi.o \
OsApi/osregistry.o \
OsApi/outwnd.o \
Palman/palman.o \
Parse/encrypt.o \
Parse/parselo.o \
Parse/sexp.o \
Particle/particle.o \
PcxUtils/pcxutils.o \
Physics/physics.o \
Playerman/managepilot.o \
Playerman/playercontrol.o \
Popup/popup.o \
Popup/popupdead.o \
Radar/radar.o \
Render/3dclipper.o \
Render/3ddraw.o \
Render/3dlaser.o \
Render/3dmath.o \
Render/3dsetup.o \
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/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/nebula.o \
Starfield/starfield.o \
Starfield/supernova.o \
Stats/medals.o \
Stats/scoring.o \
Stats/stats.o \
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/codec1.o \
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 \
Nebula/neb.o \
Nebula/neblightning.o \
Localization/fhash.o \
Localization/localize.o \
TgaUtils/tgautils.o \
Demo/demo.o \
Inetfile/cftp.o \
Inetfile/chttpget.o \
Inetfile/inetgetfile.o \
ExceptionHandler/exceptionhandler.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/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/multimsgs.o \
Network/multiteamselect.o \
Network/multiui.o \
Network/multiutil.o \
Network/psnet.o \
Network/psnet2.o \
Network/stand_gui.o
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
LIB_OBJFILES = \
$(ANIM_OBJFILES) \
$(ASTEROID_OBJFILES) \
$(BMPMAN_OBJFILES) \
$(CFILE_OBJFILES) \
$(CMDLINE_OBJFILES) \
$(CMEASURE_OBJFILES) \
$(CONTROLCONFIG_OBJFILES) \
$(CUTSCENE_OBJFILES) \
$(DEBRIS_OBJFILES) \
$(DEBUGCONSOLE_OBJFILES) \
$(FIREBALL_OBJFILES) \
$(GAMEHELP_OBJFILES) \
$(GAMESEQUENCE_OBJFILES) \
$(GAMESND_OBJFILES) \
$(GLIDE_OBJFILES) \
$(GLOBALINCS_OBJFILES) \
$(GRAPHICS_OBJFILES) \
$(HUD_OBJFILES) \
$(IO_OBJFILES) \
$(JUMPNODE_OBJFILES) \
$(LIGHTING_OBJFILES) \
$(MATH_OBJFILES) \
$(MENUUI_OBJFILES) \
$(MISSION_OBJFILES) \
$(MISSIONUI_OBJFILES) \
$(MODEL_OBJFILES) \
$(NETWORK_OBJFILES) \
$(OBJECT_OBJFILES) \
$(OBSERVER_OBJFILES) \
$(OSAPI_OBJFILES) \
$(PALMAN_OBJFILES) \
$(PARSE_OBJFILES) \
$(PARTICLE_OBJFILES) \
$(PCXUTILS_OBJFILES) \
$(PHYSICS_OBJFILES) \
$(PLAYERMAN_OBJFILES) \
$(POPUP_OBJFILES) \
$(RADAR_OBJFILES) \
$(RENDER_OBJFILES) \
$(SHIP_OBJFILES) \
$(STARFIELD_OBJFILES) \
$(STATS_OBJFILES) \
$(UI_OBJFILES) \
$(VCODEC_OBJFILES) \
$(WEAPON_OBJFILES) \
$(NEBULA_OBJFILES) \
$(LOCALIZATION_OBJFILES) \
$(TGAUTILS_OBJFILES) \
$(DEMO_OBJFILES) \
$(SOUND_OBJS) \
$(JOYSTICK_OBJS) \
$(NETWORK_OBJS)
FREESPACE2_OBJFILES = \
freespace2/freespace.o \
freespace2/levelpaging.o
STUB_OBJFILES = \
windows_stub/stubs.o
# ==============================
.PHONY: all clean code \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
SOUND_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES \
INETFILE_OBJFILES \
EXCEPTIONHANDLER_OBJFILES \
NETWORK_OBJFILES
.PHONY: all clean code
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(CXX) $(CXXFLAGS) -E $< > $@
# $(CXX) $(CXXFLAGS) -c $<
all: $(TARGET)
clean:
rm -f $(TARGET) libcode.a core *.o *~
rm -f $(TARGET) core *.o *~
find -name *.o -exec rm {} \;
find -name *~ -exec rm {} \;
code: libcode.a
code: $(TARGET)
# ==============================
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)
libcode.a: $(OBJFILES)
+12 -15
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -181,16 +178,16 @@
* $NoKeywords: $
*/
#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"
#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"
static color Color_xparent;
+2 -10
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -102,8 +96,6 @@
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
+8 -11
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
@@ -18,9 +18,6 @@
* 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
*
@@ -152,12 +149,12 @@
* $NoKeywords: $
*/
#include "graphics/grinternal.h"
#include "bmpman/bmpman.h"
#include "palman/palman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "grinternal.h"
#include "bmpman.h"
#include "palman.h"
#include "2d.h"
#include "animplay.h"
#include "packunpack.h"
int packer_code = PACKER_CODE;
int transparent_code = 254;
+5 -11
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
@@ -18,12 +18,6 @@
* 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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -151,7 +145,7 @@
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
#include "globalincs/pstypes.h"
#include "pstypes.h"
struct CFILE;
@@ -201,7 +195,7 @@ typedef struct anim {
int file_offset; // file offset to start of frame data
int cache_file_offset;
ubyte *cache;
} anim_t;
} anim;
// the direction to play the anim (forwards or backwards)
#define ANIM_DIRECT_FORWARD 0
@@ -233,7 +227,7 @@ typedef struct anim_instance {
int paused; // pause the anim
int file_offset; // current offset into frame (like data, put offset into file)
int loop_count; // starts at 0, and is incremented each time it loops
} anim_instance_t;
} anim_instance;
extern int packer_code;
+73 -105
View File
@@ -9,22 +9,13 @@
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -266,30 +257,25 @@
* $NoKeywords: $
*/
#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 "network/multiutil.h"
#include "network/multimsgs.h"
#include "network/multi.h"
#endif
#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 "multiutil.h"
#include "staticrand.h"
#include "multimsgs.h"
#include "systemvars.h"
#include "localize.h"
#include "multi.h"
#ifndef FS2_DEMO
@@ -429,15 +415,15 @@ int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vector *pos, flo
Assert(asfieldp->has_inner_bound);
int rval = 0;
if ( (pos->xyz.x > asfieldp->inner_min_bound.xyz.x - delta) && (pos->xyz.x < asfieldp->inner_max_bound.xyz.x + delta) ) {
if ( (pos->x > asfieldp->inner_min_bound.x - delta) && (pos->x < asfieldp->inner_max_bound.x + delta) ) {
rval += 1;
}
if ( (pos->xyz.y > asfieldp->inner_min_bound.xyz.y - delta) && (pos->xyz.y < asfieldp->inner_max_bound.xyz.y + delta) ) {
if ( (pos->y > asfieldp->inner_min_bound.y - delta) && (pos->y < asfieldp->inner_max_bound.y + delta) ) {
rval += 2;
}
if ( (pos->xyz.z > asfieldp->inner_min_bound.xyz.z - delta) && (pos->xyz.z < asfieldp->inner_max_bound.xyz.z + delta) ) {
if ( (pos->z > asfieldp->inner_min_bound.z - delta) && (pos->z < asfieldp->inner_max_bound.z + delta) ) {
rval += 4;
}
@@ -550,9 +536,9 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
signature = 0;
rand_base = 0;
if ( Game_mode & GM_NORMAL ) {
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * frand();
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * frand();
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * frand();
pos.x = asfieldp->min_bound.x + delta_bound.x * frand();
pos.y = asfieldp->min_bound.y + delta_bound.y * frand();
pos.z = asfieldp->min_bound.z + delta_bound.z * frand();
inner_bound_pos_fixup(asfieldp, &pos);
// vm_set_identity(&orient);
@@ -560,20 +546,18 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
angs.b = frand() * 2*PI;
angs.h = frand() * 2*PI;
} else {
#ifndef NO_NETWORK
signature = multi_assign_network_signature( MULTI_SIG_ASTEROID );
rand_base = signature;
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * static_randf( rand_base++ );
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * static_randf( rand_base++ );
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * static_randf( rand_base++ );
pos.x = asfieldp->min_bound.x + delta_bound.x * static_randf( rand_base++ );
pos.y = asfieldp->min_bound.y + delta_bound.y * static_randf( rand_base++ );
pos.z = asfieldp->min_bound.z + delta_bound.z * static_randf( rand_base++ );
inner_bound_pos_fixup(asfieldp, &pos);
// vm_set_identity(&orient);
angs.p = static_randf( rand_base++ ) * 2*PI;
angs.b = static_randf( rand_base++ ) * 2*PI;
angs.h = static_randf( rand_base++ ) * 2*PI;
#endif
}
vm_angles_2_matrix(&orient, &angs);
@@ -636,14 +620,14 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
// Fill in the max_vel field, so the collision pair stuff knows
// how fast this can move maximum in order to throw out collisions.
// This is in local coordinates, so Z is forward velocity.
objp->phys_info.max_vel.xyz.x = 0.0f;
objp->phys_info.max_vel.xyz.y = 0.0f;
objp->phys_info.max_vel.xyz.z = vm_vec_mag(&objp->phys_info.desired_vel);
objp->phys_info.max_vel.x = 0.0f;
objp->phys_info.max_vel.y = 0.0f;
objp->phys_info.max_vel.z = vm_vec_mag(&objp->phys_info.desired_vel);
objp->phys_info.mass = asip->modelp[asteroid_subtype]->rad * 700.0f;
objp->phys_info.I_body_inv.vec.rvec.xyz.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
objp->phys_info.I_body_inv.vec.uvec.xyz.y = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
objp->phys_info.I_body_inv.vec.fvec.xyz.z = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
objp->phys_info.I_body_inv.rvec.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
objp->phys_info.I_body_inv.uvec.y = objp->phys_info.I_body_inv.rvec.x;
objp->phys_info.I_body_inv.fvec.z = objp->phys_info.I_body_inv.rvec.x;
objp->hull_strength = asip->initial_hull_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
// ensure vel is valid
@@ -668,11 +652,9 @@ void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec)
if (new_objp == NULL)
return;
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ){
send_asteroid_create( new_objp, parent_objp, asteroid_type, relvec );
}
#endif
// Now, bash some values.
vm_vec_scale_add(&new_objp->pos, &parent_objp->pos, relvec, 0.5f * parent_objp->radius);
@@ -877,40 +859,38 @@ void asteroid_level_init()
// 0 from this function. We will force a wrap on the clients when server tells us
int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
{
#ifndef NO_NETWORK
if ( MULTIPLAYER_CLIENT )
return 0;
#endif
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
if (objp->pos.x < asfieldp->min_bound.x) {
return 1;
}
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
if (objp->pos.y < asfieldp->min_bound.y) {
return 1;
}
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
if (objp->pos.z < asfieldp->min_bound.z) {
return 1;
}
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
if (objp->pos.x > asfieldp->max_bound.x) {
return 1;
}
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
if (objp->pos.y > asfieldp->max_bound.y) {
return 1;
}
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
if (objp->pos.z > asfieldp->max_bound.z) {
return 1;
}
// check against inner bound
if (asfieldp->has_inner_bound) {
if ( (objp->pos.xyz.x > asfieldp->inner_min_bound.xyz.x) && (objp->pos.xyz.x < asfieldp->inner_max_bound.xyz.x)
&& (objp->pos.xyz.y > asfieldp->inner_min_bound.xyz.y) && (objp->pos.xyz.y < asfieldp->inner_max_bound.xyz.y)
&& (objp->pos.xyz.z > asfieldp->inner_min_bound.xyz.z) && (objp->pos.xyz.z < asfieldp->inner_max_bound.xyz.z) ) {
if ( (objp->pos.x > asfieldp->inner_min_bound.x) && (objp->pos.x < asfieldp->inner_max_bound.x)
&& (objp->pos.y > asfieldp->inner_min_bound.y) && (objp->pos.y < asfieldp->inner_max_bound.y)
&& (objp->pos.z > asfieldp->inner_min_bound.z) && (objp->pos.z < asfieldp->inner_max_bound.z) ) {
return 1;
}
@@ -922,28 +902,28 @@ int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
// Wrap an asteroid from one end of the asteroid field to the other
void asteroid_wrap_pos(object *objp, asteroid_field *asfieldp)
{
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
objp->pos.xyz.x = asfieldp->max_bound.xyz.x + (objp->pos.xyz.x - asfieldp->min_bound.xyz.x);
if (objp->pos.x < asfieldp->min_bound.x) {
objp->pos.x = asfieldp->max_bound.x + (objp->pos.x - asfieldp->min_bound.x);
}
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
objp->pos.xyz.y = asfieldp->max_bound.xyz.y + (objp->pos.xyz.y - asfieldp->min_bound.xyz.y);
if (objp->pos.y < asfieldp->min_bound.y) {
objp->pos.y = asfieldp->max_bound.y + (objp->pos.y - asfieldp->min_bound.y);
}
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
objp->pos.xyz.z = asfieldp->max_bound.xyz.z + (objp->pos.xyz.z - asfieldp->min_bound.xyz.z);
if (objp->pos.z < asfieldp->min_bound.z) {
objp->pos.z = asfieldp->max_bound.z + (objp->pos.z - asfieldp->min_bound.z);
}
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
objp->pos.xyz.x = asfieldp->min_bound.xyz.x + (objp->pos.xyz.x - asfieldp->max_bound.xyz.x);
if (objp->pos.x > asfieldp->max_bound.x) {
objp->pos.x = asfieldp->min_bound.x + (objp->pos.x - asfieldp->max_bound.x);
}
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
objp->pos.xyz.y = asfieldp->min_bound.xyz.y + (objp->pos.xyz.y - asfieldp->max_bound.xyz.y);
if (objp->pos.y > asfieldp->max_bound.y) {
objp->pos.y = asfieldp->min_bound.y + (objp->pos.y - asfieldp->max_bound.y);
}
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
objp->pos.xyz.z = asfieldp->min_bound.xyz.z + (objp->pos.xyz.z - asfieldp->max_bound.xyz.z);
if (objp->pos.z > asfieldp->max_bound.z) {
objp->pos.z = asfieldp->min_bound.z + (objp->pos.z - asfieldp->max_bound.z);
}
// wrap on inner bound, check all 3 axes as needed, use of rand ok for multiplayer with send_asteroid_throw()
@@ -982,9 +962,9 @@ void asteroid_aim_at_target(object *objp, object *asteroid_objp, float delta_tim
vm_vec_rand_vec_quick(&rand_vec);
vm_vec_scale_add2(&predicted_center_pos, &rand_vec, objp->radius/2.0f);
vm_vec_add2(&rand_vec, &objp->orient.vec.fvec);
vm_vec_add2(&rand_vec, &objp->orient.fvec);
if (vm_vec_mag_quick(&rand_vec) < 0.1f)
vm_vec_add2(&rand_vec, &objp->orient.vec.rvec);
vm_vec_add2(&rand_vec, &objp->orient.rvec);
vm_vec_normalize(&rand_vec);
speed = Asteroid_info[0].max_speed * (frand()/2.0f + 0.5f);
@@ -1037,11 +1017,9 @@ void maybe_throw_asteroid(int count)
// this line gives too many collision pairs.
// asteroid_update_collide(objp);
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ) {
send_asteroid_throw( objp );
}
#endif
}
}
@@ -1093,7 +1071,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
// only wrap if player won't see asteroid disappear/reverse direction
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
if ((dot < 0.7f) || (dist > 3000.0f)) {
if (Num_asteroids > MAX_ASTEROIDS-10) {
@@ -1104,7 +1082,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
Asteroids[objp->instance].target_objnum = -1;
vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
dist = vm_vec_dist_quick(&objp->pos, &Eye_position);
if (( dot > 0.7f) && (dist < 3000.0f)) {
@@ -1120,10 +1098,8 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
asteroid_update_collide(objp);
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER )
send_asteroid_throw( objp );
#endif
}
}
}
@@ -1143,12 +1119,12 @@ void asteroid_process_pre( object *objp, float frame_time)
v = &objp->phys_info.vel;
vv = &objp->phys_info.desired_vel;
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->xyz.x, v->xyz.y, v->xyz.z, vv->xyz.x, vv->xyz.y, vv->xyz.z));
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->x, v->y, v->z, vv->x, vv->y, vv->z));
// Make vel chase desired_vel
lerp(&objp->phys_info.vel.xyz.x, objp->phys_info.vel.xyz.x, objp->phys_info.desired_vel.xyz.x, flFrametime);
lerp(&objp->phys_info.vel.xyz.y, objp->phys_info.vel.xyz.y, objp->phys_info.desired_vel.xyz.y, flFrametime);
lerp(&objp->phys_info.vel.xyz.z, objp->phys_info.vel.xyz.z, objp->phys_info.desired_vel.xyz.z, flFrametime);
lerp(&objp->phys_info.vel.x, objp->phys_info.vel.x, objp->phys_info.desired_vel.x, flFrametime);
lerp(&objp->phys_info.vel.y, objp->phys_info.vel.y, objp->phys_info.desired_vel.y, flFrametime);
lerp(&objp->phys_info.vel.z, objp->phys_info.vel.z, objp->phys_info.desired_vel.z, flFrametime);
}
}
@@ -1268,8 +1244,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
pm = model_get(Ships[heavy_obj->instance].modelnum);
// turn off all rotating submodels and test for collision
int i;
for (i=0; i<num_rotating_submodels; i++) {
for (int i=0; i<num_rotating_submodels; i++) {
pm->submodel[submodel_list[i]].blown_off = 1;
}
@@ -1586,11 +1561,9 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vector * hitpos, f
return;
}
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ){
send_asteroid_hit( asteroid_obj, other_obj, hitpos, damage );
}
#endif
asteroid_obj->hull_strength -= damage;
@@ -1725,9 +1698,8 @@ void asteroid_maybe_break_up(object *asteroid_obj)
// multiplayer clients won't go through the following code. asteroid_sub_create will send
// a create packet to the client in the above named function
#ifndef NO_NETWORK
if ( !MULTIPLAYER_CLIENT ) {
#endif
switch (asp->type) {
case ASTEROID_TYPE_SMALL:
break;
@@ -1774,9 +1746,7 @@ void asteroid_maybe_break_up(object *asteroid_obj)
default:
Int3();
}
#ifndef NO_NETWORK
}
#endif
asp->final_death_time = timestamp(-1);
}
@@ -1880,12 +1850,10 @@ void asteroid_update_collide_flag(object *asteroid_objp)
asp->collide_objnum = -1;
asp->collide_objsig = -1;
#ifndef NO_NETWORK
// multiplayer dogfight
if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)){
return;
}
#endif
num_escorts = hud_escort_num_ships_on_list();
@@ -2102,12 +2070,12 @@ int set_asteroid_throw_objnum()
float radius = ship_objp->radius*2.0f;
if (Ship_info[Ships[ship_objp->instance].ship_info_index].flags & (SIF_HUGE_SHIP | SIF_BIG_SHIP)) {
if (ship_objp->pos.xyz.x + radius > Asteroid_field.min_bound.xyz.x)
if (ship_objp->pos.xyz.y + radius > Asteroid_field.min_bound.xyz.y)
if (ship_objp->pos.xyz.z + radius > Asteroid_field.min_bound.xyz.z)
if (ship_objp->pos.xyz.x - radius < Asteroid_field.max_bound.xyz.x)
if (ship_objp->pos.xyz.y - radius < Asteroid_field.max_bound.xyz.y)
if (ship_objp->pos.xyz.z - radius < Asteroid_field.max_bound.xyz.z)
if (ship_objp->pos.x + radius > Asteroid_field.min_bound.x)
if (ship_objp->pos.y + radius > Asteroid_field.min_bound.y)
if (ship_objp->pos.z + radius > Asteroid_field.min_bound.z)
if (ship_objp->pos.x - radius < Asteroid_field.max_bound.x)
if (ship_objp->pos.y - radius < Asteroid_field.max_bound.y)
if (ship_objp->pos.z - radius < Asteroid_field.max_bound.z)
if (!asteroid_in_inner_bound(&Asteroid_field, &ship_objp->pos, radius))
return so->objnum;
}
+8 -14
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -125,8 +119,8 @@
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "ship/ship.h"
#include "parse/parselo.h" // for NAME_LENGTH
#include "ship.h"
#include "parselo.h" // for NAME_LENGTH
struct object;
struct polymodel;
@@ -210,13 +204,13 @@ typedef struct asteroid {
typedef enum {
DG_ASTEROID,
DG_SHIP
} debris_genre_t;
} debris_genre;
// TYPEDEF FOR FIELD TYPE
typedef enum {
FT_ACTIVE,
FT_PASSIVE
} field_type_t;
} field_type;
#define MAX_ACTIVE_DEBRIS_TYPES 3
@@ -229,8 +223,8 @@ typedef struct asteroid_field {
vector vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
field_type field_type; // active throws and wraps, passive does not
debris_genre debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
+24 -73
View File
@@ -9,28 +9,13 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Code to load and manage all bitmaps for the game
*
* $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.4 2002/05/21 15:36:25 mharris
* Added ifdef WIN32
*
* Revision 1.3 2002/05/09 13:49:30 mharris
* Added ifndef NO_DIRECT3D
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -476,21 +461,20 @@
* $NoKeywords: $
*/
#include <ctype.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 "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"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
@@ -847,10 +831,10 @@ int bm_create( int bpp, int w, int h, void * data, int flags )
bm_bitmaps[n].type = BM_TYPE_USER;
bm_bitmaps[n].palette_checksum = 0;
bm_bitmaps[n].bm.w = (short) w;
bm_bitmaps[n].bm.h = (short) h;
bm_bitmaps[n].bm.rowsize = (short) w;
bm_bitmaps[n].bm.bpp = (unsigned char) bpp;
bm_bitmaps[n].bm.w = short(w);
bm_bitmaps[n].bm.h = short(h);
bm_bitmaps[n].bm.rowsize = short(w);
bm_bitmaps[n].bm.bpp = unsigned char(bpp);
bm_bitmaps[n].bm.flags = 0;
bm_bitmaps[n].bm.flags |= flags;
bm_bitmaps[n].bm.data = 0;
@@ -1328,7 +1312,7 @@ static void bm_convert_format( int bitmapnum, bitmap *bmp, ubyte bpp, ubyte flag
g /= Gr_t_green.scale;
b /= Gr_t_blue.scale;
a /= Gr_t_alpha.scale;
((ushort*)bmp->data)[idx] = (unsigned short)((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
((ushort*)bmp->data)[idx] = unsigned short((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
break;
default:
Int3();
@@ -1734,11 +1718,11 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
int pal_changed = 0;
int rle_changed = 0;
int fake_xparent_changed = 0;
if ( (bmp->data == 0) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
if ( (bmp->data == NULL) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
Assert(be->ref_count == 1);
if ( be->type != BM_TYPE_USER ) {
if ( bmp->data == 0 ) {
if ( bmp->data == NULL ) {
nprintf (("BmpMan","Loading %s for the first time.\n", be->filename));
} else if ( bpp != bmp->bpp ) {
nprintf (("BmpMan","Reloading %s from bitdepth %d to bitdepth %d\n", be->filename, bmp->bpp, bpp));
@@ -2146,10 +2130,8 @@ void bm_page_in_start()
}
#ifndef NO_DIRECT3D
extern void gr_d3d_preload_init();
extern int gr_d3d_preload(int bitmap_num, int is_aabitmap );
#endif
void bm_page_in_stop()
{
@@ -2165,10 +2147,9 @@ void bm_page_in_stop()
Bm_ram_freed = 0;
#endif
#ifndef NO_DIRECT3D
int d3d_preloading = 1;
gr_d3d_preload_init();
#endif
for (i = 0; i < MAX_BITMAPS; i++) {
if ( bm_bitmaps[i].type != BM_TYPE_NONE ) {
@@ -2196,14 +2177,12 @@ void bm_page_in_stop()
}
bm_unlock( bm_bitmaps[i].handle );
#ifndef NO_DIRECT3D
if ( d3d_preloading ) {
if ( !gr_d3d_preload(bm_bitmaps[i].handle, (bm_bitmaps[i].preloaded==2) ) ) {
mprintf(( "Out of VRAM. Done preloading.\n" ));
d3d_preloading = 0;
}
}
#endif
n++;
#ifdef BMPMAN_NDEBUG
@@ -2259,9 +2238,7 @@ void bm_24_to_16(int bit_24, ushort *bit_16)
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
}
#ifndef NO_DIRECT3D
extern int D3D_32bit;
#endif
void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a) = NULL;
@@ -2343,27 +2320,19 @@ void BM_SELECT_SCREEN_FORMAT()
Gr_current_alpha = &Gr_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_screen;
} else {
bm_set_components = bm_set_components_argb_d3d_16_screen;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_screen;
#endif // ifndef NO_DIRECT3D
}
}
#else
bm_set_components = bm_set_components_argb_d3d_16_screen;
#endif // ifdef WIN32
}
void BM_SELECT_TEX_FORMAT()
@@ -2374,27 +2343,19 @@ void BM_SELECT_TEX_FORMAT()
Gr_current_alpha = &Gr_t_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_tex;
} else {
bm_set_components = bm_set_components_argb_d3d_16_tex;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif
}
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
}
void BM_SELECT_ALPHA_TEX_FORMAT()
@@ -2405,27 +2366,19 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
Gr_current_alpha = &Gr_ta_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_tex;
} else {
bm_set_components = bm_set_components_argb_d3d_16_tex;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif
}
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
}
// set the rgba components of a pixel, any of the parameters can be -1
@@ -2507,12 +2460,10 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a)
{
int bit_32 = 0;
#ifndef NO_DIRECT3D
// pick a byte size - 32 bits only if 32 bit mode d3d and screen format
if(D3D_32bit && (Gr_current_red == &Gr_red)){
bit_32 = 1;
}
#endif
if(r != NULL){
if(bit_32){
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Prototypes for Bitmap Manager functions
+65 -200
View File
@@ -9,53 +9,13 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
* $Revision: 2.7 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* 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
*
* Revision 1.6 2002/05/17 06:45:53 mharris
* More porting tweaks. It links! but segfaults...
*
* Revision 1.5 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.4 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.3 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.2 2002/05/07 13:23:17 mharris
* Port tweaks
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -204,31 +164,21 @@
#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>
#include <glob.h>
#include <sys/mman.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "parse/encrypt.h"
#include "pstypes.h"
#include "cfile.h"
#include "encrypt.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfile/cfilesystem.h"
#include "cfile/cfilearchive.h"
#include "osapi/osapi.h"
#include "cfilesystem.h"
#include "cfilearchive.h"
#include "osapi.h"
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
@@ -236,47 +186,45 @@ char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
// Each path must have a valid parent that can be tracable all the way back to the root
// so that we can create directories when we need to.
//
// Please make sure extensions are all lower-case, or we'll break unix compatibility
//
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
// What type this is Path Extensions Parent type
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
// What type this is Path Extensions Parent type
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
// Root must be index 1!!
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_VOICE, "data" DIR_SEPARATOR_STR "voice", "", CF_TYPE_DATA },
{ CF_TYPE_VOICE_BRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_CMD_BRIEF, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "command_briefings", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_DEBRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_PERSONAS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_SPECIAL, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_MAIN, "data" DIR_SEPARATOR_STR "players", "", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_SQUAD_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_DEMOS, "data" DIR_SEPARATOR_STR "demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_DATA, "Data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "Data\\Maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "Data\\Text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "Data\\Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "Data\\Models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "Data\\Tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS, "Data\\Sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS_8B22K, "Data\\Sounds\\8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_SOUNDS_16B11K, "Data\\Sounds\\16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_VOICE, "Data\\Voice", "", CF_TYPE_DATA },
{ CF_TYPE_VOICE_BRIEFINGS, "Data\\Voice\\Briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_CMD_BRIEF, "Data\\Voice\\Command_briefings",".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_DEBRIEFINGS, "Data\\Voice\\Debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_PERSONAS, "Data\\Voice\\Personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_SPECIAL, "Data\\Voice\\Special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_TRAINING, "Data\\Voice\\Training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MUSIC, "Data\\Music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOVIES, "Data\\Movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "Data\\Interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_FONT, "Data\\Fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "Data\\Effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_HUD, "Data\\Hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_MAIN, "Data\\Players", "", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_IMAGES_MAIN, "Data\\Players\\Images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_CACHE, "Data\\Cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_PLAYERS, "Data\\Players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_SINGLE_PLAYERS, "Data\\Players\\Single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "Data\\Players\\Multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MULTI_CACHE, "Data\\MultiData", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "Data\\Config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_SQUAD_IMAGES_MAIN, "Data\\Players\\Squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_DEMOS, "Data\\Demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "Data\\CBAnims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "Data\\IntelAnims", ".ani", CF_TYPE_DATA },
};
@@ -298,13 +246,7 @@ char *Cfile_cdrom_dir = NULL;
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
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
#elif defined unix
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
#endif
void cf_chksum_long_init();
void cfile_close()
@@ -329,13 +271,13 @@ int cfile_in_root_dir(char *exe_path)
strncpy(path_copy, exe_path, 2047);
// count how many slashes there are in the path
tok = strtok(path_copy, DIR_SEPARATOR_STR);
tok = strtok(path_copy, "\\");
if(tok == NULL){
return 1;
}
do {
token_count++;
tok = strtok(NULL, DIR_SEPARATOR_STR);
tok = strtok(NULL, "\\");
} while(tok != NULL);
// root directory if we have <= 1 slash
@@ -369,16 +311,12 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
// are we in a root directory?
if(cfile_in_root_dir(buf)){
#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");
#endif
return 1;
}
while (i--) {
if (buf[i] == DIR_SEPARATOR_CHAR){
if (buf[i] == '\\'){
break;
}
}
@@ -387,11 +325,7 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
buf[i] = 0;
cfile_chdir(buf);
} else {
#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");
#endif
return 1;
}
@@ -423,7 +357,6 @@ void cfile_refresh()
}
#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.
@@ -448,7 +381,6 @@ int cfile_chdrive( int DriveNum, int flag )
return Valid;
}
#endif // ifdef WIN32
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type)
@@ -465,16 +397,14 @@ int cfile_push_chdir(int type)
cf_create_default_path_string( dir, type, NULL );
_strlwr(dir);
Drive = strchr(dir, ':');
if (Drive) {
#ifdef _WIN32
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
return 1;
Path = Drive+1;
#endif
} else {
Path = dir;
}
@@ -486,9 +416,7 @@ int cfile_push_chdir(int type)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
#ifdef _WIN32
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#endif
return 2;
}
@@ -508,12 +436,11 @@ int cfile_chdir(char *dir)
Drive = strchr(dir, ':');
if (Drive) {
#ifdef _WIN32
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
return 1;
Path = Drive+1;
#endif
} else {
Path = dir;
}
@@ -525,9 +452,7 @@ int cfile_chdir(char *dir)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
#ifdef _WIN32
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#endif
return 2;
}
@@ -547,6 +472,7 @@ int cfile_flush_dir(int dir_type)
{
int find_handle;
int del_count;
_finddata_t find;
Assert( CF_TYPE_SPECIFIED(dir_type) );
@@ -556,10 +482,8 @@ int cfile_flush_dir(int dir_type)
}
// proceed to delete the files
del_count = 0;
#if defined _WIN32
_finddata_t find;
find_handle = _findfirst( "*", &find );
del_count = 0;
if (find_handle != -1) {
do {
if (!(find.attrib & _A_SUBDIR) && !(find.attrib & _A_RDONLY)) {
@@ -572,27 +496,6 @@ int cfile_flush_dir(int dir_type)
} while (!_findnext(find_handle, &find));
_findclose( find_handle );
}
#elif defined unix
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob("*", 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
// delete the file
cf_delete(globinfo.gl_pathv[i], dir_type);
// increment the deleted count
del_count++;
}
}
globfree(&globinfo);
}
#endif
// pop the directory back
cfile_pop_dir();
@@ -674,7 +577,6 @@ int cf_exist( char *filename, int dir_type )
return 0;
}
#ifdef _WIN32
void cf_attrib(char *filename, int set, int clear, int dir_type)
{
char longname[MAX_PATH_LEN];
@@ -692,7 +594,6 @@ void cf_attrib(char *filename, int set, int clear, int dir_type)
}
}
#endif
int cf_rename(char *old_name, char *name, int dir_type)
{
@@ -845,7 +746,6 @@ 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
HANDLE hFile;
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -853,12 +753,6 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if (hFile != INVALID_HANDLE_VALUE) {
return cf_open_mapped_fill_cfblock(hFile, dir_type);
}
#elif defined unix
FILE *fp = fopen( longname, "rb" );
if (fp) {
return cf_open_mapped_fill_cfblock(fp, dir_type);
}
#endif
}
} else {
@@ -948,7 +842,6 @@ int cfclose( CFILE * cfile )
result = 0;
if ( cb->data ) {
// close memory mapped file
#if defined _WIN32
result = UnmapViewOfFile((void*)cb->data);
Assert(result);
result = CloseHandle(cb->hInFile);
@@ -956,10 +849,6 @@ int cfclose( CFILE * cfile )
result = CloseHandle(cb->hMapFile);
Assert(result); // Ensure file handle is closed properly
result = 0;
#elif defined unix
result = munmap(cb->data, cb->data_length);
Assert(result);
#endif
} else if ( cb->fp != NULL ) {
Assert(cb->fp != NULL);
@@ -999,13 +888,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
cfbp->fp = fp;
cfbp->dir_type = type;
#if defined _WIN32
cf_init_lowlevel_read_code(cfp,0,filelength(fileno(fp)) );
#elif defined unix
struct stat statbuf;
fstat(fileno(fp), &statbuf);
cf_init_lowlevel_read_code(cfp, 0, statbuf.st_size );
#endif
return cfp;
}
@@ -1052,11 +935,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
//
// returns: ptr CFILE structure.
//
#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)
#endif
{
int cfile_block_index;
@@ -1072,13 +951,11 @@ 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
cfbp->hInFile = hFile;
#endif
cfbp->dir_type = type;
cf_init_lowlevel_read_code(cfp,0 , 0 );
#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"));
@@ -1087,17 +964,6 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
cfbp->data = (ubyte*)MapViewOfFile(cfbp->hMapFile, FILE_MAP_READ, 0, 0, 0);
Assert( cfbp->data != NULL );
#elif defined unix
cfbp->fp = fp;
cfbp->data = mmap(NULL, // start
cfbp->data_length, // length
PROT_READ, // prot
MAP_SHARED, // flags
fileno(fp), // fd
0); // offset
Assert( cfbp->data != NULL );
#endif
return cfp;
}
}
@@ -1225,14 +1091,14 @@ void cfread_vector(vector *vec, CFILE *file, int ver, vector *deflt)
if (deflt)
*vec = *deflt;
else
vec->xyz.x = vec->xyz.y = vec->xyz.z = 0.0f;
vec->x = vec->y = vec->z = 0.0f;
return;
}
vec->xyz.x = cfread_float(file, ver, deflt ? deflt->xyz.x : 0.0f);
vec->xyz.y = cfread_float(file, ver, deflt ? deflt->xyz.y : 0.0f);
vec->xyz.z = cfread_float(file, ver, deflt ? deflt->xyz.z : 0.0f);
vec->x = cfread_float(file, ver, deflt ? deflt->x : NULL);
vec->y = cfread_float(file, ver, deflt ? deflt->y : NULL);
vec->z = cfread_float(file, ver, deflt ? deflt->z : NULL);
}
void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
@@ -1246,9 +1112,9 @@ void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
return;
}
ang->p = cfread_float(file, ver, deflt ? deflt->p : 0.0f);
ang->b = cfread_float(file, ver, deflt ? deflt->b : 0.0f);
ang->h = cfread_float(file, ver, deflt ? deflt->h : 0.0f);
ang->p = cfread_float(file, ver, deflt ? deflt->p : NULL);
ang->b = cfread_float(file, ver, deflt ? deflt->b : NULL);
ang->h = cfread_float(file, ver, deflt ? deflt->h : NULL);
}
char cfread_char(CFILE *file, int ver, char deflt)
@@ -1327,13 +1193,13 @@ int cfwrite_ubyte(ubyte b, CFILE *file)
int cfwrite_vector(vector *vec, CFILE *file)
{
if(!cfwrite_float(vec->xyz.x, file)){
if(!cfwrite_float(vec->x, file)){
return 0;
}
if(!cfwrite_float(vec->xyz.y, file)){
if(!cfwrite_float(vec->y, file)){
return 0;
}
return cfwrite_float(vec->xyz.z, file);
return cfwrite_float(vec->z, file);
}
int cfwrite_angles(angles *ang, CFILE *file)
@@ -1782,4 +1648,3 @@ int cflush(CFILE *cfile)
+30 -69
View File
@@ -9,38 +9,13 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* <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
*
* Revision 1.2 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -357,17 +332,7 @@
#define __CFILE_H__
#include <time.h>
#include "globalincs/pstypes.h"
#if defined _WIN32
#define DIR_SEPARATOR_CHAR '\\'
#define DIR_SEPARATOR_STR "\\"
#elif defined unix
#define DIR_SEPARATOR_CHAR '/'
#define DIR_SEPARATOR_STR "/"
#else
#error unknown OS
#endif
#include "pstypes.h"
#define CF_EOF (-1)
@@ -391,45 +356,44 @@ 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 //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
@@ -627,10 +591,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
int cfile_chdrive(int DriveNum, int flag);
#endif
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type);
+8 -14
View File
@@ -9,20 +9,14 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -85,17 +79,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 "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "cfile/cfilearchive.h"
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfilearchive.h"
#define CHECK_POSITION
+2 -13
View File
@@ -9,20 +9,14 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
* $Revision: 2.1 $
* $Date: 2002-07-07 19:55:58 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -66,13 +60,8 @@ 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
HANDLE hInFile; // Handle from CreateFile()
HANDLE hMapFile; // Handle from CreateFileMapping()
#else
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
int lib_offset;
int raw_position;
int size; // for packed files
+7 -13
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -63,16 +57,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 "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
+65 -296
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:28:08 $
* $Author: DTP $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* 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,39 +20,6 @@
* 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
*
* Revision 1.5 2002/05/21 15:38:00 mharris
* Unix glob changes -- still needs some work as we are getting full pathnames
*
* Revision 1.4 2002/05/17 23:38:33 mharris
* Fixed silly bug in unix find-files code
*
* Revision 1.3 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.2 2002/05/07 13:22:52 mharris
* Added errno.h include
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -118,25 +85,19 @@
#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 */
#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
@@ -258,14 +219,12 @@ 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, "\\" );
}
#if defined _WIN32
strcat( filespec, "*.vp" );
int find_handle;
@@ -283,26 +242,7 @@ int cf_get_packfile_count(cf_root *root)
_findclose( find_handle );
}
#elif defined unix
strcat( filespec, "*.[vV][pP]" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[j], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
packfile_count++;
}
}
globfree(&globinfo);
}
#endif
}
}
return packfile_count;
}
@@ -348,15 +288,11 @@ 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 );
strcat( filespec, DIR_SEPARATOR_STR );
if(strlen(Pathtypes[i].path)){
strcat( filespec, Pathtypes[i].path );
strcat( filespec, "\\" );
}
#if defined _WIN32
strcat( filespec, "*.vp" );
int find_handle;
@@ -375,13 +311,12 @@ 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)) {
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
if(strlen(Pathtypes[i].path)){
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, "\\");
}
strcat(rptr_sort->path, find.name );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
@@ -391,32 +326,6 @@ void cf_build_pack_list( cf_root *root )
_findclose( find_handle );
}
#elif defined unix
strcat( filespec, "*.[vV][pP]" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[j], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
Assert(root_index < temp_root_count);
// get a temp pointer
rptr_sort = &temp_roots_sort[root_index++];
// fill in all the proper info
strcpy(rptr_sort->path, globinfo.gl_pathv[j] );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
}
}
globfree(&globinfo);
}
#endif
}
// these should always be the same
@@ -448,27 +357,20 @@ void cf_build_root_list(char *cdrom_dir)
cf_root *root;
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);
}
//======================================================
// First, check the current directory.
// strcpy( root->path, "d:\\projects\\freespace\\" );
root = cf_create_root();
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
// do we already have a slash? as in the case of a root directory install
if(strlen(root->path) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR)){
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
if(strlen(root->path) && (root->path[strlen(root->path)-1] != '\\')){
strcat(root->path, "\\"); // put trailing backslash on for easier path construction
}
root->roottype = CF_ROOTTYPE_PATH;
//======================================================
@@ -521,12 +423,11 @@ 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 );
strcat( search_path, "\\" );
}
#if defined _WIN32
strcat( search_path, "*.*" );
int find_handle;
@@ -562,39 +463,7 @@ void cf_search_root_path(int root_index)
_findclose( find_handle );
}
#elif defined unix
strcat( search_path, "*" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(search_path, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[j], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
char *ext = strchr(globinfo.gl_pathv[j], '.' );
if ( ext ) {
if ( is_ext_in_list( Pathtypes[i].extensions, ext ) ) {
// Found a file!!!!
cf_file *file = cf_create_file();
strcpy( file->name_ext, globinfo.gl_pathv[j] );
file->root_index = root_index;
file->pathtype_index = i;
file->write_time = statbuf.st_mtime;
file->size = statbuf.st_size;
file->pack_offset = 0; // Mark as a non-packed file
//mprintf(( "Found file '%s'\n", file->name_ext ));
}
}
}
}
globfree(&globinfo);
}
#endif
}
}
@@ -614,7 +483,9 @@ 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 ));
@@ -640,7 +511,6 @@ 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;
@@ -650,13 +520,13 @@ void cf_search_root_pack(int root_index)
if ( !stricmp( find.filename, ".." )) {
int l = strlen(search_path);
char *p = &search_path[l-1];
while( (p > search_path) && (*p != DIR_SEPARATOR_CHAR) ) {
while( (p > search_path) && (*p != '\\') ) {
p--;
}
*p = 0;
} else {
if ( strlen(search_path) ) {
strcat( search_path, DIR_SEPARATOR_STR );
strcat( search_path, "\\" );
}
strcat( search_path, find.filename );
}
@@ -664,35 +534,38 @@ 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 packed file
file->pack_offset = find.offset; // Mark as a non-packed file
//mprintf(( "Found pack file '%s'\n", file->name_ext ));
}
}
}
}
}
}
fclose(fp);
}
void cf_build_file_list()
{
int i;
@@ -722,12 +595,10 @@ 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 );
// [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 ) {
// strlwr(Pathtypes[i].extensions);
// }
Assert( Pathtypes[i].index == i );
if ( Pathtypes[i].extensions ) {
strlwr(Pathtypes[i].extensions);
}
}
// Init the root blocks
@@ -798,15 +669,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
if ( strpbrk(filespec,"/\\:") ) { // do we have a full path already?
FILE *fp = fopen(filespec, "rb" );
if (fp) {
if ( size ) {
#if defined _WIN32
*size = filelength(fileno(fp));
#elif defined unix
struct stat statbuf;
fstat(fileno(fp), &statbuf);
*size = statbuf.st_size;
#endif
}
if ( size ) *size = filelength(fileno(fp));
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, filespec );
@@ -839,15 +702,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
*size = filelength(fileno(fp));
#elif defined unix
struct stat statbuf;
fstat(fileno(fp), &statbuf);
*size = statbuf.st_size;
#endif
}
if ( size ) *size = filelength(fileno(fp));
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, longname );
@@ -882,11 +737,11 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcpy( pack_filename, r->path );
if ( f->pack_offset < 1 ) {
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
strcat( pack_filename, DIR_SEPARATOR_STR );
strcat( pack_filename, "\\" );
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
// restore original filespec
strcpy(filespec, temp);
@@ -904,18 +759,17 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
if(strlen(Pathtypes[f->pathtype_index].path)){
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
strcat( pack_filename, DIR_SEPARATOR_STR );
strcat( pack_filename, "\\" );
}
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
}
return 0;
return 0;
}
@@ -968,10 +822,10 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
{
char *ptr;
int i, l, find_handle, num_files = 0, own_flag = 0;
_finddata_t find;
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -986,13 +840,10 @@ 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
_finddata_t find;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1018,43 +869,6 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
_findclose( find_handle );
}
#elif defined unix
char base_filespec[MAX_PATH_LEN];
cf_create_default_path_string( base_filespec, pathtype );
int base_filespec_len = strlen(base_filespec);
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
char *found_file = globinfo.gl_pathv[i];
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
found_file += base_filespec_len;
ptr = strrchr(found_file, '.');
if (ptr)
l = ptr - found_file;
else
l = strlen(found_file);
list[num_files] = (char *)malloc(l + 1);
strncpy(list[num_files], found_file, l);
list[num_files][l] = 0;
if (info)
info[num_files].write_time = statbuf.st_mtime;
num_files++;
}
}
globfree(&globinfo);
}
}
#endif
// Search all the packfiles and CD.
if ( !Skip_packfile_search ) {
@@ -1067,9 +881,8 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
if (num_files >= max)
break;
if ( !cf_matches_spec( filter,f->name_ext)) {
continue;
}
@@ -1112,7 +925,6 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1146,7 +958,6 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -1166,18 +977,15 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
char filespec[MAX_PATH_LEN];
cf_create_default_path_string( filespec, pathtype, filter );
mprintf(("cf_get_file_list_preallocated looking for type=%d, filter=\"%s\"\n",
pathtype, filter));
// Search the default directories
#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)) {
@@ -1202,44 +1010,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
_findclose( find_handle );
}
#elif defined unix
char base_filespec[MAX_PATH_LEN];
cf_create_default_path_string( base_filespec, pathtype );
int base_filespec_len = strlen(base_filespec);
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
char *found_file = globinfo.gl_pathv[i];
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
found_file += base_filespec_len;
strncpy(arr[num_files], found_file, MAX_FILENAME_LEN - 1 );
char *ptr = strrchr(arr[num_files], '.');
if ( ptr ) {
*ptr = 0;
}
if (info) {
info[num_files].write_time = statbuf.st_mtime;
}
num_files++;
}
}
}
globfree(&globinfo);
}
#endif
// Search all the packfiles and CD.
if ( !Skip_packfile_search ) {
@@ -1252,7 +1023,6 @@ 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)) {
@@ -1293,7 +1063,6 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1326,7 +1095,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, "\\");
}
// add filename
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Functions to keep track of and find files that can exist
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Program to create an archive file for use with cfile stuff
+10 -111
View File
@@ -9,50 +9,11 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 2.11 $
* $Date: 2002-11-10 16:32:42 $
* $Author: DTP $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* $Log: not supported by cvs2svn $
* 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
*
* Revision 1.2 2002/05/07 13:22:14 mharris
* added pstypes.h include
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -229,12 +190,11 @@
#include <string.h>
#include <stdlib.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"
#include "cmdline.h"
#include "linklist.h"
#include "systemvars.h"
#include "multi.h"
#include "cfile.h"
// variables
class cmdline_parm {
@@ -274,11 +234,6 @@ 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 mod_arg("-mod", NULL); //DTP modsupport
int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_freespace_no_sound = 0;
@@ -296,8 +251,6 @@ 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;
@@ -307,12 +260,6 @@ 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;
static cmdline_parm Parm_list(NULL, NULL);
static int Parm_list_inited = 0;
@@ -461,8 +408,10 @@ void os_init_cmdline(char *cmdline)
}
os_parse_parms(cmdline);
os_validate_parms(cmdline);
}
@@ -528,39 +477,9 @@ char *cmdline_parm::str()
}
// external entry point into this modules
#ifdef _WIN32
int parse_cmdline(char *cmdline)
#else
int parse_cmdline(int argc, char *argv[])
#endif
{
#ifdef _WIN32
os_init_cmdline(cmdline);
#else
if (argc > 1) {
// kind of silly -- combine arg list into single string for parsing,
// but it fits with the win32-centric existing code.
char *cmdline = NULL;
unsigned int arglen = 0;
int i;
for (i = 1; i < argc; i++)
arglen += strlen(argv[i]);
if (argc > 2)
arglen += argc - 2; // leave room for the separators
cmdline = new char [arglen+1];
i = 1;
strcpy(cmdline, argv[i]);
for ( ; i < argc; i++) {
strcat(cmdline, " ");
strcat(cmdline, argv[i]);
}
os_init_cmdline(cmdline);
delete [] cmdline;
} else {
// no cmdline args
os_init_cmdline("");
}
#endif
// is this a standalone server??
if (standalone_arg.found()) {
@@ -671,26 +590,6 @@ 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(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
}
return 1;
}
+3 -45
View File
@@ -5,48 +5,15 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.12 $
* $Date: 2002-11-10 16:30:53 $
* $Author: DTP $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* $Log: not supported by cvs2svn $
* 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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -184,11 +151,7 @@
#ifndef FS_CMDLINE_HEADER_FILE
#define FS_CMDLINE_HEADER_FILE
#ifdef _WIN32
int parse_cmdline(char *cmdline);
#else
int parse_cmdline(int argc, char *argv[]);
#endif
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
@@ -221,10 +184,5 @@ 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 char *Cmdline_mod; //DTP for mod support
#endif
+25 -31
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -208,26 +202,26 @@
* $NoKeywords: $
*/
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "cmeasure/cmeasure.h"
#include "freespace2/freespace.h"
#include "math/vecmat.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "model/model.h"
#include "physics/physics.h"
#include "math/floating.h"
#include "model/model.h"
#include "ship/ship.h"
#include "io/timer.h"
#include "fireball/fireballs.h"
#include "radar/radar.h"
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd/gamesnd.h"
#include "object/objectsnd.h"
#include "sound/sound.h"
#include "math/staticrand.h"
#include "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"
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
cmeasure Cmeasures[MAX_CMEASURES];
@@ -451,7 +445,7 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
vector vel, rand_vec;
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.fvec, -25.0f);
static_randvec(arand+1, &rand_vec);
@@ -466,8 +460,8 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
obj->phys_info.side_slip_time_const = 10000.0f;
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
obj->phys_info.max_vel.xyz.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.max_vel.xyz.z );
obj->phys_info.max_vel.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.fvec, obj->phys_info.max_vel.z );
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
+4 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -115,8 +112,8 @@
#ifndef _CMEASURE_H
#define _CMEASURE_H
#include "parse/parselo.h"
#include "object/object.h"
#include "parselo.h"
#include "object.h"
#define MAX_CMEASURES 64
File diff suppressed because it is too large. Load diff
+33 -56
View File
@@ -9,25 +9,13 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/10 06:08:08 mharris
* Porting... added ifndef NO_SOUND
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -303,34 +291,31 @@
*
*/
#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 "freespace.h"
#include "controlsconfig.h"
#include "gamesequence.h"
#include "player.h"
#include "2d.h"
#include "hudsquadmsg.h"
#include "key.h"
#include "timer.h"
#include "math.h"
#include "io/mouse.h"
#include "ui/ui.h"
#include "io/joy.h"
#include "bmpman/bmpman.h"
#include "sound/sound.h"
#include "gamesnd/gamesnd.h"
#include "missionui/missionscreencommon.h"
#include "graphics/font.h"
#include "hud/hud.h"
#include "playerman/managepilot.h"
#include "gamehelp/contexthelp.h"
#include "popup/popup.h"
#include "ui/uidefs.h"
#include "globalincs/alphacolors.h"
#ifndef NO_NETWORK
#include "network/multi_pmsg.h"
#include "network/multiutil.h"
#endif
#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 "multi_pmsg.h"
#include "contexthelp.h"
#include "popup.h"
#include "uidefs.h"
#include "multiutil.h"
#include "alphacolors.h"
#define NUM_SYSTEM_KEYS 14
#define NUM_BUTTONS 19
@@ -1152,15 +1137,12 @@ int control_config_clear_all()
return 0;
}
#ifndef NO_JOYSTICK
extern Joy_info joystick;
#endif
int control_config_axis_default(int axis)
{
Assert(axis >= 0);
#ifndef NO_JOYSTICK
if ( axis > 1 ) {
if (Axis_map_to_defaults[axis] < 0)
return -1;
@@ -1170,9 +1152,6 @@ int control_config_axis_default(int axis)
}
return Axis_map_to_defaults[axis];
#else
return -1;
#endif
}
int control_config_do_reset()
@@ -1349,7 +1328,7 @@ void control_config_do_bind()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i, 1); // clear checking status of all joystick buttons
joy_down_count(i); // clear checking status of all joystick buttons
}
control_config_detect_axis_reset();
@@ -1377,7 +1356,7 @@ void control_config_do_search()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i, 1); // clear checking status of all joystick buttons
joy_down_count(i); // clear checking status of all joystick buttons
}
Binding_mode = 0;
@@ -1725,7 +1704,7 @@ void control_config_do_frame(float frametime)
bind = 1;
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i, 1))
if (joy_down_count(i))
bind = 1;
if (bind) {
@@ -1806,7 +1785,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i, 1)) {
if (joy_down_count(i)) {
z = Cc_lines[Selected_line].cc_index;
Assert(!(z & JOY_AXIS));
control_config_bind_joy(z, i);
@@ -1891,7 +1870,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i, 1)) {
if (joy_down_count(i)) {
j = i;
for (i=0; i<CCFG_MAX; i++)
if (Control_config[i].joy_id == j) {
@@ -2399,15 +2378,13 @@ int check_control(int id, int key)
last_key = key;
#ifndef NO_NETWORK
// if we're in multiplayer text enter (for chat) mode, check to see if we should ignore controls
if ((Game_mode & GM_MULTIPLAYER) && multi_ignore_controls()){
return 0;
}
#endif
if (Control_config[id].type == CC_TYPE_CONTINUOUS) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id, 1)) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id)) {
control_used(id);
return 1;
}
@@ -2447,7 +2424,7 @@ int check_control(int id, int key)
return 0;
}
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id) || mouse_down_count(1 << Control_config[id].joy_id)) {
control_used(id);
return 1;
}
+4 -18
View File
@@ -9,20 +9,13 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -452,15 +445,8 @@ 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 112
#define CCFG_MAX 107
extern int Failed_key_index;
extern int Invert_heading;
@@ -9,23 +9,13 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* 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
*
@@ -382,10 +372,10 @@
*
*/
#include "controlconfig/controlsconfig.h"
#include "io/key.h"
#include "io/joy.h"
#include "localization/localize.h"
#include "controlsconfig.h"
#include "key.h"
#include "joy.h"
#include "localize.h"
#define TARGET_TAB 0
#define SHIP_TAB 1
@@ -543,13 +533,6 @@ 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, "" }
};
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -31,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "globalincs/crypt.h"
#include "crypt.h"
int main(int argc, char **argv)
{
+18 -44
View File
@@ -9,31 +9,13 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 2.4 $
* $Date: 2002-08-27 13:38:57 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.3 2002/05/13 21:43:37 mharris
* A little more network and sound cleanup
*
* Revision 1.2 2002/05/07 02:57:33 mharris
* make Buttons[] static
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -153,19 +135,19 @@
* $NoKeywords: $
*/
#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 "cutscenes.h"
#include "ui.h"
#include "cfile.h"
#include "gamesnd.h"
#include "gamesequence.h"
#include "freespace.h"
#include "key.h"
#include "bmpman.h"
// #include "movie.h"
#include "popup/popup.h"
#include "menuui/mainhallmenu.h"
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
#include "popup.h"
#include "mainhallmenu.h"
#include "alphacolors.h"
#include "localize.h"
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
"ViewFootage",
@@ -181,7 +163,7 @@ int Cutscenes_viewable;
int Description_index;
cutscene_info Cutscenes[MAX_CUTSCENES];
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
// initialization stuff for cutscenes
void cutscene_init()
@@ -232,7 +214,6 @@ void cutscene_init()
// returns -1 on failure.
int cutscenes_get_cd_num( char *filename )
{
#ifdef _WIN32
#if defined(OEM_BUILD)
return 0; // only 1 cd for OEM
#else
@@ -246,9 +227,6 @@ int cutscenes_get_cd_num( char *filename )
return -1;
#endif // defined(OEM_BUILD)
#else // !WIN32
return -1;
#endif // ifdef WIN32
}
// marks a cutscene as viewable
@@ -285,7 +263,7 @@ static int Background_bitmap;
static UI_BUTTON List_region;
static UI_WINDOW Ui_window;
static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
{ // GR_640
ui_button_info("TDB_00", 7, 5, 37, 7, 0), // tech database 1
ui_button_info("TDB_01", 7, 19, 37, 23, 1), // tech database 2
@@ -366,7 +344,6 @@ static char *Text_lines[MAX_TEXT_LINES];
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
{
#ifdef _WIN32
int cd_present = 0;
int cd_drive_num;
int cd_mve_is_on;
@@ -434,9 +411,6 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
}
return cd_present;
#else // !WIN32
return 0;
#endif // ifdef WIN32
}
void cutscenes_screen_play()
@@ -611,8 +585,8 @@ void cutscenes_screen_init()
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
#endif
// if (All_movies_enabled)
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
if (All_movies_enabled)
Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
Num_files = 0;
for ( i = 0; i < Num_cutscenes; i++ ) {
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -53,7 +50,7 @@
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#include "parse/parselo.h"
#include "parselo.h"
#define MAX_CUTSCENES 10
+33 -59
View File
@@ -9,25 +9,13 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -220,27 +208,24 @@
* $NoKeywords: $
*/
#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 "network/multi.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#endif
#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 "multi.h"
#include "multimsgs.h"
#include "particle.h"
#include "freespace.h"
#include "multiutil.h"
#include "objcollide.h"
#include "timer.h"
#define MAX_LIFE 10.0f
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
@@ -285,10 +270,8 @@ static void debris_start_death_roll(object *debris_obj, debris *debris_p)
{
if (debris_p->is_hull) {
// tell everyone else to blow up the piece of debris
#ifndef NO_NETWORK
if( MULTIPLAYER_MASTER )
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_NUKE);
#endif
int fireball_type = FIREBALL_EXPLOSION_LARGE1 + rand()%FIREBALL_NUM_LARGE_EXPLOSIONS;
fireball_create( &debris_obj->pos, fireball_type, OBJ_INDEX(debris_obj), debris_obj->radius*1.75f);
@@ -512,9 +495,7 @@ void debris_process_post(object * obj, float frame_time)
radar_plot_object( obj );
if ( timestamp_elapsed(db->sound_delay) ) {
#ifndef NO_SOUND
obj_snd_assign(objnum, SND_DEBRIS, &vmd_zero_vector, 0);
#endif
db->sound_delay = 0;
}
} else {
@@ -794,11 +775,9 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// assign the network signature. The signature will be 0 for non-hull pieces, but since that
// is our invalid signature, it should be okay.
obj->net_signature = 0;
#ifndef NO_NETWORK
if ( (Game_mode & GM_MULTIPLAYER) && hull_flag ) {
obj->net_signature = multi_get_next_network_signature( MULTI_SIG_DEBRIS );
}
#endif
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
@@ -973,12 +952,10 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
particle_emit( &pe, PARTICLE_FIRE, 0 );
}
#ifndef NO_NETWORK
// multiplayer clients bail here
if(MULTIPLAYER_CLIENT){
return;
}
#endif
if ( damage < 0.0f ) {
damage = 0.0f;
@@ -990,11 +967,9 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
debris_start_death_roll(debris_obj, debris_p );
} else {
// otherwise, give all the other players an update on the debris
#ifndef NO_NETWORK
if(MULTIPLAYER_MASTER){
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_UPDATE);
}
#endif
}
}
@@ -1112,8 +1087,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
pm = model_get(Ships[heavy_obj->instance].modelnum);
// turn off all rotating submodels and test for collision
int i;
for (i=0; i<num_rotating_submodels; i++) {
for (int i=0; i<num_rotating_submodels; i++) {
pm->submodel[submodel_list[i]].blown_off = 1;
}
@@ -1273,25 +1247,25 @@ int debris_get_team(object *objp)
void calc_debris_physics_properties( physics_info *pi, vector *mins, vector *maxs )
{
float dx, dy, dz, mass;
dx = maxs->xyz.x - mins->xyz.x;
dy = maxs->xyz.y - mins->xyz.y;
dz = maxs->xyz.z - mins->xyz.z;
dx = maxs->x - mins->x;
dy = maxs->y - mins->y;
dz = maxs->z - mins->z;
// John, with new bspgen, just set pi->mass = mass
mass = 0.12f * dx * dy * dz;
pi->mass = (float) pow(mass, 0.6666667f) * 4.65f;
pi->I_body_inv.vec.rvec.xyz.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.vec.rvec.xyz.y = 0.0f;
pi->I_body_inv.vec.rvec.xyz.z = 0.0f;
pi->I_body_inv.rvec.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.rvec.y = 0.0f;
pi->I_body_inv.rvec.z = 0.0f;
pi->I_body_inv.vec.uvec.xyz.x = 0.0f;
pi->I_body_inv.vec.uvec.xyz.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.vec.uvec.xyz.z = 0.0f;
pi->I_body_inv.uvec.x = 0.0f;
pi->I_body_inv.uvec.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.uvec.z = 0.0f;
pi->I_body_inv.vec.fvec.xyz.x = 0.0f;
pi->I_body_inv.vec.fvec.xyz.y = 0.0f;
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
pi->I_body_inv.fvec.x = 0.0f;
pi->I_body_inv.fvec.y = 0.0f;
pi->I_body_inv.fvec.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
}
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* Code for the pieces of exploding object debris.
+10 -13
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -104,14 +101,14 @@
#include <setjmp.h>
#include <string.h>
#include "globalincs/pstypes.h"
#include "freespace2/freespace.h"
#include "graphics/font.h"
#include "io/timer.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "globalincs/alphacolors.h"
#include "osapi/osapi.h"
#include "pstypes.h"
#include "freespace.h"
#include "font.h"
#include "timer.h"
#include "2d.h"
#include "key.h"
#include "alphacolors.h"
#include "osapi.h"
#define MAX_COMMANDS 300
-254
View File
@@ -1,254 +0,0 @@
#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);
}
-41
View File
@@ -1,41 +0,0 @@
#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
-148
View File
@@ -1,148 +0,0 @@
#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
while(1)
{
// 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
-34
View File
@@ -1,34 +0,0 @@
#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
+16 -23
View File
@@ -9,18 +9,12 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $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
*
@@ -47,21 +41,20 @@
* $NoKeywords: $
*/
#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"
#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"
// -----------------------------------------------------------------------------------------------------------------------------
// DEMO DEFINES/VARS
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
*
+2 -2
View File
@@ -97,8 +97,8 @@ typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
#endif
#include "directx/vd3dtypes.h"
#include "directx/vd3dcaps.h"
#include "vd3dtypes.h"
#include "vd3dcaps.h"
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -13,7 +13,7 @@
/*
* Pull in DirectDraw include file automatically:
*/
#include "directx/vddraw.h"
#include "vddraw.h"
#pragma pack(4)
+5 -5
View File
@@ -6,7 +6,7 @@
* Content: Direct3D internal include file
*@@BEGIN_MSINTERNAL
*
* $Id: vd3di.h,v 2.2 2002-08-01 01:41:04 penguin Exp $
* $Id: vd3di.h,v 1.1 2002-06-03 03:25:56 penguin Exp $
*
* History:
* Date By Reason
@@ -33,11 +33,11 @@
#include "vddrawp.h"
#if 0
//@@END_MSINTERNAL
#include "directx/vddraw.h"
#include "vddraw.h"
//@@BEGIN_MSINTERNAL
#endif
//@@END_MSINTERNAL
#include "directx/vd3d.h"
#include "vd3d.h"
// @@BEGIN_MSINTERNAL
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
@@ -45,7 +45,7 @@
#include "rlreg.h"
#include "lists.h"
#include "object/object.h"
#include "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];
+2 -2
View File
@@ -10,8 +10,8 @@
#ifndef __D3DRM_H__
#define __D3DRM_H__
#include "directx/vddraw.h"
#include "directx/vd3drmobj.h"
#include "vddraw.h"
#include "vd3drmobj.h"
#ifdef __cplusplus
extern "C" {
+2 -2
View File
@@ -11,9 +11,9 @@
#define __D3DRMDEFS_H__
#include <stddef.h>
#include "directx/vd3dtypes.h"
#include "vd3dtypes.h"
#ifdef _WIN32
#ifdef WIN32
#define D3DRMAPI __stdcall
#else
#define D3DRMAPI
+2 -2
View File
@@ -13,8 +13,8 @@
#include <objbase.h> /* Use Windows header files */
#define VIRTUAL
#include "directx/vd3drmdef.h"
#include "directx/vd3d.h"
#include "vd3drmdef.h"
#include "vd3d.h"
#ifdef __cplusplus
extern "C" {
+3 -6
View File
@@ -10,16 +10,13 @@
#ifndef __D3DRMWIN_H__
#define __D3DRMWIN_H__
#ifdef _WIN32
#ifndef WIN32
#define WIN32
#endif
#endif
#include "directx/vd3drm.h"
#include "directx/vddraw.h"
#include "directx/vd3d.h"
#include "vd3drm.h"
#include "vddraw.h"
#include "vd3d.h"
/*
* GUIDS used by Direct3DRM Windows interface
+2 -2
View File
@@ -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 "directx/vddraw.h"
#include "vddraw.h"
#pragma pack(4)
+1 -1
View File
@@ -8,7 +8,7 @@
#ifndef __DPLOBBY_INCLUDED__
#define __DPLOBBY_INCLUDED__
#include "directx/vdplay.h"
#include "vdplay.h"
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __DSOUND_INCLUDED__
#define __DSOUND_INCLUDED__
#include "directx/vd3dtypes.h"
#include "vd3dtypes.h"
#define COM_NO_WINDOWS_H
#include <objbase.h>
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Main file for dealing with exception handling
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
* $Revision: 2.1 $
* $Date: 2002-07-07 19:55:58 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -35,9 +29,7 @@
* $NoKeywords: $
*/
#ifdef _MSC_VER
#pragma once // Include this file only once
#endif
#ifndef __EXCEPTION_HANDLER_H
#define __EXCEPTION_HANDLER_H
+23 -29
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Code to move, render and otherwise deal with fireballs.
*
* $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
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -324,24 +318,24 @@
#include <stdlib.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"
#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"
#define WARPHOLE_GROW_TIME (1.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
@@ -927,7 +921,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
vector temp;
behind = 1;
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.vec.fvec, dist);
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.fvec, dist);
g3_rotate_vertex(&v, &temp);
// if still behind, bail and go with default
@@ -1094,8 +1088,8 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
if (reverse) {
fb->orient = 1;
// if warp out, then reverse the orientation
vm_vec_scale( &obj->orient.vec.fvec, -1.0f ); // Reverse the forward vector
vm_vec_scale( &obj->orient.vec.rvec, -1.0f ); // Reverse the right vector
vm_vec_scale( &obj->orient.fvec, -1.0f ); // Reverse the forward vector
vm_vec_scale( &obj->orient.rvec, -1.0f ); // Reverse the right vector
} else {
fb->orient = 0;
}
+4 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Prototypes for fireball functions
*
* $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
*
@@ -160,8 +157,8 @@
#ifndef _FIREBALLS_H
#define _FIREBALLS_H
#include "object/object.h"
#include "cfile/cfile.h"
#include "object.h"
#include "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
+34 -40
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Code for rendering the warp in effects for ships
*
* $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
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -117,24 +111,24 @@
*/
#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 "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"
DCF(norm,"normalize a zero length vector")
{
@@ -178,28 +172,28 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
vector center;
vm_vec_scale_add( &center, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
vm_vec_scale_add( &center, pos, &orient->fvec, -(max_radius/2.5f)/3.0f );
vector vecs[5];
vertex verts[5];
vm_vec_scale_add( &vecs[0], &center, &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[0], &center, &orient->uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->fvec, Grid_depth );
vm_vec_scale_add( &vecs[1], &center, &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[1], &center, &orient->uvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->rvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->fvec, Grid_depth );
vm_vec_scale_add( &vecs[2], &center, &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[2], &center, &orient->uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->fvec, Grid_depth );
vm_vec_scale_add( &vecs[3], &center, &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[3], &center, &orient->uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->fvec, Grid_depth );
// vm_vec_scale_add( &vecs[4], &center, &orient->vec.fvec, -Grid_depth );
// vm_vec_scale_add( &vecs[4], &center, &orient->fvec, -Grid_depth );
vecs[4] = center;
verts[0].u = 0.01f; verts[0].v = 0.01f;
File diff suppressed because it is too large. Load diff
+5 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -150,9 +147,9 @@
#define _FREESPACE_H
#ifndef STAMPER_PROGRAM // because of all the dependancies, I have to do this...yuck!!! MWA 7/21/97
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"
#include "pstypes.h"
#include "systemvars.h"
#include "2d.h"
// --------------------------------------------------------------------------------------------------------
// FREESPACE DEFINES/VARS
+5 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -56,9 +53,9 @@
* $NoKeywords: $
*/
#include "freespace2/freespace.h"
#include "bmpman/bmpman.h"
#include "freespace2/levelpaging.h"
#include "freespace.h"
#include "bmpman.h"
#include "levelpaging.h"
// All the page in functions
extern void ship_page_in();
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/FREESPACE2/LevelPaging.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Code to page in all the bitmaps at the beginning of a level.
+26 -32
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -110,21 +104,21 @@
#include <string.h>
#include <setjmp.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 "contexthelp.h"
#include "gamesequence.h"
#include "freespace.h"
#include "mainhallmenu.h"
#include "key.h"
#include "bmpman.h"
#include "2d.h"
#include "timer.h"
#include "math.h"
#include "io/mouse.h"
#include "controlconfig/controlsconfig.h"
#include "menuui/techmenu.h"
#include "parse/parselo.h"
#include "localization/localize.h"
#include "globalincs/alphacolors.h"
#include "mouse.h"
#include "controlsconfig.h"
#include "techmenu.h"
#include "parselo.h"
#include "localize.h"
#include "alphacolors.h"
////////////////////////////////////////////////////////////////////
@@ -516,23 +510,23 @@ void parse_helptbl()
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
stuff_int(&a);
stuff_int(&b);
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i];
}
// get 1024x768 vertex coordinates
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
stuff_int(&a);
stuff_int(&b);
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i];
}
}
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.y));
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].y));
help_overlaylist[overlay_id].plinecount++;
} else if (optional_string("+text")) {
@@ -674,11 +668,11 @@ void nudgetext_y(int textnum, int amount)
}
void nudgepline_x(int plinenum, int plinevert, int amount)
{
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.x += amount;
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].x += amount;
}
void nudgepline_y(int plinenum, int plinevert, int amount)
{
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.y += amount;
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].y += amount;
}
void nudgerbracket_x(int num, int amount)
{
@@ -714,7 +708,7 @@ void showplinepos(int plinenum)
dc_printf("pline %d on overlay %d vertices are now ", plinenum, current_helpid, help_overlaylist[current_helpid].textlist[gr_screen.res][plinenum].y_coord );
for (i=0; i<help_overlaylist[current_helpid].plinelist[GR_640][plinenum].vtxcount; i++)
{
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.y);
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].y);
}
}
+17 -20
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -118,22 +115,22 @@
* $NoKeywords: $
*/
#include "gamehelp/contexthelp.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "io/timer.h"
#include "contexthelp.h"
#include "gamesequence.h"
#include "freespace.h"
#include "key.h"
#include "bmpman.h"
#include "2d.h"
#include "timer.h"
#include "math.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"
#include "mouse.h"
#include "controlsconfig.h"
#include "ui.h"
#include "gamesnd.h"
#include "missionscreencommon.h"
#include "alphacolors.h"
#include "beam.h"
#include "audiostr.h"
// text positioning constats
#define TITLE_Y 35
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Header for displaying in-game help
+4 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GameSequence/GameSequence.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -243,8 +240,8 @@
* States should always be referred to using the macros.
*/
#include "freespace2/freespace.h"
#include "gamesequence/gamesequence.h"
#include "freespace.h"
#include "gamesequence.h"
// local defines
#define MAX_GAMESEQ_EVENTS 20 // maximum number of events on the game sequencing queue
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GameSequence/GameSequence.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -334,7 +331,7 @@
#ifndef __GAMESEQUENCE_H__
#define __GAMESEQUENCE_H__
#include "globalincs/pstypes.h"
#include "pstypes.h"
// defines for game sequencing events
//
+17 -20
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* C module for high-level control of event driven music
*
* $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
*
@@ -114,22 +111,22 @@
*/
#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 "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 "time.h"
#include "cmdline/cmdline.h"
#include "mission/missiongoals.h"
#include "localization/localize.h"
#include "cmdline.h"
#include "missiongoals.h"
#include "localize.h"
#pragma optimize("", off)
+3 -54
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Header file for high-level control of event driven music
*
* $Log: not supported by cvs2svn $
* 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
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -127,7 +121,7 @@
#ifndef __EVENT_MUSIC_H__
#define __EVENT_MUSIC_H__
#include "parse/parselo.h"
#include "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.
@@ -190,8 +184,6 @@ typedef struct tagSOUNDTRACK_INFO {
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
extern int Num_soundtracks;
#ifndef NO_SOUND
void event_music_init();
void event_music_close();
void event_music_level_init(int force_soundtrack = -1);
@@ -225,47 +217,4 @@ int event_music_player_respawn();
int event_music_player_respawn_as_observer();
void event_music_hostile_ship_destroyed();
#else
#define event_music_init()
#define event_music_close()
#define event_music_level_init(force_soundtrack) ((void)(force_soundtrack))
#define event_music_level_close()
#define event_music_do_frame()
#define event_music_disable()
#define event_music_enable()
#define event_music_pause()
#define event_music_unpause()
#define event_music_set_volume_all(volume) ((void)(volume))
#define event_music_parse_musictbl()
#define event_music_change_pattern(new_pattern) ((void)(new_pattern))
#define event_music_return_current_pattern() (0)
#define event_music_first_pattern()
#define event_music_battle_start() (0)
#define event_music_enemy_arrival() (0)
#define event_music_friendly_arrival() (0)
#define event_music_arrival(team) ((void)(team))
#define event_music_primary_goals_met() (0)
#define event_music_primary_goal_failed() (0)
#define event_music_player_death() (0)
#define event_music_start_default()
inline void event_music_get_info(char *outbuf)
{
if (outbuf) *outbuf = '\0';
}
inline void event_music_get_soundtrack_name(char *outbuf)
{
if (outbuf) *outbuf = '\0';
}
#define event_music_next_soundtrack(delta) (0)
#define event_music_set_soundtrack(name) ((void)(name))
#define event_music_set_score(score_index, name) ((void)((score_index), (name)))
#define event_music_get_spooled_music_index(name) (-1)
#define event_music_reset_choices()
#define event_music_player_respawn() (0)
#define event_music_player_respawn_as_observer() (0)
#define event_music_hostile_ship_destroyed()
#endif // ifndef NO_SOUND
#endif /* __EVENT_MUSIC_H__ */
+7 -10
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -170,11 +167,11 @@
* $NoKeywords: $
*/
#include "globalincs/pstypes.h"
#include "gamesnd/gamesnd.h"
#include "sound/sound.h"
#include "parse/parselo.h"
#include "localization/localize.h"
#include "pstypes.h"
#include "gamesnd.h"
#include "sound.h"
#include "parselo.h"
#include "localize.h"
// Global array that holds data about the gameplay sound effects.
game_snd Snds[MAX_GAME_SOUNDS];
+4 -30
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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.2 2002/05/10 06:08:08 mharris
* Porting... added ifndef NO_SOUND
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -323,10 +317,8 @@
#ifndef __GAMESND_H__
#define __GAMESND_H__
#include "sound/sound.h"
#include "mission/missionparse.h"
#ifndef NO_SOUND
#include "sound.h"
#include "missionparse.h"
void gamesnd_parse_soundstbl(); // Loads in general game sounds from sounds.tbl
void gamesnd_init_sounds(); // initializes the Snds[] and Snds_iface[] array
@@ -341,24 +333,6 @@ void gamesnd_play_error_beep();
void common_play_highlight_sound(); // called from interface code
#else
#define gamesnd_parse_soundstbl()
#define gamesnd_init_sounds()
#define gamesnd_load_gameplay_sounds()
#define gamesnd_unload_gameplay_sounds()
#define gamesnd_load_interface_sounds()
#define gamesnd_unload_interface_sounds()
#define gamesnd_preload_common_sounds()
#define gamesnd_play_iface(n) ((void)(n))
#define gamesnd_play_error_beep()
// this is a callback, so it needs to be a real function
void common_play_highlight_sound();
#endif // ifndef NO_SOUND
// Misc_sounds[] holds handles for misc sounds in the game (list appears in sounds.tbl)
#define MAX_GAME_SOUNDS 200
#define MAX_INTERFACE_SOUNDS 70
+1 -1
View File
@@ -41,7 +41,7 @@ typedef struct { float r, g, b, a; } FxColor4;
** export macros
*/
#if defined(_MSC_VER)
#if defined(__MSC__)
#if defined (MSVC16)
#define FX_ENTRY
#define FX_CALL
+1 -1
View File
@@ -42,7 +42,7 @@
#if defined(FX_DLL_DEFINITION)
#if defined(FX_DLL_ENABLE)
#if defined(_MSC_VER)
#if defined(__MSC__)
#ifndef KERNEL
#define FX_ENTRY __declspec( dllexport )
#define FX_EXPORT __declspec( dllexport )
+1 -1
View File
@@ -17,7 +17,7 @@
extern "C" {
# endif
# ifdef _WIN32
# ifdef WIN32
void sleep(int secs);
#define gethostname fxGethostname
+5 -10
View File
@@ -1,18 +1,12 @@
/*
* $Logfile: /Freespace2/code/glide/Glide.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -39,11 +33,12 @@
* $NoKeywords: $
*/
#define __MSC__
#include <windows.h>
#include <windowsx.h>
#include "glide/glide.h"
#include "globalincs/pstypes.h"
#include "glide.h"
#include "pstypes.h"
static HMODULE Glide_lib_handle;
+5 -4
View File
@@ -22,11 +22,12 @@
#ifndef __GLIDE_H__
#define __GLIDE_H__
#define __MSC__
#define FX_GLIDE_NO_FUNC_PROTO
#include "glide/3dfx.h"
#include "glide/sst1vid.h"
#include "glide/glidesys.h"
#include "3dfx.h"
#include "sst1vid.h"
#include "glidesys.h"
#ifdef __cplusplus
extern "C" {
@@ -1088,7 +1089,7 @@ grHints(GrHint_t hintType, FxU32 hintMask);
}
#endif
#include "glide/glideutl.h"
#include "glideutl.h"
#endif /* __GLIDE_H__ */
+1 -1
View File
@@ -3,7 +3,7 @@
** All Rights Reserved.
**
**
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glidesys.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glidesys.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
** $Log: not supported by cvs2svn $
** Revision 1.1 2002/05/02 18:03:07 mharris
** Initial checkin - converted filenames and includes to lower case
+1 -1
View File
@@ -3,7 +3,7 @@
** All Rights Reserved.
**
**
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glideutl.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glideutl.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
** $Log: not supported by cvs2svn $
** Revision 1.1 2002/05/02 18:03:07 mharris
** Initial checkin - converted filenames and includes to lower case
+1 -1
View File
@@ -3,7 +3,7 @@
** All Rights Reserved.
**
**
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/sst1vid.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/sst1vid.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
** $Log: not supported by cvs2svn $
** Revision 1.1 2002/05/02 18:03:07 mharris
** Initial checkin - converted filenames and includes to lower case
+2 -2
View File
@@ -7,8 +7,8 @@
*
*/
#include "graphics/2d.h"
#include "globalincs/alphacolors.h"
#include "2d.h"
#include "alphacolors.h"
// -----------------------------------------------------------------------------------
// ALPHA DEFINES/VARS
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/crypt.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $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
*
@@ -35,7 +32,7 @@
*/
#include <string.h>
#include "globalincs/crypt.h"
#include "crypt.h"
char *jcrypt (char *plainstring)
{
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/crypt.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Header for crypt stuff
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/LinkList.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Macros to handle doubly linked lists
+14 -51
View File
@@ -9,34 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
* $Revision: 2.4 $
* $Date: 2002-08-06 01:49:08 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Header file containg global typedefs, constants and macros
*
* $Log: not supported by cvs2svn $
* 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()
*
* Revision 1.3 2002/05/04 04:52:22 mharris
* 1st draft at porting
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -209,9 +188,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,
@@ -235,8 +214,6 @@
#include <malloc.h>
#include <string.h>
#include "windows_stub/config.h"
// value to represent an uninitialized state in any int or uint
#define UNINITIALIZED 0x7f8e6d9c
@@ -253,16 +230,7 @@
#define LOCAL static // make module local varilable static.
#if defined( _WIN32 ) && defined( _MSC_VER )
typedef __int64 longlong;
typedef unsigned __int64 ulonglong;
#elif defined ( __GNUC__ )
typedef long long longlong;
typedef unsigned long long ulonglong;
#else
#error unknown compiler/architecture
#endif
typedef long fix;
typedef unsigned char ubyte;
typedef unsigned short ushort;
@@ -272,14 +240,14 @@ typedef unsigned int uint;
//Stucture to store clipping codes in a word
typedef struct ccodes {
ubyte cc_or, cc_and; //or is low byte, and is high byte
ubyte or,and; //or is low byte, and is high byte
} ccodes;
typedef struct vector {
union {
struct {
float x,y,z;
} xyz;
};
float a1d[3];
};
} vector;
@@ -300,13 +268,13 @@ typedef struct vert2df {
typedef struct angles {
float p, b, h;
} angles_t;
} angles;
typedef struct matrix {
union {
struct {
vector rvec, uvec, fvec;
} vec;
};
float a2d[3][3];
float a1d[9];
};
@@ -364,7 +332,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 "osapi/outwnd.h"
#include "outwnd.h"
// To debug printf do this:
// mprintf(( "Error opening %s\n", filename ));
@@ -398,11 +366,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
#define AsmInt3() _asm { int 3 }
#else
#define AsmInt3() abort()
#endif
#define AsmInt3() _asm { int 3 }
#else
#if defined(NDEBUG)
@@ -539,14 +503,13 @@ void dc_printf( char *format, ... );
//======================================================================================
#include "math/fix.h"
#include "math/floating.h"
#include "fix.h"
#include "floating.h"
// Some constants for stuff
#ifdef _WIN32
#define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
#define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
#endif
// contants and defined for byteswapping routines (useful for mac)
+6 -9
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* Variables and constants common to FreeSpace and Fred.
*
* $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
*
@@ -194,10 +191,10 @@
* $NoKeywords: $
*/
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "io/timer.h"
#include "nebula/neb.h"
#include "pstypes.h"
#include "systemvars.h"
#include "timer.h"
#include "neb.h"
fix Missiontime;
fix Frametime;
+5 -21
View File
@@ -9,22 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
* $Revision: 2.2 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
* 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
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -198,7 +189,6 @@
#ifndef _SYSTEMVARS_H
#define _SYSTEMVARS_H
#include "globalincs/pstypes.h"
#include "math.h"
#define GM_MULTIPLAYER (1 << 0)
@@ -235,12 +225,12 @@
typedef struct vei {
angles_t angles; // Angles defining viewer location.
angles angles; // Angles defining viewer location.
float distance; // Distance from which to view, plus 2x radius.
} vei;
typedef struct vci {
angles_t angles;
angles angles;
float distance; // Distance from which to view, plus 3x radius
} vci;
@@ -353,10 +343,4 @@ int current_detail_level();
extern int TotalRam;
void windebug_memwatch_init();
enum
{
TIMERBAR_DEFAULT,
TIMERBAR_D3DCODE,
};
#endif
+4 -7
View File
@@ -9,15 +9,12 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
*
* $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
*
@@ -39,8 +36,8 @@
#include <stdio.h>
#include <string.h>
#include "globalincs/version.h"
#include "osapi/osregistry.h"
#include "version.h"
#include "osregistry.h"
// ----------------------------------------------------------------------------------------------------------------
// VERSION DEFINES/VARS
+16 -20
View File
@@ -9,21 +9,12 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
* $Revision: 2.3 $
* $Date: 2002-11-10 20:40:02 $
* $Author: inquisitor $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/13 03:32:25 penguin
* Bumped to version 3.2
*
* Revision 2.1 2002/08/04 05:11:36 penguin
* Update version number to 3.1
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -123,14 +114,19 @@
// 1.01 Patch for Win95 volume label bug
// 1.20 German release version
// fs2_open version numbers:
// the first version is 3.0 :-)
// Major.Minor.Bugfix
#define FS_VERSION_MAJOR 3 // major version
#define FS_VERSION_MINOR 3 // increase by 1 for minor revs
#define FS_VERSION_BUILD 0 // bugfix release
#if defined (FS2_DEMO)
#define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release
#define FS_VERSION_MINOR 10 // Increase by 1 for minor revs, 10 for major.
#define FS_VERSION_BUILD 00 // Build version
#elif defined(OEM_BUILD)
#define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release
#define FS_VERSION_MINOR 00 // Increase by 1 for minor revs, 10 for major.
#define FS_VERSION_BUILD 00 // Build version
#else
#define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release
#define FS_VERSION_MINOR 20 // Increase by 1 for minor revs, 10 for major.
#define FS_VERSION_BUILD 00 // Build version
#endif
#define VERSION_LOC_FNAME "version.nfo"
#define MOTD_LOC_FNAME "motd.txt"
Loaded 100 of 522 files, more files were not shown because too many files have changed in this diff. Show more