mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3671ac2c64 |
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
@@ -1,14 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
LockDir=/var/lock/cvs
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
||||
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
|
||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
||||
#LogHistory=TOFEWGCMAR
|
||||
@@ -1,23 +0,0 @@
|
||||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -t/-f options allow one to treat directories of files
|
||||
# as a single file, or to transform a file in other ways on
|
||||
# its way in and out of CVS.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,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}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
@@ -1,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));
|
||||
@@ -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.3 2003-09-07 12:46:59 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use Digest::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 Digest::MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, 'From: [email protected]');
|
||||
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);
|
||||
@@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail %s -s "CVS notification"
|
||||
@@ -1,19 +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
|
||||
randomtiger:f7Way/xL9ic7o:fs2source
|
||||
righteous1:f7fpcXiE0Ubao:fs2source
|
||||
bobboau:f7jChSbXOIdWY:fs2source
|
||||
sesquipedalian:f75AcAOV6TM6Q:fs2source
|
||||
daveb:f7f2mVbMvbe.6:fs2source
|
||||
Goober5000:f7Fc.gHzyrOL2:fs2source
|
||||
dkharrat:f7odljbD5tm5k:fs2source
|
||||
EdrickV:f7cDahmEbbAlg:fs2source
|
||||
OldMan:f7N4NyUG5Ommw:fs2source
|
||||
komet:f7fyoBN5r.m76:fs2source
|
||||
anonymous:oIKtWP1q6GDt6:fs2source
|
||||
@@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@@ -1,18 +0,0 @@
|
||||
drevil
|
||||
inquisitor
|
||||
mysterial
|
||||
DTP
|
||||
randomtiger
|
||||
wmcoolmon
|
||||
unknownplayer
|
||||
phreak
|
||||
bobboau
|
||||
righteous1
|
||||
sesquipedalian
|
||||
Goober5000
|
||||
dkharrat
|
||||
daveb
|
||||
EdrickV
|
||||
OldMan
|
||||
komet
|
||||
penguin
|
||||
@@ -1,29 +0,0 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
|
||||
|
||||
Modifications by the FreeSpace Source Code Project (FSSCP)
|
||||
http://fs2source.warpcore.org
|
||||
|
||||
FS2_OPEN STAFF:
|
||||
|
||||
Project leader:
|
||||
Edward "Inquisitor" Gardner
|
||||
|
||||
Programmers:
|
||||
"Bobboau"
|
||||
Dennis "DTP" Pedersen
|
||||
Ian "Goober5000" Warfield
|
||||
Joe "Righteous1" Dowd
|
||||
Mike "penguin" Harris
|
||||
"Mysterial"
|
||||
"PhReAk"
|
||||
Thomas "Random Tiger" Whittaker
|
||||
Will "Unknown PLayer" Rousnel
|
||||
"WMCoolmon"
|
||||
|
||||
Web support:
|
||||
Icefire and the staff at Volitionwatch.com
|
||||
Alex "Thunder" Avery and the staff at Hard Light Productions
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
@@ -1,14 +0,0 @@
|
||||
Volition Copyright (applies to original FreeSpace2 source code
|
||||
developed and released by Volition):
|
||||
|
||||
"Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
|
||||
All source code herein is the property of Volition, Inc. You may not
|
||||
sell or otherwise commercially exploit the source or things you
|
||||
created based on the source."
|
||||
|
||||
|
||||
Modifications by members of the FreeSpace Source Code Project are
|
||||
released under whatever terms the individual authors choose, but the
|
||||
above notice continues to apply to all fs2_open code.
|
||||
|
||||
-1868
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -1,165 +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 /W2 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "USE_OPENGL" /D "HTL" /D "MORE_SPECIES" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# 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 Quartz.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"C:\games\freespace2\fs2_open_r.exe" /libpath:"release" /libpath:"c:\mssdk\lib" /libpath:"c:\dxsdk\lib" /libpath:"c:\speech_api\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Custom Build - Copying $(InputPath) to D:\games\freespace2
|
||||
InputPath=\games\freespace2\fs2_open_r.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"d:\games\freespace2\fs2_open_r.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) d:\games\freespace2\fs2_open_r.exe
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Freespace2 - Win32 Debug"
|
||||
|
||||
# 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" /I "c:\mssdk\include\\" /I "c:\dxsdk\include" /I "c:\speech_api\include" /I "c:\devil-sdk\include" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "MORE_SPECIES" /U "NDEBUG" /Fr /YX /FD /GZ /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# 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 Quartz.lib d3d8.lib d3dx8.lib DxErr8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"C:\games\freespace2\fs2_open_d.exe" /libpath:"debug" /libpath:"c:\mssdk\lib" /libpath:"c:\dxsdk\lib" /libpath:"c:\speech_api\lib"
|
||||
# SUBTRACT LINK32 /pdb:none /incremental:no /map
|
||||
# Begin Custom Build - Copying $(InputPath) to D:\games\freespace2
|
||||
InputPath=\games\freespace2\fs2_open_d.exe
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
"d:\games\freespace2\fs2_open_d.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
copy $(InputPath) d:\games\freespace2\fs2_open_d.exe
|
||||
|
||||
# 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\graphics\grstub.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\FREESPACE2\LevelPaging.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\code\network\multiui.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -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>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
This is still in pretty rough form.
|
||||
|
||||
|
||||
=== for people building fs2_open:
|
||||
|
||||
Win32-MSVC:
|
||||
Use the Freespace2.dsw workspace and build within the IDE.
|
||||
|
||||
|
||||
Win32-MinGW:
|
||||
make
|
||||
|
||||
|
||||
Linux and other unix variants (NOT YET COMPLETE)
|
||||
./configure [options] (options tbd)
|
||||
make -f makefile.linux
|
||||
|
||||
|
||||
|
||||
=== for the project maintainers (people who need to
|
||||
=== keep the makefiles up to date):
|
||||
|
||||
aclocal
|
||||
autoconf
|
||||
automake
|
||||
./configure
|
||||
make
|
||||
@@ -1,5 +0,0 @@
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = code
|
||||
@@ -1,506 +0,0 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DX8_INCLUDE = @DX8_INCLUDE@
|
||||
DX8_LIB = @DX8_LIB@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EXEEXT = @EXEEXT@
|
||||
FS2_GRSOFT_FALSE = @FS2_GRSOFT_FALSE@
|
||||
FS2_GRSOFT_TRUE = @FS2_GRSOFT_TRUE@
|
||||
FS2_JOYSTICK_FALSE = @FS2_JOYSTICK_FALSE@
|
||||
FS2_JOYSTICK_TRUE = @FS2_JOYSTICK_TRUE@
|
||||
FS2_NETWORKING_FALSE = @FS2_NETWORKING_FALSE@
|
||||
FS2_NETWORKING_TRUE = @FS2_NETWORKING_TRUE@
|
||||
FS2_OS_UNIX_FALSE = @FS2_OS_UNIX_FALSE@
|
||||
FS2_OS_UNIX_TRUE = @FS2_OS_UNIX_TRUE@
|
||||
FS2_OS_WIN32_FALSE = @FS2_OS_WIN32_FALSE@
|
||||
FS2_OS_WIN32_TRUE = @FS2_OS_WIN32_TRUE@
|
||||
FS2_SOUND_FALSE = @FS2_SOUND_FALSE@
|
||||
FS2_SOUND_TRUE = @FS2_SOUND_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
||||
SUBDIRS = code
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
ps-recursive install-info-recursive uninstall-info-recursive \
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
|
||||
configure.in depcomp install-sh missing mkinstalldirs
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf autom4te.cache
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-generic clean-recursive ctags ctags-recursive dist \
|
||||
dist-all dist-gzip distcheck distclean distclean-generic \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
|
||||
info-recursive install install-am install-data install-data-am \
|
||||
install-data-recursive install-exec install-exec-am \
|
||||
install-exec-recursive install-info install-info-am \
|
||||
install-info-recursive install-man install-recursive \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am installdirs-recursive maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-recursive pdf pdf-am \
|
||||
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-info-recursive uninstall-recursive
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,3 +0,0 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog for what's new.
|
||||
@@ -1,4 +0,0 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -1,305 +0,0 @@
|
||||
# code/Makefile.am for fs2_open
|
||||
#
|
||||
# $Id: Makefile.am,v 1.2 2003-03-11 19:00:05 penguin Exp $
|
||||
|
||||
noinst_PROGRAMS = fs2
|
||||
|
||||
fs2_SOURCES = \
|
||||
anim/animplay.cpp \
|
||||
anim/packunpack.cpp \
|
||||
asteroid/asteroid.cpp \
|
||||
bmpman/bmpman.cpp \
|
||||
cfile/cfile.cpp \
|
||||
cfile/cfilearchive.cpp \
|
||||
cfile/cfilelist.cpp \
|
||||
cfile/cfilesystem.cpp \
|
||||
cmdline/cmdline.cpp \
|
||||
cmeasure/cmeasure.cpp \
|
||||
controlconfig/controlsconfig.cpp \
|
||||
controlconfig/controlsconfigcommon.cpp \
|
||||
cutscene/cutscenes.cpp \
|
||||
debris/debris.cpp \
|
||||
debugconsole/console.cpp \
|
||||
decals/decals.cpp \
|
||||
demo/demo.cpp \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/warpineffect.cpp \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/levelpaging.cpp \
|
||||
gamehelp/contexthelp.cpp \
|
||||
gamehelp/gameplayhelp.cpp \
|
||||
gamesequence/gamesequence.cpp \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/crypt.cpp \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/version.cpp \
|
||||
graphics/2d.cpp \
|
||||
graphics/aaline.cpp \
|
||||
graphics/bitblt.cpp \
|
||||
graphics/circle.cpp \
|
||||
graphics/colors.cpp \
|
||||
graphics/font.cpp \
|
||||
graphics/gradient.cpp \
|
||||
graphics/gropengl.cpp \
|
||||
graphics/grzbuffer.cpp \
|
||||
graphics/line.cpp \
|
||||
graphics/pixel.cpp \
|
||||
graphics/rect.cpp \
|
||||
graphics/scaler.cpp \
|
||||
graphics/shade.cpp \
|
||||
hud/hud.cpp \
|
||||
hud/hudartillery.cpp \
|
||||
hud/hudbrackets.cpp \
|
||||
hud/hudconfig.cpp \
|
||||
hud/hudescort.cpp \
|
||||
hud/hudets.cpp \
|
||||
hud/hudlock.cpp \
|
||||
hud/hudmessage.cpp \
|
||||
hud/hudreticle.cpp \
|
||||
hud/hudshield.cpp \
|
||||
hud/hudsquadmsg.cpp \
|
||||
hud/hudtarget.cpp \
|
||||
hud/hudtargetbox.cpp \
|
||||
hud/hudwingmanstatus.cpp \
|
||||
io/key.cpp \
|
||||
io/keycontrol.cpp \
|
||||
io/mouse.cpp \
|
||||
io/timer.cpp \
|
||||
jumpnode/jumpnode.cpp \
|
||||
lighting/lighting.cpp \
|
||||
localization/fhash.cpp \
|
||||
localization/localize.cpp \
|
||||
math/fix.cpp \
|
||||
math/floating.cpp \
|
||||
math/fvi.cpp \
|
||||
math/spline.cpp \
|
||||
math/staticrand.cpp \
|
||||
math/vecmat.cpp \
|
||||
menuui/barracks.cpp \
|
||||
menuui/credits.cpp \
|
||||
menuui/fishtank.cpp \
|
||||
menuui/mainhallmenu.cpp \
|
||||
menuui/mainhalltemp.cpp \
|
||||
menuui/optionsmenu.cpp \
|
||||
menuui/playermenu.cpp \
|
||||
menuui/readyroom.cpp \
|
||||
menuui/snazzyui.cpp \
|
||||
menuui/techmenu.cpp \
|
||||
menuui/trainingmenu.cpp \
|
||||
mission/missionbriefcommon.cpp \
|
||||
mission/missioncampaign.cpp \
|
||||
mission/missiongoals.cpp \
|
||||
mission/missiongrid.cpp \
|
||||
mission/missionhotkey.cpp \
|
||||
mission/missionload.cpp \
|
||||
mission/missionlog.cpp \
|
||||
mission/missionmessage.cpp \
|
||||
mission/missionparse.cpp \
|
||||
mission/missiontraining.cpp \
|
||||
missionui/missionbrief.cpp \
|
||||
missionui/missioncmdbrief.cpp \
|
||||
missionui/missiondebrief.cpp \
|
||||
missionui/missionloopbrief.cpp \
|
||||
missionui/missionpause.cpp \
|
||||
missionui/missionrecommend.cpp \
|
||||
missionui/missionscreencommon.cpp \
|
||||
missionui/missionshipchoice.cpp \
|
||||
missionui/missionstats.cpp \
|
||||
missionui/missionweaponchoice.cpp \
|
||||
missionui/redalert.cpp \
|
||||
model/modelcollide.cpp \
|
||||
model/modelinterp.cpp \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neblightning.cpp \
|
||||
object/collidedebrisship.cpp \
|
||||
object/collidedebrisweapon.cpp \
|
||||
object/collideshipship.cpp \
|
||||
object/collideshipweapon.cpp \
|
||||
object/collideweaponweapon.cpp \
|
||||
object/objcollide.cpp \
|
||||
object/object.cpp \
|
||||
object/objectsort.cpp \
|
||||
observer/observer.cpp \
|
||||
palman/palman.cpp \
|
||||
parse/encrypt.cpp \
|
||||
parse/parselo.cpp \
|
||||
parse/sexp.cpp \
|
||||
particle/particle.cpp \
|
||||
pcxutils/pcxutils.cpp \
|
||||
physics/physics.cpp \
|
||||
playerman/managepilot.cpp \
|
||||
playerman/playercontrol.cpp \
|
||||
popup/popup.cpp \
|
||||
popup/popupdead.cpp \
|
||||
radar/radar.cpp \
|
||||
render/3dclipper.cpp \
|
||||
render/3ddraw.cpp \
|
||||
render/3dlaser.cpp \
|
||||
render/3dmath.cpp \
|
||||
render/3dsetup.cpp \
|
||||
ship/afterburner.cpp \
|
||||
ship/ai.cpp \
|
||||
ship/aibig.cpp \
|
||||
ship/aicode.cpp \
|
||||
ship/aigoals.cpp \
|
||||
ship/awacs.cpp \
|
||||
ship/shield.cpp \
|
||||
ship/ship.cpp \
|
||||
ship/shipcontrails.cpp \
|
||||
ship/shipfx.cpp \
|
||||
ship/shiphit.cpp \
|
||||
starfield/nebula.cpp \
|
||||
starfield/starfield.cpp \
|
||||
starfield/supernova.cpp \
|
||||
stats/medals.cpp \
|
||||
stats/scoring.cpp \
|
||||
stats/stats.cpp \
|
||||
tgautils/tgautils.cpp \
|
||||
ui/button.cpp \
|
||||
ui/checkbox.cpp \
|
||||
ui/gadget.cpp \
|
||||
ui/icon.cpp \
|
||||
ui/inputbox.cpp \
|
||||
ui/keytrap.cpp \
|
||||
ui/listbox.cpp \
|
||||
ui/radio.cpp \
|
||||
ui/scroll.cpp \
|
||||
ui/slider.cpp \
|
||||
ui/slider2.cpp \
|
||||
ui/uidraw.cpp \
|
||||
ui/uimouse.cpp \
|
||||
ui/window.cpp \
|
||||
weapon/beam.cpp \
|
||||
weapon/corkscrew.cpp \
|
||||
weapon/emp.cpp \
|
||||
weapon/flak.cpp \
|
||||
weapon/muzzleflash.cpp \
|
||||
weapon/shockwave.cpp \
|
||||
weapon/swarm.cpp \
|
||||
weapon/trails.cpp \
|
||||
weapon/weapons.cpp
|
||||
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_JOYSTICK
|
||||
fs2_SOURCES += \
|
||||
io/joy.cpp \
|
||||
io/joy_ff.cpp \
|
||||
io/swff_lib.cpp
|
||||
endif # FS2_JOYSTICK
|
||||
|
||||
## networking support sources
|
||||
if FS2_NETWORKING
|
||||
fs2_SOURCES += \
|
||||
hud/hudobserver.cpp \
|
||||
network/multi.cpp \
|
||||
network/multimsgs.cpp \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiui.cpp \
|
||||
network/multiutil.cpp \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_data.cpp \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_log.cpp \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_options.cpp \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_team.cpp \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_xfer.cpp \
|
||||
network/psnet.cpp \
|
||||
network/psnet2.cpp \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
missionui/chatbox.cpp
|
||||
endif # FS2_NETWORKING
|
||||
|
||||
## sound support sources
|
||||
if FS2_SOUND
|
||||
fs2_SOURCES += \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/gamesnd.cpp \
|
||||
object/objectsnd.cpp \
|
||||
sound/acm.cpp \
|
||||
sound/audiostr.cpp \
|
||||
sound/ds.cpp \
|
||||
sound/ds3d.cpp \
|
||||
sound/dscap.cpp \
|
||||
sound/midifile.cpp \
|
||||
sound/rbaudio.cpp \
|
||||
sound/rtvoice.cpp \
|
||||
sound/sound.cpp \
|
||||
sound/winmidi.cpp \
|
||||
sound/winmidi_base.cpp \
|
||||
vcodec/codec1.cpp
|
||||
endif # FS2_SOUND
|
||||
|
||||
## software-rendering support sources
|
||||
if FS2_GRSOFT
|
||||
fs2_SOURCES += \
|
||||
graphics/grsoft.cpp \
|
||||
graphics/tmapper.cpp
|
||||
endif # FS2_GRSOFT
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
fs2_SOURCES += \
|
||||
cutscene/movie.cpp \
|
||||
directx/dx8show.cpp \
|
||||
ddsutils/ddsutils.cpp \
|
||||
globalincs/windebug.cpp \
|
||||
glide/glide.cpp \
|
||||
graphics/grd3d.cpp \
|
||||
graphics/grd3drender.cpp \
|
||||
graphics/grd3dtexture.cpp \
|
||||
graphics/grdirectdraw.cpp \
|
||||
graphics/grglide.cpp \
|
||||
graphics/grglidetexture.cpp \
|
||||
network/stand_gui.cpp \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/outwnd.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
fs2_SOURCES += \
|
||||
io/xmouse.cpp \
|
||||
osapi/osapi_unix.cpp \
|
||||
osapi/osregistry_unix.cpp \
|
||||
osapi/outwnd_unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
|
||||
## compiler flags
|
||||
# INCLUDES = -I.
|
||||
AM_CXXFLAGS = -fno-exceptions @DX8_INCLUDE@
|
||||
AM_LDFLAGS = -L/c/dx8/lib @DX8_LIB@
|
||||
|
||||
LDADD =
|
||||
|
||||
if FS2_OS_WIN32
|
||||
## Win32 libraries needed
|
||||
LDADD += \
|
||||
-lgdi32 -lole32 -lwsock32 -lwinmm -lmsacm32 -lopengl32 \
|
||||
-lcomctl32 -lstrmiids -ldxguid -lddraw -ldinput
|
||||
endif
|
||||
|
||||
|
||||
if FS2_OS_UNIX
|
||||
## Unix libraries needed
|
||||
## -- TODO --
|
||||
endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-12-08 22:30:02 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 3 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 11 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 10 4/27/98 3:36p Dave
|
||||
*
|
||||
* 9 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 8 12/24/97 8:57p Lawrance
|
||||
* Added anim_ignore_next_frametime()
|
||||
*
|
||||
* 7 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 6 8/30/97 2:11p Lawrance
|
||||
* allow animations to loop
|
||||
*
|
||||
* 5 8/25/97 11:13p Lawrance
|
||||
* support framerate independent playback with the option of now advancing
|
||||
* more than one frame at a time
|
||||
*
|
||||
* 4 7/21/97 11:41a Lawrance
|
||||
* make playback time of .ani files keyed of frametime
|
||||
*
|
||||
* 3 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 2 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 1 6/23/97 5:09p Lawrance
|
||||
*
|
||||
* 10 5/19/97 2:28p Lawrance
|
||||
* changes some variables to flags
|
||||
*
|
||||
* 9 5/15/97 5:58p Lawrance
|
||||
* fix some bugs that were present with animations when playing multiple
|
||||
* missions
|
||||
*
|
||||
* 8 5/15/97 4:42p Lawrance
|
||||
* suporting anims in-game
|
||||
*
|
||||
* 7 5/15/97 11:46a Lawrance
|
||||
* add function to check if an anim is playing
|
||||
*
|
||||
* 6 2/28/97 12:17p Lawrance
|
||||
* supporting mapping file to memory
|
||||
*
|
||||
* 5 2/25/97 11:06a Lawrance
|
||||
* moved some higher level functions to from PackUnpack to AnimPlay
|
||||
*
|
||||
* 4 2/19/97 9:27p Lawrance
|
||||
* added pause capability to anim playback
|
||||
*
|
||||
* 3 2/17/97 4:19p Lawrance
|
||||
* using frame numbers instead of percentages for accessing keyframes
|
||||
*
|
||||
* 2 2/17/97 3:01p Lawrance
|
||||
* code for playing back an anim
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct anim;
|
||||
struct anim_info;
|
||||
struct anim_instance;
|
||||
struct CFILE;
|
||||
|
||||
// structure passed in when playing an anim. Talk about overkill..
|
||||
typedef struct {
|
||||
anim *anim_info;
|
||||
int x;
|
||||
int y;
|
||||
int start_at;
|
||||
int stop_at;
|
||||
int screen_id;
|
||||
vector *world_pos;
|
||||
float radius;
|
||||
int framerate_independent;
|
||||
void *color;
|
||||
int skip_frames;
|
||||
int looped;
|
||||
int ping_pong;
|
||||
} anim_play_struct;
|
||||
|
||||
enum
|
||||
{
|
||||
PAGE_FROM_MEM = 0,
|
||||
PAGE_FROM_DISK = 1,
|
||||
PAGE_FROM_DISK_FORCED = 2,
|
||||
};
|
||||
|
||||
extern int Anim_paused;
|
||||
|
||||
void anim_init();
|
||||
void anim_level_init();
|
||||
void anim_level_close();
|
||||
void anim_render_all(int screen_id, float frametime);
|
||||
void anim_render_one(int screen_id, anim_instance *ani, float frametime);
|
||||
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
|
||||
anim_instance *anim_play(anim_play_struct *aps);
|
||||
void anim_ignore_next_frametime();
|
||||
int anim_stop_playing(anim_instance* anim_instance);
|
||||
int anim_show_next_frame(anim_instance *instance, float frametime);
|
||||
void anim_release_all_instances(int screen_id = 0);
|
||||
void anim_release_render_instance(anim_instance* instance);
|
||||
anim *anim_load(char *name, int file_mapped = PAGE_FROM_MEM);
|
||||
int anim_free(anim *ptr);
|
||||
int anim_playing(anim_instance *ai);
|
||||
int anim_write_frames_out(char *filename);
|
||||
void anim_display_info(char *filename);
|
||||
void anim_read_header(anim *ptr, CFILE *fp);
|
||||
void anim_reverse_direction(anim_instance *ai); // called automatically for ping-ponging, and can also be called externally
|
||||
void anim_pause(anim_instance *ai);
|
||||
void anim_unpause(anim_instance *ai);
|
||||
|
||||
int anim_instance_is_streamed(anim_instance *ai);
|
||||
unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
|
||||
|
||||
#endif /* __ANIMPLAY_H__ */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 7 7/16/99 1:49p Dave
|
||||
* 8 bit aabitmaps. yay.
|
||||
*
|
||||
* 6 1/14/99 12:48a Dave
|
||||
* Todo list bug fixes. Made a pass at putting briefing icons back into
|
||||
* FRED. Sort of works :(
|
||||
*
|
||||
* 5 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 4 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 3 10/16/98 3:42p Andsager
|
||||
* increase MAX_WEAPONS and MAX_SHIPS and som header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 32 5/18/98 5:59p Hoffoss
|
||||
* Made command briefing advanced now once the speech stops and animation
|
||||
* has fully played once, whichever is longer.
|
||||
*
|
||||
* 31 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 30 1/14/98 6:43p Lawrance
|
||||
* Add ref_count to anim struct, so we don't free multiple times
|
||||
*
|
||||
* 29 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 28 8/30/97 2:11p Lawrance
|
||||
* allow animations to loop
|
||||
*
|
||||
* 27 8/25/97 11:13p Lawrance
|
||||
* support framerate independent playback with the option of now advancing
|
||||
* more than one frame at a time
|
||||
*
|
||||
* 26 8/21/97 5:11p Lawrance
|
||||
* frame numbering for ANI's now is from 0 -> total_frames-1.
|
||||
*
|
||||
* 25 7/28/97 10:42p Lawrance
|
||||
* re-did interface to unpack_frame() to make more general
|
||||
*
|
||||
* 24 7/21/97 11:41a Lawrance
|
||||
* make playback time of .ani files keyed of frametime
|
||||
*
|
||||
* 23 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 22 6/27/97 4:36p Lawrance
|
||||
* update pal translation table when gr_screen.signature changes
|
||||
*
|
||||
* 21 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 20 6/25/97 3:03p Lawrance
|
||||
* fix palette translation problem with anti-alised bitmaps
|
||||
*
|
||||
* 19 5/27/97 3:48p Lawrance
|
||||
* don't re-create a bitmap if using the same frame of animation
|
||||
*
|
||||
* 18 5/21/97 11:06a Lawrance
|
||||
* enabling a user-defined transparent value
|
||||
*
|
||||
* 17 5/19/97 3:21p Lawrance
|
||||
* add fps parm, version num to anim header
|
||||
*
|
||||
* 16 5/19/97 2:28p Lawrance
|
||||
* changes some variables to flags
|
||||
*
|
||||
* 15 5/15/97 4:42p Lawrance
|
||||
* supporting animations in-game
|
||||
*
|
||||
* 14 3/01/97 2:08p Lawrance
|
||||
* not using windows.h, since memory mapping details moved to cfile
|
||||
*
|
||||
* 13 2/28/97 12:17p Lawrance
|
||||
* supporting mapping file to memory
|
||||
*
|
||||
* 12 2/25/97 11:06a Lawrance
|
||||
* moved some higher level functions to from PackUnpack to AnimPlay
|
||||
*
|
||||
* 11 2/19/97 9:51p Lawrance
|
||||
* made keyframe decompression more effecient, moved
|
||||
* default anim FPS to header file
|
||||
*
|
||||
* 10 2/19/97 4:01p Lawrance
|
||||
* load_anim returns int, not void
|
||||
*
|
||||
* 9 2/17/97 4:19p Lawrance
|
||||
* changed stop and start to be actual frame numbers, not percentages
|
||||
*
|
||||
* 8 2/17/97 4:17p Hoffoss
|
||||
* modified packing internal format and added random access function to an
|
||||
* Anim frame.
|
||||
*
|
||||
* 7 2/17/97 2:59p Lawrance
|
||||
* integrating into game
|
||||
*
|
||||
* 6 2/14/97 11:09p Hoffoss
|
||||
* Made optimizations.
|
||||
*
|
||||
* 5 2/14/97 10:48p Hoffoss
|
||||
* fixed bug.
|
||||
*
|
||||
* 4 2/14/97 10:38p Lawrance
|
||||
* fixing bugs
|
||||
*
|
||||
* 3 2/14/97 3:29p Hoffoss
|
||||
* Added header for MSDEV to fill in.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef __PACKUNPACK_H__
|
||||
#define __PACKUNPACK_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct CFILE;
|
||||
|
||||
#define ANI_STREAM_CACHE_SIZE 4096
|
||||
|
||||
#define PACKER_CODE 0xEE // Use'd by PACKING_METHOD_RLE
|
||||
#define PACKING_METHOD_RLE 0 // Hoffoss's RLE format
|
||||
#define PACKING_METHOD_RLE_KEY 1 // Hoffoss's key frame RLE format
|
||||
#define PACKING_METHOD_STD_RLE 2 // Standard RLE format (high bit is count)
|
||||
#define PACKING_METHOD_STD_RLE_KEY 3 // Standard RLE format key frame
|
||||
|
||||
#define STD_RLE_CODE 0x80
|
||||
|
||||
typedef struct key_frame {
|
||||
int frame_num; // which frame number this key frame is
|
||||
int offset; // offset from the start of data block
|
||||
} key_frame;
|
||||
|
||||
#define ANF_MEM_MAPPED (1<<0) // animation is memory-mapped file
|
||||
#define ANF_STREAMED (1<<1)
|
||||
#define ANF_XPARENT (1<<2) // animation has transparency
|
||||
#define ANF_ALL_KEYFRAMES (1<<3) // all the frames are keyframes (this is necessary if we want to play the file backwards)
|
||||
|
||||
typedef struct anim {
|
||||
anim *next;
|
||||
char name[MAX_PATH_LEN];
|
||||
ubyte packer_code;
|
||||
int width;
|
||||
int height;
|
||||
int total_frames;
|
||||
int instance_count; // number of instances that are currently playing
|
||||
int ref_count; // number of times this anim has been loaded
|
||||
float time; // playback time in seconds
|
||||
int num_keys;
|
||||
key_frame *keys;
|
||||
ubyte palette[768];
|
||||
ubyte palette_translation[256];
|
||||
ubyte *data; // points to compressed data
|
||||
CFILE* cfile_ptr;
|
||||
int version;
|
||||
int fps;
|
||||
ubyte xparent_r; // red component for the transparent color in source image
|
||||
ubyte xparent_g; // green component for the transparent color in source image
|
||||
ubyte xparent_b; // blue component for the transparent color in source image
|
||||
int flags;
|
||||
uint screen_sig;
|
||||
int file_offset; // file offset to start of frame data
|
||||
int cache_file_offset;
|
||||
ubyte *cache;
|
||||
} anim;
|
||||
|
||||
// the direction to play the anim (forwards or backwards)
|
||||
#define ANIM_DIRECT_FORWARD 0
|
||||
#define ANIM_DIRECT_REVERSE 1
|
||||
|
||||
typedef struct anim_instance {
|
||||
anim_instance *next, *prev;
|
||||
int x,y; // coordinates anim is played at (top left corner of anim)
|
||||
vector *world_pos; // world (x,y,z) position of explosion
|
||||
float radius; // radius of image, needed for scaling
|
||||
int frame_num; // current frame, or last frame if between frames (first frame is 0)
|
||||
int last_frame_num;// last frame rendered
|
||||
anim *parent; // pointer to anim structure, which holds compressed data
|
||||
ubyte *data; // pointer to next frame's compressed data
|
||||
ubyte *frame; // uncompressed frame
|
||||
float time_elapsed; // how long the anim has played for (in seconds)
|
||||
int start_at; // frame anim playing should start
|
||||
int stop_at; // frame anim playing should stop
|
||||
int framerate_independent; // animation should play back in same amount of time, regardless
|
||||
int skip_frames; // should anim skip frames during framerate independent playback
|
||||
int looped; // should anim keep playing over and over...
|
||||
int stop_now; // flag to indicate time to stop the animation
|
||||
int last_bitmap; // id of last bitmap that was rendered out from animation
|
||||
int screen_id; // 0 means all screens should render, otherwise screen specific
|
||||
void *aa_color; // anti-aliased bitmap color
|
||||
int xlate_pal;
|
||||
int direction; // playing forwards or backwards ?
|
||||
int ping_pong; // should be played ping-pong style
|
||||
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;
|
||||
|
||||
extern int packer_code;
|
||||
|
||||
int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_type);
|
||||
int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, int compress_type);
|
||||
|
||||
ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
|
||||
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
|
||||
|
||||
void anim_init();
|
||||
anim_instance *init_anim_instance(anim *ptr, int bpp);
|
||||
void free_anim_instance(anim_instance *inst);
|
||||
int anim_get_next_frame(anim_instance *inst);
|
||||
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal=1);
|
||||
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp);
|
||||
void anim_set_palette(anim *a);
|
||||
void anim_check_for_palette_change(anim_instance *inst);
|
||||
|
||||
|
||||
#endif /* __PACKUNPACK_H__ */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,335 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-03-05 09:01:53 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 12 6/09/99 2:55p Andsager
|
||||
* Allow multiple asteroid subtypes (of large, medium, small) and follow
|
||||
* family.
|
||||
*
|
||||
* 11 6/07/99 1:18p Andsager
|
||||
* Make asteroids choose consistent texture from large to small. Modify
|
||||
* fireball radius of dying asteroids.
|
||||
*
|
||||
* 10 5/03/99 10:50p Andsager
|
||||
* Make Asteroid_obj_list. Change get_nearest_turret_objnum() to use
|
||||
* Asteroid_obj_list, Ship_obj_list and Missile_obj_list vs.
|
||||
* obj_used_list.
|
||||
*
|
||||
* 9 4/16/99 2:34p Andsager
|
||||
* Second pass on debris fields
|
||||
*
|
||||
* 8 4/15/99 5:00p Andsager
|
||||
* Frist pass on Debris field
|
||||
*
|
||||
* 7 3/31/99 9:51a Andsager
|
||||
* Add for generalization to debris field
|
||||
*
|
||||
* 6 2/07/99 8:51p Andsager
|
||||
* Add inner bound to asteroid field. Inner bound tries to stay astroid
|
||||
* free. Wrap when within and don't throw at ships inside.
|
||||
*
|
||||
* 5 1/20/99 6:04p Dave
|
||||
* Another bit of stuff for beam weapons. Ships will properly use them
|
||||
* now, although they're really deadly.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 17 3/26/98 9:19a Lawrance
|
||||
* Support multiple asteroid pofs
|
||||
*
|
||||
* 16 3/17/98 12:16a Allender
|
||||
* asteroids in multiplayer -- minor problems with position being correct
|
||||
*
|
||||
* 15 3/14/98 1:44p Mike
|
||||
* Todolist items 3365..3368. Make child asteroids collide properly.
|
||||
* Make asteroid throwing less bunchy, toss asteroids earlier, make
|
||||
* facing-ness not break mission balance.
|
||||
*
|
||||
* 14 3/11/98 12:13a Lawrance
|
||||
* Auto-target asteroids if no hostile ships present
|
||||
*
|
||||
* 13 3/08/98 4:16p Hoffoss
|
||||
*
|
||||
* 12 3/07/98 3:48p Lawrance
|
||||
* Show offscreen indicators for asteroids
|
||||
*
|
||||
* 11 3/04/98 11:59p Lawrance
|
||||
* create an asteroid.tbl, read all asteroid data from there
|
||||
*
|
||||
* 10 3/04/98 4:11p Lawrance
|
||||
* Have area effects affect asteroids, have asteroids cast an area effect,
|
||||
* fix ship shockwaves
|
||||
*
|
||||
* 9 3/03/98 12:48a Lawrance
|
||||
* Ensure collide_objnum is still valid each frame.
|
||||
*
|
||||
* 8 3/02/98 11:35p Lawrance
|
||||
* Keep track of asteroids that will impact ships on the escort view.
|
||||
*
|
||||
* 7 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 6 2/26/98 4:22p Lawrance
|
||||
* Change wrapping behavior, make vel random
|
||||
*
|
||||
* 5 2/20/98 8:31p Lawrance
|
||||
* delay creation of sub-asteroids
|
||||
*
|
||||
* 4 2/19/98 4:33p Lawrance
|
||||
* hook in new sounds and custom explosion animation
|
||||
*
|
||||
* 3 2/19/98 12:46a Lawrance
|
||||
* Further work on asteroids.
|
||||
*
|
||||
* 2 2/10/98 6:43p Lawrance
|
||||
* Moved asteroid code to a separate lib.
|
||||
*
|
||||
* 1 2/10/98 6:05p Lawrance
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h" // for NAME_LENGTH
|
||||
|
||||
struct object;
|
||||
struct polymodel;
|
||||
struct collision_info_struct;
|
||||
|
||||
#define MAX_ASTEROIDS 256
|
||||
|
||||
// DEBRIS TYPES
|
||||
|
||||
|
||||
#if defined(MORE_SPECIES)
|
||||
#define DEBRIS_NAME_MASK 0x000f
|
||||
// -----------------------------------
|
||||
// Kazan Extended Species version
|
||||
// -----------------------------------
|
||||
#define MAX_DEBRIS_TYPES 27
|
||||
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
// terran
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
// vasudan
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
// shivan
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// ancient
|
||||
#define DEBRIS_ANCIENT_SMALL 12
|
||||
#define DEBRIS_ANCIENT_MEDIUM 13
|
||||
#define DEBRIS_ANCIENT_LARGE 14
|
||||
// user1
|
||||
#define DEBRIS_USER1_SMALL 15
|
||||
#define DEBRIS_USER1_MEDIUM 16
|
||||
#define DEBRIS_USER1_LARGE 17
|
||||
// user2
|
||||
#define DEBRIS_USER2_SMALL 18
|
||||
#define DEBRIS_USER2_MEDIUM 19
|
||||
#define DEBRIS_USER2_LARGE 20
|
||||
// user3
|
||||
#define DEBRIS_USER3_SMALL 21
|
||||
#define DEBRIS_USER3_MEDIUM 22
|
||||
#define DEBRIS_USER3_LARGE 23
|
||||
// user4
|
||||
#define DEBRIS_USER4_SMALL 24
|
||||
#define DEBRIS_USER4_MEDIUM 25
|
||||
#define DEBRIS_USER4_LARGE 26
|
||||
#else
|
||||
// -----------------------------------
|
||||
// Old Volition Version
|
||||
// -----------------------------------
|
||||
#define MAX_DEBRIS_TYPES 12
|
||||
//
|
||||
#define ASTEROID_TYPE_SMALL 0
|
||||
#define ASTEROID_TYPE_MEDIUM 1
|
||||
#define ASTEROID_TYPE_BIG 2
|
||||
//
|
||||
#define DEBRIS_TERRAN_SMALL 3
|
||||
#define DEBRIS_TERRAN_MEDIUM 4
|
||||
#define DEBRIS_TERRAN_LARGE 5
|
||||
//
|
||||
#define DEBRIS_VASUDAN_SMALL 6
|
||||
#define DEBRIS_VASUDAN_MEDIUM 7
|
||||
#define DEBRIS_VASUDAN_LARGE 8
|
||||
//
|
||||
#define DEBRIS_SHIVAN_SMALL 9
|
||||
#define DEBRIS_SHIVAN_MEDIUM 10
|
||||
#define DEBRIS_SHIVAN_LARGE 11
|
||||
// END DEBRIS TYPES
|
||||
#endif
|
||||
|
||||
typedef struct debris_struct {
|
||||
int index;
|
||||
char *name;
|
||||
} debris_struct;
|
||||
|
||||
// Data structure to track the active asteroids
|
||||
typedef struct asteroid_obj {
|
||||
asteroid_obj *next, *prev;
|
||||
int flags, objnum;
|
||||
} asteroid_obj;
|
||||
extern asteroid_obj Asteroid_obj_list;
|
||||
|
||||
|
||||
extern debris_struct Field_debris_info[];
|
||||
|
||||
#define MAX_ASTEROID_POFS 3 // Max number of POFs per asteroid type
|
||||
|
||||
#define AF_USED (1<<0) // Set means used.
|
||||
|
||||
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
|
||||
#define MAX_ASTEROID_DETAIL_LEVELS 5
|
||||
|
||||
typedef struct asteroid_info {
|
||||
char name[NAME_LENGTH]; // name for the asteroid
|
||||
char pof_files[MAX_ASTEROID_POFS][NAME_LENGTH]; // POF files to load/associate with ship
|
||||
int num_detail_levels; // number of detail levels for this ship
|
||||
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
|
||||
float max_speed; // cap on speed for asteroid
|
||||
float inner_rad; // radius within which maximum area effect damage is applied
|
||||
float outer_rad; // radius at which no area effect damage is applied
|
||||
float damage; // maximum damage applied from area effect explosion
|
||||
float blast; // maximum blast impulse from area effect explosion
|
||||
float initial_asteroid_strength; // starting strength of asteroid
|
||||
polymodel *modelp[MAX_ASTEROID_POFS];
|
||||
int model_num[MAX_ASTEROID_POFS];
|
||||
} asteroid_info;
|
||||
|
||||
typedef struct asteroid {
|
||||
int flags;
|
||||
int objnum;
|
||||
int type; // In 0..Num_asteroid_types
|
||||
int asteroid_subtype; // Which index into asteroid_info for modelnum and modelp
|
||||
int check_for_wrap; // timestamp to check for asteroid wrapping around field
|
||||
int check_for_collide; // timestamp to check for asteroid colliding with escort ships
|
||||
int final_death_time; // timestamp to swap in new models after explosion starts
|
||||
int collide_objnum; // set to objnum that asteroid will be impacting soon
|
||||
int collide_objsig; // object signature corresponding to collide_objnum
|
||||
vector death_hit_pos; // hit pos that caused death
|
||||
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
|
||||
} asteroid;
|
||||
|
||||
// TYPEDEF FOR SPECIES OF DEBRIS - BITFIELD
|
||||
#define DS_TERRAN 0x01
|
||||
#define DS_VASUDAN 0x02
|
||||
#define DS_SHIVAN 0x04
|
||||
#define DS_ANCIENT 0x08
|
||||
#define DS_USER1 0x10
|
||||
#define DS_USER2 0x20
|
||||
#define DS_USER3 0x40
|
||||
#define DS_USER4 0x80
|
||||
|
||||
// TYPEDEF FOR DEBRIS TYPE
|
||||
typedef enum {
|
||||
DG_ASTEROID,
|
||||
DG_SHIP
|
||||
} debris_genre_t;
|
||||
|
||||
// TYPEDEF FOR FIELD TYPE
|
||||
typedef enum {
|
||||
FT_ACTIVE,
|
||||
FT_PASSIVE
|
||||
} field_type_t;
|
||||
|
||||
#define MAX_ACTIVE_DEBRIS_TYPES 3
|
||||
|
||||
typedef struct asteroid_field {
|
||||
vector min_bound; // Minimum range of field.
|
||||
vector max_bound; // Maximum range of field.
|
||||
int has_inner_bound;
|
||||
vector inner_min_bound;
|
||||
vector inner_max_bound;
|
||||
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]
|
||||
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
|
||||
} asteroid_field;
|
||||
|
||||
extern asteroid_info Asteroid_info[MAX_DEBRIS_TYPES];
|
||||
extern asteroid Asteroids[MAX_ASTEROIDS];
|
||||
extern asteroid_field Asteroid_field;
|
||||
|
||||
extern int Num_asteroid_types;
|
||||
extern int Num_asteroids;
|
||||
extern int Asteroids_enabled;
|
||||
|
||||
void asteroid_init();
|
||||
void asteroid_level_init();
|
||||
void asteroid_level_close();
|
||||
void asteroid_create_all();
|
||||
void asteroid_render( object *asteroid_objp );
|
||||
void asteroid_delete( object *asteroid_objp );
|
||||
void asteroid_process_pre( object *asteroid_objp, float frame_time);
|
||||
void asteroid_process_post( object *asteroid_objp, float frame_time);
|
||||
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vector * hitpos, collision_info_struct *asteroid_hit_info=NULL );
|
||||
void asteroid_hit( object *asteroid_objp, object *other_objp, vector *hitpos, float damage );
|
||||
int asteroid_count();
|
||||
int asteroid_collide_objnum(object *asteroid_objp);
|
||||
float asteroid_time_to_impact(object *asteroid_objp);
|
||||
void asteroid_show_brackets();
|
||||
void asteroid_target_closest_danger();
|
||||
int asteroid_get_random_in_cone(vector *pos, vector *dir, float ang, int danger = 0);
|
||||
|
||||
// need to extern for multiplayer
|
||||
void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec);
|
||||
|
||||
void asteroid_frame();
|
||||
|
||||
#endif // __ASTEROID_H__
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,564 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
*
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2004-05-06 22:35:26 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12 2004/04/01 15:31:20 taylor
|
||||
* don't use interface anis as ship textures
|
||||
*
|
||||
* Revision 2.11 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/12/04 20:39:08 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.9 2003/11/19 20:37:22 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.8 2003/11/07 18:31:01 randomtiger
|
||||
* Fixed a nohtl call to htl funcs (crash with NULL pointer)
|
||||
* Fixed a bug with 32bit PCX code.
|
||||
* Fixed a bug in the d3d_string batch system that was messing up screen shaking.
|
||||
* Added a couple of checks to try and stop timerbar push and pop overloads, check returns missing pops if you use the system.
|
||||
* Put in a higher res icon until we get something better sorted out.
|
||||
*
|
||||
* Revision 2.7 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.6 2003/08/16 03:52:22 bobboau
|
||||
* update for the specmapping code includeing
|
||||
* suport for seperate specular levels on lights and
|
||||
* optional strings for the stars table
|
||||
* code has been made more organised,
|
||||
* though there seems to be a bug in the state selecting code
|
||||
* resulting in the HUD being rendered incorectly
|
||||
* and specmapping failing ocasionaly
|
||||
*
|
||||
* Revision 2.5 2003/08/12 03:18:32 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.3 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.2 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.1 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
|
||||
* Fixed debug bitmap compiling bug.
|
||||
* Fixed tga bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
|
||||
* Fixed new TGA code texturing bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
|
||||
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
|
||||
*
|
||||
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
|
||||
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
|
||||
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
|
||||
*
|
||||
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
|
||||
* Bmpmap has been reverted to an old non d3d8 version.
|
||||
* All d3d8 code is now in the proper place.
|
||||
* PCX code is now working to an extent. Problems with alpha though.
|
||||
* Ani's work slowly with alpha problems.
|
||||
* Also I have done a bit of tidying - RT
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 16 8/10/99 6:54p Dave
|
||||
* Mad optimizations. Added paging to the nebula effect.
|
||||
*
|
||||
* 15 8/06/99 1:52p Dave
|
||||
* Bumped up MAX_BITMAPS for the demo.
|
||||
*
|
||||
* 14 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 13 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 12 6/29/99 10:35a Dave
|
||||
* Interface polygon bitmaps! Whee!
|
||||
*
|
||||
* 11 6/16/99 4:06p Dave
|
||||
* New pilot info popup. Added new draw-bitmap-as-poly function.
|
||||
*
|
||||
* 10 5/05/99 9:02p Dave
|
||||
* Fixed D3D aabitmap rendering. Spiffed up nebula effect a bit (added
|
||||
* rotations, tweaked values, made bitmap selection more random). Fixed
|
||||
* D3D beam weapon clipping problem. Added D3d frame dumping.
|
||||
*
|
||||
* 9 2/08/99 5:07p Dave
|
||||
* FS2 chat server support. FS2 specific validated missions.
|
||||
*
|
||||
* 8 2/05/99 12:52p Dave
|
||||
* Fixed Glide nondarkening textures.
|
||||
*
|
||||
* 7 2/03/99 11:44a Dave
|
||||
* Fixed d3d transparent textures.
|
||||
*
|
||||
* 6 12/06/98 2:36p Dave
|
||||
* Drastically improved nebula fogging.
|
||||
*
|
||||
* 5 12/01/98 4:46p Dave
|
||||
* Put in targa bitmap support (16 bit).
|
||||
*
|
||||
* 4 12/01/98 8:06a Dave
|
||||
* Temporary checkin to fix some texture transparency problems in d3d.
|
||||
*
|
||||
* 3 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 32 4/16/98 6:31p Hoffoss
|
||||
* Added function to get filename of a bitmap handle, which we don't have
|
||||
* yet and I need.
|
||||
*
|
||||
* 31 4/02/98 11:40a Lawrance
|
||||
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
|
||||
*
|
||||
* 30 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to ke7ep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 29 3/29/98 4:05p John
|
||||
* New paging code that loads everything necessary at level startup.
|
||||
*
|
||||
* 28 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 27 3/24/98 6:18p John
|
||||
* Hacked MAX_BITMAPS up to 3500
|
||||
*
|
||||
* 26 3/10/98 4:18p John
|
||||
* Cleaned up graphics lib. Took out most unused gr functions. Made D3D
|
||||
* & Glide have popups and print screen. Took out all >8bpp software
|
||||
* support. Made Fred zbuffer. Made zbuffer allocate dynamically to
|
||||
* support Fred. Made zbuffering key off of functions rather than one
|
||||
* global variable.
|
||||
*
|
||||
* 25 3/02/98 6:46p John
|
||||
* Upped MAX_BITMAPS to 2000
|
||||
*
|
||||
* 24 3/02/98 6:00p John
|
||||
* Moved MAX_BITMAPS into BmpMan.h so the stuff in the graphics code that
|
||||
* is dependent on it won't break if it changes. Made ModelCache slots
|
||||
* be equal to MAX_OBJECTS which is what it is.
|
||||
*
|
||||
* 23 2/06/98 8:25p John
|
||||
* Added code for new bitmaps since last frame
|
||||
*
|
||||
* 22 2/06/98 8:10p John
|
||||
* Added code to show amout of texture usage each frame.
|
||||
*
|
||||
* 21 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 20 1/11/98 2:14p John
|
||||
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
|
||||
* not do callbacks, I put that in global code. Made only bitmaps that
|
||||
* need to load for a level load.
|
||||
*
|
||||
* 19 9/03/97 4:19p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 18 8/25/97 11:14p Lawrance
|
||||
* added support for .ani files in bm_load_animation()
|
||||
*
|
||||
* 17 7/16/97 3:07p John
|
||||
*
|
||||
* 16 6/17/97 8:58p Lawrance
|
||||
* fixed bug with not nulling bm.data with USER bitmaps
|
||||
*
|
||||
* 15 6/12/97 2:44a Lawrance
|
||||
* changed bm_unlock() to take an index into bm_bitmaps(). Added
|
||||
* ref_count to bitmap_entry struct
|
||||
*
|
||||
* 14 5/20/97 10:36a John
|
||||
* Fixed problem with user bitmaps and direct3d caching.
|
||||
*
|
||||
* 13 3/24/97 3:25p John
|
||||
* Cleaned up and restructured model_collide code and fvi code. In fvi
|
||||
* made code that finds uvs work.. Added bm_get_pixel to BmpMan.
|
||||
*
|
||||
* 12 2/17/97 5:18p John
|
||||
* Added a bunch of RCS headers to a bunch of old files that don't have
|
||||
* them.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
|
||||
|
||||
// 16 bit pixel formats
|
||||
#define BM_PIXEL_FORMAT_ARGB 0 // for glide - can assume certain things, like 1555 LFB writes, whee!
|
||||
#define BM_PIXEL_FORMAT_D3D 1 // d3d - card dependant. booo!
|
||||
#define BM_PIXEL_FORMAT_ARGB_D3D 2 // this card has nice 1555 textures like Glide - ahhhhh!
|
||||
|
||||
enum
|
||||
{
|
||||
BM_TYPE_NONE,
|
||||
BM_TYPE_PCX, // 16 bit PCX
|
||||
BM_TYPE_USER, // Data created at run time
|
||||
BM_TYPE_ANI, // In-house ANI format
|
||||
// Only list 32 bit formats after this flag please
|
||||
BM_TYPE_32_BIT_FORMATS,
|
||||
BM_TYPE_TGA,
|
||||
BM_TYPE_JPG,
|
||||
BM_TYPE_DDS,
|
||||
};
|
||||
|
||||
/// Moved from cpp file ///////////////////
|
||||
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
|
||||
|
||||
typedef union bm_extra_info {
|
||||
struct {
|
||||
// Stuff needed for animations
|
||||
int first_frame; // used for animations -- points to index of first frame
|
||||
ubyte num_frames; // used for animation -- number of frames in the animation
|
||||
ubyte fps; // used for animation -- frames per second
|
||||
} ani;
|
||||
struct {
|
||||
// Stuff needed for user bitmaps
|
||||
void *data; // For user bitmaps, this is where the data comes from
|
||||
ubyte bpp; // For user bitmaps, this is what format the data is
|
||||
ubyte flags; // Flags passed to bm_create
|
||||
} user;
|
||||
} bm_extra_info;
|
||||
|
||||
typedef struct bitmap_entry {
|
||||
// identification
|
||||
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
|
||||
|
||||
uint signature; // a unique signature identifying the data
|
||||
uint palette_checksum; // checksum used to be sure bitmap is in current palette
|
||||
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
|
||||
int last_used; // When this bitmap was last used
|
||||
|
||||
ubyte type; // PCX, USER, ANI, etc
|
||||
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
|
||||
|
||||
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
|
||||
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
|
||||
int num_mipmaps; // number of mipmap levels, we need to read all of them
|
||||
|
||||
// Stuff to keep track of usage
|
||||
ubyte preloaded; // If set, then this was loaded from the lst file
|
||||
ubyte used_flags; // What flags it was accessed thru
|
||||
|
||||
// Bitmap info
|
||||
bitmap bm;
|
||||
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
ubyte used_this_frame; // If set, then it was used this frame
|
||||
int data_size; // How much data this bitmap uses
|
||||
int used_count; // How many times it was accessed
|
||||
#endif
|
||||
|
||||
} bitmap_entry;
|
||||
|
||||
void bm_gfx_init();
|
||||
void bm_gfx_close();
|
||||
int bm_gfx_get_cache_slot( int bitmap_id, int separate_ani_frames );
|
||||
|
||||
int bm_gfx_get_next_handle();
|
||||
|
||||
// 16 bit pixel formats
|
||||
extern int Bm_pixel_format;
|
||||
|
||||
#define BYTES_PER_PIXEL(x) ((x+7)/8)
|
||||
|
||||
// how many bytes of textures are used.
|
||||
extern int bm_texture_ram;
|
||||
|
||||
// This loads a bitmap so we can draw with it later.
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number.
|
||||
int bm_gfx_load(char * filename);
|
||||
|
||||
// special load function. basically allows you to load a bitmap which already exists (by filename).
|
||||
// this is useful because in some cases we need to have a bitmap which is locked in screen format
|
||||
// _and_ texture format, such as pilot pics and squad logos
|
||||
int bm_gfx_load_duplicate(char *filename);
|
||||
|
||||
// Creates a bitmap that exists in RAM somewhere, instead
|
||||
// of coming from a disk file. You pass in a pointer to a
|
||||
// block of data. The data can be in the following formats:
|
||||
// 8 bpp (mapped into game palette)
|
||||
// 32 bpp
|
||||
// On success, it returns the bitmap number. You cannot
|
||||
// free that RAM until bm_release is called on that bitmap.
|
||||
// See example at bottom of this file
|
||||
int bm_gfx_create( int bpp, int w, int h, void * data, int flags = 0);
|
||||
|
||||
// Frees up a bitmap's data, but bitmap number 'n' can
|
||||
// still be used, it will just have to be paged in next
|
||||
// time it is locked.
|
||||
int bm_gfx_unload( int n );
|
||||
|
||||
// Frees up a bitmap's data, and it's slot, so bitmap
|
||||
// number 'n' cannot be used anymore, and bm_load or
|
||||
// bm_create might reuse the slot.
|
||||
void bm_gfx_release(int n);
|
||||
|
||||
// This loads a bitmap sequence so we can draw with it later.
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number of the first frame and nframes is set.
|
||||
extern int bm_gfx_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_unlock. Only lock
|
||||
// a bitmap when you need it! This will convert it into the
|
||||
// appropriate format also.
|
||||
extern bitmap * bm_gfx_lock( int bitmapnum, ubyte bpp, ubyte flags );
|
||||
|
||||
// The signature is a field that gets filled in with
|
||||
// a unique signature for each bitmap. The signature for each bitmap
|
||||
// will also change when the bitmap's data changes.
|
||||
extern uint bm_get_signature( int bitmapnum);
|
||||
|
||||
// Unlocks a bitmap
|
||||
extern void bm_gfx_unlock( int bitmapnum );
|
||||
|
||||
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
|
||||
extern void bm_gfx_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
|
||||
|
||||
// get filename
|
||||
extern void bm_get_filename(int bitmapnum, char *filename);
|
||||
|
||||
// resyncs all the bitmap palette
|
||||
extern void bm_update();
|
||||
|
||||
// call to load all data for all bitmaps that have been requested to be loaded
|
||||
extern void bm_gfx_load_all();
|
||||
extern void bm_gfx_unload_all();
|
||||
|
||||
// call to get the palette for a bitmap
|
||||
void bm_gfx_get_palette(int n, ubyte *pal, char *name);
|
||||
|
||||
// Hacked function to get a pixel from a bitmap.
|
||||
// Only works good in 8bpp mode.
|
||||
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
|
||||
|
||||
// Returns number of bytes of bitmaps locked this frame
|
||||
// ntotal = number of bytes of bitmaps locked this frame
|
||||
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
|
||||
void bm_gfx_get_frame_usage(int *ntotal, int *nnew);
|
||||
|
||||
/*
|
||||
* Example on using bm_create
|
||||
*
|
||||
{
|
||||
static int test_inited = 0;
|
||||
static int test_bmp;
|
||||
static uint test_bmp_data[128*64];
|
||||
|
||||
if ( !test_inited ) {
|
||||
test_inited = 1;
|
||||
// Create the new bitmap and fill in its data.
|
||||
// When you're done with it completely, call
|
||||
// bm_release to free up the bitmap handle
|
||||
test_bmp = bm_create( 32, 128, 64, test_bmp_data );
|
||||
int i,j;
|
||||
for (i=0; i<64; i++ ) {
|
||||
for (j=0; j<64; j++ ) {
|
||||
uint r=i*4;
|
||||
test_bmp_data[j+i*128] = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bm_unload(test_bmp); // this pages out the data, so that the
|
||||
// next bm_lock will convert the new data to the
|
||||
// correct bpp
|
||||
|
||||
// put in new data
|
||||
int x,y;
|
||||
gr_reset_clip();
|
||||
for (y=0; y<64; y++)
|
||||
for (x=0; x<128; x++ )
|
||||
test_bmp_data[y*128+x] = 15;
|
||||
|
||||
// Draw the bitmap to upper left corner
|
||||
gr_set_bitmap(test_bmp);
|
||||
gr_bitmap( 0,0 );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Paging stuff
|
||||
//============================================================================
|
||||
|
||||
void bm_gfx_page_in_start();
|
||||
void bm_gfx_page_in_stop();
|
||||
|
||||
// Paging code in a library should call these functions
|
||||
// in its page in function.
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_gfx_page_in_texture( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_gfx_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
|
||||
|
||||
// marks a texture as being a transparent textyre used for this level
|
||||
// Marks a texture as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_gfx_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
|
||||
|
||||
// Marks an aabitmap as being used for this level
|
||||
// If num_frames is passed, assume this is an animation
|
||||
void bm_gfx_page_in_aabitmap( int bitmapnum, int num_frames=1 );
|
||||
|
||||
//
|
||||
// Mode: 0 = High memory
|
||||
// 1 = Low memory ( every other frame of ani's)
|
||||
// 2 = Debug low memory ( only use first frame of each ani )
|
||||
void bm_set_low_mem( int mode );
|
||||
|
||||
char *bm_get_filename(int handle);
|
||||
|
||||
void BM_SELECT_SCREEN_FORMAT();
|
||||
void BM_SELECT_TEX_FORMAT();
|
||||
void BM_SELECT_ALPHA_TEX_FORMAT();
|
||||
|
||||
// set the rgba components of a pixel, any of the parameters can be NULL
|
||||
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_d3d(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
// get the rgba components of a pixel, any of the parameters can be NULL
|
||||
void bm_gfx_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
|
||||
//============================================================================
|
||||
// section info stuff
|
||||
//============================================================================
|
||||
|
||||
// given a bitmap and a section, return the size (w, h)
|
||||
void bm_gfx_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
|
||||
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_size(int num);
|
||||
int bm_get_num_mipmaps(int num);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,645 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2003-08-20 08:12:08 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/11/02 23:06:59 DTP
|
||||
* DOh,uhmm, define error again, this is getting to me.
|
||||
*
|
||||
* Revision 2.4 2002/11/02 23:04:46 DTP
|
||||
* DOh, fixed that define, learn to count DTP :)
|
||||
*
|
||||
* Revision 2.3 2002/10/27 23:59:28 DTP
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 11 9/08/99 12:03a Dave
|
||||
* Make squad logos render properly in D3D all the time. Added intel anim
|
||||
* directory.
|
||||
*
|
||||
* 10 8/31/99 9:46a Dave
|
||||
* Support for new cfile cbanims directory.
|
||||
*
|
||||
* 9 5/19/99 4:07p Dave
|
||||
* Moved versioning code into a nice isolated common place. Fixed up
|
||||
* updating code on the pxo screen. Fixed several stub problems.
|
||||
*
|
||||
* 8 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
* 7 3/24/99 4:05p Dave
|
||||
* Put in support for assigning the player to a specific squadron with a
|
||||
* specific logo. Preliminary work for doing pos/orient checksumming in
|
||||
* multiplayer to reduce bandwidth.
|
||||
*
|
||||
* 6 1/12/99 3:15a Dave
|
||||
* Barracks screen support for selecting squad logos. We need real artwork
|
||||
* :)
|
||||
*
|
||||
* 5 10/29/98 10:41a Dave
|
||||
* Change the way cfile initializes exe directory.
|
||||
*
|
||||
* 4 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 3 10/12/98 9:54a Dave
|
||||
* Fixed a few file organization things.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 84 9/09/98 5:53p Dave
|
||||
* Put in new tracker packets in API. Change cfile to be able to checksum
|
||||
* portions of a file.
|
||||
*
|
||||
* 83 8/12/98 4:53p Dave
|
||||
* Put in 32 bit checksumming for PXO missions. No validation on the
|
||||
* actual tracker yet, though.
|
||||
*
|
||||
* 82 5/19/98 1:19p Allender
|
||||
* new low level reliable socket reading code. Make all missions/campaign
|
||||
* load/save to data missions folder (i.e. we are rid of the player
|
||||
* missions folder)
|
||||
*
|
||||
* 81 5/13/98 10:22p John
|
||||
* Added cfile functions to read/write rle compressed blocks of data.
|
||||
* Made palman use it for .clr files. Made alphacolors calculate on the
|
||||
* fly rather than caching to/from disk.
|
||||
*
|
||||
* 80 5/01/98 10:21a John
|
||||
* Added code to find all pack files in all trees. Added code to create
|
||||
* any directories that we write to.
|
||||
*
|
||||
* 79 4/30/98 10:29p John
|
||||
* Added code to refresh filelist if cd-rom changed or packfiles created
|
||||
* or deleted.
|
||||
*
|
||||
* 78 4/30/98 10:06p John
|
||||
* Started adding code for splitting the maps data tree for hardware
|
||||
* textures.
|
||||
*
|
||||
* 77 4/30/98 9:43p John
|
||||
* Restructured some stuff.
|
||||
*
|
||||
* 76 4/30/98 8:23p John
|
||||
* Fixed some bugs with Fred caused by my new cfile code.
|
||||
*
|
||||
* 75 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 74 4/20/98 6:04p Dave
|
||||
* Implement multidata cache flushing and xferring mission files to
|
||||
* multidata. Make sure observers can't change hud config. Fix pilot image
|
||||
* viewing in popup. Put in game status field. Tweaked multi options.
|
||||
*
|
||||
* 73 4/01/98 6:06p Hoffoss
|
||||
* Added a command briefing directory for those voice files.
|
||||
*
|
||||
* 72 3/31/98 4:51p Dave
|
||||
* Removed medals screen and multiplayer buttons from demo version. Put in
|
||||
* new pilot popup screen. Make ships in mp team vs. team have proper team
|
||||
* ids. Make mp respawns a permanent option saved in the player file.
|
||||
*
|
||||
* 71 3/26/98 6:01p Dave
|
||||
* Put in file checksumming routine in cfile. Made pilot pic xferring more
|
||||
* robust. Cut header size of voice data packets in half. Put in
|
||||
* restricted game host query system.
|
||||
*
|
||||
* 70 3/10/98 2:27p Hoffoss
|
||||
* Added change directory with history stack functions, so you can switch
|
||||
* to a new directory, do something, and restore to what it was. useful
|
||||
* for Fred.
|
||||
*
|
||||
* 69 3/07/98 3:48p Lawrance
|
||||
* get save game working, allow restore from main menu
|
||||
*
|
||||
* 68 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 67 2/20/98 4:43p Dave
|
||||
* Finished support for multiplayer player data files. Split off
|
||||
* multiplayer campaign functionality.
|
||||
*
|
||||
* 66 2/19/98 6:26p Dave
|
||||
* Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
|
||||
* initial support for player data uploading.
|
||||
*
|
||||
* 65 2/06/98 3:47p Allender
|
||||
* subtitling for movies
|
||||
*
|
||||
* 64 2/05/98 10:15p Lawrance
|
||||
* Add support for .svg filenames.
|
||||
*
|
||||
* 63 1/12/98 10:07p Hoffoss
|
||||
* Made tab cycle properly in debriefing screen and put in aux. pilot
|
||||
* image directory.
|
||||
*
|
||||
* 62 1/11/98 2:45p John
|
||||
* Changed .lst to .clt
|
||||
*
|
||||
* 61 1/11/98 2:14p John
|
||||
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
|
||||
* not do callbacks, I put that in global code. Made only bitmaps that
|
||||
* need to load for a level load.
|
||||
*
|
||||
* 60 1/02/98 4:41p Allender
|
||||
* added new mission folder for "player" missions
|
||||
*
|
||||
* 59 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 58 12/17/97 10:16p Allender
|
||||
* implemented a "no callback" flag to tell the cfile code not to use the
|
||||
* cf_callback on files which specify this flag
|
||||
*
|
||||
* 57 12/08/97 6:23p Lawrance
|
||||
* add cflush()
|
||||
*
|
||||
* 56 12/07/97 4:30p John
|
||||
* Fixed bug with cfile versioning if two files use it at once. Added
|
||||
* code to cfile so I could display a loading box while loading.
|
||||
*
|
||||
* 55 11/24/97 9:28a Hoffoss
|
||||
* Moved define of CF_TYPE_MULTI_PLAYERS so it's in order. I started to
|
||||
* add it because I couldn't find it, so that's indication enough it
|
||||
* needed it.
|
||||
*
|
||||
* 54 11/20/97 1:07a Lawrance
|
||||
* add support for voice/debriefings directory
|
||||
*
|
||||
* 53 11/19/97 7:27p Hoffoss
|
||||
* Added version checking read functions.
|
||||
*
|
||||
* 52 11/18/97 10:53a Hoffoss
|
||||
*
|
||||
* 51 11/17/97 6:07p Hoffoss
|
||||
* Make get_file_list() allow filtering via a callback function.
|
||||
*
|
||||
* 50 11/16/97 2:29p John
|
||||
* added versioning to nebulas; put nebula code into freespace.
|
||||
*
|
||||
* 49 11/15/97 6:10p Lawrance
|
||||
* add in support for new voice directories
|
||||
*
|
||||
* 48 11/11/97 4:54p Dave
|
||||
* Put in support for single vs. multiplayer pilots. Put in initial player
|
||||
* selection screen (no command line option yet). Started work on
|
||||
* multiplayer campaign file save gaming.
|
||||
*
|
||||
* 47 11/07/97 4:00p Hoffoss
|
||||
* Capitalized directory names, changed the player/image directory to work
|
||||
* like the rest, and forced the player/images directory to be created.
|
||||
*
|
||||
* 46 11/06/97 5:38p Hoffoss
|
||||
* Added a new player image directory and added support for it.
|
||||
*
|
||||
* 45 11/04/97 7:46p Lawrance
|
||||
* Add support for data\interface\HUD directory
|
||||
*
|
||||
* 44 10/29/97 6:22p Hoffoss
|
||||
* Added some new file listing functions.
|
||||
*
|
||||
* 43 10/28/97 10:54a Lawrance
|
||||
* support for 8b22k and 16b11k directories under the sound directory
|
||||
*
|
||||
* 42 10/14/97 11:34p Lawrance
|
||||
* add function to get full path for a given filename
|
||||
*
|
||||
* 41 9/24/97 5:30p Lawrance
|
||||
* add directory for voices
|
||||
*
|
||||
* 40 9/20/97 8:16a John
|
||||
* Made .clr files go into the Cache directory. Replaced cfopen(name,NULL)
|
||||
* to delete a file with cf_delete.
|
||||
*
|
||||
* 39 9/09/97 6:50p Hoffoss
|
||||
* Fixed bug with mission saving.
|
||||
*
|
||||
* 38 9/05/97 4:52p Lawrance
|
||||
* fix prototype for cfread_angles() and cfwrite_angles()
|
||||
*
|
||||
* 37 8/29/97 4:47p Dave
|
||||
* Added an extension for state transfer status files.
|
||||
*
|
||||
* 36 8/21/97 12:14p Dave
|
||||
* Changed demo file extension from .keg to .fsd
|
||||
*
|
||||
* 35 8/19/97 5:51p Hoffoss
|
||||
* Fixes to cfopen to not check the default directory first, but check it
|
||||
* last. Also tracks info as to where a file is located when opened.
|
||||
*
|
||||
* 34 8/17/97 10:22p Hoffoss
|
||||
* Fixed several bugs in Fred with Undo feature. In the process, recoded
|
||||
* a lot of CFile.cpp.
|
||||
*
|
||||
* 33 8/17/97 12:47p Hoffoss
|
||||
* Changed code so I can force missions to load from the missions
|
||||
* directory regardless of it's extension.
|
||||
*
|
||||
* 32 8/13/97 1:39p Adam
|
||||
* make .ani files available in the data/effects directory
|
||||
*
|
||||
* 31 8/13/97 12:24p Lawrance
|
||||
* Add support for effects directory
|
||||
*
|
||||
* 30 7/30/97 5:23p Dave
|
||||
* Added file extensions for demo stuff
|
||||
*
|
||||
* 29 7/28/97 10:42p Lawrance
|
||||
* added ctmpfile(), analog to tmpfile()
|
||||
*
|
||||
* 28 7/16/97 5:29p John
|
||||
* added palette table caching and made scaler and liner no light tmapper
|
||||
* do alpha blending in 8 bpp mode.
|
||||
*
|
||||
* 27 6/05/97 4:53p John
|
||||
* First rev of new antialiased font stuff.
|
||||
*
|
||||
* 26 6/05/97 1:22p Allender
|
||||
* added .ntl as an extension for nettest program
|
||||
*
|
||||
* 25 4/25/97 11:31a Allender
|
||||
* Campaign state now saved in campaign save file in player directory.
|
||||
* Made some global variables follow naming convention. Solidified
|
||||
* continuing campaigns based on new structure
|
||||
*
|
||||
* 24 4/17/97 9:01p Allender
|
||||
* start of campaign stuff. Campaigns now stored in external file (no
|
||||
* filenames in code). Continuing campaign won't work at this point
|
||||
*
|
||||
* 23 4/03/97 4:26p Lawrance
|
||||
* adding .wav search to music directory
|
||||
*
|
||||
* 22 4/01/97 9:26a Allender
|
||||
* added support for descent style fonts although they are not used in the
|
||||
* game yet
|
||||
*
|
||||
* 21 3/04/97 8:17a John
|
||||
* Fixed movie code to not require a file handle. Used CFILE instead.
|
||||
* Took cfile_get_handle or whatever out.
|
||||
*
|
||||
* 20 3/03/97 8:57a Lawrance
|
||||
* took out cf_returnfp()
|
||||
*
|
||||
* 19 3/01/97 2:09p Lawrance
|
||||
* supporting memory mapped files, moved cfile implementation details into
|
||||
* .cpp file
|
||||
*
|
||||
* 18 2/17/97 3:00p Lawrance
|
||||
* added .ani type to MAPS_EXT and INTERFACE_EXT
|
||||
*
|
||||
* 17 2/07/97 9:00a Lawrance
|
||||
* added cfread_uint() and cwrite_uint()
|
||||
*
|
||||
* 16 2/04/97 9:29a Allender
|
||||
* added cfwrite* functions
|
||||
*
|
||||
* 15 1/22/97 10:48a Lawrance
|
||||
* supporting AVI playback
|
||||
*
|
||||
* 14 12/23/96 10:56a John
|
||||
* Totally restructured the POF stuff to support multiple
|
||||
* detail levels in one POF file.
|
||||
*
|
||||
*
|
||||
* 13 11/20/96 10:00a Hoffoss
|
||||
* Added cfile_chdir() function.
|
||||
*
|
||||
* 12 11/13/96 10:14a Allender
|
||||
* added small routines to read basic data types. Also changed code to
|
||||
* try to find extensions in more than 1 directory.
|
||||
*
|
||||
* 11 11/11/96 3:21p Allender
|
||||
* added extension for movies
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef __CFILE_H__
|
||||
#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
|
||||
|
||||
#define CF_EOF (-1)
|
||||
|
||||
#define CF_SEEK_SET (0)
|
||||
#define CF_SEEK_CUR (1)
|
||||
#define CF_SEEK_END (2)
|
||||
|
||||
typedef struct CFILE {
|
||||
int id; // Index into cfile.cpp specific structure
|
||||
int version; // version of this file
|
||||
} CFILE;
|
||||
|
||||
// extra info that can be returned when getting a file listing
|
||||
typedef struct {
|
||||
time_t write_time;
|
||||
} file_list_info;
|
||||
|
||||
|
||||
#define CF_MAX_FILENAME_LENGTH 32 // Includes null terminater, so real length is 31
|
||||
#define CF_MAX_PATHNAME_LENGTH 256 // Includes null terminater, so real length is 255
|
||||
|
||||
#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_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_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_PLAYER_MAIN 24
|
||||
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
|
||||
#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_CACHE 30
|
||||
#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_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
|
||||
|
||||
|
||||
// TRUE if type is specified and valid
|
||||
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
|
||||
|
||||
// #define's for the type parameter in cfopen.
|
||||
#define CFILE_NORMAL 0 // open file normally
|
||||
#define CFILE_MEMORY_MAPPED (1<<0) // open file as a memory-mapped file
|
||||
|
||||
#define CF_SORT_NONE 0
|
||||
#define CF_SORT_NAME 1
|
||||
#define CF_SORT_TIME 2
|
||||
|
||||
#define cfread_fix(file) (fix)cfread_int(file)
|
||||
#define cfwrite_fix(i,file) cfwrite_int(i,file)
|
||||
|
||||
// callback function used for get_file_list() to filter files to be added to list. Return 1
|
||||
// to add file to list, or 0 to not add it.
|
||||
extern int (*Get_file_list_filter)(char *filename);
|
||||
|
||||
// cfile directory. valid after cfile_init() returns successfully
|
||||
#define CFILE_ROOT_DIRECTORY_LEN 256
|
||||
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
|
||||
|
||||
//================= LOW-LEVEL FUNCTIONS ==================
|
||||
// Call this once at the beginning of the program
|
||||
int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
|
||||
|
||||
// Call this if pack files got added or removed or the
|
||||
// cdrom changed. This will refresh the list of filenames
|
||||
// stored in packfiles and on the cdrom.
|
||||
void cfile_refresh();
|
||||
|
||||
// add an extension to a filename if it doesn't already have it
|
||||
char *cf_add_ext(char *filename, char *ext);
|
||||
|
||||
// return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
|
||||
int cf_get_dir_type(CFILE *cfile);
|
||||
|
||||
// Opens the file. If no path is given, use the extension to look into the
|
||||
// default path. If mode is NULL, delete the file.
|
||||
CFILE *cfopen(char *filename, char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
|
||||
|
||||
// Flush the open file buffer
|
||||
int cflush(CFILE *cfile);
|
||||
|
||||
// version number of opened file. Will be 0 unless you put something else here after you
|
||||
// open a file. Once set, you can use minimum version numbers with the read functions.
|
||||
void cf_set_version( CFILE * cfile, int version );
|
||||
|
||||
// Deletes a file. Returns 0 on error, 1 if successful
|
||||
int cf_delete( char *filename, int dir_type );
|
||||
|
||||
// Same as _access function to read a file's access bits
|
||||
int cf_access( char *filename, int dir_type, int mode );
|
||||
|
||||
// Returns 1 if file exists, 0 if not.
|
||||
int cf_exist( char *filename, int dir_type );
|
||||
|
||||
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
|
||||
CFILE *ctmpfile();
|
||||
|
||||
// Closes the file
|
||||
int cfclose(CFILE *cfile);
|
||||
|
||||
// Returns size of file...
|
||||
int cfilelength(CFILE *fp);
|
||||
|
||||
// Reads data
|
||||
int cfread(void *buf, int elsize, int nelem, CFILE *fp);
|
||||
|
||||
// cfwrite() writes to the file
|
||||
int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile);
|
||||
|
||||
// Reads/writes RLE compressed data.
|
||||
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
|
||||
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile);
|
||||
|
||||
// Moves the file pointer
|
||||
int cfseek(CFILE *fp, int offset, int where);
|
||||
|
||||
// Returns current position of file.
|
||||
int cftell(CFILE *fp);
|
||||
|
||||
// cfputc() writes a character to a file
|
||||
int cfputc(int c, CFILE *cfile);
|
||||
|
||||
// cfputs() writes a string to a file
|
||||
int cfputs(char *str, CFILE *cfile);
|
||||
|
||||
// cfgetc() reads a character to a file
|
||||
int cfgetc(CFILE *cfile);
|
||||
|
||||
// cfgets() reads a string from a file
|
||||
char *cfgets(char *buf, int n, CFILE *cfile);
|
||||
|
||||
// cfeof() Tests for end-of-file on a stream
|
||||
int cfeof(CFILE *cfile);
|
||||
|
||||
// Return the data pointer associated with the CFILE structure (for memory mapped files)
|
||||
void *cf_returndata(CFILE *cfile);
|
||||
|
||||
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
|
||||
int cf_chksum_short(char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
|
||||
|
||||
// get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
|
||||
// NOTE : preserves current file position
|
||||
int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
|
||||
|
||||
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
|
||||
int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
|
||||
|
||||
// get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
|
||||
// NOTE : preserves current file position
|
||||
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
|
||||
|
||||
// convenient for misc checksumming purposes ------------------------------------------
|
||||
|
||||
// update cur_chksum with the chksum of the new_data of size new_data_size
|
||||
ushort cf_add_chksum_short(ushort seed, char *buffer, int size);
|
||||
|
||||
// update cur_chksum with the chksum of the new_data of size new_data_size
|
||||
unsigned long cf_add_chksum_long(unsigned long seed, char *buffer, int size);
|
||||
|
||||
// convenient for misc checksumming purposes ------------------------------------------
|
||||
|
||||
//================= HIGH LEVEL FUNCTIONS ==================
|
||||
int cfexist(char *filename); // Returns true if file exists on disk (1) or in hog (2).
|
||||
|
||||
// rename a file, utilizing the extension to determine where file is.
|
||||
#define CF_RENAME_SUCCESS 0 // successfully renamed the file
|
||||
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
|
||||
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
|
||||
int cf_rename(char *old_name, char *name, int type = CF_TYPE_ANY );
|
||||
|
||||
// changes the attributes of a file
|
||||
void cf_attrib(char *name, int set, int clear, int type);
|
||||
|
||||
// flush (delete all files in) the passed directory (by type), return the # of files deleted
|
||||
// NOTE : WILL NOT DELETE READ-ONLY FILES
|
||||
int cfile_flush_dir(int type);
|
||||
|
||||
// functions for reading from cfile
|
||||
// These are all high level, built up from
|
||||
// cfread.
|
||||
int cfgetc(CFILE *fp);
|
||||
char *cfgets(char *buf, size_t n, CFILE *fp);
|
||||
char cfread_char(CFILE *file, int ver = 0, char deflt = 0);
|
||||
ubyte cfread_ubyte(CFILE *file, int ver = 0, ubyte deflt = 0);
|
||||
short cfread_short(CFILE *file, int ver = 0, short deflt = 0);
|
||||
ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
|
||||
int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
|
||||
uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
|
||||
float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
|
||||
void cfread_vector(vector *vec, CFILE *file, int ver = 0, vector *deflt = NULL);
|
||||
void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
|
||||
|
||||
// Reads variable length, null-termined string. Will only read up
|
||||
// to n characters.
|
||||
void cfread_string(char *buf,int n, CFILE *file);
|
||||
// Read a fixed length that is null-terminatedm, and has the length
|
||||
// stored in file
|
||||
void cfread_string_len(char *buf,int n, CFILE *file);
|
||||
|
||||
// functions for writing cfiles
|
||||
int cfwrite_char(char c, CFILE *file);
|
||||
int cfwrite_float(float f, CFILE *file);
|
||||
int cfwrite_int(int i, CFILE *file);
|
||||
int cfwrite_uint(uint i, CFILE *file);
|
||||
int cfwrite_short(short s, CFILE *file);
|
||||
int cfwrite_ushort(ushort s, CFILE *file);
|
||||
int cfwrite_ubyte(ubyte u, CFILE *file);
|
||||
int cfwrite_vector(vector *vec, CFILE *file);
|
||||
int cfwrite_angles(angles *ang, CFILE *file);
|
||||
|
||||
// writes variable length, null-termined string.
|
||||
int cfwrite_string(char *buf, CFILE *file);
|
||||
|
||||
// write a fixed length that is null-terminatedm, and has the length
|
||||
// stored in file
|
||||
int cfwrite_string_len(char *buf, CFILE *file);
|
||||
|
||||
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
|
||||
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
|
||||
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
|
||||
|
||||
// Searches for a file. Follows all rules and precedence and searches
|
||||
// CD's and pack files.
|
||||
// Input: filespace - Filename & extension
|
||||
// pathtype - See CF_TYPE_ defines in CFILE.H
|
||||
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
|
||||
// size - File size
|
||||
// offset - Offset into pack file. 0 if not a packfile.
|
||||
// Returns: If not found returns 0.
|
||||
int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, int *size, int *offset, bool localize = false);
|
||||
|
||||
// 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);
|
||||
|
||||
// restore directory on top of the stack
|
||||
int cfile_pop_dir();
|
||||
|
||||
|
||||
#endif /* __CFILE_H__ */
|
||||
@@ -1,298 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2004-03-05 09:01:54 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Low-level code for reading data out of large archive files or normal files. All
|
||||
* reads/seeks come through here.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/03/19 09:05:25 Goober5000
|
||||
* more housecleaning, this time for debug warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:17:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 4 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 3 1/06/99 2:24p Dave
|
||||
* Stubs and release build fixes.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 12 5/14/98 8:10p Lawrance
|
||||
* Fix bug with trying to read past the end of a file (when from a
|
||||
* packfile).
|
||||
*
|
||||
* 11 5/11/98 11:48a John
|
||||
* fixed bug with memory mapped files
|
||||
*
|
||||
* 10 5/11/98 10:59a John
|
||||
* added in debug code
|
||||
*
|
||||
* 9 5/11/98 10:59a John
|
||||
* Moved the low-level file reading code into cfilearchive.cpp.
|
||||
*
|
||||
* 8 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 7 4/20/98 11:49a Hoffoss
|
||||
* Fixed bug with directory name getting.
|
||||
*
|
||||
* 6 4/10/98 12:18a Hoffoss
|
||||
* Make pilot image search in pack file possible.
|
||||
*
|
||||
* 5 1/19/98 9:37p Allender
|
||||
* Great Compiler Warning Purge of Jan, 1998. Used pragma's in a couple
|
||||
* of places since I was unsure of what to do with code.
|
||||
*
|
||||
* 4 12/30/97 5:31p Lawrance
|
||||
* fixed problem for people that didn't have a VP file
|
||||
*
|
||||
* 3 12/30/97 4:31p Sandeep
|
||||
* Changed pakfile format
|
||||
*
|
||||
* 2 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#define _CFILE_INTERNAL
|
||||
|
||||
#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 "cfile/cfile.h"
|
||||
#include "cfile/cfilearchive.h"
|
||||
|
||||
#define CHECK_POSITION
|
||||
|
||||
// Called once to setup the low-level reading code.
|
||||
|
||||
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
|
||||
{
|
||||
Assert(cfile != NULL);
|
||||
|
||||
Cfile_block *cb;
|
||||
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
|
||||
cb = &Cfile_block_list[cfile->id];
|
||||
|
||||
cb->lib_offset = offset;
|
||||
cb->raw_position = 0;
|
||||
cb->size = size;
|
||||
|
||||
if ( cb->fp ) {
|
||||
if ( cb->lib_offset ) {
|
||||
fseek( cb->fp, cb->lib_offset, SEEK_SET );
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// cfeof() Tests for end-of-file on a stream
|
||||
//
|
||||
// returns a nonzero value after the first read operation that attempts to read
|
||||
// past the end of the file. It returns 0 if the current position is not end of file.
|
||||
// There is no error return.
|
||||
|
||||
int cfeof(CFILE *cfile)
|
||||
{
|
||||
Assert(cfile != NULL);
|
||||
|
||||
Cfile_block *cb;
|
||||
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
|
||||
cb = &Cfile_block_list[cfile->id];
|
||||
|
||||
int result;
|
||||
|
||||
result = 0;
|
||||
|
||||
// cfeof() not supported for memory-mapped files
|
||||
Assert( !cb->data );
|
||||
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
if (cb->raw_position >= cb->size ) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// cftell() returns offset into file
|
||||
//
|
||||
// returns: success ==> offset into the file
|
||||
// error ==> -1
|
||||
//
|
||||
int cftell( CFILE * cfile )
|
||||
{
|
||||
Assert(cfile != NULL);
|
||||
Cfile_block *cb;
|
||||
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
|
||||
cb = &Cfile_block_list[cfile->id];
|
||||
|
||||
// Doesn't work for memory mapped files
|
||||
Assert( !cb->data );
|
||||
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int raw_position;
|
||||
raw_position = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(raw_position == cb->raw_position);
|
||||
#endif
|
||||
|
||||
return cb->raw_position;
|
||||
}
|
||||
|
||||
|
||||
// cfseek() moves the file pointer
|
||||
//
|
||||
// returns: success ==> 0
|
||||
// error ==> non-zero
|
||||
//
|
||||
int cfseek( CFILE *cfile, int offset, int where )
|
||||
{
|
||||
|
||||
Assert(cfile != NULL);
|
||||
Cfile_block *cb;
|
||||
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
|
||||
cb = &Cfile_block_list[cfile->id];
|
||||
|
||||
|
||||
// TODO: seek to offset in memory mapped file
|
||||
Assert( !cb->data );
|
||||
Assert( cb->fp != NULL );
|
||||
|
||||
int goal_position;
|
||||
|
||||
switch( where ) {
|
||||
case CF_SEEK_SET:
|
||||
goal_position = offset+cb->lib_offset;
|
||||
break;
|
||||
case CF_SEEK_CUR:
|
||||
{
|
||||
goal_position = cb->raw_position+offset+cb->lib_offset;
|
||||
}
|
||||
break;
|
||||
case CF_SEEK_END:
|
||||
goal_position = cb->size+offset+cb->lib_offset;
|
||||
break;
|
||||
default:
|
||||
Int3();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int result = fseek(cb->fp, goal_position, SEEK_SET );
|
||||
cb->raw_position = goal_position - cb->lib_offset;
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// cfread() reads from a file
|
||||
//
|
||||
// returns: returns the number of full elements read
|
||||
//
|
||||
//
|
||||
int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
|
||||
{
|
||||
Assert(cfile != NULL);
|
||||
Assert(buf != NULL);
|
||||
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
|
||||
|
||||
Cfile_block *cb;
|
||||
cb = &Cfile_block_list[cfile->id];
|
||||
|
||||
// cfread() not supported for memory-mapped files
|
||||
Assert( !cb->data );
|
||||
Assert(cb->fp != NULL);
|
||||
|
||||
int size = elsize*nelem;
|
||||
|
||||
Assert(nelem > 0);
|
||||
Assert(elsize > 0);
|
||||
Assert(size > 0);
|
||||
|
||||
if ( (cb->raw_position+size) > cb->size ) {
|
||||
size = cb->size - cb->raw_position;
|
||||
if ( size < 1 ) {
|
||||
return 0;
|
||||
}
|
||||
//mprintf(( "CFILE: EOF encountered in file\n" ));
|
||||
}
|
||||
|
||||
int bytes_read = fread( buf, 1, size, cb->fp );
|
||||
if ( bytes_read > 0 ) {
|
||||
cb->raw_position += bytes_read;
|
||||
}
|
||||
|
||||
#if defined(CHECK_POSITION) && !defined(NDEBUG)
|
||||
int tmp_offset;
|
||||
tmp_offset = ftell(cb->fp) - cb->lib_offset;
|
||||
Assert(tmp_offset==cb->raw_position);
|
||||
#endif
|
||||
|
||||
return bytes_read / elsize;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-07-07 19:55:58 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* External def's for CfileArchive.cpp. This should only be used
|
||||
* internally by cfile stuff.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 4 5/11/98 10:59a John
|
||||
* Moved the low-level file reading code into cfilearchive.cpp.
|
||||
*
|
||||
* 3 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 2 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _CFILEARCHIVE_H
|
||||
#define _CFILEARCHIVE_H
|
||||
|
||||
#ifndef _CFILE_INTERNAL
|
||||
#error This file should only be included internally in CFILE!!
|
||||
#endif
|
||||
|
||||
// The following Cfile_block data is private to cfile.cpp
|
||||
// DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
|
||||
//
|
||||
#define CFILE_BLOCK_UNUSED 0
|
||||
#define CFILE_BLOCK_USED 1
|
||||
|
||||
typedef struct Cfile_block {
|
||||
int type; // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
|
||||
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
|
||||
|
||||
} Cfile_block;
|
||||
|
||||
#define MAX_CFILE_BLOCKS 64
|
||||
extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
|
||||
extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
|
||||
|
||||
// Called once to setup the low-level reading code.
|
||||
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size );
|
||||
|
||||
#endif
|
||||
@@ -1,493 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for doing directory lists and sorts
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/07/29 19:37:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 6 5/13/98 10:22p John
|
||||
* Added cfile functions to read/write rle compressed blocks of data.
|
||||
* Made palman use it for .clr files. Made alphacolors calculate on the
|
||||
* fly rather than caching to/from disk.
|
||||
*
|
||||
* 5 5/06/98 5:30p John
|
||||
* Removed unused cfilearchiver. Removed/replaced some unused/little used
|
||||
* graphics functions, namely gradient_h and _v and pixel_sp. Put in new
|
||||
* DirectX header files and libs that fixed the Direct3D alpha blending
|
||||
* problems.
|
||||
*
|
||||
* 4 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 3 4/10/98 12:18a Hoffoss
|
||||
* Make pilot image search in pack file possible.
|
||||
*
|
||||
* 2 3/30/98 10:36p Allender
|
||||
* be sure to call _findclose() when done reading a file list
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#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"
|
||||
|
||||
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
|
||||
// n = number of filenames in list to sort
|
||||
// list = list of filenames to be sorted
|
||||
// sort = sorting method to use (one of the CF_SORT_* defines)
|
||||
// info = extra info for each file. Only required if sorting by time, however if you
|
||||
// have extra file info, you should pass it as well to get it sorted too (so an
|
||||
// index into list is the same index for info for that file
|
||||
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
|
||||
{
|
||||
int i, j, incr;
|
||||
char *t;
|
||||
file_list_info tt;
|
||||
|
||||
if (sort == CF_SORT_NAME) {
|
||||
incr = n / 2;
|
||||
while (incr > 0) {
|
||||
for (i=incr; i<n; i++) {
|
||||
j = i - incr;
|
||||
while (j >= 0) {
|
||||
if (stricmp(list[j], list[j + incr]) > 0) {
|
||||
t = list[j];
|
||||
list[j] = list[j + incr];
|
||||
list[j + incr] = t;
|
||||
|
||||
if (info) {
|
||||
tt = info[j];
|
||||
info[j] = info[j + incr];
|
||||
info[j + incr] = tt;
|
||||
}
|
||||
|
||||
j -= incr;
|
||||
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
incr /= 2;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} else if (sort == CF_SORT_TIME) {
|
||||
Assert(info);
|
||||
incr = n / 2;
|
||||
while (incr > 0) {
|
||||
for (i=incr; i<n; i++) {
|
||||
j = i - incr;
|
||||
while (j >= 0) {
|
||||
if (info[j].write_time < info[j + incr].write_time) {
|
||||
t = list[j];
|
||||
list[j] = list[j + incr];
|
||||
list[j + incr] = t;
|
||||
|
||||
tt = info[j];
|
||||
info[j] = info[j + incr];
|
||||
info[j + incr] = tt;
|
||||
j -= incr;
|
||||
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
incr /= 2;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
nprintf(("Error", "Unknown sorting method %d passed to cf_sort_filenames()\n", sort));
|
||||
}
|
||||
|
||||
|
||||
// cf_compress - Do Run Length Compression on a block of data. Targa format.
|
||||
//
|
||||
// Usage:
|
||||
// out Buffer to write it out to
|
||||
// in Buffer to compress
|
||||
// bytecount Number of bytes input
|
||||
int cf_compress(char *out, char *in, int bytecount )
|
||||
{
|
||||
int pixcount; // number of pixels in the current packet
|
||||
char *inputpixel=NULL; // current input pixel position
|
||||
char *matchpixel=NULL; // pixel value to match for a run
|
||||
char *flagbyte=NULL; // location of last flag byte to set
|
||||
int rlcount; // current count in r.l. string
|
||||
int rlthresh; // minimum valid run length
|
||||
char *copyloc; // location to begin copying at
|
||||
|
||||
// set the threshold -- the minimum valid run length
|
||||
rlthresh = 2; // Require a 2 pixel span before rle'ing
|
||||
|
||||
// set the first pixel up
|
||||
|
||||
flagbyte = out; // place to put next flag if run
|
||||
inputpixel = in;
|
||||
pixcount = 1;
|
||||
rlcount = 0;
|
||||
copyloc = (char *)0;
|
||||
|
||||
// loop till data processing complete
|
||||
do {
|
||||
|
||||
// if we have accumulated a 128-byte packet, process it
|
||||
if ( pixcount == 129 ) {
|
||||
*flagbyte = 127;
|
||||
|
||||
// set the run flag if this is a run
|
||||
|
||||
if ( rlcount >= rlthresh ) {
|
||||
*flagbyte |= 0x80;
|
||||
pixcount = 2;
|
||||
}
|
||||
|
||||
// copy the data into place
|
||||
++flagbyte;
|
||||
memmove( flagbyte, copyloc, pixcount-1 );
|
||||
flagbyte += pixcount-1;
|
||||
pixcount = 1;
|
||||
|
||||
// set up for next packet
|
||||
continue;
|
||||
}
|
||||
|
||||
// if zeroth byte, handle as special case
|
||||
if ( pixcount == 1 ) {
|
||||
rlcount = 0;
|
||||
copyloc = inputpixel; /* point to 1st guy in packet */
|
||||
matchpixel = inputpixel; /* set pointer to pix to match */
|
||||
pixcount = 2;
|
||||
inputpixel += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// assembling a packet -- look at next pixel
|
||||
|
||||
// current pixel == match pixel?
|
||||
if ( *inputpixel == *matchpixel ) {
|
||||
|
||||
// establishing a run of enough length to
|
||||
// save space by doing it
|
||||
// -- write the non-run length packet
|
||||
// -- start run-length packet
|
||||
|
||||
if ( ++rlcount == rlthresh ) {
|
||||
|
||||
// close a non-run packet
|
||||
|
||||
if ( pixcount > (rlcount+1) ) {
|
||||
// write out length and do not set run flag
|
||||
|
||||
*flagbyte++ = (char)(pixcount - 2 - rlthresh);
|
||||
|
||||
memmove(flagbyte, copyloc, (pixcount-1-rlcount) );
|
||||
flagbyte += (pixcount-1-rlcount);
|
||||
|
||||
copyloc = inputpixel;
|
||||
pixcount = rlcount + 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// no match -- either break a run or continue without one
|
||||
// if a run exists break it:
|
||||
// write the bytes in the string (1+1)
|
||||
// start the next string
|
||||
|
||||
if ( rlcount >= rlthresh ) {
|
||||
|
||||
*flagbyte++ = (char)(0x80 | rlcount);
|
||||
memmove(flagbyte, copyloc, 1 );
|
||||
flagbyte += 1;
|
||||
pixcount = 1;
|
||||
continue;
|
||||
} else {
|
||||
|
||||
// not a match and currently not a run
|
||||
// - save the current pixel
|
||||
// - reset the run-length flag
|
||||
rlcount = 0;
|
||||
matchpixel = inputpixel;
|
||||
}
|
||||
}
|
||||
pixcount++;
|
||||
inputpixel += 1;
|
||||
} while ( inputpixel < (in + bytecount));
|
||||
|
||||
// quit this buffer without loosing any data
|
||||
if ( --pixcount >= 1 ) {
|
||||
*flagbyte = (char)(pixcount - 1);
|
||||
if ( rlcount >= rlthresh ) {
|
||||
*flagbyte |= 0x80;
|
||||
pixcount = 1;
|
||||
}
|
||||
|
||||
// copy the data into place
|
||||
++flagbyte;
|
||||
memmove(flagbyte, copyloc, pixcount );
|
||||
flagbyte += pixcount;
|
||||
}
|
||||
return(flagbyte-out);
|
||||
}
|
||||
|
||||
|
||||
// cf_decompress - Do Decompression on a run-length encoded block of data. Targa format.
|
||||
//
|
||||
// Usage:
|
||||
// out Buffer to write it out to
|
||||
// in Buffer to compress
|
||||
// bytecount Number of bytes input
|
||||
int cf_decompress(char *out, char *in )
|
||||
{
|
||||
int count;
|
||||
|
||||
char *param_out = out;
|
||||
|
||||
while(1) {
|
||||
|
||||
count = int(*in++);
|
||||
int run_span = count & 0x80;
|
||||
|
||||
count &= (~0x80);
|
||||
|
||||
if ( count > 0 ) {
|
||||
if ( run_span ) {
|
||||
// RLE'd data
|
||||
ubyte c = *in++;
|
||||
|
||||
memset( out, c, count );
|
||||
out += count;
|
||||
} else {
|
||||
memmove( out, in, count );
|
||||
in += count;
|
||||
out += count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out - param_out;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// cfread() reads from a file and decompresses it
|
||||
//
|
||||
// returns: returns the number of full elements read
|
||||
//
|
||||
//
|
||||
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
|
||||
{
|
||||
char *out = (char *)buf;
|
||||
|
||||
while(1) {
|
||||
|
||||
byte count;
|
||||
|
||||
if ( cfread( &count, 1, 1, cfile ) != 1 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
int run_span = count & 0x80;
|
||||
count &= (~0x80);
|
||||
count++;
|
||||
|
||||
if ( count > 0 ) {
|
||||
if ( run_span ) {
|
||||
// RLE'd data
|
||||
byte c;
|
||||
if ( cfread( &c, 1, 1, cfile ) != 1 ) {
|
||||
break;
|
||||
}
|
||||
memset( out, c, count );
|
||||
} else {
|
||||
if ( cfread( out, 1, count, cfile ) != count ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
out += count;
|
||||
if ( out >= (char *)buf + (elsize*nelem)) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (out - (char *)buf)/elsize;
|
||||
}
|
||||
|
||||
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile)
|
||||
{
|
||||
char *in = (char *)param_buf;
|
||||
int bytecount = (param_elsize * param_nelem );
|
||||
|
||||
int pixcount; // number of pixels in the current packet
|
||||
char *inputpixel=NULL; // current input pixel position
|
||||
char *matchpixel=NULL; // pixel value to match for a run
|
||||
int rlcount; // current count in r.l. string
|
||||
int rlthresh; // minimum valid run length
|
||||
char *copyloc; // location to begin copying at
|
||||
|
||||
// set the threshold -- the minimum valid run length
|
||||
rlthresh = 2; // Require a 2 pixel span before rle'ing
|
||||
|
||||
// set the first pixel up
|
||||
|
||||
inputpixel = in;
|
||||
pixcount = 1;
|
||||
rlcount = 0;
|
||||
copyloc = (char *)0;
|
||||
|
||||
// loop till data processing complete
|
||||
do {
|
||||
|
||||
// if we have accumulated a 128-byte packet, process it
|
||||
if ( pixcount == 129 ) {
|
||||
ubyte code = 127;
|
||||
|
||||
// set the run flag if this is a run
|
||||
|
||||
if ( rlcount >= rlthresh ) {
|
||||
code |= 0x80;
|
||||
pixcount = 2;
|
||||
}
|
||||
|
||||
cfwrite( &code, 1, 1, cfile );
|
||||
|
||||
// copy the data into place
|
||||
cfwrite( copyloc, 1, pixcount-1, cfile );
|
||||
pixcount = 1;
|
||||
|
||||
// set up for next packet
|
||||
continue;
|
||||
}
|
||||
|
||||
// if zeroth byte, handle as special case
|
||||
if ( pixcount == 1 ) {
|
||||
rlcount = 0;
|
||||
copyloc = inputpixel; /* point to 1st guy in packet */
|
||||
matchpixel = inputpixel; /* set pointer to pix to match */
|
||||
pixcount = 2;
|
||||
inputpixel += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// assembling a packet -- look at next pixel
|
||||
|
||||
// current pixel == match pixel?
|
||||
if ( *inputpixel == *matchpixel ) {
|
||||
|
||||
// establishing a run of enough length to
|
||||
// save space by doing it
|
||||
// -- write the non-run length packet
|
||||
// -- start run-length packet
|
||||
|
||||
if ( ++rlcount == rlthresh ) {
|
||||
|
||||
// close a non-run packet
|
||||
|
||||
if ( pixcount > (rlcount+1) ) {
|
||||
// write out length and do not set run flag
|
||||
|
||||
ubyte code = (ubyte)(pixcount - 2 - rlthresh);
|
||||
cfwrite( &code, 1, 1, cfile );
|
||||
|
||||
cfwrite( copyloc, 1, (pixcount-1-rlcount), cfile );
|
||||
copyloc = inputpixel;
|
||||
pixcount = rlcount + 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// no match -- either break a run or continue without one
|
||||
// if a run exists break it:
|
||||
// write the bytes in the string (1+1)
|
||||
// start the next string
|
||||
|
||||
if ( rlcount >= rlthresh ) {
|
||||
|
||||
ubyte code = (ubyte)(0x80 | rlcount);
|
||||
cfwrite( &code, 1, 1, cfile );
|
||||
cfwrite( copyloc, 1, 1, cfile );
|
||||
pixcount = 1;
|
||||
continue;
|
||||
} else {
|
||||
|
||||
// not a match and currently not a run
|
||||
// - save the current pixel
|
||||
// - reset the run-length flag
|
||||
rlcount = 0;
|
||||
matchpixel = inputpixel;
|
||||
}
|
||||
}
|
||||
pixcount++;
|
||||
inputpixel += 1;
|
||||
} while ( inputpixel < (in + bytecount));
|
||||
|
||||
// quit this buffer without loosing any data
|
||||
if ( --pixcount >= 1 ) {
|
||||
ubyte code = ubyte(pixcount - 1);
|
||||
|
||||
// set the run flag if this is a run
|
||||
|
||||
if ( rlcount >= rlthresh ) {
|
||||
code |= 0x80;
|
||||
pixcount = 1;
|
||||
}
|
||||
|
||||
cfwrite( &code, 1, 1, cfile );
|
||||
|
||||
// copy the data into place
|
||||
cfwrite( copyloc, 1, pixcount, cfile );
|
||||
}
|
||||
|
||||
return param_nelem;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-03-05 09:01:54 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
* This keeps a list of all the files in packfiles or on CD-rom
|
||||
* and when you need a file you call one function which then searches
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 5 5/01/98 10:21a John
|
||||
* Added code to find all pack files in all trees. Added code to create
|
||||
* any directories that we write to.
|
||||
*
|
||||
* 4 4/30/98 10:21p John
|
||||
* Added code to cleanup cfilesystem
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _CFILESYSTEM_H
|
||||
#define _CFILESYSTEM_H
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
// Builds a list of all the files
|
||||
void cf_build_secondary_filelist( char *cdrom_path );
|
||||
void cf_free_secondary_filelist();
|
||||
|
||||
// Internal stuff
|
||||
typedef struct cf_pathtype {
|
||||
int index; // To verify that the CF_TYPE define is correctly indexed into this array
|
||||
char *path; // Path relative to Freespace root, has ending backslash.
|
||||
char *extensions; // Extensions used in this pathtype, separated by spaces
|
||||
int parent_index; // Index of this directory's parent. Used for creating directories when writing.
|
||||
} cf_pathtype;
|
||||
|
||||
// During cfile_init, verify that Pathtypes[n].index == n for each item
|
||||
extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
|
||||
|
||||
// Returns the default storage path for files given a
|
||||
// particular pathtype. In other words, the path to
|
||||
// the unpacked, non-cd'd, stored on hard drive path.
|
||||
// If filename isn't null it will also tack the filename
|
||||
// on the end, creating a completely valid filename.
|
||||
// Input: pathtype - CF_TYPE_??
|
||||
// filename - optional, if set, tacks the filename onto end of path.
|
||||
// Output: path - Fully qualified pathname.
|
||||
void cf_create_default_path_string( char *path, int pathtype, char *filename=NULL, bool localize = false);
|
||||
|
||||
|
||||
#endif //_CFILESYSTEM_H
|
||||
@@ -1,285 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-11-16 09:42:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Program to create an archive file for use with cfile stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/23/98 6:15p Dave
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#include <string.h>
|
||||
#include <conio.h>
|
||||
|
||||
unsigned int Total_size=16; // Start with size of header
|
||||
unsigned int Num_files =0;
|
||||
FILE * fp_out = NULL;
|
||||
FILE * fp_out_hdr = NULL;
|
||||
|
||||
typedef struct vp_header {
|
||||
char id[4];
|
||||
int version;
|
||||
int index_offset;
|
||||
int num_files;
|
||||
} vp_header;
|
||||
|
||||
//vp_header Vp_header;
|
||||
|
||||
char archive_dat[1024];
|
||||
char archive_hdr[1024];
|
||||
|
||||
#define BLOCK_SIZE (1024*1024)
|
||||
#define VERSION_NUMBER 2;
|
||||
|
||||
char tmp_data[BLOCK_SIZE]; // 1 MB
|
||||
|
||||
void write_header()
|
||||
{
|
||||
fseek(fp_out, 0, SEEK_SET);
|
||||
fwrite("VPVP", 1, 4, fp_out);
|
||||
int ver = VERSION_NUMBER;
|
||||
fwrite(&ver, 1, 4, fp_out);
|
||||
fwrite(&Total_size, 1, 4, fp_out);
|
||||
fwrite(&Num_files, 1, 4, fp_out);
|
||||
}
|
||||
|
||||
int write_index(char *hf, char *df)
|
||||
{
|
||||
FILE *h = fopen(hf, "rb");
|
||||
if (!h) return 0;
|
||||
FILE *d = fopen(df, "a+b");
|
||||
if (!d) return 0;
|
||||
for (unsigned int i=0;i<Num_files;i++) {
|
||||
fread(tmp_data, 32+4+4+4, 1, h);
|
||||
fwrite(tmp_data, 32+4+4+4, 1, d);
|
||||
}
|
||||
fclose(h);
|
||||
fclose(d);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void pack_file( char *filespec, char *filename, int filesize, time_t time_write )
|
||||
{
|
||||
char path[1024];
|
||||
|
||||
if ( strstr( filename, ".vp" )) {
|
||||
// Don't pack yourself!!
|
||||
return;
|
||||
}
|
||||
|
||||
if ( strstr( filename, ".hdr" )) {
|
||||
// Don't pack yourself!!
|
||||
return;
|
||||
}
|
||||
|
||||
if ( filesize == 0 ) {
|
||||
// Don't pack 0 length files, screws up directory structure!
|
||||
return;
|
||||
}
|
||||
|
||||
memset( path, 0, sizeof(path));
|
||||
strcpy( path, filename );
|
||||
if ( strlen(filename)>31 ) {
|
||||
printf( "Filename '%s' too long\n", filename );
|
||||
exit(1);
|
||||
}
|
||||
fwrite( &Total_size, 1, 4, fp_out_hdr );
|
||||
fwrite( &filesize, 1, 4, fp_out_hdr );
|
||||
fwrite( &path, 1, 32, fp_out_hdr );
|
||||
fwrite( &time_write, 1, sizeof(time_t), fp_out_hdr);
|
||||
|
||||
Total_size += filesize;
|
||||
Num_files++;
|
||||
printf( "Packing %s\\%s...", filespec, filename );
|
||||
|
||||
sprintf( path, "%s\\%s", filespec, filename );
|
||||
|
||||
FILE *fp = fopen( path, "rb" );
|
||||
|
||||
if ( fp == NULL ) {
|
||||
printf( "Error opening '%s'\n", path );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int nbytes, nbytes_read=0;
|
||||
|
||||
do {
|
||||
nbytes = fread( tmp_data, 1, BLOCK_SIZE, fp );
|
||||
if ( nbytes > 0 ) {
|
||||
fwrite( tmp_data, 1, nbytes, fp_out );
|
||||
nbytes_read += nbytes;
|
||||
|
||||
}
|
||||
} while( nbytes > 0 );
|
||||
|
||||
fclose(fp);
|
||||
|
||||
printf( " %d bytes\n", nbytes_read );
|
||||
}
|
||||
|
||||
// This function adds a directory marker to the header file
|
||||
void add_directory( char * dirname)
|
||||
{
|
||||
char path[256];
|
||||
char *pathptr = path;
|
||||
char *tmpptr;
|
||||
|
||||
strcpy(path, dirname);
|
||||
fwrite(&Total_size, 1, 4, fp_out_hdr);
|
||||
int i = 0;
|
||||
fwrite(&i, 1, 4, fp_out_hdr);
|
||||
// strip out any directories that this dir is a subdir of
|
||||
while ((tmpptr = strchr(pathptr, '\\')) != NULL) {
|
||||
pathptr = tmpptr+1;
|
||||
}
|
||||
fwrite(pathptr, 1, 32, fp_out_hdr);
|
||||
fwrite(&i, 1, 4, fp_out_hdr); // timestamp = 0
|
||||
Num_files++;
|
||||
}
|
||||
|
||||
void pack_directory( char * filespec)
|
||||
{
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
char tmp[512];
|
||||
char tmp1[512];
|
||||
|
||||
/*
|
||||
char dir_name[512];
|
||||
char *last_slash;
|
||||
|
||||
last_slash = strrchr(filespec, '\\');
|
||||
if ( last_slash ) {
|
||||
strcpy(dir_name, last_slash+1);
|
||||
} else {
|
||||
strcpy(dir_name, filespec);
|
||||
}
|
||||
|
||||
if ( !stricmp(dir_name, "voice") ) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
strcpy( tmp1, filespec );
|
||||
add_directory(filespec);
|
||||
strcat( tmp1, "\\*.*" );
|
||||
|
||||
printf( "In dir '%s'\n", tmp1 );
|
||||
|
||||
find_handle = _findfirst( tmp1, &find );
|
||||
if( find_handle != -1 ) {
|
||||
if ( find.attrib & _A_SUBDIR ) {
|
||||
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
|
||||
strcpy( tmp, filespec );
|
||||
strcat( tmp, "\\" );
|
||||
strcat( tmp, find.name );
|
||||
pack_directory(tmp);
|
||||
}
|
||||
} else {
|
||||
pack_file( filespec, find.name, find.size, find.time_write );
|
||||
}
|
||||
|
||||
while( !_findnext( find_handle, &find ) ) {
|
||||
if ( find.attrib & _A_SUBDIR ) {
|
||||
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
|
||||
strcpy( tmp, filespec );
|
||||
strcat( tmp, "\\" );
|
||||
strcat( tmp, find.name );
|
||||
pack_directory(tmp);
|
||||
|
||||
}
|
||||
} else {
|
||||
pack_file( filespec, find.name, find.size, find.time_write );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_directory("..");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[] )
|
||||
{
|
||||
char archive[1024];
|
||||
char *p;
|
||||
|
||||
if ( argc < 3 ) {
|
||||
printf( "Usage: %s archive_name src_dir\n", argv[0] );
|
||||
printf( "Example: %s freespace c:\\freespace\\data\n", argv[0] );
|
||||
printf( "Creates an archive named freespace out of the\nfreespace data tree\n" );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
}
|
||||
|
||||
strcpy( archive, argv[1] );
|
||||
p = strchr( archive, '.' );
|
||||
if (p) *p = 0; // remove extension
|
||||
|
||||
strcpy( archive_dat, archive );
|
||||
strcat( archive_dat, ".vp" );
|
||||
|
||||
strcpy( archive_hdr, archive );
|
||||
strcat( archive_hdr, ".hdr" );
|
||||
|
||||
fp_out = fopen( archive_dat, "wb" );
|
||||
if ( !fp_out ) {
|
||||
printf( "out1: Couldn't open '%s'!\n", archive_dat );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
}
|
||||
|
||||
fp_out_hdr = fopen( archive_hdr, "wb" );
|
||||
if ( !fp_out_hdr ) {
|
||||
printf( "out2: Couldn't open '%s'!\n", archive_hdr );
|
||||
printf( "Press any key to exit...\n" );
|
||||
getch();
|
||||
return 1;
|
||||
}
|
||||
|
||||
write_header();
|
||||
|
||||
pack_directory( argv[2] );
|
||||
|
||||
write_header();
|
||||
|
||||
fclose(fp_out);
|
||||
fclose(fp_out_hdr);
|
||||
|
||||
printf( "Data files written, appending index...\n" );
|
||||
|
||||
if (!write_index(archive_hdr, archive_dat)) {
|
||||
printf("Error appending index!\n");
|
||||
printf("Press any key to exit...\n");
|
||||
getch();
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf( "%d total KB.\n", Total_size/1024 );
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,508 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
|
||||
* $Revision: 2.54 $
|
||||
* $Date: 2004-04-26 18:23:47 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.53 2004/04/26 00:23:26 taylor
|
||||
* novbo and snd_preload cmdline options, fix moddir getting appended space
|
||||
*
|
||||
* Revision 2.52 2004/04/18 19:39:12 randomtiger
|
||||
* Added -2d_poof command which allows access to 2D poof rendering
|
||||
* Added -radar_reduce to launcher flag description structure
|
||||
*
|
||||
* Revision 2.51 2004/04/03 18:11:20 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.50 2004/03/20 14:47:12 randomtiger
|
||||
* Added base for a general dynamic batching solution.
|
||||
* Fixed NO_DSHOW_CODE code path bug.
|
||||
*
|
||||
* Revision 2.49 2004/03/19 14:51:54 randomtiger
|
||||
* New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system.
|
||||
*
|
||||
* Revision 2.48 2004/03/19 11:44:04 randomtiger
|
||||
* Removed -d3d_notmanaged param.
|
||||
* Tided D3D texture code. Merged remaining section code into the rest of the system.
|
||||
* Prepared for removal of code causing waste of memory for secondry store of textures.
|
||||
*
|
||||
* Revision 2.47 2004/02/27 04:09:55 bobboau
|
||||
* fixed a Z buffer error in HTL submodel rendering,
|
||||
* and glow points,
|
||||
* and other stuff
|
||||
*
|
||||
* Revision 2.46 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.45 2004/01/29 01:34:00 randomtiger
|
||||
* Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
|
||||
* Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
|
||||
*
|
||||
* Revision 2.44 2004/01/24 14:31:27 randomtiger
|
||||
* Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
|
||||
* Its optional and off by default, use -d3d_particle to activiate.
|
||||
* Also bumped up D3D ambient light setting, it was way too dark.
|
||||
* Its now set to something similar to the original game.
|
||||
*
|
||||
* Revision 2.43 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.42 2003/12/04 20:39:09 randomtiger
|
||||
* Added DDS image support for D3D
|
||||
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
|
||||
* Hopefully have fixed D3D text batching bug that caused old values to appear
|
||||
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
|
||||
* Fixed jump nodes not showing
|
||||
*
|
||||
* Revision 2.41 2003/12/03 19:27:00 randomtiger
|
||||
* Changed -t32 flag to -jpgtga
|
||||
* Added -query_flag to identify builds with speech not compiled and other problems
|
||||
* Now loads up launcher if videocard reg entry not found
|
||||
* Now offers to go online to download launcher if its not present
|
||||
* Changed target view not to use lower res texture, hi res one is already chached so might as well use it
|
||||
*
|
||||
* Revision 2.40 2003/11/29 10:52:09 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.39 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 2.38 2003/11/15 18:09:33 randomtiger
|
||||
* Put TGA and JPG stuff on -t32 flag
|
||||
* Put 32 bit PCX stuff on -pcx32 (still has bugs)
|
||||
* Added multisample checking on device initialisation
|
||||
* Changed unrecognised parameter message (as requested) to be more user friendly
|
||||
* Speech now chooses voice based on reg value set by launcher v3.1
|
||||
*
|
||||
* Revision 2.37 2003/11/09 06:31:38 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 2.36 2003/11/09 04:09:18 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
* Revision 2.34 2003/11/03 18:07:26 randomtiger
|
||||
* Added -d3d_no_vsync command to make turning off vsync optional.
|
||||
* Removed 32bit command, it doesnt do anything.
|
||||
* Made aa multisample reg check safe.
|
||||
*
|
||||
* Revision 2.33 2003/10/27 23:04:20 randomtiger
|
||||
* Added -no_set_gamma flags
|
||||
* Fixed up some more non standard res stuff
|
||||
* Improved selection of device type, this includes using a pure device when allowed which means dev should not use Get* functions in D3D
|
||||
* Made fade in credits work
|
||||
* Stopped a call to gr_reser_lighting() in non htl mode when the pointer was NULL, was causing a crash loading a fogged level
|
||||
* Deleted directx8 directory content, has never been needed.
|
||||
*
|
||||
* Revision 2.32 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.31 2003/10/17 17:18:42 randomtiger
|
||||
* Big restructure for D3D and new modules grd3dlight and grd3dsetup
|
||||
*
|
||||
* Revision 2.30 2003/10/12 03:41:37 Kazan
|
||||
* #Kazan# FS2NetD client code gone multithreaded, some Fred2 Open -mod stuff [obvious code.lib] including a change in cmdline.cpp, changed Stick's "-nohtl" to "-htl" - HTL is _OFF_ by default here (Bobboau and I decided this was a better idea for now)
|
||||
*
|
||||
* Revision 2.29 2003/09/25 21:12:22 Kazan
|
||||
* ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
|
||||
* Also D3D8 Screenshots work now.
|
||||
*
|
||||
* Revision 2.28 2003/09/23 02:42:52 Kazan
|
||||
* ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able]
|
||||
*
|
||||
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
|
||||
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
|
||||
*
|
||||
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.25 2003/09/13 06:02:05 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2003/08/22 07:35:08 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.22 2003/08/21 20:54:37 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.21 2003/08/12 03:18:33 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.20 2003/08/09 06:07:23 bobboau
|
||||
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
|
||||
*
|
||||
* Revision 2.19 2003/03/29 09:42:05 Goober5000
|
||||
* made beams default shield piercing again
|
||||
* also added a beam no pierce command line flag
|
||||
* and fixed something else which I forgot :P
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
|
||||
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
|
||||
*
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.11 2002/10/31 21:14:16 DTP
|
||||
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
|
||||
*
|
||||
* Revision 2.10 2002/10/30 20:22:30 inquisitor
|
||||
* Bad Committ, Rolling back
|
||||
*
|
||||
* Revision 2.7 2002/10/22 23:02:39 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.6 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.5 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
|
||||
*
|
||||
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
|
||||
* When on is now less blury. - RT
|
||||
*
|
||||
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
|
||||
*
|
||||
* Added new command line parameter -d3dlauncher which brings up the launcher.
|
||||
* This is needed since FS2 DX8 now stores the last successful details in the registry and
|
||||
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
|
||||
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
|
||||
*
|
||||
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.4 2002/08/18 19:48:28 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.3 2002/08/07 00:44:13 DTP
|
||||
* Implented -GF4FIX commandline switch
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 8 8/26/99 8:51p Dave
|
||||
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
|
||||
*
|
||||
* 7 7/15/99 3:07p Dave
|
||||
* 32 bit detection support. Mouse coord commandline.
|
||||
*
|
||||
* 6 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 5 6/22/99 9:37p Dave
|
||||
* Put in pof spewing.
|
||||
*
|
||||
* 4 1/12/99 5:45p Dave
|
||||
* Moved weapon pipeline in multiplayer to almost exclusively client side.
|
||||
* Very good results. Bandwidth goes down, playability goes up for crappy
|
||||
* connections. Fixed object update problem for ship subsystems.
|
||||
*
|
||||
* 3 11/17/98 11:12a Dave
|
||||
* Removed player identification by address. Now assign explicit id #'s.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 27 9/15/98 4:04p Allender
|
||||
* added back in the -ip_addr command line switch because it needs to be
|
||||
* in the standalone server only executable
|
||||
*
|
||||
* 26 9/14/98 11:28a Allender
|
||||
* support for server bashing of address when received from client. Added
|
||||
* a cmdline.cfg file to process command line arguments from a file
|
||||
*
|
||||
* 25 9/08/98 2:20p Allender
|
||||
* temporary code to force IP address to a specific value.
|
||||
*
|
||||
* 24 8/20/98 5:30p Dave
|
||||
* Put in handy multiplayer logfile system. Now need to put in useful
|
||||
* applications of it all over the code.
|
||||
*
|
||||
* 23 8/07/98 10:40a Allender
|
||||
* new command line flags for starting netgames. Only starting currently
|
||||
* works, and PXO isn't implemented yet
|
||||
*
|
||||
* 22 7/24/98 11:14a Allender
|
||||
* start of new command line options for version 1.04
|
||||
*
|
||||
* 21 5/21/98 1:50a Dave
|
||||
* Remove obsolete command line functions. Reduce shield explosion packets
|
||||
* drastically. Tweak PXO screen even more. Fix file xfer system so that
|
||||
* we can guarantee file uniqueness.
|
||||
*
|
||||
* 20 5/18/98 9:10p Dave
|
||||
* Put in many new PXO features. Fixed skill level bashing in multiplayer.
|
||||
* Removed several old command line options. Put in network config files.
|
||||
*
|
||||
* 19 5/09/98 7:16p Dave
|
||||
* Put in CD checking. Put in standalone host password. Made pilot into
|
||||
* popup scrollable.
|
||||
*
|
||||
* 18 4/23/98 8:27p Allender
|
||||
* basic support for cutscene playback. Into movie code in place. Tech
|
||||
* room can view cutscenes stored in CDROM_dir variable
|
||||
*
|
||||
* 17 3/14/98 2:48p Dave
|
||||
* Cleaned up observer joining code. Put in support for file xfers to
|
||||
* ingame joiners (observers or not). Revamped and reinstalled pseudo
|
||||
* lag/loss system.
|
||||
*
|
||||
* 16 1/31/98 4:32p Dave
|
||||
* Put in new support for VMT player validation, game logging in and game
|
||||
* logging out.
|
||||
*
|
||||
* 15 12/10/97 4:45p Dave
|
||||
* Added in more detailed support for multiplayer packet lag/loss. Fixed
|
||||
* some multiplayer stuff. Added some controls to the standalone.
|
||||
*
|
||||
* 14 12/09/97 6:14p Lawrance
|
||||
* add -nomusic flag
|
||||
*
|
||||
* 13 11/28/97 7:04p Dave
|
||||
* Emergency checkin due to big system crash.
|
||||
*
|
||||
* 12 11/28/97 5:06p Dave
|
||||
* Put in facilities for simulating multiplayer lag.
|
||||
*
|
||||
* 11 11/24/97 5:42p Dave
|
||||
* Fixed a file xfer buffer free/malloc problem. Lengthened command line
|
||||
* switch string parse length.
|
||||
*
|
||||
* 10 11/12/97 4:39p Dave
|
||||
* Put in multiplayer campaign support parsing, loading and saving. Made
|
||||
* command-line variables better named. Changed some things on the initial
|
||||
* pilot select screen.
|
||||
*
|
||||
* 9 11/11/97 4:54p Dave
|
||||
* Put in support for single vs. multiplayer pilots. Put in initial player
|
||||
* selection screen (no command line option yet). Started work on
|
||||
* multiplayer campaign file save gaming.
|
||||
*
|
||||
* 8 9/18/97 10:13p Dave
|
||||
* Added -gimmemedals, which gives the current pilot all the medals in the
|
||||
* game (debug)
|
||||
*
|
||||
* 7 9/18/97 9:20a Dave
|
||||
* Minor modifications
|
||||
*
|
||||
* 6 9/15/97 11:40p Lawrance
|
||||
* remove demo granularity switch
|
||||
*
|
||||
* 5 9/03/97 5:03p Lawrance
|
||||
* add support for -nosound command line parm
|
||||
*
|
||||
* 4 8/21/97 4:55p Dave
|
||||
* Added a switch for multiplayer chat streaming. Added a section for
|
||||
* global command line vars.
|
||||
*
|
||||
* 3 8/06/97 2:26p Dave
|
||||
* Made the command line parse more robust. Made it easier to add and
|
||||
* process new command-line switches.
|
||||
*
|
||||
* 2 8/04/97 3:13p Dave
|
||||
* Added command line functions. See cmdline.cpp for directions on adding
|
||||
* new switches
|
||||
*
|
||||
* 1 8/04/97 9:58a Dave
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
int fred2_parse_cmdline(int argc, char *argv[]);
|
||||
// COMMAND LINE SETTINGS
|
||||
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
|
||||
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
|
||||
//
|
||||
// Add any extern definitions here and put the actual variables inside of cmdline.cpp for ease of use
|
||||
// Also, check to make sure anything you add doesn't break Fred or TestCode
|
||||
|
||||
extern int Cmdline_multi_stream_chat_to_file;
|
||||
extern int Cmdline_freespace_no_sound;
|
||||
extern int Cmdline_freespace_no_music;
|
||||
extern int Cmdline_gimme_all_medals;
|
||||
extern int Cmdline_use_last_pilot;
|
||||
extern int Cmdline_cd_check;
|
||||
extern int Cmdline_start_netgame;
|
||||
extern int Cmdline_closed_game;
|
||||
extern int Cmdline_restricted_game;
|
||||
extern int Cmdline_network_port;
|
||||
extern char *Cmdline_game_name;
|
||||
extern char *Cmdline_game_password;
|
||||
extern char *Cmdline_rank_above;
|
||||
extern char *Cmdline_rank_below;
|
||||
extern char *Cmdline_connect_addr;
|
||||
extern int Cmdline_multi_log;
|
||||
extern int Cmdline_server_firing;
|
||||
extern int Cmdline_client_dodamage;
|
||||
extern int Cmdline_spew_pof_info;
|
||||
extern int Cmdline_mouse_coords;
|
||||
extern int Cmdline_timeout;
|
||||
extern int Cmdline_SpewMission_CRCs;
|
||||
extern int Cmdline_SpewTable_CRCs;
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern char *Cmdline_almission; //DTP for autoload mission
|
||||
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
|
||||
extern int Cmdline_allslev;
|
||||
extern int Cmdline_phreak;
|
||||
extern int Cmdline_dnoshowvid; //WMC Toggles movie playing support
|
||||
extern char *Cmdline_mod; //DTP for mod support
|
||||
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
|
||||
extern int Cmdline_show_stats;
|
||||
extern int Cmdline_safeloading;
|
||||
extern int Cmdline_nospec;
|
||||
|
||||
extern int Cmdline_cache_ani;
|
||||
extern int Cmdline_d3dmipmap;
|
||||
|
||||
extern int Cmdline_beams_no_pierce_shields; // Goober5000
|
||||
extern float Cmdline_fov;
|
||||
|
||||
extern float static_light_factor;
|
||||
extern float static_tube_factor;
|
||||
extern float static_point_factor;
|
||||
extern double specular_exponent_value;
|
||||
|
||||
extern int Cmdline_cell;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_dxt;
|
||||
extern int Cmdline_jpgtga;
|
||||
extern int Cmdline_no_set_gamma;
|
||||
extern int Cmdline_d3d_no_vsync;
|
||||
extern int Cmdline_pcx32;
|
||||
|
||||
extern int Cmdline_noglow;
|
||||
extern int Cmdline_timerbar;
|
||||
extern int Cmdline_query_speech;
|
||||
extern int Cmdline_ship_choice_3d;
|
||||
extern int Cmdline_d3d_particle;
|
||||
|
||||
extern int Cmdline_ambient_factor;
|
||||
extern int Cmdline_show_mem_usage;
|
||||
extern int Cmdline_rt;
|
||||
extern char *Cmdline_start_mission;
|
||||
|
||||
extern int Cmdline_d3d_lesstmem;
|
||||
extern int Cmdline_batch_3dunlit;
|
||||
|
||||
extern int Cmdline_2d_poof;
|
||||
|
||||
extern int Cmdline_FRED2_htl;
|
||||
extern int CmdLine_FRED2_NoWarn;
|
||||
|
||||
extern int Cmdline_novbo;
|
||||
extern int Cmdline_snd_preload;
|
||||
extern int Cmdline_NoFPSCap;
|
||||
|
||||
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
|
||||
#endif
|
||||
@@ -1,476 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:57 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 5 9/05/99 11:25p Mikek
|
||||
* Debug code (only on NDEBUG). Don't drop countermeasures if
|
||||
* Ai_firing_enabled not set.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 44 4/29/98 9:36p Allender
|
||||
* ingame join tweaks. added network message for countermeasures
|
||||
*
|
||||
* 43 4/13/98 5:11p Mike
|
||||
* More improvement to countermeasure code.
|
||||
*
|
||||
* 42 4/13/98 2:14p Mike
|
||||
* Countermeasure balance testing for Jim.
|
||||
*
|
||||
* 41 4/10/98 11:02p Mike
|
||||
* Make countermeasures less effective against aspect seekers than against
|
||||
* heat seekers.
|
||||
* Make AI ships match bank with each other when attacking a faraway
|
||||
* target.
|
||||
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
|
||||
* target.
|
||||
*
|
||||
* 40 3/31/98 5:11p John
|
||||
* Removed demo/save/restore. Made NDEBUG defined compile. Removed a
|
||||
* bunch of debug stuff out of player file. Made model code be able to
|
||||
* unload models and malloc out only however many models are needed.
|
||||
*
|
||||
* 39 3/17/98 3:49p John
|
||||
* Turned off lighting on counter measures.
|
||||
*
|
||||
* 38 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 37 2/23/98 5:44p Johnson
|
||||
* Resolve build error.
|
||||
*
|
||||
* 36 2/23/98 4:30p Mike
|
||||
* Make homing missiles detonate after they pass up their target. Make
|
||||
* countermeasures less effective.
|
||||
*
|
||||
* 35 2/09/98 8:04p Lawrance
|
||||
* Add objnum to cmeasure struct, correctly set source_objnum
|
||||
*
|
||||
* 34 2/05/98 11:20p Lawrance
|
||||
* save/restore countermeasure data
|
||||
*
|
||||
* 33 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 32 2/04/98 12:20p Mike
|
||||
* Make countermeasures detonate in a smaller radius. Make all in radius,
|
||||
* not just homing one, detonate.
|
||||
*
|
||||
* 31 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 30 1/29/98 11:11a John
|
||||
* Put in code to show dummy counter measure object.
|
||||
*
|
||||
* 29 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* 28 1/23/98 9:43a Mike
|
||||
* Debug-C to disallow countermeasure firing.
|
||||
* Fix bug in countermeasure tracking by aspect seekers.
|
||||
*
|
||||
* 27 1/20/98 9:47a Mike
|
||||
* Suppress optimized compiler warnings.
|
||||
* Some secondary weapon work.
|
||||
*
|
||||
* 26 1/16/98 11:43a Mike
|
||||
* Fix countermeasures.
|
||||
*
|
||||
* 25 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 24 11/29/97 2:05p John
|
||||
* made g3_draw_bitmap and g3_draw_rotated bitmap take w&h, not w/2 & h/2,
|
||||
* like they used to incorrectly assume. Added code to model to read in
|
||||
* thruster radius's.
|
||||
*
|
||||
* 23 10/27/97 3:24p Lawrance
|
||||
* ensure countermeasures keep their initial velocity
|
||||
*
|
||||
* 22 9/14/97 4:50p Lawrance
|
||||
* added some demo debugging code
|
||||
*
|
||||
* 21 9/04/97 5:09p Andsager
|
||||
* implement physics using moment of inertia and mass (from BSPgen).
|
||||
* Added to phys_info struct. Updated ship_info, polymodel structs.
|
||||
* Updated weapon ($Mass and $Force) and ship ($Mass -> $Density) tables
|
||||
*
|
||||
* 20 8/20/97 11:09a Mike
|
||||
* Make countermeasure lifetime based on skill level.
|
||||
*
|
||||
* 19 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 18 8/13/97 4:45p Allender
|
||||
* fixed ship_fire_primary and fire_secondary to not take parameter for
|
||||
* determining whether to count ammo or not. Fixed countermeasure firing
|
||||
* for multiplayer
|
||||
*
|
||||
* 17 8/13/97 12:06p Lawrance
|
||||
* supporting multiple types of fireball explosions
|
||||
*
|
||||
* 16 8/11/97 6:03p Mike
|
||||
* Make ships with no shields not claim to have shields in target box.
|
||||
*
|
||||
* 15 8/08/97 4:29p Allender
|
||||
* countermeasure stuff for multiplayer
|
||||
*
|
||||
* 14 7/31/97 5:55p John
|
||||
* made so you pass flags to obj_create.
|
||||
* Added new collision code that ignores any pairs that will never
|
||||
* collide.
|
||||
*
|
||||
* 13 7/15/97 12:03p Andsager
|
||||
* New physics stuff
|
||||
*
|
||||
* 12 7/11/97 11:54a John
|
||||
* added rotated 3d bitmaps.
|
||||
*
|
||||
* 11 6/24/97 10:04a Allender
|
||||
* major multiplayer improvements. Better sequencing before game.
|
||||
* Dealing with weapon/fireball/counter measure objects between
|
||||
* client/host.
|
||||
*
|
||||
* 10 6/24/97 12:38a Lawrance
|
||||
* fix minor bug with cycling cmeasure
|
||||
*
|
||||
* 9 6/05/97 1:37a Lawrance
|
||||
* change syntax of a snd_play()
|
||||
*
|
||||
* 8 5/22/97 5:45p Mike
|
||||
* Better countermeasure firing, key off availability, specify in
|
||||
* weapons.tbl
|
||||
*
|
||||
* 7 5/22/97 12:06p Lawrance
|
||||
* include Sound.h for playing sound fx
|
||||
*
|
||||
* 6 5/22/97 12:04p Lawrance
|
||||
* added soundhook for cmeasure cycle
|
||||
*
|
||||
* 5 5/15/97 5:05p Mike
|
||||
* In the midst of changing subsystem targetnig from type-based to
|
||||
* pointer-based.
|
||||
* Also allowed you to view a target while dead.
|
||||
*
|
||||
* 4 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 3 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 2 5/12/97 5:58p Mike
|
||||
* Add countermeasures.
|
||||
*
|
||||
* 1 5/12/97 2:23p Mike
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "model/model.h"
|
||||
#include "ship/ship.h"
|
||||
#include "math/staticrand.h"
|
||||
#include "object/object.h"
|
||||
|
||||
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
|
||||
cmeasure Cmeasures[MAX_CMEASURES];
|
||||
|
||||
int Num_cmeasure_types = 0;
|
||||
int Num_cmeasures = 0;
|
||||
int Cmeasure_inited = 0;
|
||||
int Cmeasures_homing_check = 0;
|
||||
int Countermeasures_enabled = 1; // Debug, set to 0 means no one can fire countermeasures.
|
||||
|
||||
// This will get called at the start of each level.
|
||||
void cmeasure_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( !Cmeasure_inited )
|
||||
Cmeasure_inited = 1;
|
||||
|
||||
// Reset everything between levels
|
||||
Num_cmeasures = 0;
|
||||
|
||||
for (i=0; i<MAX_CMEASURES; i++ ) {
|
||||
Cmeasures[i].subtype = CMEASURE_UNUSED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void cmeasure_render(object * objp)
|
||||
{
|
||||
// JAS TODO: Replace with proper fireball
|
||||
cmeasure *cmp;
|
||||
cmeasure_info *cmip;
|
||||
|
||||
cmp = &Cmeasures[objp->instance];
|
||||
cmip = &Cmeasure_info[cmp->subtype];
|
||||
|
||||
if ( cmp->subtype == CMEASURE_UNUSED ) {
|
||||
Int3(); // Hey, what are we doing in here?
|
||||
return;
|
||||
}
|
||||
|
||||
// float size = -1.0f;
|
||||
// vertex p;
|
||||
// g3_rotate_vertex(&p, &objp->pos );
|
||||
// if ( rand() > RAND_MAX/2 ) {
|
||||
// gr_set_color( 255, 0, 0 );
|
||||
// } else {
|
||||
// gr_set_color( 255, 255, 255 );
|
||||
// }
|
||||
// g3_draw_sphere(&p, 100.0f );
|
||||
|
||||
if ( cmip->model_num > -1 ) {
|
||||
model_clear_instance(cmip->model_num);
|
||||
model_render(cmip->model_num, &objp->orient, &objp->pos, MR_NO_LIGHTING );
|
||||
} else {
|
||||
mprintf(( "Not rendering countermeasure because model_num is negative\n" ));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// JAS TODO: Replace with proper fireball
|
||||
int framenum = -1;
|
||||
float size = -1.0f;
|
||||
vertex p;
|
||||
cmeasure *cmp;
|
||||
|
||||
fireball_data *fd;
|
||||
|
||||
cmp = &Cmeasures[objp->instance];
|
||||
fd = &Fireball_data[FIREBALL_SHIP_EXPLODE1];
|
||||
|
||||
switch (cmp->subtype) {
|
||||
case CMEASURE_UNUSED:
|
||||
Int3(); // Hey, what are we doing in here?
|
||||
break;
|
||||
default:
|
||||
framenum = (int) (fd->num_frames * Cmeasures[objp->instance].lifeleft*4) % fd->num_frames;
|
||||
size = objp->radius;
|
||||
break;
|
||||
}
|
||||
|
||||
Assert(framenum != -1);
|
||||
Assert(size != -1.0f);
|
||||
|
||||
gr_set_bitmap(fd->bitmap_id + framenum);
|
||||
g3_rotate_vertex(&p, &objp->pos );
|
||||
g3_draw_bitmap(&p, 0, size*0.5f, TMAP_FLAG_TEXTURED );
|
||||
*/
|
||||
}
|
||||
|
||||
void cmeasure_delete( object * objp )
|
||||
{
|
||||
int num;
|
||||
|
||||
num = objp->instance;
|
||||
|
||||
// Assert( Cmeasures[num].objnum == OBJ_INDEX(objp));
|
||||
|
||||
Cmeasures[num].subtype = CMEASURE_UNUSED;
|
||||
Num_cmeasures--;
|
||||
Assert( Num_cmeasures >= 0 );
|
||||
}
|
||||
|
||||
// broke cmeasure_move into two functions -- process_pre and process_post (as was done with
|
||||
// all *_move functions). Nothing to do for process_pre
|
||||
|
||||
void cmeasure_process_pre( object *objp, float frame_time)
|
||||
{
|
||||
}
|
||||
|
||||
void cmeasure_process_post(object * objp, float frame_time)
|
||||
{
|
||||
int num;
|
||||
num = objp->instance;
|
||||
|
||||
// Assert( Cmeasures[num].objnum == objnum );
|
||||
cmeasure *cmp = &Cmeasures[num];
|
||||
|
||||
if ( cmp->lifeleft >= 0.0f) {
|
||||
cmp->lifeleft -= frame_time;
|
||||
if ( cmp->lifeleft < 0.0f ) {
|
||||
objp->flags |= OF_SHOULD_BE_DEAD;
|
||||
// demo_do_flag_dead(OBJ_INDEX(objp));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float Skill_level_cmeasure_life_scale[NUM_SKILL_LEVELS] = {3.0f, 2.0f, 1.5f, 1.25f, 1.0f};
|
||||
|
||||
// creates one countermeasure. A ship fires 1 of these per launch. rand_val is used
|
||||
// in multiplayer. If -1, then create a random number. If non-negative, use this
|
||||
// number for static_rand functions
|
||||
int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_val )
|
||||
{
|
||||
int n, objnum, parent_objnum, arand;
|
||||
object * obj;
|
||||
ship *shipp;
|
||||
cmeasure *cmp;
|
||||
cmeasure_info *cmeasurep;
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (!Countermeasures_enabled || !Ai_firing_enabled)
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
Cmeasures_homing_check = 2; // Tell homing code to scan everything for two frames. If only one frame, get sync problems due to objects being created at end of frame!
|
||||
|
||||
parent_objnum = OBJ_INDEX(source_obj);
|
||||
|
||||
Assert( source_obj->type == OBJ_SHIP );
|
||||
Assert( source_obj->instance >= 0 && source_obj->instance < MAX_SHIPS );
|
||||
|
||||
shipp = &Ships[source_obj->instance];
|
||||
|
||||
if ( Num_cmeasures >= MAX_CMEASURES)
|
||||
return -1;
|
||||
|
||||
for (n=0; n<MAX_CMEASURES; n++ )
|
||||
if ( Cmeasures[n].subtype == CMEASURE_UNUSED)
|
||||
break;
|
||||
if ( n == MAX_CMEASURES)
|
||||
return -1;
|
||||
|
||||
nprintf(("Network", "Cmeasure created by %s\n", Ships[source_obj->instance].ship_name));
|
||||
|
||||
cmp = &Cmeasures[n];
|
||||
cmeasurep = &Cmeasure_info[cm_type];
|
||||
|
||||
if ( pos == NULL )
|
||||
pos = &source_obj->pos;
|
||||
|
||||
objnum = obj_create( OBJ_CMEASURE, parent_objnum, n, &source_obj->orient, pos, 1.0f, OF_RENDERS | OF_PHYSICS );
|
||||
|
||||
Assert( objnum >= 0 && objnum < MAX_OBJECTS );
|
||||
|
||||
// Create Debris piece n!
|
||||
if ( rand_val == -1 )
|
||||
arand = myrand(); // use a random number to get lifeleft, and random vector for displacement from ship
|
||||
else
|
||||
arand = rand_val;
|
||||
|
||||
cmp->lifeleft = static_randf(arand) * (cmeasurep->life_max - cmeasurep->life_min) / cmeasurep->life_min;
|
||||
if (source_obj->flags & OF_PLAYER_SHIP){
|
||||
cmp->lifeleft *= Skill_level_cmeasure_life_scale[Game_skill_level];
|
||||
}
|
||||
cmp->lifeleft = cmeasurep->life_min + cmp->lifeleft * (cmeasurep->life_max - cmeasurep->life_min);
|
||||
|
||||
// cmp->objnum = objnum;
|
||||
cmp->team = shipp->team;
|
||||
cmp->subtype = cm_type;
|
||||
cmp->objnum = objnum;
|
||||
cmp->source_objnum = parent_objnum;
|
||||
cmp->source_sig = Objects[objnum].signature;
|
||||
|
||||
cmp->flags = 0;
|
||||
|
||||
nprintf(("Jim", "Frame %i: Launching countermeasure #%i\n", Framecount, Objects[objnum].signature));
|
||||
|
||||
obj = &Objects[objnum];
|
||||
|
||||
Num_cmeasures++;
|
||||
|
||||
vector vel, rand_vec;
|
||||
|
||||
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
|
||||
|
||||
static_randvec(arand+1, &rand_vec);
|
||||
|
||||
vm_vec_scale_add2(&vel, &rand_vec, 2.0f);
|
||||
|
||||
obj->phys_info.vel = vel;
|
||||
|
||||
vm_vec_zero(&obj->phys_info.rotvel);
|
||||
|
||||
// blow out his reverse thrusters. Or drag, same thing.
|
||||
obj->phys_info.rotdamp = 10000.0f;
|
||||
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 );
|
||||
|
||||
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
|
||||
|
||||
// obj->phys_info.flags |= PF_USE_VEL;
|
||||
|
||||
return arand; // need to return this value for multiplayer purposes
|
||||
}
|
||||
|
||||
void cmeasure_select_next(object *objp)
|
||||
{
|
||||
ship *shipp;
|
||||
|
||||
Assert(objp->type == OBJ_SHIP);
|
||||
|
||||
shipp = &Ships[objp->instance];
|
||||
shipp->current_cmeasure++;
|
||||
|
||||
if (shipp->current_cmeasure >= Num_cmeasure_types)
|
||||
shipp->current_cmeasure = 0;
|
||||
|
||||
//snd_play( &Snds[SND_CMEASURE_CYCLE] );
|
||||
|
||||
mprintf(("Countermeasure type set to %i in frame %i\n", shipp->current_cmeasure, Framecount));
|
||||
}
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:57 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 20 4/11/98 5:17p Jim
|
||||
* Reduced countermeasure firing rate from 2 times per second to 3 times
|
||||
* per second.
|
||||
*
|
||||
* 19 4/10/98 11:02p Mike
|
||||
* Make countermeasures less effective against aspect seekers than against
|
||||
* heat seekers.
|
||||
* Make AI ships match bank with each other when attacking a faraway
|
||||
* target.
|
||||
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
|
||||
* target.
|
||||
*
|
||||
* 18 4/01/98 5:34p John
|
||||
* Made only the used POFs page in for a level. Reduced some interp
|
||||
* arrays. Made custom detail level work differently.
|
||||
*
|
||||
* 17 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 16 2/23/98 4:30p Mike
|
||||
* Make homing missiles detonate after they pass up their target. Make
|
||||
* countermeasures less effective.
|
||||
*
|
||||
* 15 2/09/98 8:04p Lawrance
|
||||
* Add objnum to cmeasure struct, correctly set source_objnum
|
||||
*
|
||||
* 14 2/05/98 11:20p Lawrance
|
||||
* save/restore countermeasure data
|
||||
*
|
||||
* 13 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 12 1/16/98 11:43a Mike
|
||||
* Fix countermeasures.
|
||||
*
|
||||
* 11 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 10 8/13/97 4:45p Allender
|
||||
* fixed ship_fire_primary and fire_secondary to not take parameter for
|
||||
* determining whether to count ammo or not. Fixed countermeasure firing
|
||||
* for multiplayer
|
||||
*
|
||||
* 9 8/08/97 4:29p Allender
|
||||
* countermeasure stuff for multiplayer
|
||||
*
|
||||
* 8 7/09/97 12:04a Mike
|
||||
* Error prevention in matrix_interpolate().
|
||||
*
|
||||
* 7 6/24/97 10:04a Allender
|
||||
* major multiplayer improvements. Better sequencing before game.
|
||||
* Dealing with weapon/fireball/counter measure objects between
|
||||
* client/host.
|
||||
*
|
||||
* 6 5/22/97 5:45p Mike
|
||||
* Better countermeasure firing, key off availability, specify in
|
||||
* weapons.tbl
|
||||
*
|
||||
* 5 5/15/97 5:05p Mike
|
||||
* In the midst of changing subsystem targetnig from type-based to
|
||||
* pointer-based.
|
||||
* Also allowed you to view a target while dead.
|
||||
*
|
||||
* 4 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 3 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 2 5/12/97 5:58p Mike
|
||||
* Add countermeasures.
|
||||
*
|
||||
* 1 5/12/97 2:23p Mike
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
#include "globalincs/globals.h"
|
||||
|
||||
struct object;
|
||||
struct vector;
|
||||
|
||||
#define MAX_CMEASURES 64
|
||||
|
||||
// Goes in cmeasure.subtype
|
||||
#define CMEASURE_UNUSED -1
|
||||
|
||||
#define MAX_CMEASURE_TYPES 3
|
||||
|
||||
#define CMEASURE_WAIT 333 // delay in milliseconds between countermeasure firing.
|
||||
|
||||
#define CMF_DUD_HEAT 0x01 // If set, this cmeasure is a dud to heat seekers. Set at create time.
|
||||
#define CMF_DUD_ASPECT 0x02 // If set, this cmeasure is a dud to aspect seekers. Set at create time.
|
||||
|
||||
#define CMF_DUD (CMF_DUD_HEAT | CMF_DUD_ASPECT)
|
||||
|
||||
// Maximum distance at which a countermeasure can be tracked
|
||||
// If this value is too large, missiles will always be tracking countermeasures.
|
||||
#define MAX_CMEASURE_TRACK_DIST 300.0f
|
||||
|
||||
typedef struct cmeasure_info {
|
||||
char cmeasure_name[NAME_LENGTH];
|
||||
float max_speed; // launch speed, relative to ship
|
||||
float fire_wait; // time between launches
|
||||
float life_min, life_max; // lifetime will be in range min..max.
|
||||
int launch_sound; // Sound played when launched.
|
||||
char pof_name[NAME_LENGTH];
|
||||
int model_num; // What this renders as
|
||||
} cmeasure_info;
|
||||
|
||||
typedef struct cmeasure {
|
||||
int flags; // You know, flag type things.
|
||||
int subtype; // See CMEASURE_??? defines
|
||||
int objnum;
|
||||
int source_objnum; // What object this came from
|
||||
int source_sig; // Signature of the source object
|
||||
int team; // Team of the ship where the cmeasure came from
|
||||
float lifeleft; // When 0 or less object dies
|
||||
} cmeasure;
|
||||
|
||||
extern cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
|
||||
extern cmeasure Cmeasures[MAX_CMEASURES];
|
||||
extern int Num_cmeasure_types;
|
||||
extern int Num_cmeasures;
|
||||
extern int Cmeasures_homing_check;
|
||||
|
||||
extern void cmeasure_init();
|
||||
extern void cmeasure_render( object * obj );
|
||||
extern void cmeasure_delete( object * obj );
|
||||
extern void cmeasure_process_pre( object * obj, float frame_time);
|
||||
extern void cmeasure_process_post( object * obj, float frame_time);
|
||||
extern int cmeasure_create( object * source_obj, vector *pos, int cm_type, int rand_val = -1 );
|
||||
extern void cmeasure_select_next(object *objp);
|
||||
|
||||
#endif // _CMEASURE_H
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,529 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-05-03 21:22:19 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.5 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2002/12/02 23:52:02 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.3 2002/12/02 20:47:28 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 6 8/22/99 5:53p Dave
|
||||
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
|
||||
* instead of ship designations for multiplayer players.
|
||||
*
|
||||
* 5 8/19/99 10:59a Dave
|
||||
* Packet loss detection.
|
||||
*
|
||||
* 4 8/01/99 12:39p Dave
|
||||
* Added HUD contrast control key (for nebula).
|
||||
*
|
||||
* 3 11/05/98 4:18p Dave
|
||||
* First run nebula support. Beefed up localization a bit. Removed all
|
||||
* conditional compiles for foreign versions. Modified mission file
|
||||
* format.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 26 6/13/98 5:19p Hoffoss
|
||||
* externalized control config texts.
|
||||
*
|
||||
* 25 5/15/98 8:37p Lawrance
|
||||
* Add 'equalize recharge rates' and 'target ship that sent last
|
||||
* transmission' key bindings
|
||||
*
|
||||
* 24 5/14/98 5:32p Hoffoss
|
||||
* Improved axis binding code some more.
|
||||
*
|
||||
* 23 5/13/98 7:15p Hoffoss
|
||||
* Fixed remaining bugs with axis binding.
|
||||
*
|
||||
* 22 5/13/98 1:17a Hoffoss
|
||||
* Added joystick axes configurability.
|
||||
*
|
||||
* 21 4/30/98 9:43p Hoffoss
|
||||
* Added new actions for free look movement which are default bounded to
|
||||
* the hat.
|
||||
*
|
||||
* 20 4/25/98 1:59p Lawrance
|
||||
* fix merge typo
|
||||
*
|
||||
* 19 4/25/98 1:24p Lawrance
|
||||
* Add time compression keys to key config
|
||||
*
|
||||
* 18 4/25/98 12:43p Allender
|
||||
* added new shortcut key for attack my subsystem
|
||||
*
|
||||
* 17 4/18/98 5:00p Dave
|
||||
* Put in observer zoom key. Made mission sync screen more informative.
|
||||
*
|
||||
* 16 4/10/98 12:47p Allender
|
||||
* changed working on replay popup. Don't reference repair in comm menu.
|
||||
* Added Shift-R for repair me
|
||||
*
|
||||
* 15 4/08/98 11:11a Hoffoss
|
||||
* Fixed some bugs that showed up due to fixing other bugs the other day
|
||||
* with controls.
|
||||
*
|
||||
* 14 3/31/98 4:15p Hoffoss
|
||||
* Disabled the show objectives action.
|
||||
*
|
||||
* 13 3/23/98 12:27p Hoffoss
|
||||
* Whoops, changed order in list but forget to actually change the number.
|
||||
*
|
||||
* 12 3/23/98 11:35a Hoffoss
|
||||
* Fixed #defines that were out of sync.
|
||||
*
|
||||
* 11 3/19/98 5:04p Dave
|
||||
* Put in support for targeted multiplayer text and voice messaging (all,
|
||||
* friendly, hostile, individual).
|
||||
*
|
||||
* 10 3/11/98 5:28p Hoffoss
|
||||
* Added control config debug display info to possibly aid in tracking
|
||||
* down a bug.
|
||||
*
|
||||
* 9 2/28/98 7:02p Lawrance
|
||||
* overhaul on-line help
|
||||
*
|
||||
* 8 2/26/98 12:33a Lawrance
|
||||
* Added back slew mode, lots of changes to external and chase views.
|
||||
*
|
||||
* 7 2/02/98 6:59p Lawrance
|
||||
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
|
||||
* turrets).
|
||||
*
|
||||
* 6 1/30/98 10:40a Lawrance
|
||||
* remove any binding references to hotkey screen
|
||||
*
|
||||
* 5 1/28/98 6:19p Dave
|
||||
* Reduced standalone memory usage ~8 megs. Put in support for handling
|
||||
* multiplayer submenu handling for endgame, etc.
|
||||
*
|
||||
* 4 1/22/98 4:53p Hoffoss
|
||||
* Made training messages/directives display a joystick button in place of
|
||||
* a keypress if there is no keypress bound to the action.
|
||||
*
|
||||
* 3 1/02/98 4:42p Allender
|
||||
* removed unused key bindings from control config list
|
||||
*
|
||||
* 2 12/30/97 4:47p Allender
|
||||
* work with ignore my target command. Added new keyboard hotkey. Made
|
||||
* it work globally
|
||||
*
|
||||
* 1 12/24/97 11:59a Hoffoss
|
||||
*
|
||||
* 41 11/24/97 10:20p Lawrance
|
||||
* Add key 'KEY_N' to target next ship on monitoring view
|
||||
*
|
||||
* 40 11/21/97 5:57p Hoffoss
|
||||
* Fixed bug where timef type controls weren't checking joystick buttons.
|
||||
*
|
||||
* 39 11/20/97 1:08a Lawrance
|
||||
* add support for 'R' key - target closest friendly repair ship
|
||||
*
|
||||
* 38 11/17/97 6:40p Lawrance
|
||||
* Changed 'I' key to toggle of extended target info, moved target closest
|
||||
* locked missile to 'L'
|
||||
*
|
||||
* 37 11/02/97 1:15p Hoffoss
|
||||
* Externed an array I need elsewhere.
|
||||
*
|
||||
* 36 10/28/97 12:12a Lawrance
|
||||
* remove unused keys (Alt-H and Alt-F)
|
||||
*
|
||||
* 35 10/24/97 11:00p Hoffoss
|
||||
* Controls config screen much improved.
|
||||
*
|
||||
* 34 10/22/97 4:50p Hoffoss
|
||||
* Disabled throttle by default.
|
||||
*
|
||||
* 33 10/21/97 7:05p Hoffoss
|
||||
* Overhauled the key/joystick control structure and usage throughout the
|
||||
* entire FreeSpace code. The whole system is very different now.
|
||||
*
|
||||
* 32 10/18/97 7:19p Hoffoss
|
||||
* Added timestamp recording when a key is pressed.
|
||||
*
|
||||
* 31 9/14/97 10:24p Lawrance
|
||||
* add damage screen popup window
|
||||
*
|
||||
* 30 9/10/97 6:02p Hoffoss
|
||||
* Added code to check for key-pressed sexp operator in FreeSpace as part
|
||||
* of training mission stuff.
|
||||
*
|
||||
* 29 9/09/97 9:18a Hoffoss
|
||||
* Added message token translation (phase 1) to FreeSpace for training
|
||||
* missions support.
|
||||
*
|
||||
* 28 8/31/97 6:38p Lawrance
|
||||
* pass in frametime to do_frame loop
|
||||
*
|
||||
* 27 8/29/97 5:02p Sandeep
|
||||
* fixed joystick support for shield config
|
||||
*
|
||||
* 26 8/25/97 12:24a Lawrance
|
||||
* added keys for shield management
|
||||
*
|
||||
* 25 8/22/97 10:44p Sandeep
|
||||
* Added Configurable support for energy management keys, keyboard and
|
||||
* joystick
|
||||
*
|
||||
* 24 8/21/97 5:03p Sandeep
|
||||
* Fixed joystick functions past "Target Closest Hostile Targeting Self"
|
||||
* bug.
|
||||
*
|
||||
* 23 8/20/97 4:22p Sandeep
|
||||
* Add support for joystick mapping to all keyboard configurable commands.
|
||||
* Changed pilot file to allow support for new joystick, incompatible
|
||||
* version 33
|
||||
*
|
||||
* 22 8/07/97 11:27p Lawrance
|
||||
* add support for 4th joystick axis (rudder), add new option to roll ship
|
||||
*
|
||||
* 21 7/08/97 11:37a Lawrance
|
||||
* add joystick support for afterburners
|
||||
*
|
||||
* 20 7/01/97 11:52a Lawrance
|
||||
* add targeting key, allow player to clear all bindings
|
||||
*
|
||||
* 19 6/24/97 12:38a Lawrance
|
||||
* added in some new joystick bindings
|
||||
*
|
||||
* 18 6/17/97 8:57p Lawrance
|
||||
* added target previous hostile/friendly
|
||||
*
|
||||
* 17 6/03/97 1:39a Allender
|
||||
* made macros for joystick button id's
|
||||
*
|
||||
* 16 5/28/97 9:53a Lawrance
|
||||
* move goals keys and squadmate message key from function keys to
|
||||
* assignable keys
|
||||
*
|
||||
* 15 5/26/97 5:49p Lawrance
|
||||
* supporting max range on radar
|
||||
*
|
||||
* 14 5/26/97 3:31p Lawrance
|
||||
* assign key bindings for view modes and view controls
|
||||
*
|
||||
* 13 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 12 4/24/97 2:40p Lawrance
|
||||
* add key for targeting closest ship attacking self
|
||||
*
|
||||
* 11 4/05/97 3:46p Allender
|
||||
* lots 'o messaging stuff. Make shortcut keys for squadmate messaging
|
||||
* work. Make menus a little more dynamic
|
||||
*
|
||||
* 10 4/01/97 7:50p Lawrance
|
||||
* added many new keys, don't allow Shft or Alt as action keys, only allow
|
||||
* Ctrl as an action key
|
||||
*
|
||||
* 9 3/10/97 8:30a Lawrance
|
||||
* changed -/+ 5% throttle keys to 1/3 2/3 throttle keys
|
||||
*
|
||||
* 8 12/18/96 6:09p Lawrance
|
||||
* allowing shift+alt+ctrl modifiers on keyboard bindings
|
||||
*
|
||||
* 7 12/18/96 10:18a Lawrance
|
||||
* integrating joystick axis configuration
|
||||
*
|
||||
* 6 12/17/96 11:10a Lawrance
|
||||
* added targeting of subsystem in reticle
|
||||
*
|
||||
* 5 12/06/96 12:27a Lawrance
|
||||
* adding support for joystick configuration
|
||||
*
|
||||
* 4 12/05/96 2:47p Lawrance
|
||||
* changed how keyboard configuration was done to make code more easily
|
||||
* changeable
|
||||
*
|
||||
* 3 12/03/96 10:11p Lawrance
|
||||
* Integrating keyboard configuration
|
||||
*
|
||||
* 2 12/03/96 3:45p Lawrance
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONTROLS_CONFIG_H
|
||||
#define CONTROLS_CONFIG_H
|
||||
|
||||
#define CONTROL_CONFIG_XSTR 507
|
||||
|
||||
#define JOY_X_AXIS 0
|
||||
#define JOY_Y_AXIS 1
|
||||
#define JOY_Z_AXIS 2
|
||||
#define JOY_RX_AXIS 3
|
||||
#define JOY_RY_AXIS 4
|
||||
#define JOY_RZ_AXIS 5
|
||||
|
||||
#define NUM_JOY_AXIS_ACTIONS 5
|
||||
|
||||
#define JOY_HEADING_AXIS 0
|
||||
#define JOY_PITCH_AXIS 1
|
||||
#define JOY_BANK_AXIS 2
|
||||
#define JOY_ABS_THROTTLE_AXIS 3
|
||||
#define JOY_REL_THROTTLE_AXIS 4
|
||||
|
||||
// --------------------------------------------------
|
||||
// different types of controls that can be assigned
|
||||
// --------------------------------------------------
|
||||
|
||||
#define CC_TYPE_TRIGGER 0
|
||||
#define CC_TYPE_CONTINUOUS 1
|
||||
|
||||
typedef struct config_item {
|
||||
short key_default; // default key bound to action
|
||||
short joy_default; // default joystick button bound to action
|
||||
char tab; // what tab (category) it belongs in
|
||||
char *text; // describes the action in the config screen
|
||||
char type; // manner control should be checked in
|
||||
short key_id; // actual key bound to action
|
||||
short joy_id; // joystick button bound to action
|
||||
int used; // has control been used yet in mission? If so, this is the timestamp
|
||||
} config_item;
|
||||
|
||||
// --------------------------------------------------
|
||||
// Keyboard #defines for the actions
|
||||
// This is the value of the id field in config_item
|
||||
// --------------------------------------------------
|
||||
|
||||
// targeting a ship
|
||||
|
||||
#define TARGET_NEXT 0
|
||||
#define TARGET_PREV 1
|
||||
#define TARGET_NEXT_CLOSEST_HOSTILE 2
|
||||
#define TARGET_PREV_CLOSEST_HOSTILE 3
|
||||
#define TOGGLE_AUTO_TARGETING 4
|
||||
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
|
||||
#define TARGET_PREV_CLOSEST_FRIENDLY 6
|
||||
#define TARGET_SHIP_IN_RETICLE 7
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
|
||||
#define TARGET_LAST_TRANMISSION_SENDER 9
|
||||
#define STOP_TARGETING_SHIP 10
|
||||
|
||||
// targeting a ship's subsystem
|
||||
#define TARGET_SUBOBJECT_IN_RETICLE 11
|
||||
#define TARGET_NEXT_SUBOBJECT 12
|
||||
#define TARGET_PREV_SUBOBJECT 13
|
||||
#define STOP_TARGETING_SUBSYSTEM 14
|
||||
|
||||
// speed matching
|
||||
#define MATCH_TARGET_SPEED 15
|
||||
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
|
||||
|
||||
// weapons
|
||||
#define FIRE_PRIMARY 17
|
||||
#define FIRE_SECONDARY 18
|
||||
#define CYCLE_NEXT_PRIMARY 19
|
||||
#define CYCLE_PREV_PRIMARY 20
|
||||
#define CYCLE_SECONDARY 21
|
||||
#define CYCLE_NUM_MISSLES 22
|
||||
#define LAUNCH_COUNTERMEASURE 23
|
||||
|
||||
// controls
|
||||
#define FORWARD_THRUST 24
|
||||
#define REVERSE_THRUST 25
|
||||
#define BANK_LEFT 26
|
||||
#define BANK_RIGHT 27
|
||||
#define PITCH_FORWARD 28
|
||||
#define PITCH_BACK 29
|
||||
#define YAW_LEFT 30
|
||||
#define YAW_RIGHT 31
|
||||
|
||||
// throttle control
|
||||
#define ZERO_THROTTLE 32
|
||||
#define MAX_THROTTLE 33
|
||||
#define ONE_THIRD_THROTTLE 34
|
||||
#define TWO_THIRDS_THROTTLE 35
|
||||
#define PLUS_5_PERCENT_THROTTLE 36
|
||||
#define MINUS_5_PERCENT_THROTTLE 37
|
||||
|
||||
// squadmate messaging keys
|
||||
#define ATTACK_MESSAGE 38
|
||||
#define DISARM_MESSAGE 39
|
||||
#define DISABLE_MESSAGE 40
|
||||
#define ATTACK_SUBSYSTEM_MESSAGE 41
|
||||
#define CAPTURE_MESSAGE 42
|
||||
#define ENGAGE_MESSAGE 43
|
||||
#define FORM_MESSAGE 44
|
||||
#define IGNORE_MESSAGE 45
|
||||
#define PROTECT_MESSAGE 46
|
||||
#define COVER_MESSAGE 47
|
||||
#define WARP_MESSAGE 48
|
||||
#define REARM_MESSAGE 49
|
||||
|
||||
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
|
||||
|
||||
// Views
|
||||
#define VIEW_CHASE 51
|
||||
#define VIEW_EXTERNAL 52
|
||||
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
|
||||
#define VIEW_SLEW 54
|
||||
#define VIEW_OTHER_SHIP 55
|
||||
#define VIEW_DIST_INCREASE 56
|
||||
#define VIEW_DIST_DECREASE 57
|
||||
#define VIEW_CENTER 58
|
||||
#define PADLOCK_UP 59
|
||||
#define PADLOCK_DOWN 60
|
||||
#define PADLOCK_LEFT 61
|
||||
#define PADLOCK_RIGHT 62
|
||||
|
||||
|
||||
#define RADAR_RANGE_CYCLE 63
|
||||
#define SQUADMSG_MENU 64
|
||||
#define SHOW_GOALS 65
|
||||
#define END_MISSION 66
|
||||
#define TARGET_TARGETS_TARGET 67
|
||||
#define AFTERBURNER 68
|
||||
|
||||
#define INCREASE_WEAPON 69
|
||||
#define DECREASE_WEAPON 70
|
||||
#define INCREASE_SHIELD 71
|
||||
#define DECREASE_SHIELD 72
|
||||
#define INCREASE_ENGINE 73
|
||||
#define DECREASE_ENGINE 74
|
||||
#define ETS_EQUALIZE 75
|
||||
#define SHIELD_EQUALIZE 76
|
||||
#define SHIELD_XFER_TOP 77
|
||||
#define SHIELD_XFER_BOTTOM 78
|
||||
#define SHIELD_XFER_LEFT 79
|
||||
#define SHIELD_XFER_RIGHT 80
|
||||
|
||||
#define XFER_SHIELD 81
|
||||
#define XFER_LASER 82
|
||||
#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
|
||||
|
||||
#define BANK_WHEN_PRESSED 84
|
||||
#define SHOW_NAVMAP 85
|
||||
#define ADD_REMOVE_ESCORT 86
|
||||
#define ESCORT_CLEAR 87
|
||||
#define TARGET_NEXT_ESCORT_SHIP 88
|
||||
|
||||
#define TARGET_CLOSEST_REPAIR_SHIP 89
|
||||
#define TARGET_NEXT_UNINSPECTED_CARGO 90
|
||||
#define TARGET_PREV_UNINSPECTED_CARGO 91
|
||||
#define TARGET_NEWEST_SHIP 92
|
||||
#define TARGET_NEXT_LIVE_TURRET 93
|
||||
#define TARGET_PREV_LIVE_TURRET 94
|
||||
|
||||
#define TARGET_NEXT_BOMB 95
|
||||
#define TARGET_PREV_BOMB 96
|
||||
|
||||
// multiplayer messaging keys
|
||||
#define MULTI_MESSAGE_ALL 97
|
||||
#define MULTI_MESSAGE_FRIENDLY 98
|
||||
#define MULTI_MESSAGE_HOSTILE 99
|
||||
#define MULTI_MESSAGE_TARGET 100
|
||||
|
||||
// multiplayer misc keys
|
||||
#define MULTI_OBSERVER_ZOOM_TO 101
|
||||
|
||||
#define TIME_SPEED_UP 102
|
||||
#define TIME_SLOW_DOWN 103
|
||||
|
||||
#define TOGGLE_HUD_CONTRAST 104
|
||||
|
||||
#define MULTI_TOGGLE_NETINFO 105
|
||||
|
||||
#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
|
||||
#define HUD_TARGETBOX_TOGGLE_WIREFRAME 112
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
//AutoPilot - Kazan
|
||||
#define AUTO_PILOT_TOGGLE 113
|
||||
#define NAV_CYCLE 114
|
||||
|
||||
// this should be the total number of control action defines above (or last define + 1)
|
||||
#define CCFG_MAX 115
|
||||
#else
|
||||
#define CCFG_MAX 113
|
||||
|
||||
#endif
|
||||
|
||||
extern int Failed_key_index;
|
||||
extern int Invert_heading;
|
||||
extern int Invert_pitch;
|
||||
extern int Invert_roll;
|
||||
extern int Invert_thrust;
|
||||
extern int Disable_axis2;
|
||||
extern int Disable_axis3;
|
||||
|
||||
extern int Axis_map_to[];
|
||||
extern int Invert_axis[];
|
||||
extern int Invert_axis_defaults[];
|
||||
|
||||
extern config_item Control_config[]; // stores the keyboard configuration
|
||||
extern char **Scan_code_text;
|
||||
extern char **Joy_button_text;
|
||||
|
||||
// initialize common control config stuff - call at game startup after localization has been initialized
|
||||
void control_config_common_init();
|
||||
|
||||
void control_config_init();
|
||||
void control_config_do_frame(float frametime);
|
||||
void control_config_close();
|
||||
|
||||
void control_config_cancel_exit();
|
||||
|
||||
void control_config_reset_defaults();
|
||||
int translate_key_to_index(char *key);
|
||||
char *translate_key(char *key);
|
||||
char *textify_scancode(int code);
|
||||
float check_control_timef(int id);
|
||||
int check_control(int id, int key = -1);
|
||||
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr);
|
||||
void control_used(int id);
|
||||
void control_config_clear();
|
||||
void clear_key_binding(short key);
|
||||
void control_check_indicate();
|
||||
void control_config_clear_used_status();
|
||||
|
||||
#endif
|
||||
@@ -1,902 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2004-05-03 21:22:19 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 14 11/01/99 3:36p Jefff
|
||||
* had scan code texts for y and z in german swapped
|
||||
*
|
||||
* 13 11/01/99 2:16p Jefff
|
||||
* minor key name change in german
|
||||
*
|
||||
* 12 10/29/99 6:10p Jefff
|
||||
* squashed the y/z german issues once and for all
|
||||
*
|
||||
* 11 10/28/99 11:16p Jefff
|
||||
* Changed some german key names. Made key translations always use the
|
||||
* english table.
|
||||
*
|
||||
* 10 10/28/99 2:05a Jefff
|
||||
* revised some german key names. changed some y/z switch stuff.
|
||||
*
|
||||
* 9 10/25/99 5:39p Jefff
|
||||
* swap init binding for y and z keys in German builds
|
||||
*
|
||||
* 8 9/01/99 2:56p Jefff
|
||||
* a few control key description changes
|
||||
*
|
||||
* 7 8/22/99 5:53p Dave
|
||||
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
|
||||
* instead of ship designations for multiplayer players.
|
||||
*
|
||||
* 6 8/19/99 10:59a Dave
|
||||
* Packet loss detection.
|
||||
*
|
||||
* 5 8/01/99 12:39p Dave
|
||||
* Added HUD contrast control key (for nebula).
|
||||
*
|
||||
* 4 7/23/99 2:57p Andsager
|
||||
* fix translate_key_to_index to work with localization
|
||||
*
|
||||
* 3 11/05/98 4:18p Dave
|
||||
* First run nebula support. Beefed up localization a bit. Removed all
|
||||
* conditional compiles for foreign versions. Modified mission file
|
||||
* format.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 41 6/19/98 3:51p Lawrance
|
||||
* localize control text
|
||||
*
|
||||
* 40 6/17/98 11:05a Lawrance
|
||||
* localize the control config strings
|
||||
*
|
||||
* 39 5/24/98 2:28p Hoffoss
|
||||
* Because we never really care about if the left or the right shift or
|
||||
* alt key was used, but rather than either shift or alt was used, made
|
||||
* both map to the left one. Solves some problems, causes none.
|
||||
*
|
||||
* 38 5/22/98 11:21a Hoffoss
|
||||
* Added bank when pressed back in.
|
||||
*
|
||||
* 37 5/15/98 8:37p Lawrance
|
||||
* Add 'equalize recharge rates' and 'target ship that sent last
|
||||
* transmission' key bindings
|
||||
*
|
||||
* 36 5/13/98 7:15p Hoffoss
|
||||
* Fixed remaining bugs with axis binding.
|
||||
*
|
||||
* 35 5/13/98 1:17a Hoffoss
|
||||
* Added joystick axes configurability.
|
||||
*
|
||||
* 34 5/12/98 11:25a Hoffoss
|
||||
* Disabled bank when pressed action.
|
||||
*
|
||||
* 33 5/09/98 10:48p Lawrance
|
||||
* change text for view bindings
|
||||
*
|
||||
* 32 5/09/98 4:52p Lawrance
|
||||
* Implement padlock view (up/rear/left/right)
|
||||
*
|
||||
* 31 4/30/98 9:43p Hoffoss
|
||||
* Added new actions for free look movement which are default bounded to
|
||||
* the hat.
|
||||
*
|
||||
* 30 4/25/98 1:25p Lawrance
|
||||
* Add time compression keys to key config
|
||||
*
|
||||
* 29 4/25/98 12:43p Allender
|
||||
* added new shortcut key for attack my subsystem
|
||||
*
|
||||
* 28 4/18/98 5:00p Dave
|
||||
* Put in observer zoom key. Made mission sync screen more informative.
|
||||
*
|
||||
* 27 4/17/98 1:24a Lawrance
|
||||
* fix spelling error
|
||||
*
|
||||
* 26 4/15/98 11:06a Lawrance
|
||||
* fix bug with a multi key showing up in demo, remove obsolete bindings
|
||||
* from demo and full version
|
||||
*
|
||||
* 25 4/10/98 12:47p Allender
|
||||
* changed working on replay popup. Don't reference repair in comm menu.
|
||||
* Added Shift-R for repair me
|
||||
*
|
||||
* 24 4/08/98 11:11a Hoffoss
|
||||
* Fixed some bugs that showed up due to fixing other bugs the other day
|
||||
* with controls.
|
||||
*
|
||||
* 23 4/07/98 4:06p Lawrance
|
||||
* Change binding next for bomb targeting
|
||||
*
|
||||
* 22 4/07/98 1:52p Lawrance
|
||||
* fix error in binding text for energy keys
|
||||
*
|
||||
* 21 4/06/98 11:17a Hoffoss
|
||||
* Fixed num lock/pause interplay bug.
|
||||
*
|
||||
* 20 4/01/98 6:46p Lawrance
|
||||
* change text for Alt+J
|
||||
*
|
||||
* 19 3/31/98 4:15p Hoffoss
|
||||
* Disabled the show objectives action.
|
||||
*
|
||||
* 18 3/25/98 2:16p Dave
|
||||
* Select random default image for newly created pilots. Fixed several
|
||||
* multi-pause messaging bugs. Begin work on online help for multiplayer
|
||||
* keys.
|
||||
*
|
||||
* 17 3/19/98 5:04p Dave
|
||||
* Put in support for targeted multiplayer text and voice messaging (all,
|
||||
* friendly, hostile, individual).
|
||||
*
|
||||
* 16 3/17/98 11:25a Hoffoss
|
||||
* Fixed some of the action's names.
|
||||
*
|
||||
* 15 3/17/98 10:48a Hoffoss
|
||||
* Allowed a special hack for "bank while pressed" action to use alt and
|
||||
* shift keys standalone.
|
||||
*
|
||||
* 14 2/28/98 9:47p Lawrance
|
||||
* change some binding text
|
||||
*
|
||||
* 13 2/28/98 7:02p Lawrance
|
||||
* overhaul on-line help
|
||||
*
|
||||
* 12 2/26/98 12:33a Lawrance
|
||||
* Added back slew mode, lots of changes to external and chase views.
|
||||
*
|
||||
* 11 2/23/98 11:25a Sandeep
|
||||
* added default keys
|
||||
*
|
||||
* 10 2/22/98 6:27p Lawrance
|
||||
* External mode takes precedence over chase mode. Fix bug with repair
|
||||
* ships docking in chase mode.
|
||||
*
|
||||
* 9 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 8 2/02/98 6:59p Lawrance
|
||||
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
|
||||
* turrets).
|
||||
*
|
||||
* 7 1/27/98 4:24p Allender
|
||||
* moved hotkey selection to F3 instead of X. Made palette flash
|
||||
* disappear in multiplayer pause menu
|
||||
*
|
||||
* 6 1/22/98 4:53p Hoffoss
|
||||
* Made training messages/directives display a joystick button in place of
|
||||
* a keypress if there is no keypress bound to the action.
|
||||
*
|
||||
* 5 1/22/98 4:15p Hoffoss
|
||||
* Added code to allow popup to tell player he needs to bind a key for the
|
||||
* training mission.
|
||||
*
|
||||
* 4 1/02/98 4:42p Allender
|
||||
* removed unused key bindings from control config list
|
||||
*
|
||||
* 3 12/30/97 4:47p Allender
|
||||
* work with ignore my target command. Added new keyboard hotkey. Made
|
||||
* it work globally
|
||||
*
|
||||
* 2 12/24/97 3:37p Hoffoss
|
||||
* Moved control config stuff to seperate library to Fred can access it as
|
||||
* well.
|
||||
*
|
||||
* 1 12/24/97 3:27p Hoffoss
|
||||
*
|
||||
* 1 12/24/97 11:58a Hoffoss
|
||||
*
|
||||
* 98 12/22/97 2:15p Hoffoss
|
||||
* Fixed bug where joystick axis lines weren't being displayed.
|
||||
*
|
||||
* 97 12/16/97 2:44p Hoffoss
|
||||
* Added clear button to control config screen.
|
||||
*
|
||||
* 96 12/12/97 3:07p Hoffoss
|
||||
* Changed how deleting bindings work. Each control of an action can be
|
||||
* deleted independently or both at once.
|
||||
*
|
||||
* 95 12/07/97 2:36p John
|
||||
* Made warp out be Alt+J instead of J
|
||||
*
|
||||
* 94 12/03/97 4:59p Hoffoss
|
||||
* Added reset sound and change control config sounds around.
|
||||
*
|
||||
* 93 12/03/97 4:16p Hoffoss
|
||||
* Changed sound stuff used in interface screens for interface purposes.
|
||||
*
|
||||
* 92 12/01/97 5:25p Hoffoss
|
||||
* Routed interface sound playing through a special function that will
|
||||
* only allow one instance of the sound to play at a time, avoiding
|
||||
* over-mixing problems.
|
||||
*
|
||||
* 91 12/01/97 3:38p Hoffoss
|
||||
* Changed placement of 'More' indicator.
|
||||
*
|
||||
* 90 11/25/97 3:49p Hoffoss
|
||||
* Changed subhilighting to happen when mouse is over line, rather than
|
||||
* mouse button down but not up again yet.
|
||||
*
|
||||
* 89 11/24/97 10:20p Lawrance
|
||||
* Add key 'KEY_N' to target next ship on monitoring view
|
||||
*
|
||||
* 88 11/24/97 6:15p Lawrance
|
||||
* fix button scroll problem
|
||||
*
|
||||
* 87 11/23/97 6:15p Hoffoss
|
||||
* Make exiting the controls config screen save the pilot, so changes keep
|
||||
* even if programs crashes or something.
|
||||
*
|
||||
* 86 11/21/97 5:57p Hoffoss
|
||||
* Fixed bug where timef type controls weren't checking joystick buttons.
|
||||
*
|
||||
* 85 11/21/97 4:06p Hoffoss
|
||||
* Fixed bug with enabling of axis are reversed.
|
||||
*
|
||||
* 84 11/20/97 4:47p Hoffoss
|
||||
* Swapped throttle and rudder, which apparently were backwards.
|
||||
*
|
||||
* 83 11/20/97 4:00p Lawrance
|
||||
* set z to a valid value
|
||||
*
|
||||
* 82 11/20/97 3:52p Hoffoss
|
||||
* Made "None" appear if no control is bound to function.
|
||||
*
|
||||
* 81 11/20/97 2:10p Hoffoss
|
||||
* Added defaults for joystick buttons 2 and 3.
|
||||
*
|
||||
* 80 11/20/97 1:08a Lawrance
|
||||
* add support for 'R' key - target closest friendly repair ship
|
||||
*
|
||||
* 79 11/19/97 8:33p Hoffoss
|
||||
* New controls config screen baby!
|
||||
*
|
||||
* 78 11/17/97 7:09p Hoffoss
|
||||
* Made chase view control a trigger type.
|
||||
*
|
||||
* 77 11/17/97 6:40p Lawrance
|
||||
* Changed 'I' key to toggle of extended target info, moved target closest
|
||||
* locked missile to 'L'
|
||||
*
|
||||
* 76 11/17/97 3:26p Jasen
|
||||
* Adjusted coordinates for the help button .ani location
|
||||
*
|
||||
* 75 11/16/97 3:51p Hoffoss
|
||||
* Added more button to config screen when scrolling allowed.
|
||||
*
|
||||
* 74 11/16/97 3:20p Hoffoss
|
||||
* Added various suggestions from the Todolist.
|
||||
*
|
||||
* 73 11/14/97 4:33p Mike
|
||||
* Change Debug key to backquote (from F11).
|
||||
* Balance a ton of subsystems in ships.tbl.
|
||||
* Change "Heavy Laser" to "Disruptor".
|
||||
*
|
||||
* 72 11/12/97 2:54p Hoffoss
|
||||
* Made modifiers non-stand alone, added support for red tabs on
|
||||
* conflicts.
|
||||
*
|
||||
* 71 10/30/97 6:01p Hoffoss
|
||||
* Changed screen to utilize the new text color standards.
|
||||
*
|
||||
* 70 10/29/97 7:25p Hoffoss
|
||||
* Added crude support for UI button double click checking.
|
||||
*
|
||||
* 69 10/29/97 6:32p Hoffoss
|
||||
* Changed some interface apperances.
|
||||
*
|
||||
* 68 10/29/97 4:54p Hoffoss
|
||||
* Changed scan_code_text element for Enter to 'Enter' instead of 'a' with
|
||||
* a caret over it (what's that all about?)
|
||||
*
|
||||
* 67 10/28/97 10:42a Hoffoss
|
||||
* Fixed handling of continuous controls that have modifiers to the key.
|
||||
*
|
||||
* 66 10/28/97 10:03a Hoffoss
|
||||
* Fixed bug with continuous type controls not registering if pressed and
|
||||
* released too quickly. Also some other little changes.
|
||||
*
|
||||
* 65 10/28/97 12:12a Lawrance
|
||||
* remove unused keys (Alt-H and Alt-F)
|
||||
*
|
||||
* 64 10/27/97 12:23p Hoffoss
|
||||
* Improved warning system and fixed coloring bug.
|
||||
*
|
||||
* 63 10/27/97 11:39a Hoffoss
|
||||
* Added control conflicts checking.
|
||||
*
|
||||
* 62 10/26/97 3:20p Hoffoss
|
||||
* Added many missing features to control config screen.
|
||||
*
|
||||
* 61 10/25/97 5:41p Hoffoss
|
||||
* More functionality added to the controls config screen.
|
||||
*
|
||||
* 60 10/24/97 11:00p Hoffoss
|
||||
* Controls config screen much improved.
|
||||
*
|
||||
* 59 10/22/97 4:50p Hoffoss
|
||||
* Disabled throttle by default.
|
||||
*
|
||||
* 58 10/22/97 11:00a Hoffoss
|
||||
* Changed VIEW_SLEW and VIEW_EXTERNAL to be continuous rather than
|
||||
* trigger actions.
|
||||
*
|
||||
* 57 10/21/97 7:05p Hoffoss
|
||||
* Overhauled the key/joystick control structure and usage throughout the
|
||||
* entire FreeSpace code. The whole system is very different now.
|
||||
*
|
||||
* 56 10/18/97 7:19p Hoffoss
|
||||
* Added timestamp recording when a key is pressed.
|
||||
*
|
||||
* 55 10/13/97 4:33p Hoffoss
|
||||
* Made training messages go away after time.
|
||||
*
|
||||
* 54 10/13/97 3:24p Hoffoss
|
||||
* Made it so training message text can be arbitrarily bolded.
|
||||
*
|
||||
* 53 9/24/97 4:52p Hoffoss
|
||||
* Changed training message key token handling, and implemented a new
|
||||
* training message system method to test out for a while.
|
||||
*
|
||||
* 52 9/14/97 10:24p Lawrance
|
||||
* add damage screen popup window
|
||||
*
|
||||
* 51 9/10/97 6:02p Hoffoss
|
||||
* Added code to check for key-pressed sexp operator in FreeSpace as part
|
||||
* of training mission stuff.
|
||||
*
|
||||
* 50 9/09/97 3:39p Sandeep
|
||||
* warning level 4 bugs
|
||||
* $NoKeywords: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "io/key.h"
|
||||
#include "io/joy.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#define TARGET_TAB 0
|
||||
#define SHIP_TAB 1
|
||||
#define WEAPON_TAB 2
|
||||
#define COMPUTER_TAB 3
|
||||
|
||||
int Failed_key_index;
|
||||
|
||||
// assume control keys are used as modifiers until we find out
|
||||
int Shift_is_modifier;
|
||||
int Ctrl_is_modifier;
|
||||
int Alt_is_modifier;
|
||||
|
||||
int Axis_enabled[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
|
||||
int Axis_enabled_defaults[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
|
||||
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
// arrays which hold the key mappings. The array index represents a key-independent action.
|
||||
//
|
||||
//XSTR:OFF
|
||||
config_item Control_config[CCFG_MAX + 1] = {
|
||||
// targeting a ship
|
||||
{ KEY_T, -1, TARGET_TAB, "Target Next Ship" },
|
||||
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, "Target Previous Ship" },
|
||||
{ KEY_H, 2, TARGET_TAB, "Target Next Closest Hostile Ship" },
|
||||
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, "Target Previous Closest Hostile Ship" },
|
||||
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, "Toggle Auto Targeting" },
|
||||
{ KEY_F, -1, TARGET_TAB, "Target Next Closest Friendly Ship" },
|
||||
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, "Target Previous Closest Friendly Ship" },
|
||||
{ KEY_Y, 4, TARGET_TAB, "Target Ship in Reticle" },
|
||||
{ KEY_G, -1, TARGET_TAB, "Target Target's Nearest Attacker" },
|
||||
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, "Target Last Ship to Send Transmission" },
|
||||
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, "Turn Off Auto-Targeting" },
|
||||
|
||||
// targeting a ship's subsystem
|
||||
{ KEY_V, -1, TARGET_TAB, "Target Subsystem in Reticle" },
|
||||
{ KEY_S, -1, TARGET_TAB, "Target Next Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, "Target Previous Subsystem" },
|
||||
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, "Turn Off Auto-Targeting of Subsystems" },
|
||||
|
||||
// matching speed
|
||||
{ KEY_M, -1, COMPUTER_TAB, "Match Target Speed" },
|
||||
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, "Toggle Auto Speed Matching" },
|
||||
|
||||
// weapons
|
||||
{ KEY_LCTRL, 0, WEAPON_TAB, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_SPACEBAR, 1, WEAPON_TAB, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PERIOD, -1, WEAPON_TAB, "Cycle Forward Primary Weapon" },
|
||||
{ KEY_COMMA, -1, WEAPON_TAB, "Cycle Backward Primary Weapon" },
|
||||
{ KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Bank" },
|
||||
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Firing Rate" },
|
||||
{ KEY_X, 3, WEAPON_TAB, "Launch Countermeasure" },
|
||||
|
||||
// controls
|
||||
{ KEY_A, -1, SHIP_TAB, "Forward Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_Z, -1, SHIP_TAB, "Reverse Thrust", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD7, -1, SHIP_TAB, "Bank Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD9, -1, SHIP_TAB, "Bank Right", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD8, -1, SHIP_TAB, "Pitch Forward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD2, -1, SHIP_TAB, "Pitch Backward", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD4, -1, SHIP_TAB, "Turn Left", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD6, -1, SHIP_TAB, "Turn Right", CC_TYPE_CONTINUOUS },
|
||||
|
||||
// throttle controls
|
||||
{ KEY_BACKSP, -1, SHIP_TAB, "Set Throttle to Zero" },
|
||||
{ KEY_SLASH, -1, SHIP_TAB, "Set Throttle to Max" },
|
||||
{ KEY_LBRACKET, -1, SHIP_TAB, "Set Throttle to One-Third" },
|
||||
{ KEY_RBRACKET, -1, SHIP_TAB, "Set Throttle to Two-Thirds" },
|
||||
{ KEY_EQUAL, -1, SHIP_TAB, "Increase Throttle 5 Percent" },
|
||||
{ KEY_MINUS, -1, SHIP_TAB, "Decrease Throttle 5 Percent" },
|
||||
|
||||
// squadmate messaging
|
||||
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, "Attack My Target" },
|
||||
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, "Disarm My Target" },
|
||||
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, "Disable My Target" },
|
||||
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, "Attack my Subsystem" },
|
||||
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, "Capture My Target" },
|
||||
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Engage Enemy" },
|
||||
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, "Form on my Wing" },
|
||||
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, "Ignore my Target" },
|
||||
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, "Protect my Target" },
|
||||
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, "Cover me" },
|
||||
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, "Return to base" },
|
||||
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, "Rearm me" },
|
||||
|
||||
{ KEY_R, 6, TARGET_TAB, "Target Closest Attacking Ship" },
|
||||
|
||||
// Views
|
||||
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, "Chase View" },
|
||||
{ KEY_PADPERIOD, -1, COMPUTER_TAB, "External View"},
|
||||
{ KEY_PADENTER, -1, COMPUTER_TAB, "Toggle External Camera Lock"},
|
||||
{ KEY_PAD0, -1, COMPUTER_TAB, "Free Look View", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, "Current Target View" },
|
||||
{ KEY_PADPLUS, -1, COMPUTER_TAB, "Increase View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PADMINUS, -1, COMPUTER_TAB, "Decrease View Distance", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_PAD5, -1, COMPUTER_TAB, "Center View", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 33, COMPUTER_TAB, "View Up", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 32, COMPUTER_TAB, "View Rear", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 34, COMPUTER_TAB, "View Left", CC_TYPE_CONTINUOUS },
|
||||
{ -1, 35, COMPUTER_TAB, "View Right", CC_TYPE_CONTINUOUS },
|
||||
|
||||
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, "Cycle Radar Range" },
|
||||
{ KEY_C, -1, COMPUTER_TAB, "Communications Menu" },
|
||||
{ -1, -1, -1, "Show Objectives" },
|
||||
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, "Enter Subspace (End Mission)" },
|
||||
{ KEY_J, -1, TARGET_TAB, "Target Target's Target" },
|
||||
{ KEY_TAB, 5, SHIP_TAB, "Afterburner", CC_TYPE_CONTINUOUS },
|
||||
|
||||
{ KEY_INSERT, -1, COMPUTER_TAB, "Increase Weapon Energy" },
|
||||
{ KEY_DELETE, -1, COMPUTER_TAB, "Decrease Weapon Energy" },
|
||||
{ KEY_HOME, -1, COMPUTER_TAB, "Increase Shield Energy" },
|
||||
{ KEY_END, -1, COMPUTER_TAB, "Decrease Shield Energy" },
|
||||
{ KEY_PAGEUP, -1, COMPUTER_TAB, "Increase Engine Energy" },
|
||||
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, "Decrease Engine Energy" },
|
||||
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, "Equalize Energy Settings" },
|
||||
|
||||
{ KEY_Q, 7, COMPUTER_TAB, "Equalize Shield" },
|
||||
{ KEY_UP, -1, COMPUTER_TAB, "Augment Forward Shield" },
|
||||
{ KEY_DOWN, -1, COMPUTER_TAB, "Augment Rear Shield" },
|
||||
{ KEY_LEFT, -1, COMPUTER_TAB, "Augment Left Shield" },
|
||||
{ KEY_RIGHT, -1, COMPUTER_TAB, "Augment Right Shield" },
|
||||
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Laser->Shield" },
|
||||
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Shield->Laser" },
|
||||
{ -1, -1, -1, "Show Damage Popup Window" },
|
||||
|
||||
{ -1, -1, SHIP_TAB, "Bank When Pressed", CC_TYPE_CONTINUOUS },
|
||||
{ -1, -1, -1, "Show NavMap" },
|
||||
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, "Add or Remove Escort" },
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Clear Escort List" },
|
||||
{ KEY_E, -1, TARGET_TAB, "Target Next Escort Ship" },
|
||||
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, "Target Closest Repair Ship" },
|
||||
|
||||
{ KEY_U, -1, TARGET_TAB, "Target Next Uninspected Cargo" },
|
||||
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, "Target Previous Uninspected Cargo" },
|
||||
{ KEY_N, -1, TARGET_TAB, "Target Newest Ship In Area" },
|
||||
{ KEY_K, -1, TARGET_TAB, "Target Next Live Turret" },
|
||||
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, "Target Previous Live Turret" },
|
||||
|
||||
{ KEY_B, -1, TARGET_TAB, "Target Next Hostile Bomb or Bomber" },
|
||||
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, "Target Previous Hostile Bomb or Bomber" },
|
||||
|
||||
// multiplayer messaging keys
|
||||
{ KEY_1, -1, COMPUTER_TAB, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_2, -1, COMPUTER_TAB, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_3, -1, COMPUTER_TAB, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_4, -1, COMPUTER_TAB, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
|
||||
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, "(Multiplayer) Observer zoom to target"},
|
||||
|
||||
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, "Increase time compression" },
|
||||
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, "Decrease time compression" },
|
||||
|
||||
{ KEY_L, -1, COMPUTER_TAB, "Toggle high HUD contrast" },
|
||||
|
||||
{ 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},
|
||||
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, "Toggle HUD Wireframe Targetbox"},
|
||||
|
||||
#if defined(ENABLE_AUTO_PILOT)
|
||||
// Auto Navigation Systen
|
||||
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, "Toggle Auto Pilot"},
|
||||
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, "Cycle Nav Points"},
|
||||
#endif
|
||||
|
||||
{ -1, -1, -1, "" }
|
||||
};
|
||||
|
||||
char *Scan_code_text_german[] = {
|
||||
"", "Esc", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "0", "Akzent '", "\xE1", "R\x81""cktaste", "Tab",
|
||||
"Q", "W", "E", "R", "T", "Z", "U", "I",
|
||||
"O", "P", "\x9A", "+", "Eingabe", "Strg Links", "A", "S",
|
||||
|
||||
"D", "F", "G", "H", "J", "K", "L", "\x99",
|
||||
"\xAE", "`", "Shift", "#", "Y", "X", "C", "V",
|
||||
"B", "N", "M", ",", ".", "-", "Shift", "Num *",
|
||||
"Alt", "Leertaste", "Hochstell", "F1", "F2", "F3", "F4", "F5",
|
||||
|
||||
"F6", "F7", "F8", "F9", "F10", "Pause", "Rollen", "Num 7",
|
||||
"Num 8", "Num 9", "Num -", "Num 4", "Num 5", "Num 6", "Num +", "Num 1",
|
||||
"Num 2", "Num 3", "Num 0", "Num ,", "", "", "", "F11",
|
||||
"F12", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "Num Eingabe", "Strg Rechts", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "Num /", "", "Druck",
|
||||
"Alt", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "Num Lock", "", "Pos 1",
|
||||
"Pfeil Hoch", "Bild Hoch", "", "Pfeil Links", "", "Pfeil Rechts", "", "Ende",
|
||||
"Pfeil Runter", "Bild Runter", "Einfg", "Entf", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
};
|
||||
|
||||
char *Joy_button_text_german[] = {
|
||||
"Knopf 1", "Knopf 2", "Knopf 3", "Knopf 4", "Knopf 5", "Knopf 6",
|
||||
"Knopf 7", "Knopf 8", "Knopf 9", "Knopf 10", "Knopf 11", "Knopf 12",
|
||||
"Knopf 13", "Knopf 14", "Knopf 15", "Knopf 16", "Knopf 17", "Knopf 18",
|
||||
"Knopf 19", "Knopf 20", "Knopf 21", "Knopf 22", "Knopf 23", "Knopf 24",
|
||||
"Knopf 25", "Knopf 26", "Knopf 27", "Knopf 28", "Knopf 29", "Knopf 30",
|
||||
"Knopf 31", "Knopf 32", "Hut Hinten", "Hut Vorne", "Hut Links", "Hut Rechts"
|
||||
};
|
||||
|
||||
char *Scan_code_text_french[] = {
|
||||
"", "\x90""chap", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "0", "-", "=", "Fl\x82""che Ret.", "Tab",
|
||||
"Q", "W", "E", "R", "T", "Y", "U", "I",
|
||||
"O", "P", "[", "]", "Entr\x82""e", "Ctrl Gauche", "A", "S",
|
||||
|
||||
"D", "F", "G", "H", "J", "K", "L", ";",
|
||||
"'", "`", "Maj.", "\\", "Z", "X", "C", "V",
|
||||
"B", "N", "M", ",", ".", "/", "Maj.", "Pav\x82 *",
|
||||
"Alt", "Espace", "Verr. Maj.", "F1", "F2", "F3", "F4", "F5",
|
||||
|
||||
"F6", "F7", "F8", "F9", "F10", "Pause", "Arret defil", "Pav\x82 7",
|
||||
"Pav\x82 8", "Pav\x82 9", "Pav\x82 -", "Pav\x82 4", "Pav\x82 5", "Pav\x82 6", "Pav\x82 +", "Pav\x82 1",
|
||||
"Pav\x82 2", "Pav\x82 3", "Pav\x82 0", "Pav\x82 .", "", "", "", "F11",
|
||||
"F12", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "Pav\x82 Entr", "Ctrl Droite", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "Pav\x82 /", "", "Impr \x82""cran",
|
||||
"Alt", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "Verr num", "", "Orig.",
|
||||
"Fl\x82""che Haut", "Page Haut", "", "Fl\x82""che Gauche", "", "Fl\x82""che Droite", "", "Fin",
|
||||
"Fl\x82""che Bas", "Page Bas", "Inser", "Suppr", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
};
|
||||
|
||||
char *Joy_button_text_french[] = {
|
||||
"Bouton 1", "Bouton 2", "Bouton 3", "Bouton 4", "Bouton 5", "Bouton 6",
|
||||
"Bouton 7", "Bouton 8", "Bouton 9", "Bouton 10", "Bouton 11", "Bouton 12",
|
||||
"Bouton 13", "Bouton 14", "Bouton 15", "Bouton 16", "Bouton 17", "Bouton 18",
|
||||
"Bouton 19", "Bouton 20", "Bouton 21", "Bouton 22", "Bouton 23", "Bouton 24",
|
||||
"Bouton 25", "Bouton 26", "Bouton 27", "Bouton 28", "Bouton 29", "Bouton 30",
|
||||
"Bouton 31", "Bouton 32", "Chapeau Arrière", "Chapeau Avant", "Chapeau Gauche", "Chapeau Droite"
|
||||
};
|
||||
|
||||
// This is the text that is displayed on the screen for the keys a player selects
|
||||
char *Scan_code_text_english[] = {
|
||||
"", "Esc", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "0", "-", "=", "Backspace", "Tab",
|
||||
"Q", "W", "E", "R", "T", "Y", "U", "I",
|
||||
"O", "P", "[", "]", "Enter", "Left Ctrl", "A", "S",
|
||||
|
||||
"D", "F", "G", "H", "J", "K", "L", ";",
|
||||
"'", "`", "Shift", "\\", "Z", "X", "C", "V",
|
||||
"B", "N", "M", ",", ".", "/", "Shift", "Pad *",
|
||||
"Alt", "Spacebar", "Caps Lock", "F1", "F2", "F3", "F4", "F5",
|
||||
|
||||
"F6", "F7", "F8", "F9", "F10", "Pause", "Scroll Lock", "Pad 7",
|
||||
"Pad 8", "Pad 9", "Pad -", "Pad 4", "Pad 5", "Pad 6", "Pad +", "Pad 1",
|
||||
"Pad 2", "Pad 3", "Pad 0", "Pad .", "", "", "", "F11",
|
||||
"F12", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "Pad Enter", "Right Ctrl", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "Pad /", "", "Print Scrn",
|
||||
"Alt", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "Num Lock", "", "Home",
|
||||
"Up Arrow", "Page Up", "", "Left Arrow", "", "Right Arrow", "", "End",
|
||||
"Down Arrow", "Page Down", "Insert", "Delete", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
};
|
||||
|
||||
char *Joy_button_text_english[] = {
|
||||
"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6",
|
||||
"Button 7", "Button 8", "Button 9", "Button 10", "Button 11", "Button 12",
|
||||
"Button 13", "Button 14", "Button 15", "Button 16", "Button 17", "Button 18",
|
||||
"Button 19", "Button 20", "Button 21", "Button 22", "Button 23", "Button 24",
|
||||
"Button 25", "Button 26", "Button 27", "Button 28", "Button 29", "Button 30",
|
||||
"Button 31", "Button 32", "Hat Back", "Hat Forward", "Hat Left", "Hat Right"
|
||||
};
|
||||
|
||||
char **Scan_code_text = Scan_code_text_english;
|
||||
char **Joy_button_text = Joy_button_text_english;
|
||||
|
||||
void set_modifier_status()
|
||||
{
|
||||
int i;
|
||||
|
||||
Alt_is_modifier = 0;
|
||||
Shift_is_modifier = 0;
|
||||
Ctrl_is_modifier = 0;
|
||||
|
||||
for (i=0; i<CCFG_MAX; i++) {
|
||||
if (Control_config[i].key_id < 0)
|
||||
continue;
|
||||
|
||||
if (Control_config[i].key_id & KEY_ALTED)
|
||||
Alt_is_modifier = 1;
|
||||
|
||||
if (Control_config[i].key_id & KEY_SHIFTED)
|
||||
Shift_is_modifier = 1;
|
||||
|
||||
if (Control_config[i].key_id & KEY_CTRLED) {
|
||||
Assert(0); // get Alan
|
||||
Ctrl_is_modifier = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int translate_key_to_index(char *key)
|
||||
{
|
||||
int i, index = -1, alt = 0, shift = 0, max_scan_codes;
|
||||
|
||||
if (Lcl_gr) {
|
||||
max_scan_codes = sizeof(Scan_code_text_german) / sizeof(char *);
|
||||
} else if (Lcl_fr) {
|
||||
max_scan_codes = sizeof(Scan_code_text_french) / sizeof(char *);
|
||||
} else {
|
||||
max_scan_codes = sizeof(Scan_code_text_english) / sizeof(char *);
|
||||
}
|
||||
|
||||
// look for modifiers
|
||||
Assert(key);
|
||||
if (!strnicmp(key, "Alt", 3)) {
|
||||
alt = 1;
|
||||
key += 3;
|
||||
if (*key)
|
||||
key++;
|
||||
}
|
||||
|
||||
char *translated_shift;
|
||||
|
||||
if(Lcl_gr){
|
||||
translated_shift = "Shift";
|
||||
} else if(Lcl_fr){
|
||||
translated_shift = "Maj.";
|
||||
} else {
|
||||
translated_shift = "Shift";
|
||||
}
|
||||
|
||||
if (!strnicmp(key, translated_shift, 5)) {
|
||||
shift = 1;
|
||||
key += 5;
|
||||
if (*key)
|
||||
key++;
|
||||
}
|
||||
|
||||
// look up index for default key
|
||||
if (*key) {
|
||||
for (i=0; i<max_scan_codes; i++)
|
||||
if (!stricmp(key, Scan_code_text_english[i])) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == max_scan_codes)
|
||||
return -1;
|
||||
|
||||
if (shift)
|
||||
index |= KEY_SHIFTED;
|
||||
if (alt)
|
||||
index |= KEY_ALTED;
|
||||
|
||||
// convert scancode to Control_config index
|
||||
for (i=0; i<CCFG_MAX; i++) {
|
||||
if (Control_config[i].key_default == index) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == CCFG_MAX)
|
||||
return -1;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Given the system default key 'key', return the current key that is bound to the function
|
||||
// Both are 'key' and the return value are descriptive strings that can be displayed
|
||||
// directly to the user. If 'key' isn't a real key or not normally bound to anything,
|
||||
// or there is no key current bound to the function, NULL is returned.
|
||||
char *translate_key(char *key)
|
||||
{
|
||||
int index = -1, code = -1;
|
||||
|
||||
index = translate_key_to_index(key);
|
||||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
code = Control_config[index].key_id;
|
||||
Failed_key_index = index;
|
||||
if (code < 0) {
|
||||
code = Control_config[index].joy_id;
|
||||
if (code >= 0)
|
||||
return Joy_button_text[code];
|
||||
}
|
||||
|
||||
return textify_scancode(code);
|
||||
}
|
||||
|
||||
char *textify_scancode(int code)
|
||||
{
|
||||
static char text[40];
|
||||
|
||||
if (code < 0)
|
||||
return "None";
|
||||
|
||||
*text = 0;
|
||||
if (code & KEY_ALTED) {
|
||||
if(Lcl_gr){
|
||||
strcat(text, "Alt-");
|
||||
} else if(Lcl_fr){
|
||||
strcat(text, "Alt-");
|
||||
} else {
|
||||
strcat(text, "Alt-");
|
||||
}
|
||||
}
|
||||
|
||||
if (code & KEY_SHIFTED) {
|
||||
if(Lcl_gr){
|
||||
strcat(text, "Shift-");
|
||||
} else if(Lcl_fr){
|
||||
strcat(text, "Maj.-");
|
||||
} else {
|
||||
strcat(text, "Shift-");
|
||||
}
|
||||
}
|
||||
|
||||
strcat(text, Scan_code_text[code & KEY_MASK]);
|
||||
return text;
|
||||
}
|
||||
//XSTR:ON
|
||||
|
||||
// initialize common control config stuff - call at game startup after localization has been initialized
|
||||
void control_config_common_init()
|
||||
{
|
||||
if(Lcl_gr){
|
||||
Scan_code_text = Scan_code_text_german;
|
||||
Joy_button_text = Joy_button_text_german;
|
||||
|
||||
// swap init bindings for y and z keys
|
||||
Control_config[TARGET_SHIP_IN_RETICLE].key_default = KEY_Z;
|
||||
Control_config[TARGET_LAST_TRANMISSION_SENDER].key_default = KEY_ALTED | KEY_Z;
|
||||
Control_config[REVERSE_THRUST].key_default = KEY_Y;
|
||||
Control_config[DISARM_MESSAGE].key_default = KEY_SHIFTED | KEY_Y;
|
||||
} else if(Lcl_fr){
|
||||
Scan_code_text = Scan_code_text_french;
|
||||
Joy_button_text = Joy_button_text_french;
|
||||
} else {
|
||||
Scan_code_text = Scan_code_text_english;
|
||||
Joy_button_text = Joy_button_text_english;
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Applet for crypting strings.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/23/98 6:21p Dave
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "globalincs/crypt.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
char *crypt_string;
|
||||
|
||||
if ( argc == 1 ) {
|
||||
printf("Usage: cryptstring <string1> <string2> ...\n");
|
||||
printf("Output will be <crypt1> <crypt2>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for ( i = 1; i < argc; i++ ) {
|
||||
char *s;
|
||||
|
||||
s = argv[i];
|
||||
// if the length of the string is greater than the number of crypted symbols we
|
||||
// return, then pass only the maximum length
|
||||
if ( strlen(s) > CRYPT_STRING_LENGTH )
|
||||
s += (strlen(s) - CRYPT_STRING_LENGTH);
|
||||
|
||||
crypt_string = jcrypt(s);
|
||||
printf("%s\n", crypt_string);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *jcrypt (char *plainstring)
|
||||
{
|
||||
int i,t,len;
|
||||
static char cryptstring[CRYPT_STRING_LENGTH + 1];
|
||||
|
||||
len=strlen (plainstring);
|
||||
if (len > CRYPT_STRING_LENGTH)
|
||||
len = CRYPT_STRING_LENGTH;
|
||||
|
||||
for (i = 0;i < len; i++) {
|
||||
cryptstring[i]=0;
|
||||
|
||||
for (t = 0; t < len; t++) {
|
||||
cryptstring[i]^=(plainstring[t] ^ plainstring[i%(t+1)]);
|
||||
cryptstring[i]%=90;
|
||||
cryptstring[i]+=33;
|
||||
}
|
||||
}
|
||||
|
||||
cryptstring[i]=0;
|
||||
return ((char *)cryptstring);
|
||||
}
|
||||
@@ -1,853 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-04-26 13:11:11 $
|
||||
* $Author: taylor $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2004-04-26 13:11:11 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.10 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/20 04:29:53 bobboau
|
||||
* pluged memory leaks,
|
||||
* 3D HTL lasers (they work perfictly)
|
||||
* and posably fixed Turnsky's shinemap bug
|
||||
*
|
||||
* Revision 2.8 2004/01/24 15:52:25 randomtiger
|
||||
* I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
|
||||
* In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
|
||||
*
|
||||
* Revision 2.7 2003/08/21 20:54:38 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.6 2003/07/15 02:58:08 phreak
|
||||
* the cutscene section in the techroom does not append *.mve onto a filename
|
||||
*
|
||||
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.4 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
|
||||
* Tiny change to DX branch to keep movie code optional (default off)
|
||||
*
|
||||
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
|
||||
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
|
||||
* The movie and dx8show files have been cleaned up big time.
|
||||
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
|
||||
* Aside from that a few changes to help the movie code work properly.
|
||||
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
|
||||
* Im going to leave this as a bug for now, serves you right for buying voodoo!
|
||||
*
|
||||
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.3 2002/08/18 19:48:29 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
* 15 6/16/00 3:15p Jefff
|
||||
* sim of the year dvd version changes, a few german soty localization
|
||||
* fixes
|
||||
*
|
||||
* 14 10/13/99 10:20a Jefff
|
||||
* fixed bug where intro cutscene showed 2x after getting bad ending
|
||||
*
|
||||
* 13 10/06/99 10:30a Jefff
|
||||
* OEM updates
|
||||
*
|
||||
* 12 9/30/99 6:01p Jefff
|
||||
* OEM updates
|
||||
*
|
||||
* 11 9/07/99 1:10p Mikek
|
||||
* Make movie check not hang in ~RELEASE_REAL build.
|
||||
*
|
||||
* 10 9/06/99 6:38p Dave
|
||||
* Improved CD detection code.
|
||||
*
|
||||
* 9 9/06/99 1:16a Dave
|
||||
* Make sure the user sees the intro movie.
|
||||
*
|
||||
* 8 9/03/99 1:31a Dave
|
||||
* CD checking by act. Added support to play 2 cutscenes in a row
|
||||
* seamlessly. Fixed super low level cfile bug related to files in the
|
||||
* root directory of a CD. Added cheat code to set campaign mission # in
|
||||
* main hall.
|
||||
*
|
||||
* 7 7/19/99 2:13p Dave
|
||||
* Added some new strings for Heiko.
|
||||
*
|
||||
* 6 6/01/99 3:52p Dave
|
||||
* View footage screen. Fixed xstrings to not display the & symbol. Popup,
|
||||
* dead popup, pxo find player popup, pxo private room popup.
|
||||
*
|
||||
* 5 1/30/99 5:08p Dave
|
||||
* More new hi-res stuff.Support for nice D3D textures.
|
||||
*
|
||||
* 4 10/23/98 3:51p Dave
|
||||
* Full support for tstrings.tbl and foreign languages. All that remains
|
||||
* is to make it active in Fred.
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 18 6/09/98 10:31a Hoffoss
|
||||
* Created index numbers for all xstr() references. Any new xstr() stuff
|
||||
* added from here on out should be added to the end if the list. The
|
||||
* current list count can be found in FreeSpace.cpp (search for
|
||||
* XSTR_SIZE).
|
||||
*
|
||||
* 17 6/01/98 11:43a John
|
||||
* JAS & MK: Classified all strings for localization.
|
||||
*
|
||||
* 16 5/24/98 9:01p Lawrance
|
||||
* Add commit sounds when accept is pressed
|
||||
*
|
||||
* 15 5/21/98 8:05p Allender
|
||||
* fix possible bug with number of cutscenes shown in the list
|
||||
*
|
||||
* 14 5/21/98 12:35a Lawrance
|
||||
* Tweak how CD is checked for
|
||||
*
|
||||
* 13 5/20/98 1:34p Hoffoss
|
||||
* Added cutscene description rendering.
|
||||
*
|
||||
* 12 5/19/98 12:19p Mike
|
||||
* Cheat codes!
|
||||
*
|
||||
* 11 5/12/98 4:17p Hoffoss
|
||||
* Make ctrl-arrows (up/down) switch between tech room screens.
|
||||
*
|
||||
* 10 5/11/98 8:04p Hoffoss
|
||||
* Fixed minor bugs.
|
||||
*
|
||||
* 9 5/10/98 10:05p Allender
|
||||
* only show cutscenes which have been seen before. Made Fred able to
|
||||
* write missions anywhere, defaulting to player misison folder, not data
|
||||
* mission folder. Fix FreeSpace code to properly read missions from
|
||||
* correct locations
|
||||
*
|
||||
* 8 5/08/98 5:30p Lawrance
|
||||
* add CD checks for movie playing
|
||||
*
|
||||
* 7 5/08/98 4:07p Allender
|
||||
* more cutscene stuff
|
||||
*
|
||||
* 6 5/07/98 2:33p Hoffoss
|
||||
* Removed help and options buttons.
|
||||
*
|
||||
* 5 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 4 4/23/98 8:27p Allender
|
||||
* basic support for cutscene playback. Into movie code in place. Tech
|
||||
* room can view cutscenes stored in CDROM_dir variable
|
||||
*
|
||||
* 3 4/21/98 7:07p Hoffoss
|
||||
* Fixed problem where when switching screens flashes old tab hilight once
|
||||
* before switching to new state.
|
||||
*
|
||||
* 2 4/17/98 6:33p Hoffoss
|
||||
* Made changes to the tech room group of screens. Cutscenes screen is
|
||||
* now in a new file.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "io/key.h"
|
||||
#include "movie.h"
|
||||
#include "popup/popup.h"
|
||||
#include "menuui/mainhallmenu.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
|
||||
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage",
|
||||
"2_ViewFootage"
|
||||
};
|
||||
char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
|
||||
"ViewFootage-m",
|
||||
"2_ViewFootage-m"
|
||||
};
|
||||
|
||||
int Num_cutscenes;
|
||||
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.
|
||||
void cutsceen_close(){
|
||||
for(int i = 0; i<MAX_CUTSCENES; i++)
|
||||
if(Cutscenes[i].description)free(Cutscenes[i].description);
|
||||
}
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
void cutscene_init()
|
||||
{
|
||||
atexit(cutsceen_close);
|
||||
char buf[MULTITEXT_LENGTH];
|
||||
int rval;
|
||||
|
||||
if ((rval = setjmp(parse_abort)) != 0) {
|
||||
Error(LOCATION, "Error parsing 'rank.tbl'\r\nError code = %i.\r\n", rval);
|
||||
}
|
||||
|
||||
// open localization
|
||||
lcl_ext_open();
|
||||
|
||||
read_file_text("cutscenes.tbl");
|
||||
reset_parse();
|
||||
|
||||
// parse in all the rank names
|
||||
Num_cutscenes = 0;
|
||||
skip_to_string("#Cutscenes");
|
||||
ignore_white_space();
|
||||
while ( required_string_either("#End", "$Filename:") ) {
|
||||
Assert ( Num_cutscenes < MAX_CUTSCENES );
|
||||
required_string("$Filename:");
|
||||
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, NULL );
|
||||
required_string("$Name:");
|
||||
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NULL );
|
||||
required_string("$Description:");
|
||||
stuff_string(buf, F_MULTITEXT, NULL);
|
||||
drop_white_space(buf);
|
||||
compact_multitext_string(buf);
|
||||
Cutscenes[Num_cutscenes].description = strdup(buf);
|
||||
required_string("$cd:");
|
||||
stuff_int( &Cutscenes[Num_cutscenes].cd );
|
||||
|
||||
Num_cutscenes++;
|
||||
}
|
||||
|
||||
required_string("#End");
|
||||
|
||||
Cutscenes_viewable = INTRO_CUTSCENE_FLAG;
|
||||
|
||||
// close localization
|
||||
lcl_ext_close();
|
||||
}
|
||||
|
||||
// function to return 0 based index of which CD a particular movie is on
|
||||
// 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
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
if ( !stricmp(Cutscenes[i].filename, filename) ) {
|
||||
return (Cutscenes[i].cd - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
#endif // defined(OEM_BUILD)
|
||||
#else // !WIN32
|
||||
return -1;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
// marks a cutscene as viewable
|
||||
void cutscene_mark_viewable(char *filename)
|
||||
{
|
||||
int i;
|
||||
char cut_file[MAX_FILENAME_LEN];
|
||||
char file[MAX_FILENAME_LEN];
|
||||
|
||||
Assert(filename);
|
||||
|
||||
// strip off extension
|
||||
strcpy( file, filename );
|
||||
char *p = strchr( file, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
// change to lower case
|
||||
strlwr(file);
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
// change the cutscene file name to lower case
|
||||
strcpy(cut_file, Cutscenes[i].filename);
|
||||
strlwr(cut_file);
|
||||
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
if ( strstr(cut_file, file) != NULL ) {
|
||||
Cutscenes_viewable |= (1<<i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define NUM_BUTTONS 8
|
||||
|
||||
#define TECH_DATABASE_BUTTON 0
|
||||
#define SIMULATOR_BUTTON 1
|
||||
#define CUTSCENES_BUTTON 2
|
||||
#define CREDITS_BUTTON 3
|
||||
|
||||
#define SCROLL_UP_BUTTON 4
|
||||
#define SCROLL_DOWN_BUTTON 5
|
||||
#define PLAY_BUTTON 6
|
||||
#define EXIT_BUTTON 7
|
||||
|
||||
static int Num_files;
|
||||
static int Cutscene_list[MAX_CUTSCENES];
|
||||
static int Stats_scroll_offset;
|
||||
static int Selected_line = 0; // line that is currently selected for binding
|
||||
static int Scroll_offset;
|
||||
static int Background_bitmap;
|
||||
static UI_BUTTON List_region;
|
||||
static UI_WINDOW Ui_window;
|
||||
|
||||
static 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
|
||||
ui_button_info("TDB_02", 7, 34, 37, 38, 2), // tech database 3
|
||||
ui_button_info("TDB_03", 7, 49, 37, 54, 3), // tech database 4
|
||||
|
||||
ui_button_info("VFB_04", 6, 318, -1, -1, 4), // scroll up
|
||||
ui_button_info("VFB_05", 36, 318, -1, -1, 5), // scroll down
|
||||
ui_button_info("VFB_06", 578, 319, 587, 366, 6), // play
|
||||
ui_button_info("VFB_07", 574, 431, 587, 413, 7), // exit
|
||||
},
|
||||
{ // GR_1024
|
||||
ui_button_info("2_TDB_00", 12, 7, 59, 12, 0), // tech database 1
|
||||
ui_button_info("2_TDB_01", 12, 31, 59, 37, 1), // tech database 2
|
||||
ui_button_info("2_TDB_02", 12, 56, 59, 62, 2), // tech database 3
|
||||
ui_button_info("2_TDB_03", 12, 81, 59, 88, 3), // tech database 4
|
||||
|
||||
ui_button_info("2_VFB_04", 9, 509, -1, -1, 4), // scroll up
|
||||
ui_button_info("2_VFB_05", 58, 509, -1, -1, 5), // scroll down
|
||||
ui_button_info("2_VFB_06", 925, 511, 940, 586, 6), // play
|
||||
ui_button_info("2_VFB_07", 918, 689, 940, 661, 7), // exit
|
||||
}
|
||||
};
|
||||
|
||||
// text
|
||||
#define NUM_CUTSCENE_TEXT 6
|
||||
UI_XSTR Cutscene_text[GR_NUM_RESOLUTIONS][NUM_CUTSCENE_TEXT] = {
|
||||
{ // GR_640
|
||||
{"Technical Database", 1055, 37, 7, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][TECH_DATABASE_BUTTON].button },
|
||||
{"Mission Simulator", 1056, 37, 23, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][SIMULATOR_BUTTON].button },
|
||||
{"Cutscenes", 1057, 37, 38, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CUTSCENES_BUTTON].button },
|
||||
{"Credits", 1058, 37, 54, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CREDITS_BUTTON].button },
|
||||
|
||||
{"Play", 1335, 587, 366, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][PLAY_BUTTON].button },
|
||||
{"Exit", 1419, 587, 413, UI_XSTR_COLOR_PINK, -1, &Buttons[0][EXIT_BUTTON].button },
|
||||
},
|
||||
{ // GR_1024
|
||||
{"Technical Database", 1055, 59, 12, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][TECH_DATABASE_BUTTON].button },
|
||||
{"Mission Simulator", 1056, 59, 37, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][SIMULATOR_BUTTON].button },
|
||||
{"Cutscenes", 1057, 59, 62, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CUTSCENES_BUTTON].button },
|
||||
{"Credits", 1058, 59, 88, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CREDITS_BUTTON].button },
|
||||
|
||||
{"Play", 1335, 940, 586, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][PLAY_BUTTON].button },
|
||||
{"Exit", 1419, 940, 661, UI_XSTR_COLOR_PINK, -1, &Buttons[1][EXIT_BUTTON].button },
|
||||
}
|
||||
};
|
||||
|
||||
int Cutscene_list_coords[GR_NUM_RESOLUTIONS][4] = {
|
||||
{ // GR_640
|
||||
9, 117, 621, 198
|
||||
},
|
||||
{ // GR_1024
|
||||
14, 188, 994, 316
|
||||
}
|
||||
};
|
||||
|
||||
int Cutscene_desc_coords[GR_NUM_RESOLUTIONS][4] = {
|
||||
{ // GR_640
|
||||
9, 378, 484, 73
|
||||
},
|
||||
{ // GR_1024
|
||||
14, 605, 775, 117
|
||||
}
|
||||
};
|
||||
|
||||
#define MAX_TEXT_LINES 20
|
||||
int Cutscene_max_text_lines[GR_NUM_RESOLUTIONS] = {
|
||||
10,
|
||||
MAX_TEXT_LINES
|
||||
};
|
||||
#define MAX_TEXT_LINE_LEN 256
|
||||
|
||||
static int Text_size;
|
||||
static int Text_offset = 0;
|
||||
static int Text_line_size[MAX_TEXT_LINES];
|
||||
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;
|
||||
char volume_name[128];
|
||||
|
||||
#ifdef RELEASE_REAL
|
||||
int num_attempts = 0;
|
||||
#endif
|
||||
|
||||
while(1) {
|
||||
int path_set_ok;
|
||||
|
||||
cd_mve_is_on = cutscenes_get_cd_num(mve_name);
|
||||
if ((cd_mve_is_on != 0) && (cd_mve_is_on != 1) && (cd_mve_is_on != 2)) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(OEM_BUILD)
|
||||
sprintf(volume_name, NOX("FS2_OEM"));
|
||||
#else
|
||||
sprintf(volume_name, NOX("FREESPACE2_%c"), '1' + cd_mve_is_on);
|
||||
#endif
|
||||
|
||||
|
||||
cd_drive_num = find_freespace_cd(volume_name);
|
||||
path_set_ok = set_cdrom_path(cd_drive_num);
|
||||
|
||||
if ( path_set_ok ) {
|
||||
cd_present = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef RELEASE_REAL
|
||||
if ( !prompt_for_cd ) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
// no CD found, so prompt user
|
||||
char popup_msg[256];
|
||||
int popup_rval;
|
||||
|
||||
#if defined(DVD_MESSAGE_HACK)
|
||||
sprintf(popup_msg, XSTR( "Movie not found\n\nInsert FreeSpace DVD to continue", 203));
|
||||
#else
|
||||
sprintf(popup_msg, XSTR( "Movie not found\n\nInsert FreeSpace CD #%d to continue", 203), cd_mve_is_on+1);
|
||||
#endif
|
||||
|
||||
popup_rval = popup(PF_BODY_BIG, 2, POPUP_CANCEL, POPUP_OK, popup_msg);
|
||||
if ( popup_rval != 1 ) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( num_attempts++ > 5 ) {
|
||||
cd_present = 0;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
cd_present = 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
return cd_present;
|
||||
#else // !WIN32
|
||||
return 0;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
void cutscenes_screen_play()
|
||||
{
|
||||
char name[MAX_FILENAME_LEN]; // *full_name
|
||||
int which_cutscene;
|
||||
|
||||
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
|
||||
which_cutscene = Cutscene_list[Selected_line];
|
||||
|
||||
strcpy(name, Cutscenes[which_cutscene].filename );
|
||||
// full_name = cf_add_ext(name, NOX(".mve"));
|
||||
|
||||
main_hall_stop_music();
|
||||
int rval = movie_play(name);
|
||||
main_hall_start_music();
|
||||
|
||||
if ( !rval ) {
|
||||
char str[256];
|
||||
|
||||
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
|
||||
popup(0, 1, POPUP_OK, str );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_line_up()
|
||||
{
|
||||
if (Selected_line) {
|
||||
Selected_line--;
|
||||
gamesnd_play_iface(SND_SCROLL);
|
||||
|
||||
} else
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
|
||||
if (Selected_line < Scroll_offset)
|
||||
Scroll_offset = Selected_line;
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_line_down()
|
||||
{
|
||||
int h;
|
||||
|
||||
if (Selected_line < Num_files - 1) {
|
||||
Selected_line++;
|
||||
gamesnd_play_iface(SND_SCROLL);
|
||||
|
||||
} else
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
|
||||
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
|
||||
if (Selected_line >= Scroll_offset + h){
|
||||
Scroll_offset++;
|
||||
}
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_screen_up()
|
||||
{
|
||||
int h;
|
||||
|
||||
if (Scroll_offset) {
|
||||
Scroll_offset--;
|
||||
Assert(Selected_line > Scroll_offset);
|
||||
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
|
||||
while (Selected_line >= Scroll_offset + h){
|
||||
Selected_line--;
|
||||
}
|
||||
|
||||
gamesnd_play_iface(SND_SCROLL);
|
||||
|
||||
} else {
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
void cutscenes_screen_scroll_screen_down()
|
||||
{
|
||||
int h;
|
||||
|
||||
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
|
||||
if (Scroll_offset + h < Num_files) {
|
||||
Scroll_offset++;
|
||||
if (Selected_line < Scroll_offset){
|
||||
Selected_line = Scroll_offset;
|
||||
}
|
||||
|
||||
gamesnd_play_iface(SND_SCROLL);
|
||||
} else {
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
int cutscenes_screen_button_pressed(int n)
|
||||
{
|
||||
switch (n) {
|
||||
case TECH_DATABASE_BUTTON:
|
||||
gamesnd_play_iface(SND_SWITCH_SCREENS);
|
||||
gameseq_post_event(GS_EVENT_TECH_MENU);
|
||||
return 1;
|
||||
|
||||
case SIMULATOR_BUTTON:
|
||||
gamesnd_play_iface(SND_SWITCH_SCREENS);
|
||||
gameseq_post_event(GS_EVENT_SIMULATOR_ROOM);
|
||||
return 1;
|
||||
|
||||
case CREDITS_BUTTON:
|
||||
gamesnd_play_iface(SND_SWITCH_SCREENS);
|
||||
gameseq_post_event(GS_EVENT_CREDITS);
|
||||
return 1;
|
||||
|
||||
case SCROLL_UP_BUTTON:
|
||||
cutscenes_screen_scroll_screen_up();
|
||||
break;
|
||||
|
||||
case SCROLL_DOWN_BUTTON:
|
||||
cutscenes_screen_scroll_screen_down();
|
||||
break;
|
||||
|
||||
case PLAY_BUTTON:
|
||||
cutscenes_screen_play();
|
||||
break;
|
||||
|
||||
case EXIT_BUTTON:
|
||||
gamesnd_play_iface(SND_COMMIT_PRESSED);
|
||||
gameseq_post_event(GS_EVENT_MAIN_MENU);
|
||||
game_flush();
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cutscenes_screen_init()
|
||||
{
|
||||
int i;
|
||||
ui_button_info *b;
|
||||
|
||||
Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
|
||||
Ui_window.set_mask_bmap(Cutscene_mask_name[gr_screen.res]);
|
||||
|
||||
for (i=0; i<NUM_BUTTONS; i++) {
|
||||
b = &Buttons[gr_screen.res][i];
|
||||
|
||||
b->button.create(&Ui_window, "", b->x, b->y, 60, 30, (i < 2), 1);
|
||||
// set up callback for when a mouse first goes over a button
|
||||
b->button.set_highlight_action(common_play_highlight_sound);
|
||||
b->button.set_bmaps(b->filename);
|
||||
b->button.link_hotspot(b->hotspot);
|
||||
}
|
||||
|
||||
// add xstrs
|
||||
for(i=0; i<NUM_CUTSCENE_TEXT; i++){
|
||||
Ui_window.add_XSTR(&Cutscene_text[gr_screen.res][i]);
|
||||
}
|
||||
|
||||
Buttons[gr_screen.res][EXIT_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
|
||||
Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_PAGEUP);
|
||||
Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_PAGEDOWN);
|
||||
|
||||
List_region.create(&Ui_window, "", Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1], Cutscene_list_coords[gr_screen.res][2], Cutscene_list_coords[gr_screen.res][3], 0, 1);
|
||||
List_region.hide();
|
||||
|
||||
// set up hotkeys for buttons so we draw the correct animation frame when a key is pressed
|
||||
Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_PAGEUP);
|
||||
Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_PAGEDOWN);
|
||||
|
||||
Background_bitmap = bm_load(Cutscene_bitmap_name[gr_screen.res]);
|
||||
Scroll_offset = Selected_line = 0;
|
||||
Description_index = -1;
|
||||
|
||||
// when doing a debug version, just put all of the movie files here.
|
||||
#ifndef NDEBUG
|
||||
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
|
||||
#endif
|
||||
|
||||
// if (All_movies_enabled)
|
||||
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
|
||||
|
||||
Num_files = 0;
|
||||
for ( i = 0; i < Num_cutscenes; i++ ) {
|
||||
if ( Cutscenes_viewable & (1<<i) ) {
|
||||
Cutscene_list[Num_files] = i;
|
||||
Num_files++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cutscenes_screen_close()
|
||||
{
|
||||
if (Background_bitmap)
|
||||
bm_unload(Background_bitmap);
|
||||
|
||||
Ui_window.destroy();
|
||||
}
|
||||
|
||||
void cutscenes_screen_do_frame()
|
||||
{
|
||||
int i, k, y, z;
|
||||
int font_height = gr_get_font_height();
|
||||
int select_tease_line = -1;
|
||||
|
||||
k = Ui_window.process();
|
||||
switch (k) {
|
||||
case KEY_DOWN: // select next line
|
||||
cutscenes_screen_scroll_line_down();
|
||||
break;
|
||||
|
||||
case KEY_UP: // select previous line
|
||||
cutscenes_screen_scroll_line_up();
|
||||
break;
|
||||
|
||||
case KEY_TAB:
|
||||
case KEY_CTRLED | KEY_DOWN:
|
||||
cutscenes_screen_button_pressed(CREDITS_BUTTON);
|
||||
break;
|
||||
|
||||
case KEY_SHIFTED | KEY_TAB:
|
||||
case KEY_CTRLED | KEY_UP:
|
||||
cutscenes_screen_button_pressed(SIMULATOR_BUTTON);
|
||||
break;
|
||||
|
||||
case KEY_ENTER:
|
||||
cutscenes_screen_play();
|
||||
break;
|
||||
|
||||
case KEY_ESC: // cancel
|
||||
gameseq_post_event(GS_EVENT_MAIN_MENU);
|
||||
game_flush();
|
||||
break;
|
||||
|
||||
case KEY_F1: // show help overlay
|
||||
break;
|
||||
|
||||
case KEY_F2: // goto options screen
|
||||
gameseq_post_event(GS_EVENT_OPTIONS_MENU);
|
||||
break;
|
||||
} // end switch
|
||||
|
||||
for (i=0; i<NUM_BUTTONS; i++){
|
||||
if (Buttons[gr_screen.res][i].button.pressed()){
|
||||
if (cutscenes_screen_button_pressed(i)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (List_region.button_down()) {
|
||||
List_region.get_mouse_pos(NULL, &y);
|
||||
z = Scroll_offset + y / font_height;
|
||||
if ((z >= 0) && (z < Num_files))
|
||||
select_tease_line = z;
|
||||
}
|
||||
|
||||
if (List_region.pressed()) {
|
||||
List_region.get_mouse_pos(NULL, &y);
|
||||
z = Scroll_offset + y / font_height;
|
||||
if ((z >= 0) && (z < Num_files))
|
||||
Selected_line = z;
|
||||
}
|
||||
|
||||
GR_MAYBE_CLEAR_RES(Background_bitmap);
|
||||
if (Background_bitmap >= 0) {
|
||||
gr_set_bitmap(Background_bitmap);
|
||||
gr_bitmap(0, 0);
|
||||
}
|
||||
|
||||
Ui_window.draw();
|
||||
|
||||
for (i=TECH_DATABASE_BUTTON; i<=CREDITS_BUTTON; i++){
|
||||
if (Buttons[gr_screen.res][i].button.button_down()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > CREDITS_BUTTON){
|
||||
Buttons[gr_screen.res][CUTSCENES_BUTTON].button.draw_forced(2);
|
||||
}
|
||||
|
||||
y = 0;
|
||||
z = Scroll_offset;
|
||||
while (y + font_height <= Cutscene_list_coords[gr_screen.res][3]) {
|
||||
if (z >= Num_files){
|
||||
break;
|
||||
}
|
||||
|
||||
if (z == Selected_line){
|
||||
gr_set_color_fast(&Color_text_selected);
|
||||
} else if (z == select_tease_line) {
|
||||
gr_set_color_fast(&Color_text_subselected);
|
||||
} else {
|
||||
gr_set_color_fast(&Color_text_normal);
|
||||
}
|
||||
|
||||
gr_printf(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
|
||||
|
||||
y += font_height;
|
||||
z++;
|
||||
}
|
||||
|
||||
if (Description_index != Selected_line) {
|
||||
char *src;
|
||||
|
||||
Description_index = Selected_line;
|
||||
Text_size = 0;
|
||||
src = Cutscenes[Cutscene_list[Description_index]].description;
|
||||
if (src) {
|
||||
Text_size = split_str(src, Cutscene_desc_coords[gr_screen.res][2], Text_line_size, Text_lines, Cutscene_max_text_lines[gr_screen.res]);
|
||||
Assert(Text_size >= 0 && Text_size < Cutscene_max_text_lines[gr_screen.res]);
|
||||
}
|
||||
}
|
||||
|
||||
if (Description_index >= 0) {
|
||||
int len;
|
||||
char line[MAX_TEXT_LINE_LEN + 1];
|
||||
|
||||
gr_set_color_fast(&Color_text_normal);
|
||||
|
||||
y = 0;
|
||||
z = Text_offset;
|
||||
while (y + font_height <= Cutscene_desc_coords[gr_screen.res][3]) {
|
||||
if (z >= Text_size)
|
||||
break;
|
||||
|
||||
len = Text_line_size[z];
|
||||
if (len > MAX_TEXT_LINE_LEN)
|
||||
len = MAX_TEXT_LINE_LEN;
|
||||
|
||||
strncpy(line, Text_lines[z], len);
|
||||
line[len] = 0;
|
||||
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line);
|
||||
|
||||
y += font_height;
|
||||
z++;
|
||||
}
|
||||
}
|
||||
|
||||
gr_flip();
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 6 5/21/98 12:35a Lawrance
|
||||
* Tweak how CD is checked for
|
||||
*
|
||||
* 5 5/10/98 10:05p Allender
|
||||
* only show cutscenes which have been seen before. Made Fred able to
|
||||
* write missions anywhere, defaulting to player misison folder, not data
|
||||
* mission folder. Fix FreeSpace code to properly read missions from
|
||||
* correct locations
|
||||
*
|
||||
* 4 5/08/98 5:30p Lawrance
|
||||
* add cutscenes_validate_cd()
|
||||
*
|
||||
* 3 5/08/98 4:07p Allender
|
||||
* more cutscene stuff
|
||||
*
|
||||
* 2 4/17/98 6:33p Hoffoss
|
||||
* Made changes to the tech room group of screens. Cutscenes screen is
|
||||
* now in a new file.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define MAX_CUTSCENES 10
|
||||
|
||||
// this cutscene is always available.
|
||||
#define INTRO_CUTSCENE_FLAG (1<<0)
|
||||
|
||||
typedef struct cutscene_info
|
||||
{
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
char name[NAME_LENGTH];
|
||||
char *description;
|
||||
int cd;
|
||||
} cutscene_info;
|
||||
|
||||
extern cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
extern int Num_cutscenes;
|
||||
extern int Cutscenes_viewable;
|
||||
|
||||
// initializa table data
|
||||
void cutscene_init();
|
||||
int cutscene_get_cd_num(char *filename);
|
||||
|
||||
|
||||
void cutscenes_screen_init();
|
||||
void cutscenes_screen_close();
|
||||
void cutscenes_screen_do_frame();
|
||||
|
||||
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd = 1);
|
||||
void cutscene_mark_viewable(char *filename);
|
||||
|
||||
#endif
|
||||
@@ -1,240 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
|
||||
* $Revision: 2.20 $
|
||||
* $Date: 2004-04-26 13:09:20 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* movie player code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "movie.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
|
||||
#include "freespace2/freespace.h" // for Game_mode, etc.
|
||||
|
||||
// This module links freespace movie calls to the actual API calls the play the movie.
|
||||
// This module handles all the different requires of OS and gfx API and finding the file to play
|
||||
#ifdef _WIN32
|
||||
|
||||
void process_messages()
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
#include "graphics/grd3dinternal.h"
|
||||
|
||||
// filename - file to search for
|
||||
// out_name - output, full path to file
|
||||
// returns non-zero if file is found
|
||||
int movie_find(char *filename, char *out_name)
|
||||
{
|
||||
char full_path[MAX_PATH];
|
||||
char tmp_name[MAX_PATH];
|
||||
char search_name[MAX_PATH];
|
||||
int i, size, offset = 0;
|
||||
const int NUM_EXT = 2;
|
||||
const char *movie_ext[NUM_EXT] = { ".avi", ".mpg" };
|
||||
|
||||
if (out_name == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// remove extension
|
||||
strcpy( tmp_name, filename );
|
||||
char *p = strchr( tmp_name, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<NUM_EXT; i++) {
|
||||
strcpy( search_name, tmp_name );
|
||||
strcat( search_name, movie_ext[i] );
|
||||
|
||||
// try and find the file
|
||||
if ( cf_find_file_location(search_name, CF_TYPE_ANY, full_path, &size, &offset, 0) ) {
|
||||
// if it's not in a packfile then we're done
|
||||
if (offset == 0) {
|
||||
strcpy( out_name, full_path );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// clear old string
|
||||
strcpy( search_name, "" );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Play one movie
|
||||
bool movie_play(char *name)
|
||||
{
|
||||
// mark the movie as viewable to the player when in a campaign
|
||||
// do this before anything else so that we're sure the movie is available
|
||||
// to the player even if it's not going to play right now
|
||||
if (Game_mode & GM_CAMPAIGN_MODE) {
|
||||
cutscene_mark_viewable(name);
|
||||
}
|
||||
|
||||
// reset the gr_* stuff before trying to play a movie
|
||||
// fixes white flash in OGL and possibly other wierd stuff
|
||||
gr_reset_clip();
|
||||
gr_clear();
|
||||
gr_flip();
|
||||
|
||||
extern int Is_standalone;
|
||||
if(Is_standalone) return false;
|
||||
if(Cmdline_dnoshowvid) return false;
|
||||
if(Cmdline_window) return false;
|
||||
|
||||
char full_name[MAX_PATH];
|
||||
int rc = 0;
|
||||
|
||||
rc = movie_find(name, full_name);
|
||||
|
||||
if (!rc) {
|
||||
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s", name);
|
||||
return false;
|
||||
} else {
|
||||
DBUGFILE_OUTPUT_1("About to play: %s", full_name);
|
||||
}
|
||||
|
||||
process_messages();
|
||||
|
||||
// This is a bit of a hack but it works nicely
|
||||
if(gr_screen.mode == GR_DIRECT3D)
|
||||
{
|
||||
GlobalD3DVars::D3D_activate = 0;
|
||||
GlobalD3DVars::lpD3DDevice->EndScene();
|
||||
GlobalD3DVars::lpD3DDevice->Present(NULL,NULL,NULL,NULL);
|
||||
d3d_lost_device();
|
||||
}
|
||||
|
||||
// This clears the screen
|
||||
InvalidateRect((HWND) os_get_window(), NULL, TRUE);
|
||||
PAINTSTRUCT paint_info;
|
||||
HDC clear_hdc = BeginPaint((HWND) os_get_window(),&paint_info);
|
||||
|
||||
if(clear_hdc)
|
||||
{
|
||||
|
||||
POINT points[4] = {
|
||||
{0,0},
|
||||
{gr_screen.max_w,0},
|
||||
{gr_screen.max_w, gr_screen.max_h},
|
||||
{0, gr_screen.max_h}};
|
||||
|
||||
HBRUSH hBrush = CreateSolidBrush(0x00000000);
|
||||
HBRUSH hOldBrush = (HBRUSH)SelectObject(clear_hdc, hBrush);
|
||||
SelectObject(clear_hdc, hBrush);
|
||||
|
||||
Polygon(clear_hdc, points, 4);
|
||||
|
||||
SelectObject(clear_hdc, hOldBrush);
|
||||
DeleteObject(hBrush);
|
||||
|
||||
EndPaint((HWND) os_get_window(),&paint_info);
|
||||
}
|
||||
|
||||
process_messages();
|
||||
|
||||
if(OpenClip((HWND) os_get_window(), full_name))
|
||||
{
|
||||
|
||||
do
|
||||
{
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
Sleep(100);
|
||||
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
||||
|
||||
if(msg.message == WM_ERASEBKGND)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
PassMsgToVideoWindow((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
|
||||
if(msg.message == WM_PAINT)
|
||||
{
|
||||
}
|
||||
|
||||
if(msg.message != WM_KEYDOWN)
|
||||
{
|
||||
// DefWindowProc((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
|
||||
DispatchMessage(&msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(msg.wParam )
|
||||
{
|
||||
// Quits movie if escape, space or return is pressed
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
// Terminate movie playback early
|
||||
CloseClip((HWND) os_get_window());
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Stream bit of the movie then handle windows messages
|
||||
while(dx8show_stream_movie() == false);
|
||||
|
||||
}
|
||||
|
||||
// We finished playing the movie
|
||||
CloseClip((HWND) os_get_window());
|
||||
GlobalD3DVars::D3D_activate = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2)
|
||||
{
|
||||
bool result1 = movie_play(name1);
|
||||
process_messages();
|
||||
bool result2 = movie_play(name2);
|
||||
|
||||
return result1 && result2;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Stubs, preprocessor calls were making the win32 code more complex for no good reason.
|
||||
// Using stubs instead.
|
||||
bool movie_play(char *name) {return true;}
|
||||
bool movie_play_two(char *name1, char *name2) {return true;}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
bool movie_play(char *name);
|
||||
bool movie_play_two(char *name1, char *name2);
|
||||
|
||||
#endif
|
||||
@@ -1,181 +0,0 @@
|
||||
#include "ddsutils/ddsutils.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
int Texture_compression_enabled=0;
|
||||
|
||||
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels)
|
||||
{
|
||||
char code[5];
|
||||
CFILE *ddsfile;
|
||||
char real_name[MAX_FILENAME_LEN];
|
||||
char *p;
|
||||
int retval=DDS_ERROR_NONE;
|
||||
int ct;
|
||||
int bits=0;
|
||||
|
||||
//this better not happen.. ever
|
||||
Assert(filename!=NULL);
|
||||
|
||||
//make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
p=strchr(real_name, '.');
|
||||
if (p) *p=0;
|
||||
strcat(real_name, ".dds");
|
||||
|
||||
memset(code,0,sizeof(code));
|
||||
//try to open the file
|
||||
ddsfile = cfopen(real_name, "rb");
|
||||
|
||||
//file not found
|
||||
if (!ddsfile)
|
||||
{
|
||||
return DDS_ERROR_INVALID_FILENAME;
|
||||
}
|
||||
|
||||
//read the code
|
||||
cfread(code,1,4,ddsfile);
|
||||
code[4]=0;
|
||||
|
||||
//check it
|
||||
if (strncmp(code,DDS_FILECODE,4)!=0)
|
||||
{
|
||||
return DDS_ERROR_BAD_HEADER;
|
||||
}
|
||||
|
||||
//read the header
|
||||
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
|
||||
|
||||
//stuff important info
|
||||
if (width)
|
||||
*width = lpddsd->dwWidth;
|
||||
|
||||
if (height)
|
||||
*height = lpddsd->dwHeight;
|
||||
|
||||
if (levels)
|
||||
*levels = lpddsd->dwMipMapCount;
|
||||
|
||||
switch(lpddsd->ddpfPixelFormat.dwFourCC)
|
||||
{
|
||||
case FOURCC_DXT1:
|
||||
bits=24;
|
||||
ct=DDS_DXT1;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT3:
|
||||
bits=32;
|
||||
ct=DDS_DXT3;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT5:
|
||||
bits=32;
|
||||
ct=DDS_DXT5;
|
||||
break;
|
||||
|
||||
//dxt2 and dxt4 aren't supported
|
||||
case FOURCC_DXT2:
|
||||
case FOURCC_DXT4:
|
||||
retval=DDS_ERROR_INVALID_FORMAT;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
|
||||
//none of the above
|
||||
default:
|
||||
retval=DDS_ERROR_UNCOMPRESSED;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bpp) *bpp=bits;
|
||||
if (compression_type) *compression_type=ct;
|
||||
|
||||
//close file and return
|
||||
cfclose(ddsfile);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels)
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type, levels);
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data)
|
||||
{
|
||||
int retval;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int w,h,ct,lvl,bpp;
|
||||
CFILE *cfp;
|
||||
ubyte* tmp;
|
||||
|
||||
//this must be set
|
||||
Assert(size!=NULL);
|
||||
|
||||
//read the header -- if its at this stage, it should be legal.
|
||||
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct, &lvl);
|
||||
Assert(retval==DDS_ERROR_NONE);
|
||||
|
||||
//get some more info from the surface
|
||||
*size=ddsd.dwMipMapCount > 1 ? ddsd.dwLinearSize * 2 : ddsd.dwLinearSize;
|
||||
|
||||
//open it up and go to the data section
|
||||
cfp=cfopen(filename,"rb");
|
||||
cfseek(cfp,DDS_OFFSET, CF_SEEK_SET);
|
||||
|
||||
//get the data
|
||||
tmp=(ubyte*)malloc(*size);
|
||||
|
||||
if (!tmp)
|
||||
{
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NO_MEM; //barf
|
||||
}
|
||||
|
||||
cfread(tmp,1,*size,cfp);
|
||||
|
||||
*data=(uint)tmp;
|
||||
//we look done here
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NONE;
|
||||
}
|
||||
|
||||
//returns string representation of DDS_** error code
|
||||
const char *dds_error_string(int code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case DDS_ERROR_NONE:
|
||||
return "No error";
|
||||
|
||||
case DDS_ERROR_NO_MEM:
|
||||
return "Insufficient memory";
|
||||
|
||||
case DDS_ERROR_INVALID_FILENAME:
|
||||
return "File not found";
|
||||
|
||||
case DDS_ERROR_BAD_HEADER:
|
||||
return "Filecode did not equal \"DDS \"";
|
||||
|
||||
case DDS_ERROR_INVALID_FORMAT:
|
||||
return "File was compressed, but it was DXT2 or DXT4";
|
||||
|
||||
case DDS_ERROR_UNCOMPRESSED:
|
||||
return "*.DDS files must be compressed and use DXT1, DXT3, or DXT5 compression";
|
||||
|
||||
default:
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
//get a warning otherwise
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
//header file to load .dds files
|
||||
//these use dxtc texture compression
|
||||
|
||||
#ifndef __DDS_H
|
||||
#define __DDS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#define DDS_ERROR_NONE 0 //everything went fine
|
||||
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
|
||||
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
|
||||
#define DDS_ERROR_UNCOMPRESSED 3 //not using dxtc compression
|
||||
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
|
||||
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
|
||||
|
||||
|
||||
#define DDS_DXT_INVALID -1
|
||||
#define DDS_DXT1 1
|
||||
#define DDS_DXT3 3
|
||||
#define DDS_DXT5 5
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
|
||||
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
|
||||
#endif //defined(MAKEFOURCC)
|
||||
|
||||
// FOURCC codes for DX compressed-texture pixel formats
|
||||
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
|
||||
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
|
||||
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
|
||||
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
|
||||
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
|
||||
|
||||
#define DDS_FILECODE "DDS "
|
||||
|
||||
#ifndef DUMMYUNIONNAMEN
|
||||
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
|
||||
#define DUMMYUNIONNAMEN(n)
|
||||
#else
|
||||
#define DUMMYUNIONNAMEN(n) u##n
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//these structures are the headers for a dds file
|
||||
typedef struct _DDSCAPS2
|
||||
{
|
||||
DWORD dwCaps; // capabilities of surface wanted
|
||||
DWORD dwCaps2;
|
||||
DWORD dwCaps3;
|
||||
union
|
||||
{
|
||||
DWORD dwCaps4;
|
||||
DWORD dwVolumeDepth;
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
} DDSCAPS2;
|
||||
|
||||
typedef struct _DDSURFACEDESC2
|
||||
{
|
||||
DWORD dwSize; // size of the DDSURFACEDESC structure
|
||||
DWORD dwFlags; // determines what fields are valid
|
||||
DWORD dwHeight; // height of surface to be created
|
||||
DWORD dwWidth; // width of input surface
|
||||
union
|
||||
{
|
||||
LONG lPitch; // distance to start of next line (return value only)
|
||||
DWORD dwLinearSize; // Formless late-allocated optimized surface size
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
union
|
||||
{
|
||||
DWORD dwBackBufferCount; // number of back buffers requested
|
||||
DWORD dwDepth; // the depth if this is a volume texture
|
||||
} DUMMYUNIONNAMEN(5);
|
||||
union
|
||||
{
|
||||
DWORD dwMipMapCount; // number of mip-map levels requestde
|
||||
// dwZBufferBitDepth removed, use ddpfPixelFormat one instead
|
||||
DWORD dwRefreshRate; // refresh rate (used when display mode is described)
|
||||
DWORD dwSrcVBHandle; // The source used in VB::Optimize
|
||||
} DUMMYUNIONNAMEN(2);
|
||||
DWORD dwAlphaBitDepth; // depth of alpha buffer requested
|
||||
DWORD dwReserved; // reserved
|
||||
LPVOID lpSurface; // pointer to the associated surface memory
|
||||
union
|
||||
{
|
||||
DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use
|
||||
DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces
|
||||
} DUMMYUNIONNAMEN(3);
|
||||
DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
|
||||
DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
|
||||
DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
|
||||
union
|
||||
{
|
||||
DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface
|
||||
DWORD dwFVF; // vertex format description of vertex buffers
|
||||
} DUMMYUNIONNAMEN(4);
|
||||
DDSCAPS2 ddsCaps; // direct draw surface capabilities
|
||||
DWORD dwTextureStage; // stage in multitexture cascade
|
||||
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
|
||||
|
||||
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
|
||||
|
||||
//reads a dds header
|
||||
//returns one of the error values
|
||||
//'compression_type' comes back as one of the DDS_DXTC* defines
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type, int *levels);
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data);
|
||||
|
||||
//returns a string from a DDS error code
|
||||
const char* dds_error_string(int code);
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
#endif //__DDS_H
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,208 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2004-03-05 09:01:59 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 6 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 5 7/01/99 11:44a Dave
|
||||
* Updated object sound system to allow multiple obj sounds per ship.
|
||||
* Added hit-by-beam sound. Added killed by beam sound.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 29 4/02/98 6:30p Lawrance
|
||||
* reduce max debris piece if DEMO defined
|
||||
*
|
||||
* 28 4/02/98 11:40a Lawrance
|
||||
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
|
||||
*
|
||||
* 27 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 26 2/19/98 12:46a Lawrance
|
||||
* Further work on asteroids.
|
||||
*
|
||||
* 25 2/10/98 6:43p Lawrance
|
||||
* Moved asteroid code to a separate lib.
|
||||
*
|
||||
* 24 2/06/98 3:08p Mike
|
||||
* More asteroid stuff, including resolving conflicts between the two
|
||||
* asteroid_field structs!
|
||||
*
|
||||
* 23 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 22 1/29/98 5:50p John
|
||||
* Made electrical arcing on debris pieces be persistent from frame to
|
||||
* frame
|
||||
*
|
||||
* 21 1/21/98 7:18p Lawrance
|
||||
* Fix bug with creating debris before the mission starts.
|
||||
*
|
||||
* 20 12/22/97 9:56p Andsager
|
||||
* Implement ship:debris collisions. Generalize and move
|
||||
* ship_ship_or_debris_hit struct from CollideShipShip to ObjCollide.h
|
||||
*
|
||||
* 19 11/19/97 5:57p Mike
|
||||
* Make debris go away if more than N units away from the nearest player.
|
||||
* Make speed of a docked object not read zero if it's moving.
|
||||
*
|
||||
* 18 10/01/97 10:52a Mike
|
||||
* Change debris prototype to take an additional parameter to give debris
|
||||
* more thrust when it is created.
|
||||
*
|
||||
* 17 9/20/97 9:25a John
|
||||
* fixed bug with species specific debris shards.
|
||||
*
|
||||
* 16 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 15 7/24/97 8:35a Allender
|
||||
* allow ships to blow up before missions starts. Made some debris system
|
||||
* items available in other modules
|
||||
*
|
||||
* 14 7/13/97 5:53p Lawrance
|
||||
* save model name in debris
|
||||
*
|
||||
* 13 7/02/97 11:48a Lawrance
|
||||
* update debris to delay persistant sound
|
||||
*
|
||||
* 12 6/06/97 4:13p Lawrance
|
||||
* leave debris chunks from very large ships persistant, scale fireball
|
||||
* lifetime by ship radius
|
||||
*
|
||||
* 11 6/06/97 12:12p Lawrance
|
||||
* limit hull debris pieces, destroying oldest debris to make way for new
|
||||
* debris.
|
||||
*
|
||||
* 10 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 9 4/03/97 12:23a Mike
|
||||
* Make debris collidable-with. Can hit it, too.
|
||||
* Make AI ships stop firing when target enters death roll.
|
||||
*
|
||||
* 8 3/31/97 11:11a John
|
||||
* added ship species specific debris.
|
||||
*
|
||||
* 7 3/25/97 3:55p Lawrance
|
||||
* allowing debris to be targeted and shown on radar
|
||||
*
|
||||
* 6 2/27/97 12:07p John
|
||||
* Added code to suppord debris chunks after a ship is exploded..
|
||||
*
|
||||
* 5 2/26/97 2:18p Lawrance
|
||||
* adding Debris[] to save/restore
|
||||
*
|
||||
* 4 2/10/97 12:38p John
|
||||
* made all ships blow up into debris pieces when exploded.
|
||||
*
|
||||
* 3 2/07/97 10:45a John
|
||||
* Initial bare bones implementation of blowing off turrets.
|
||||
*
|
||||
* 2 2/07/97 9:30a John
|
||||
*
|
||||
* 1 2/06/97 4:13p John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _DEBRIS_H
|
||||
#define _DEBRIS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct object;
|
||||
struct CFILE;
|
||||
|
||||
#define MAX_DEBRIS_ARCS 8 // Must be less than MAX_ARC_EFFECTS in model.h
|
||||
|
||||
typedef struct debris {
|
||||
debris *next, *prev; // used for a linked list of the hull debris chunks
|
||||
int flags; // See DEBRIS_??? defines
|
||||
int source_objnum; // What object this came from
|
||||
int source_sig; // Signature of the source object
|
||||
int ship_info_index; // Ship info index of the ship type debris came from
|
||||
int team; // Team of the ship where the debris came from
|
||||
int objnum; // What object this is linked to
|
||||
float lifeleft; // When 0 or less object dies
|
||||
int model_num; // What model this uses
|
||||
int submodel_num; // What submodel this uses
|
||||
int next_fireball; // When to start a fireball
|
||||
int is_hull; // indicates a large hull chunk of debris
|
||||
int species; // What species this is from. -1 if don't care.
|
||||
int fire_timeout; // timestamp that holds time for fireballs to stop appearing
|
||||
int sound_delay; // timestamp to signal when sound should start
|
||||
fix time_started; // time when debris was created
|
||||
int next_distance_check; // timestamp to determine whether to delete this piece of debris.
|
||||
|
||||
vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
|
||||
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
|
||||
int arc_frequency; // Starts at 0, gets bigger
|
||||
|
||||
} debris;
|
||||
|
||||
|
||||
// flags for debris pieces
|
||||
#define DEBRIS_USED (1<<0)
|
||||
#define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships)
|
||||
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
#define MAX_DEBRIS_PIECES 48
|
||||
#else
|
||||
#define MAX_DEBRIS_PIECES 64
|
||||
#endif
|
||||
|
||||
extern debris Debris[MAX_DEBRIS_PIECES];
|
||||
|
||||
extern int Num_debris_pieces;
|
||||
|
||||
struct collision_info_struct;
|
||||
|
||||
void debris_init();
|
||||
void debris_render( object * obj );
|
||||
void debris_delete( object * obj );
|
||||
void debris_process_pre( object * obj, float frame_time);
|
||||
void debris_process_post( object * obj, float frame_time);
|
||||
object *debris_create( object * source_obj, int model_num, int submodel_num, vector *pos, vector *exp_center, int hull_flag, float exp_force );
|
||||
int debris_check_collision( object * obj, object * other_obj, vector * hitpos, collision_info_struct *debris_hit_info=NULL );
|
||||
void debris_hit( object * debris_obj, object * other_obj, vector * hitpos, float damage );
|
||||
int debris_get_team(object *objp);
|
||||
void debris_clear_expired_flag(debris *db);
|
||||
|
||||
#endif // _DEBRIS_H
|
||||
@@ -1,813 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2004-03-05 09:01:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 4 6/04/99 10:35a Dave
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 17 2/05/98 11:43a Allender
|
||||
* enhcanced network statistic collection. Made callback in debug console
|
||||
* to do networking if player is in the console
|
||||
*
|
||||
* 16 1/22/98 6:42p John
|
||||
* Move game_flush out of debug console into freespace. Made object
|
||||
* pair code throw out some weapons that turn. Added stats for how many
|
||||
* object pair are actually checked.
|
||||
*
|
||||
* 15 1/16/98 11:56a Allender
|
||||
* ability to scroll back in debug console, and call game_flush() when
|
||||
* leaving
|
||||
*
|
||||
* 14 1/10/98 1:14p John
|
||||
* Added explanation to debug console commands
|
||||
*
|
||||
* 13 12/21/97 4:39p John
|
||||
* fixed bug in name compare
|
||||
*
|
||||
* 12 12/21/97 4:33p John
|
||||
* Made debug console functions a class that registers itself
|
||||
* automatically, so you don't need to add the function to
|
||||
* debugfunctions.cpp.
|
||||
*
|
||||
* 11 9/13/97 9:31a Lawrance
|
||||
* if playing a demo, clear key filter then reset it once done with debug
|
||||
* console
|
||||
*
|
||||
* 10 9/09/97 3:39p Sandeep
|
||||
* warning level 4 bugs
|
||||
*
|
||||
* 9 6/13/97 3:50p John
|
||||
* sped up debug console printf
|
||||
*
|
||||
* 8 6/13/97 3:27p John
|
||||
* made debug console pretty
|
||||
*
|
||||
* 7 6/09/97 9:24a John
|
||||
* Changed the way fonts are set.
|
||||
*
|
||||
* 6 5/29/97 3:09p John
|
||||
* Took out debug menu.
|
||||
* Made software scaler draw larger bitmaps.
|
||||
* Optimized Direct3D some.
|
||||
*
|
||||
* 5 5/13/97 4:07p John
|
||||
* made numbers also be marked as strings.
|
||||
*
|
||||
* 4 4/28/97 5:24p John
|
||||
* made so : and \ don't get parsed out in debug console.
|
||||
*
|
||||
* 3 4/24/97 11:49a John
|
||||
* added new lighting commands to console.
|
||||
*
|
||||
* 2 4/24/97 10:36a John
|
||||
* moved the debug console stuff into it's own lib... made it compile with
|
||||
* Fred.
|
||||
*
|
||||
* 1 4/24/97 10:16a John
|
||||
* Initial rev
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/font.h"
|
||||
#include "io/timer.h"
|
||||
#include "io/key.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
#define MAX_COMMANDS 300
|
||||
|
||||
static int Num_debug_commands = 0;
|
||||
static debug_command *Debug_command[MAX_COMMANDS];
|
||||
|
||||
|
||||
debug_command::debug_command(char *_name, char *_help, void (*_func)() )
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( Num_debug_commands >= MAX_COMMANDS ) {
|
||||
Int3(); // Too many debug console commands!! Increase MAX_COMMANDS!!
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<Num_debug_commands; i++ ) {
|
||||
int ret = stricmp( Debug_command[i]->name, _name );
|
||||
|
||||
if ( ret == 0) {
|
||||
Int3(); // This debug console command already exists!!!!
|
||||
return;
|
||||
} else if ( ret > 0 ) {
|
||||
break; // Insert it here
|
||||
|
||||
} else if ( ret < 0 ) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
if ( i < Num_debug_commands ) {
|
||||
// Insert it at element i
|
||||
int j;
|
||||
for (j=Num_debug_commands; j>i; j-- ) {
|
||||
Debug_command[j] = Debug_command[j-1];
|
||||
}
|
||||
Debug_command[i] = this;
|
||||
Num_debug_commands++;
|
||||
} else {
|
||||
Debug_command[Num_debug_commands] = this;
|
||||
Num_debug_commands++;
|
||||
}
|
||||
|
||||
name = _name;
|
||||
help = _help;
|
||||
func = _func;
|
||||
}
|
||||
|
||||
// some global variables
|
||||
int Dc_command; // If this is set, then process the command
|
||||
int Dc_help; // If this is set, then print out the help text in the form, "usage: ... \nLong description\n" );
|
||||
int Dc_status; // If this is set, then print out the current status of the command.
|
||||
char *Dc_arg; // The (lowercased) string value of the argument retrieved from dc_arg
|
||||
char *Dc_arg_org; // Dc_arg before it got converted to lowercase
|
||||
uint Dc_arg_type; // The type of dc_arg.
|
||||
char *Dc_command_line; // The rest of the command line, from the end of the last processed arg on.
|
||||
int Dc_arg_int; // If Dc_arg_type & ARG_INT is set, then this is the value
|
||||
float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is the value
|
||||
|
||||
int scroll_times = 0; // incremented each time display scrolls
|
||||
|
||||
int debug_inited = 0;
|
||||
|
||||
#define DROWS 25
|
||||
#define DCOLS 80
|
||||
|
||||
int debug_x=0, debug_y=0;
|
||||
char debug_text[DROWS][DCOLS];
|
||||
|
||||
|
||||
static char command_line[1024];
|
||||
static int command_line_pos = 0;
|
||||
#define DEBUG_HISTORY 16
|
||||
static char oldcommand_line[DEBUG_HISTORY][1024];
|
||||
int last_oldcommand=-1;
|
||||
int command_scroll = 0;
|
||||
|
||||
///=========================== SCANNER =======================
|
||||
typedef enum {
|
||||
LETTER, QUOTE, SPECIAL, EOF_CODE, DIGIT,
|
||||
} CHAR_CODE;
|
||||
|
||||
typedef enum {
|
||||
NO_TOKEN, IDENTIFIER, NUMBER, STRING,
|
||||
} TOKEN_CODE;
|
||||
|
||||
|
||||
#define MAX_TOKEN_STRING_LENGTH 128
|
||||
|
||||
char scanner_ch;
|
||||
TOKEN_CODE scanner_token;
|
||||
|
||||
char scanner_token_string[MAX_TOKEN_STRING_LENGTH];
|
||||
char scanner_word_string[MAX_TOKEN_STRING_LENGTH];
|
||||
char * scanner_bufferp = "";
|
||||
char * scanner_tokenp = scanner_token_string;
|
||||
|
||||
CHAR_CODE scanner_char_table[256];
|
||||
|
||||
#define scanner_char_code(x) scanner_char_table[x]
|
||||
|
||||
void scanner_get_char()
|
||||
{
|
||||
if ( *scanner_bufferp == '\0' ) {
|
||||
scanner_ch = 0;
|
||||
return;
|
||||
}
|
||||
scanner_ch = *scanner_bufferp++;
|
||||
}
|
||||
|
||||
void scanner_init()
|
||||
{
|
||||
int ch;
|
||||
for (ch=0; ch<256; ++ch) scanner_char_table[ch] = SPECIAL;
|
||||
for (ch='0'; ch<='9'; ++ch) scanner_char_table[ch] = DIGIT;
|
||||
for (ch='A'; ch<='Z'; ++ch) scanner_char_table[ch] = LETTER;
|
||||
for (ch='a'; ch<='z'; ++ch) scanner_char_table[ch] = LETTER;
|
||||
|
||||
scanner_char_table['.'] = DIGIT;
|
||||
scanner_char_table['-'] = DIGIT;
|
||||
scanner_char_table['+'] = DIGIT;
|
||||
|
||||
scanner_char_table['_'] = LETTER;
|
||||
scanner_char_table[34] = QUOTE;
|
||||
scanner_char_table[0] = EOF_CODE;
|
||||
|
||||
|
||||
scanner_char_table[':'] = LETTER;
|
||||
scanner_char_table['\\'] = LETTER;
|
||||
|
||||
scanner_ch = 0;
|
||||
}
|
||||
|
||||
|
||||
void scanner_skip_blanks()
|
||||
{
|
||||
while( (scanner_ch ==' ') || (scanner_ch =='\t') )
|
||||
scanner_get_char();
|
||||
}
|
||||
|
||||
|
||||
void scanner_downshift_word()
|
||||
{
|
||||
int offset = 'a' - 'A';
|
||||
char * tp;
|
||||
|
||||
strcpy( scanner_word_string, scanner_token_string );
|
||||
|
||||
tp = scanner_word_string;
|
||||
do {
|
||||
*tp = (char)((*tp>='A') && (*tp <='Z') ? *tp + offset : *tp) ;
|
||||
tp++;
|
||||
} while (*tp != '\0' );
|
||||
}
|
||||
|
||||
|
||||
void scanner_get_word()
|
||||
{
|
||||
while( (scanner_char_code(scanner_ch)==LETTER) || (scanner_char_code(scanner_ch)==DIGIT) ) {
|
||||
*scanner_tokenp++ = scanner_ch;
|
||||
scanner_get_char();
|
||||
}
|
||||
*scanner_tokenp = '\0';
|
||||
|
||||
scanner_token = IDENTIFIER;
|
||||
}
|
||||
|
||||
|
||||
void scanner_get_string()
|
||||
{
|
||||
*scanner_tokenp++ = 34;
|
||||
scanner_get_char();
|
||||
|
||||
while(scanner_ch != 34 ) {
|
||||
*scanner_tokenp++ = scanner_ch;
|
||||
scanner_get_char();
|
||||
}
|
||||
scanner_get_char();
|
||||
*scanner_tokenp++ = 34;
|
||||
*scanner_tokenp = '\0';
|
||||
scanner_token = STRING;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void scanner_get_token()
|
||||
{
|
||||
scanner_skip_blanks();
|
||||
scanner_tokenp = scanner_token_string;
|
||||
*scanner_tokenp = 0;
|
||||
|
||||
|
||||
switch( scanner_char_code(scanner_ch) ) {
|
||||
case QUOTE: scanner_get_string(); break;
|
||||
case EOF_CODE: scanner_token = NO_TOKEN; break;
|
||||
case DIGIT:
|
||||
case LETTER: scanner_get_word(); break;
|
||||
default:
|
||||
*scanner_tokenp++ = scanner_ch;
|
||||
*scanner_tokenp = '\0';
|
||||
scanner_get_char();
|
||||
scanner_token = IDENTIFIER;
|
||||
break;
|
||||
}
|
||||
|
||||
scanner_downshift_word();
|
||||
}
|
||||
|
||||
void scanner_start_command( char * s )
|
||||
{
|
||||
scanner_bufferp = s;
|
||||
scanner_get_char();
|
||||
}
|
||||
|
||||
|
||||
int Dc_debug_on = 0;
|
||||
jmp_buf dc_bad_arg;
|
||||
|
||||
void dc_get_arg(uint type)
|
||||
{
|
||||
scanner_get_token();
|
||||
|
||||
Dc_command_line = scanner_bufferp;
|
||||
Dc_arg_org = scanner_token_string;
|
||||
Dc_arg = scanner_word_string;
|
||||
|
||||
if (Dc_debug_on) {
|
||||
dc_printf( "next arg is '%s', was originally '%s'\n", Dc_arg, Dc_arg_org );
|
||||
dc_printf( "Rest of the command line is '%s'\n", Dc_command_line );
|
||||
}
|
||||
|
||||
if ( scanner_token == NO_TOKEN ) {
|
||||
Dc_arg_type = ARG_NONE;
|
||||
} else if ( scanner_token == IDENTIFIER ) {
|
||||
Dc_arg_type = ARG_STRING;
|
||||
} else if ( scanner_token == STRING ) {
|
||||
Dc_arg_type = ARG_QUOTE;
|
||||
} else {
|
||||
Dc_arg_type = ARG_STRING;
|
||||
}
|
||||
|
||||
if ( Dc_arg_type & ARG_STRING ) {
|
||||
int i, num_digits, len;
|
||||
|
||||
len = strlen(Dc_arg);
|
||||
num_digits = 0;
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
if ( scanner_char_table[Dc_arg[i]] == DIGIT ) num_digits++;
|
||||
|
||||
if ( num_digits==len ) {
|
||||
Dc_arg_type |= ARG_FLOAT;
|
||||
Dc_arg_float = (float)atof(Dc_arg);
|
||||
if ( !strchr( Dc_arg, '.' )) {
|
||||
Dc_arg_type |= ARG_INT;
|
||||
Dc_arg_int = atoi(Dc_arg);
|
||||
}
|
||||
} else {
|
||||
if ( (Dc_arg[0] == '0') && (Dc_arg[1] == 'x') ) {
|
||||
char *p;
|
||||
int n;
|
||||
n = strtol(Dc_arg,&p,0);
|
||||
if ( *p == 0 ) {
|
||||
Dc_arg_type |= ARG_INT|ARG_HEX;
|
||||
Dc_arg_int = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Dc_debug_on) {
|
||||
if ( Dc_arg_type & ARG_FLOAT )
|
||||
dc_printf( "Found float number! %f\n", Dc_arg_float );
|
||||
|
||||
if ( Dc_arg_type & ARG_INT )
|
||||
dc_printf( "Found int number! %d\n", Dc_arg_int );
|
||||
|
||||
if ( Dc_arg_type & ARG_HEX )
|
||||
dc_printf( "Found hex number! 0x%x\n", Dc_arg_int );
|
||||
}
|
||||
|
||||
if ( !stricmp( Dc_arg, "on" ))
|
||||
Dc_arg_type |= ARG_TRUE;
|
||||
if ( !stricmp( Dc_arg, "true" ))
|
||||
Dc_arg_type |= ARG_TRUE;
|
||||
if ( !stricmp( Dc_arg, "off" ))
|
||||
Dc_arg_type |= ARG_FALSE;
|
||||
if ( !stricmp( Dc_arg, "false" ))
|
||||
Dc_arg_type |= ARG_FALSE;
|
||||
|
||||
if ( !stricmp( Dc_arg, "+" ))
|
||||
Dc_arg_type |= ARG_PLUS;
|
||||
|
||||
if ( !stricmp( Dc_arg, "-" ))
|
||||
Dc_arg_type |= ARG_MINUS;
|
||||
|
||||
if ( !stricmp( Dc_arg, "," ))
|
||||
Dc_arg_type |= ARG_COMMA;
|
||||
}
|
||||
|
||||
if ( Dc_arg_type & ARG_INT) {
|
||||
if ( Dc_arg_int )
|
||||
Dc_arg_type |= ARG_TRUE;
|
||||
else
|
||||
Dc_arg_type |= ARG_FALSE;
|
||||
}
|
||||
|
||||
if ( !(Dc_arg_type&type) ) {
|
||||
if ( (Dc_arg_type & ARG_NONE) && !(type & ARG_NONE))
|
||||
dc_printf( "Error: Not enough parameters.\n" );
|
||||
else
|
||||
dc_printf( "Error: '%s' invalid type\n", Dc_arg );
|
||||
longjmp(dc_bad_arg,1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void debug_help();
|
||||
|
||||
void debug_do_command(char * command)
|
||||
{
|
||||
|
||||
int i;
|
||||
int mode = 0;
|
||||
|
||||
if ( strlen(command) < 1 ) return;
|
||||
|
||||
Dc_debug_on = 0;
|
||||
Dc_command_line = command;
|
||||
scanner_start_command(command);
|
||||
|
||||
if (setjmp(dc_bad_arg) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
dc_get_arg( ARG_ANY );
|
||||
|
||||
if ( !strcmp( Dc_arg, "debug" ) ) {
|
||||
Dc_debug_on = 1;
|
||||
dc_printf( "Command line: '%s'\n", Dc_command_line );
|
||||
dc_get_arg( ARG_ANY );
|
||||
}
|
||||
|
||||
if ( !strcmp( Dc_arg, "?" ) ) {
|
||||
mode = 1;
|
||||
dc_get_arg( ARG_ANY );
|
||||
|
||||
if ( Dc_arg_type&ARG_NONE ) {
|
||||
debug_help();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !strcmp( Dc_arg, "help" ) || !strcmp( Dc_arg, "man" ) ) {
|
||||
mode = 2;
|
||||
dc_get_arg( ARG_ANY );
|
||||
if ( Dc_arg_type&ARG_NONE ) {
|
||||
debug_help();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( strstr( Dc_command_line, "?" ) ) {
|
||||
mode = 2;
|
||||
}
|
||||
|
||||
if ( !(Dc_arg_type&ARG_STRING) ) {
|
||||
dc_printf( "Invalid keyword '%s'\n", Dc_arg );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Dc_debug_on) {
|
||||
dc_printf( "Searching for command '%s'\n", Dc_arg );
|
||||
}
|
||||
|
||||
for (i=0; i<Num_debug_commands; i++ ) {
|
||||
if ( !stricmp( Debug_command[i]->name, Dc_arg )) {
|
||||
|
||||
if (mode==0) {
|
||||
if (Dc_debug_on)
|
||||
dc_printf( "Calling function '%s'\n", Dc_arg );
|
||||
Dc_command = 1;
|
||||
Dc_help = 0;
|
||||
Dc_status = 1;
|
||||
} else if (mode==1) {
|
||||
if (Dc_debug_on)
|
||||
dc_printf( "Checking status for '%s'\n", Dc_arg );
|
||||
Dc_command = 0;
|
||||
Dc_help = 0;
|
||||
Dc_status = 1;
|
||||
} else {
|
||||
if (Dc_debug_on)
|
||||
dc_printf( "Doing help for '%s'\n", Dc_arg );
|
||||
Dc_command = 0;
|
||||
Dc_help = 1;
|
||||
Dc_status = 0;
|
||||
}
|
||||
|
||||
(*Debug_command[i]->func)();
|
||||
|
||||
if (mode==0) {
|
||||
dc_get_arg(ARG_ANY);
|
||||
if (!(Dc_arg_type&ARG_NONE)) {
|
||||
dc_printf( "Ignoring the unused command line tail '%s %s'\n", Dc_arg_org, Dc_command_line );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dc_printf( "Unknown command '%s'\n", Dc_arg );
|
||||
}
|
||||
|
||||
void debug_draw()
|
||||
{
|
||||
int i;
|
||||
|
||||
gr_clear();
|
||||
gr_set_font(FONT1);
|
||||
gr_set_color_fast( &Color_bright );
|
||||
gr_string( 0x8000, 3, "Debug Console" );
|
||||
|
||||
gr_set_color_fast( &Color_normal );
|
||||
|
||||
for (i=0; i<DROWS; i++ ) {
|
||||
gr_string( 0, i*16+16, debug_text[i] );
|
||||
}
|
||||
|
||||
int t = timer_get_fixed_seconds() / (F1_0/3);
|
||||
if ( t & 1 ) {
|
||||
int w,h;
|
||||
char c;
|
||||
|
||||
c = debug_text[debug_y][command_line_pos+1];
|
||||
debug_text[debug_y][command_line_pos+1] = 0;
|
||||
|
||||
gr_get_string_size( &w, &h, debug_text[debug_y] );
|
||||
|
||||
//gr_string( w, debug_y*16, "_" );
|
||||
gr_rect(w+1,debug_y*16+1+16,2,14);
|
||||
|
||||
debug_text[debug_y][command_line_pos+1] = c;
|
||||
}
|
||||
|
||||
gr_flip();
|
||||
}
|
||||
|
||||
|
||||
void debug_output( char c )
|
||||
{
|
||||
if ( c == '\t' ) {
|
||||
int next_tab = ((debug_x/28)+1)*28;
|
||||
|
||||
if ( next_tab >= DCOLS-1 ) {
|
||||
debug_x=0;
|
||||
debug_y++;
|
||||
scroll_times++;
|
||||
if ( debug_y >= DROWS ) {
|
||||
int i;
|
||||
for (i=1; i<DROWS; i++ )
|
||||
strcpy( debug_text[i-1], debug_text[i] );
|
||||
debug_y = DROWS-1;
|
||||
debug_x = 0;
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
}
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
for ( ; debug_x < next_tab; )
|
||||
debug_text[debug_y][debug_x++] = ' ';
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (c == '\n') || (debug_x >= DCOLS-1) ) {
|
||||
debug_x=0;
|
||||
debug_y++;
|
||||
scroll_times++;
|
||||
if ( debug_y >= DROWS ) {
|
||||
int i;
|
||||
for (i=1; i<DROWS; i++ )
|
||||
strcpy( debug_text[i-1], debug_text[i] );
|
||||
debug_y = DROWS-1;
|
||||
debug_x = 0;
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
}
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
if ( c == '\n' ) return;
|
||||
}
|
||||
|
||||
debug_text[debug_y][debug_x++] = c;
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
}
|
||||
|
||||
void dc_printf(char *format, ...)
|
||||
{
|
||||
char tmp[DCOLS*2];
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vsprintf(tmp, format, args);
|
||||
va_end(args);
|
||||
|
||||
char *p = tmp;
|
||||
while( *p ) {
|
||||
debug_output(*p);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void debug_init()
|
||||
{
|
||||
int i;
|
||||
if ( debug_inited ) return;
|
||||
|
||||
debug_inited = 1;
|
||||
|
||||
debug_x=0;
|
||||
debug_y=0;
|
||||
|
||||
for (i=0; i<DROWS; i++ ) {
|
||||
debug_text[i][0] = 0;
|
||||
}
|
||||
|
||||
dc_printf("Debug console started.\n" );
|
||||
}
|
||||
|
||||
|
||||
void debug_console( void (*_func)() )
|
||||
{
|
||||
int done = 0;
|
||||
|
||||
scanner_init();
|
||||
|
||||
while( key_inkey() ){
|
||||
os_poll();
|
||||
}
|
||||
|
||||
if ( !debug_inited ) debug_init();
|
||||
|
||||
|
||||
debug_draw();
|
||||
|
||||
while (!done) {
|
||||
// poll the os
|
||||
os_poll();
|
||||
|
||||
int k = key_inkey();
|
||||
switch( k ) {
|
||||
|
||||
case KEY_SHIFTED+KEY_ENTER:
|
||||
case KEY_ESC:
|
||||
done=1; break;
|
||||
|
||||
case KEY_BACKSP:
|
||||
if ( command_line_pos > 0 ) {
|
||||
command_line[--command_line_pos] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_F3:
|
||||
if ( last_oldcommand > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[last_oldcommand] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
command_scroll--;
|
||||
if (command_scroll<0)
|
||||
command_scroll = last_oldcommand;
|
||||
|
||||
if ( command_scroll > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[command_scroll] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
command_scroll++;
|
||||
if (command_scroll>last_oldcommand)
|
||||
command_scroll = 0;
|
||||
if (command_scroll>last_oldcommand)
|
||||
command_scroll = -1;
|
||||
if ( command_scroll > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[command_scroll] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_ENTER: {
|
||||
debug_output( '\n' );
|
||||
debug_draw();
|
||||
|
||||
debug_do_command(command_line);
|
||||
|
||||
int i, found = 0;
|
||||
for (i=0; i<=last_oldcommand; i++ ) {
|
||||
if (!stricmp( oldcommand_line[i], command_line )) {
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
if ( !found ) {
|
||||
if ( last_oldcommand < DEBUG_HISTORY-1 ) {
|
||||
last_oldcommand++;
|
||||
strcpy( oldcommand_line[last_oldcommand], command_line);
|
||||
} else {
|
||||
int i;
|
||||
for (i=0; i<last_oldcommand; i++ ) {
|
||||
strcpy( oldcommand_line[i], oldcommand_line[i+1] );
|
||||
}
|
||||
strcpy( oldcommand_line[last_oldcommand], command_line);
|
||||
}
|
||||
}
|
||||
// int i;
|
||||
// for (i=0; i<=last_oldcommand; i++ ) {
|
||||
// dc_printf( "OC %d. %s\n", i, oldcommand_line[i] );
|
||||
// }
|
||||
|
||||
debug_output( '\n' );
|
||||
command_line_pos = 0;
|
||||
command_line[command_line_pos] = 0;
|
||||
|
||||
command_scroll = 0;
|
||||
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
ubyte c = (ubyte)key_to_ascii(k);
|
||||
if ( c != 255 ) {
|
||||
command_line[command_line_pos++] = c;
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
strcpy( debug_text[debug_y], ">" );
|
||||
strcat( debug_text[debug_y], command_line );
|
||||
debug_draw();
|
||||
|
||||
if ( _func ){
|
||||
_func();
|
||||
}
|
||||
}
|
||||
|
||||
while( key_inkey() ){
|
||||
os_poll();
|
||||
}
|
||||
}
|
||||
|
||||
void debug_help()
|
||||
{
|
||||
int s, i;
|
||||
|
||||
dc_printf( "Available functions:\n\n" );
|
||||
|
||||
s = scroll_times;
|
||||
for (i=0; i<Num_debug_commands; i++ ) {
|
||||
dc_printf( " %s - %s\n", Debug_command[i]->name, Debug_command[i]->help );
|
||||
//mprintf(( "Scroll times %d\n", scroll_times - s ));
|
||||
if ( scroll_times - s > DROWS - 3 ) {
|
||||
int k;
|
||||
dc_printf( " Press a key...B for back\n" );
|
||||
debug_draw();
|
||||
k = key_getch();
|
||||
s = scroll_times;
|
||||
if ( k == KEY_B ) {
|
||||
i -= ((DROWS-3)*2);
|
||||
if ( i <= 0 )
|
||||
i = -1;
|
||||
}
|
||||
}
|
||||
debug_draw();
|
||||
}
|
||||
dc_printf( "\n" );
|
||||
|
||||
dc_printf( "Typing '? function_name' will give the current status.\n" );
|
||||
dc_printf( "Typing 'function_name ?' will give help on the function.\n" );
|
||||
dc_printf( "Typing ? or help will give you help.\n");
|
||||
dc_printf( "F3 selects last command line.\n" );
|
||||
}
|
||||
@@ -1,406 +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"
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
int dbugfile_counters[MAX_COUNTERS];
|
||||
bool dbugfile_init_var = false;
|
||||
|
||||
char dbugfile_filename[512];
|
||||
|
||||
void dbugfile_output(char *buffer)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FILE *fp = fopen(dbugfile_filename, "a");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void dbugfile_init()
|
||||
{
|
||||
// Clear the counters
|
||||
memset(dbugfile_counters, 0, sizeof(int) * MAX_COUNTERS);
|
||||
|
||||
char big_buffer[1000];
|
||||
char temp_buff[512];
|
||||
|
||||
dbugfile_filename[0] = '\0';
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
char path[MAX_PATH];
|
||||
|
||||
GetCurrentDirectory(MAX_PATH, path);
|
||||
|
||||
int path_len = strlen(path);
|
||||
if(path[path_len - 1] != '\\')
|
||||
{
|
||||
path[path_len] = '\\';
|
||||
path[path_len + 1] = '\0';
|
||||
}
|
||||
|
||||
strcpy(dbugfile_filename, path);
|
||||
|
||||
#endif
|
||||
|
||||
strcat(dbugfile_filename, "DBUG-");
|
||||
strcpy(big_buffer, "DBUGFILE Active: ");
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
unsigned long len = 512;
|
||||
GetUserName(temp_buff, &len);
|
||||
|
||||
strcat(dbugfile_filename, temp_buff);
|
||||
strcat(big_buffer, temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, "-");
|
||||
strcat(big_buffer, " ");
|
||||
}
|
||||
#endif
|
||||
|
||||
_tzset();
|
||||
|
||||
// Display operating system-style date and time.
|
||||
_strdate( temp_buff);
|
||||
strcat(dbugfile_filename, "D(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ") T(");
|
||||
strcat(big_buffer, " ");
|
||||
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ").txt");
|
||||
strcat(big_buffer, "\n");
|
||||
|
||||
// Remove invalid slash chars
|
||||
int len = strlen(dbugfile_filename);
|
||||
while(len >= 2)
|
||||
{
|
||||
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
|
||||
{
|
||||
dbugfile_filename[len] = '-';
|
||||
}
|
||||
len--;
|
||||
}
|
||||
|
||||
// open file
|
||||
// Uncomment this to see where the file is going
|
||||
//MessageBox(NULL, dbugfile_filename, "das", MB_OK);
|
||||
FILE *fp = fopen(dbugfile_filename, "w");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// detect OS type
|
||||
|
||||
OSVERSIONINFO version_info;
|
||||
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
if(GetVersionEx(&version_info) != false)
|
||||
{
|
||||
char *error = "Error in detecting OS version";
|
||||
char *version = error;
|
||||
|
||||
switch(version_info.dwMajorVersion)
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 95";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 10)
|
||||
{
|
||||
version = "Windows 98";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 90)
|
||||
{
|
||||
version = "Windows Me";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if(version_info.dwMinorVersion == 0)
|
||||
{
|
||||
version = "Windows 2000";
|
||||
}
|
||||
else if(version_info.dwMinorVersion == 1)
|
||||
{
|
||||
version = "Windows XP";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char *release_type = NULL;
|
||||
#ifdef _DEBUG
|
||||
release_type = "Debug";
|
||||
#else
|
||||
release_type = "Release";
|
||||
#endif
|
||||
sprintf(big_buffer, "OS: %s %s, ", version, release_type);
|
||||
}
|
||||
|
||||
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
|
||||
|
||||
char exe_name[MAX_PATH];
|
||||
|
||||
GetModuleFileName(NULL, exe_name, MAX_PATH);
|
||||
strcat(exe_name, "\n");
|
||||
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
|
||||
dbugfile_init_var = true;
|
||||
}
|
||||
|
||||
void dbugfile_deinit()
|
||||
{
|
||||
dbugfile_output("Normal end");
|
||||
dbugfile_init_var = false;
|
||||
}
|
||||
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
|
||||
|
||||
va_list ap;
|
||||
char *p, *sval;
|
||||
long ival;
|
||||
double dval;
|
||||
|
||||
// Add each extra parameter to string
|
||||
va_start(ap, format);
|
||||
|
||||
for(p = (char *) format; *p; p++)
|
||||
{
|
||||
if(*p != '%')
|
||||
{
|
||||
*(buffer + i) = *p;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
p++;
|
||||
|
||||
switch(*p)
|
||||
{
|
||||
case 'd':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%d", ival);
|
||||
break;
|
||||
}
|
||||
case 'c':
|
||||
{
|
||||
ival = va_arg(ap, char);
|
||||
buffer[i] = (char) ival;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
case 'x':
|
||||
{
|
||||
ival = va_arg(ap, int);
|
||||
i += sprintf(buffer+i,"%x", ival);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'f':
|
||||
{
|
||||
dval = va_arg(ap, double);
|
||||
i += sprintf(buffer+i,"%f", dval);
|
||||
break;
|
||||
}
|
||||
case 's':
|
||||
{
|
||||
for(sval = va_arg(ap, char *); *sval; sval++)
|
||||
{
|
||||
*(buffer + i++) = *sval;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
i += sprintf(buffer+i,"N/A: %%%c", *p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
|
||||
i += sprintf(buffer + i, "\n");
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n"
|
||||
"%f %f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8],
|
||||
matrix[9],
|
||||
matrix[10],
|
||||
matrix[11],
|
||||
matrix[12],
|
||||
matrix[13],
|
||||
matrix[14],
|
||||
matrix[15]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
|
||||
{
|
||||
if(dbugfile_init_var == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(matrix == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// find last slash (for PC) to crop file path
|
||||
char *ptr = strrchr(file, '\\');
|
||||
|
||||
if(ptr == NULL)
|
||||
{
|
||||
ptr = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if(text == NULL)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
char buffer[1000];
|
||||
|
||||
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n"
|
||||
"%f %f %f\n",
|
||||
ptr,line, text,
|
||||
matrix[0],
|
||||
matrix[1],
|
||||
matrix[2],
|
||||
matrix[3],
|
||||
matrix[4],
|
||||
matrix[5],
|
||||
matrix[6],
|
||||
matrix[7],
|
||||
matrix[8]);
|
||||
|
||||
dbugfile_output(buffer);
|
||||
}
|
||||
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
|
||||
{
|
||||
char buffer[1000];
|
||||
strcpy(buffer, string);
|
||||
strcat(buffer, " %d");
|
||||
|
||||
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#ifndef _DBUGFILE_HEADER_
|
||||
#define _DBUGFILE_HEADER_
|
||||
|
||||
#define MAX_COUNTERS 10
|
||||
|
||||
void dbugfile_init();
|
||||
void dbugfile_deinit();
|
||||
void dbugfile_sprintf(int line, char *file, const char *format, ...);
|
||||
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
|
||||
|
||||
#ifdef DBUGFILE_ACTIVE
|
||||
|
||||
#define DBUGFILE_INIT() dbugfile_init();
|
||||
#define DBUGFILE_DEINIT() dbugfile_deinit();
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
|
||||
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
|
||||
|
||||
extern int dbugfile_counters[MAX_COUNTERS];
|
||||
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
|
||||
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
|
||||
|
||||
#else
|
||||
|
||||
#define DBUGFILE_INIT() ;
|
||||
#define DBUGFILE_DEINIT() ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_0(t) ;
|
||||
#define DBUGFILE_OUTPUT_1(t,a) ;
|
||||
#define DBUGFILE_OUTPUT_2(t,a,b) ;
|
||||
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
|
||||
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
|
||||
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
|
||||
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
|
||||
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
|
||||
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
|
||||
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
|
||||
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
|
||||
|
||||
#define DBUGFILE_INC_COUNTER(n) ;
|
||||
#define DBUGFILE_DEC_COUNTER(n) ;
|
||||
|
||||
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is intended as a debug tool to measure the speed of blocks of code and display
|
||||
* that information as coloured bars across the top of the screen.
|
||||
*
|
||||
* This allows interactive measuring of components of the code, very useful for optimisztion.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
||||
#include "timerbar.h"
|
||||
#include "globalincs\pstypes.h"
|
||||
|
||||
// Internal structure for handling frame data
|
||||
typedef struct
|
||||
{
|
||||
LARGE_INTEGER start_value;
|
||||
LARGE_INTEGER total_value;
|
||||
|
||||
LARGE_INTEGER average;
|
||||
LARGE_INTEGER frame_total;
|
||||
|
||||
} timerbar_profile;
|
||||
|
||||
timerbar_profile profiles[MAX_NUM_TIMERBARS];
|
||||
int timerbar_current_profile = 0;
|
||||
|
||||
LARGE_INTEGER timerbar_ultimate_start_value;
|
||||
LARGE_INTEGER timerbar_last_start_value;
|
||||
|
||||
// Data needed for push and pop functionality
|
||||
const MAX_TB_STACK_SIZE = 100;
|
||||
|
||||
int timerbar_stack[MAX_TB_STACK_SIZE];
|
||||
int timerbar_current_stack_layer = 0;
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_push(int value)
|
||||
{
|
||||
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
|
||||
{
|
||||
// To many pushs, this must be a bug
|
||||
// Someone is letting code miss the pops, check for early retuns
|
||||
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
|
||||
timerbar_current_stack_layer++;
|
||||
|
||||
timerbar_switch_type(value);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void timerbar_pop()
|
||||
{
|
||||
timerbar_current_stack_layer--;
|
||||
if(timerbar_current_stack_layer < 0)
|
||||
{
|
||||
Assert(!(timerbar_current_stack_layer < 0));
|
||||
timerbar_current_stack_layer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
|
||||
}
|
||||
|
||||
// This pointer holds the draw function to use or NULL
|
||||
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
|
||||
|
||||
void timerbar_start_frame()
|
||||
{
|
||||
timerbar_current_stack_layer = 0;
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
// Constants need for timerbar_conv_and_draw calculations
|
||||
const int WIDTH = 480;
|
||||
const float WIDTHF = ((float) WIDTH) * 1.01f;
|
||||
|
||||
/**
|
||||
* Internal conversion function to convert draw data into bars for the screen
|
||||
*
|
||||
* @param int colour - colour index (>=0)
|
||||
* @param int xpos - x position to start bar on
|
||||
* @param int xwidth - width of bar
|
||||
* @param int yrow - Index of row bar belongs to
|
||||
*/
|
||||
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
|
||||
{
|
||||
float fxpos = (float) xpos;
|
||||
float fxwidth = (float) xwidth;
|
||||
|
||||
draw_func_ptr(colour,
|
||||
fxpos / WIDTHF,
|
||||
yrow * 0.01f,
|
||||
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 < MAX_NUM_TIMERBARS; i++)
|
||||
{
|
||||
// Nothing to render this frame
|
||||
if(profiles[i].frame_total.QuadPart == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
|
||||
|
||||
// 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 >= MAX_NUM_TIMERBARS)
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
|
||||
*
|
||||
* Sets the draw function used to output the timer data, designed to be generic allowing any API
|
||||
* to take advantage of this module. Set to NULL to disable drawing.
|
||||
*
|
||||
* By default the draw function is set to NULL
|
||||
*/
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
|
||||
{
|
||||
draw_func_ptr = new_draw_func_ptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
|
||||
*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* created based on the source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2004-02-16 11:47:31 $
|
||||
* $Author: randomtiger $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2003/11/19 20:37:23 randomtiger
|
||||
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
|
||||
* Made some commandline variables fit the naming standard.
|
||||
* Changed timerbar system not to run pushes and pops if its not in use.
|
||||
* Put in a note about not uncommenting asserts.
|
||||
* Fixed up a lot of missing POP's on early returns?
|
||||
* Perhaps the motivation for Assert functionality getting commented out?
|
||||
* Fixed up some bad asserts.
|
||||
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
|
||||
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
|
||||
* Put in a special check for the signs of that D3D init bug I need to lock down.
|
||||
*
|
||||
* Revision 1.6 2003/11/09 06:31:39 Kazan
|
||||
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
|
||||
* conflicts in cmdline and timerbar.h log entries
|
||||
* cvs stopped acting like it was on crack obviously
|
||||
*
|
||||
* Revision 1.5 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
const int MAX_NUM_TIMERBARS = 20;
|
||||
|
||||
#include "cmdline/cmdline.h"
|
||||
|
||||
// These functions should never be used directly, always use macros below
|
||||
void timerbar_start_frame();
|
||||
void timerbar_end_frame();
|
||||
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
|
||||
|
||||
void timerbar_push(int value);
|
||||
void timerbar_pop();
|
||||
|
||||
// This function shouldnt not be used any more or it will break push and pop calls
|
||||
void timerbar_switch_type(int num);
|
||||
|
||||
#define TIMERBAR_SET_DRAW_FUNC(f) if (Cmdline_timerbar) timerbar_set_draw_func(f);
|
||||
#define TIMERBAR_START_FRAME() if (Cmdline_timerbar) timerbar_start_frame();
|
||||
#define TIMERBAR_END_FRAME() if (Cmdline_timerbar) timerbar_end_frame();
|
||||
#define TIMERBAR_SWITCH_TYPE(n) if (Cmdline_timerbar) timerbar_switch_type(n);
|
||||
|
||||
#define TIMERBAR_PUSH(v) if (Cmdline_timerbar) timerbar_push(v);
|
||||
#define TIMERBAR_POP() if (Cmdline_timerbar) timerbar_pop();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,835 +0,0 @@
|
||||
//sorce file for decals-Bobboau
|
||||
//and no, I don't have any idea what I'm doing
|
||||
/*
|
||||
#include "decals/decals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "render/3d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math/fvi.h"
|
||||
#include "lighting/lighting.h"
|
||||
|
||||
//#define DECALS_ENABLED
|
||||
|
||||
int decal_intersect_seg_with_cube(vector * poly_point, vector start, vector end, vector cube_point[8], matrix orient, int ints=1);
|
||||
|
||||
int decal_intersect_poly_with_cube(vector * poly_point, vector point[3], vector cube_point[8], int ints);
|
||||
|
||||
decal_model d_model;
|
||||
|
||||
int poly_num = 0;
|
||||
|
||||
static vector decal_cube_point[8];
|
||||
static vector decal_cube_plane[6][2];
|
||||
static vector decal_hit_point;
|
||||
static vector decal_hit_vect;
|
||||
static float decal_hit_radius;
|
||||
|
||||
static matrix decal_orient;
|
||||
|
||||
static vector * decal_point_list[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static int decal_poly[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static decal * new_decal;
|
||||
|
||||
static int nverts;
|
||||
|
||||
static float min_rad;
|
||||
|
||||
static int back_faceing;
|
||||
|
||||
/*
|
||||
vector uvec, rvec;
|
||||
vector temp;
|
||||
|
||||
temp = *pos;
|
||||
|
||||
vm_vec_sub( &rvec, Eyeposition, &temp );
|
||||
vm_vec_normalize( &rvec );
|
||||
|
||||
vm_vec_crossprod(&uvec,fvec,&rvec);
|
||||
vm_vec_normalize(&uvec);
|
||||
|
||||
vm_vec_scale_add( top, &temp, &uvec, w/2.0f );
|
||||
vm_vec_scale_add( bot, &temp, &uvec, -w/2.0f );
|
||||
|
||||
|
||||
int decal_find_next(object *obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
int oldest = shipp->decals[0].timestamp;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].is_valid != 1){ //use up all the unused decals first
|
||||
return i%MAX_SHIP_DECALS;
|
||||
}
|
||||
}
|
||||
for(i = 1; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].timestamp > oldest){ //then get the oldest one
|
||||
oldest = i;
|
||||
}
|
||||
}
|
||||
return oldest%MAX_SHIP_DECALS;
|
||||
#else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return 0;
|
||||
}
|
||||
// vertex vert[1][2];
|
||||
// vector vec[4];
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 10;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
|
||||
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
|
||||
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
mprintf(("\n"));
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *dec = shipp->decals;
|
||||
|
||||
vm_vec_scale_add( &dec[0].vert[0], ¢er, &plain_point[0], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[1], ¢er, &plain_point[2], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[2], ¢er, &plain_point[1], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[3], ¢er, &plain_point[3], rad );
|
||||
|
||||
dec[dinx].poly[0].point[0] = 0;
|
||||
dec[dinx].poly[0].point[1] = 1;
|
||||
dec[dinx].poly[0].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[1].point[0] = 0;
|
||||
dec[dinx].poly[1].point[1] = 3;
|
||||
dec[0].poly[1].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[0].uv[0].u = 0; dec[0].poly[0].uv[0].v = 0;
|
||||
dec[dinx].poly[0].uv[1].u = 0; dec[0].poly[0].uv[1].v = 1;
|
||||
dec[dinx].poly[0].uv[2].u = 1; dec[0].poly[0].uv[2].v = 1;
|
||||
|
||||
dec[dinx].poly[1].uv[0].u = 0; dec[0].poly[1].uv[0].v = 0;
|
||||
dec[dinx].poly[1].uv[1].u = 1; dec[0].poly[1].uv[1].v = 0;
|
||||
dec[dinx].poly[1].uv[2].u = 1; dec[0].poly[1].uv[2].v = 1;
|
||||
|
||||
dec[dinx].texture = texture;
|
||||
dec[dinx].n_poly = 2;
|
||||
dec[dinx].is_valid = 1;
|
||||
dec[dinx].timestamp = timestamp();
|
||||
|
||||
mprintf(("a decal should have been made at %0.2f %0.2f %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
//Int3();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define duw(p) (*((uint *) (p)))
|
||||
#define dw(p) (*((int *) (p)))
|
||||
#define dwp(p) ((int *) (p))
|
||||
#define dvp(p) ((vector *) (p))
|
||||
#define dfl(p) (*((float *) (p)))
|
||||
|
||||
|
||||
//creates a decal, returns decal index on succes, -1 on failure
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture){
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return -1;
|
||||
}
|
||||
if(texture == -1)return -1;
|
||||
if(point->radius <= 0)return -1;
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 1;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
vector cube_point[8];
|
||||
//define the decals dimentions
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
vector topcenter;
|
||||
vector bvec = point->orient.vec.fvec;
|
||||
vm_vec_negate(&bvec);
|
||||
vm_vec_scale_add(&topcenter, ¢er, &bvec, rad);
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
vm_vec_scale_add( &cube_point[i], &topcenter, &plain_point[i], rad );
|
||||
vm_vec_scale_add( &cube_point[i+4], &cube_point[i], &point->orient.vec.fvec, rad*2);
|
||||
}
|
||||
|
||||
float max_rad = vm_vec_dist_quick(¢er, &cube_point[0]); //the cube points are all equidistant, right?
|
||||
min_rad = fl_sqrt((rad * rad)/2); //the cube points are all equidistant, right?
|
||||
mprintf(("decal defined\n"));
|
||||
|
||||
//define the decals dimentions
|
||||
|
||||
//set up the decal model
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *sdec = shipp->decals;
|
||||
|
||||
polymodel *pm = model_get(shipp->modelnum);
|
||||
bsp_info * sm;
|
||||
sm = &pm->submodel[subobject];
|
||||
// decal_model dmod = pm->submodel[subobject].dec_model;// sm->dec_model;
|
||||
// decal_model tdec; //temporary decal model for holding the culled down part of the decal
|
||||
|
||||
//setting up the decal cube
|
||||
vector test_vec, temp1, temp2;
|
||||
for(i = 0; i<8; i++)decal_cube_point[i] = cube_point[i];
|
||||
|
||||
decal_orient = point->orient;
|
||||
|
||||
decal_cube_plane[0][0] = cube_point[5];
|
||||
|
||||
temp1 = decal_orient.vec.uvec;
|
||||
temp2 = decal_orient.vec.rvec;
|
||||
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[0][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[1][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[1][1] = test_vec;
|
||||
// mprintf(("plane 1 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][0].xyz.x, decal_cube_plane[1][0].xyz.y, decal_cube_plane[1][0].xyz.z));
|
||||
// mprintf(("plane 1 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][1].xyz.x, decal_cube_plane[1][1].xyz.y, decal_cube_plane[1][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[2][0] = cube_point[5];
|
||||
|
||||
vm_vec_negate(&temp2);
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[2][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 2 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][0].xyz.x, decal_cube_plane[2][0].xyz.y, decal_cube_plane[2][0].xyz.z));
|
||||
// mprintf(("plane 2 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][1].xyz.x, decal_cube_plane[2][1].xyz.y, decal_cube_plane[2][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[3][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[3][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 3 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][0].xyz.x, decal_cube_plane[3][0].xyz.y, decal_cube_plane[3][0].xyz.z));
|
||||
// mprintf(("plane 3 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][1].xyz.x, decal_cube_plane[3][1].xyz.y, decal_cube_plane[3][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
test_vec = decal_orient.vec.fvec;
|
||||
|
||||
decal_cube_plane[4][0] = cube_point[0];
|
||||
|
||||
decal_cube_plane[4][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 4 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][0].xyz.x, decal_cube_plane[4][0].xyz.y, decal_cube_plane[4][0].xyz.z));
|
||||
// mprintf(("plane 4 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][1].xyz.x, decal_cube_plane[4][1].xyz.y, decal_cube_plane[4][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
decal_cube_plane[5][0] = cube_point[5];
|
||||
|
||||
decal_cube_plane[5][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 5 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][0].xyz.x, decal_cube_plane[5][0].xyz.y, decal_cube_plane[5][0].xyz.z));
|
||||
// mprintf(("plane 5 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][1].xyz.x, decal_cube_plane[5][1].xyz.y, decal_cube_plane[5][1].xyz.z));
|
||||
//setting up the decal cube
|
||||
|
||||
mprintf(("cube set up\n"));
|
||||
|
||||
decal_hit_point = point->pnt;
|
||||
decal_hit_radius = max_rad;
|
||||
decal_hit_vect = point->orient.vec.fvec;
|
||||
poly_num = 0;
|
||||
nverts = 0;
|
||||
|
||||
//go and find decals for each submodel
|
||||
// for(int z = 0; z<pm->n_models;z++){
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
mprintf(("decal is number %d\n", dinx));
|
||||
|
||||
sdec[dinx].is_valid = 0;
|
||||
|
||||
new_decal = &shipp->decals[dinx];
|
||||
|
||||
if(backfaced_texture != -1){
|
||||
back_faceing = 1;
|
||||
}else{
|
||||
back_faceing = 0;
|
||||
}
|
||||
decal_create_sub((ubyte *)pm->submodel[subobject].bsp_data);
|
||||
|
||||
mprintf(("deacal defined\n"));
|
||||
|
||||
sdec[dinx].texture = texture;
|
||||
sdec[dinx].backfaced_texture = backfaced_texture;
|
||||
sdec[dinx].is_valid = 1;
|
||||
sdec[dinx].timestamp = timestamp();
|
||||
sdec[dinx].n_poly = poly_num;
|
||||
sdec[dinx].state = 1;
|
||||
sdec[dinx].lifetime = 3000;
|
||||
sdec[dinx].frames = 1;
|
||||
sdec[dinx].importance = 0;
|
||||
sdec[dinx].radius = max_rad;
|
||||
sdec[dinx].position = point->pnt;
|
||||
|
||||
mprintf(("a decal should have been made with %d polys\n",sdec[0].n_poly));
|
||||
|
||||
|
||||
return dinx;
|
||||
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
//decal_model d_model;
|
||||
|
||||
// Point list
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 int n_verts
|
||||
// +12 int n_norms
|
||||
// +16 int offset from start of chunk to vertex data
|
||||
// +20 n_verts*char norm_counts
|
||||
// +offset vertex data. Each vertex n is a point followed by norm_counts[n] normals.
|
||||
void decal_create_defpoints(ubyte * p )
|
||||
{
|
||||
// mprintf(("entering decal decal_create_defpoints\n"));
|
||||
|
||||
|
||||
int n;
|
||||
nverts = dw(p+8);
|
||||
int offset = dw(p+16);
|
||||
|
||||
mprintf(("%d verts\n",nverts));
|
||||
ubyte * normcount = p+20;
|
||||
vector *src = dvp(p+offset);
|
||||
|
||||
Assert( nverts < 1200 );
|
||||
|
||||
|
||||
|
||||
for (n=0; n<nverts; n++ ) {
|
||||
|
||||
|
||||
decal_point_list[n] = src;
|
||||
new_decal->vert[n].xyz = src->xyz;
|
||||
src += normcount[n]+1;
|
||||
// mprintf(("defpoint %d, x %0.2f, y %0.2f, z %0.2f\n",n,d_model.vert[n].xyz.x,d_model.vert[n].xyz.y,d_model.vert[n].xyz.z));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Sortnorms
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector center
|
||||
// +32 float radius
|
||||
// 36 int front offset
|
||||
// 40 int back offset
|
||||
// 44 int prelist offset
|
||||
// 48 int postlist offset
|
||||
// 52 int online offset
|
||||
|
||||
void decal_create_sortnorm(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_sortnorm\n"));
|
||||
int frontlist = dw(p+36);
|
||||
int backlist = dw(p+40);
|
||||
int prelist = dw(p+44);
|
||||
int postlist = dw(p+48);
|
||||
int onlist = dw(p+52);
|
||||
|
||||
vector min, max;
|
||||
min.xyz = dvp(p+56)->xyz;
|
||||
max.xyz = dvp(p+68)->xyz;
|
||||
min.xyz.x += decal_hit_radius;
|
||||
min.xyz.y += decal_hit_radius;
|
||||
min.xyz.z += decal_hit_radius;
|
||||
max.xyz.x += decal_hit_radius;
|
||||
max.xyz.y += decal_hit_radius;
|
||||
max.xyz.z += decal_hit_radius;
|
||||
|
||||
/* if (!fvi_ray_boundingbox( &min, &max, &decal_hit_point, &decal_hit_vect, NULL )) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prelist) decal_create_sub(p+prelist);
|
||||
if (backlist) decal_create_sub(p+backlist);
|
||||
if (onlist) decal_create_sub(p+onlist);
|
||||
if (frontlist) decal_create_sub(p+frontlist);
|
||||
if (postlist) decal_create_sub(p+postlist);
|
||||
}
|
||||
|
||||
/*
|
||||
typedef struct model_tmap_vert {
|
||||
short vertnum;
|
||||
short normnum;
|
||||
float u,v;
|
||||
} model_tmap_vert;
|
||||
|
||||
//int poly_num = 0;
|
||||
// Textured Poly
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector normal_point
|
||||
// +32 int tmp = 0
|
||||
// +36 int nverts
|
||||
// +40 int tmap_num
|
||||
// +44 nverts*(model_tmap_vert) vertlist (n,u,v)
|
||||
void decal_create_tmappoly(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_tmappoly\n"));
|
||||
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int i;
|
||||
int nv;
|
||||
// uv_pair uvlist[TMAP_MAX_VERTS];
|
||||
// vector points[TMAP_MAX_VERTS];
|
||||
model_tmap_vert *verts;
|
||||
|
||||
nv = dw(p+36);
|
||||
if ( nv < 0 ) return;
|
||||
|
||||
// int tmap_num = dw(p+40);
|
||||
/*
|
||||
if ( (!(Mc->flags & MC_CHECK_INVISIBLE_FACES)) && (Mc_pm->textures[tmap_num] < 0) ) {
|
||||
// Don't check invisible polygons.
|
||||
return;
|
||||
}
|
||||
|
||||
verts = (model_tmap_vert *)(p+44);
|
||||
vector temppoly[820];
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
decal_poly[i] = (int)verts[i].vertnum;
|
||||
temppoly[i].xyz = decal_point_list[decal_poly[i]]->xyz;
|
||||
}
|
||||
|
||||
vector pnorm;
|
||||
vm_vec_perp(&pnorm, decal_point_list[decal_poly[0]], decal_point_list[decal_poly[1]], decal_point_list[decal_poly[2]]);
|
||||
|
||||
float back = vm_vec_dot(&decal_cube_plane[4][1], &pnorm);
|
||||
|
||||
if( (back_faceing == 0) && (back >= 0) )return;
|
||||
|
||||
//poly culling
|
||||
vector pcenter;
|
||||
vm_vec_avg_n(&pcenter, nv, temppoly);
|
||||
float pradius = 0;
|
||||
float dist = 0;
|
||||
for (i=0;i<nv;i++) {
|
||||
dist = vm_vec_dist(decal_point_list[decal_poly[i]], &pcenter);
|
||||
if(dist>pradius){
|
||||
pradius = dist;
|
||||
}
|
||||
}
|
||||
|
||||
//if it's too far to posably get near the cube get out
|
||||
if(vm_vec_dist_quick(&pcenter, &decal_hit_point) >= (pradius + decal_hit_radius)){
|
||||
// mprintf(("leaveing becase poly is too far away\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
//this is for faster testing, I'm not sure if it's realy makeing it faster or not
|
||||
int k;
|
||||
for(k = 0; k<6; k++){
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//poly culling
|
||||
int temp_poly[820];
|
||||
|
||||
int skip = 0, numv = 0, valid = 0;
|
||||
|
||||
// mprintf(("starting to test the poly, with %d verts in it\n",nv));
|
||||
for(k = 0; k<6; k++){
|
||||
//find the first point in front of the plain
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
// mprintf(("testing point %d with plane %d\n", i, k));
|
||||
// mprintf(("point's position is x %0.2f y %0.2f z %0.2f\n", decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z));
|
||||
// mprintf(("plane's position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][0].xyz.x, decal_cube_plane[k][0].xyz.y, decal_cube_plane[k][0].xyz.z));
|
||||
// mprintf(("plane's normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][1].xyz.x, decal_cube_plane[k][1].xyz.y, decal_cube_plane[k][1].xyz.z));
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
// mprintf(("%d is the first good point\n", i));
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}else{
|
||||
valid = 1;
|
||||
}
|
||||
|
||||
//first point in front of the plane is good of corse
|
||||
// temp_poly[0] = decal_poly[(first_good + nv)%nv];
|
||||
numv = 0;
|
||||
//go through each point and see if there is an intersection between it the next point and the current plane
|
||||
//if there is then make the intersection point the next point in the poly
|
||||
//ignor all points untill there is another intersection
|
||||
//other wise make the next point the next point in the poly
|
||||
// if(k==1)Int3();
|
||||
int is_infront = 1, is_infront2 = 1;
|
||||
for(i = first_good; i < (nv + first_good); i++){
|
||||
// mprintf(("looking for intersections between point %d and point %d, with plane %d\n", i%nv, (i + 1)%nv, k));
|
||||
// mprintf((" point %d, is at, x %0.2f y %0.2f z %0.2f and point %d, is at, x %0.2f y %0.2f z %0.2f\n", i%nv, decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z, (i + 1)%nv, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.x, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.y, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.z));
|
||||
is_infront2 = is_infront;
|
||||
float is_in = fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[(i + 1)%nv]]);
|
||||
if(is_in > 0){
|
||||
is_infront = 1;
|
||||
}else{
|
||||
is_infront= 0;
|
||||
}
|
||||
if(is_infront != is_infront2){
|
||||
if(fvi_segment_plane(&new_decal->vert[nverts], &decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i%nv]], decal_point_list[decal_poly[(i + 1)%nv]], 0)){
|
||||
// mprintf(("segment %d %d has an an itersection\n", i%nv, (i + 1)%nv));
|
||||
decal_point_list[nverts] = &new_decal->vert[nverts];
|
||||
// mprintf(("new decal defpoint has been added as number %d at x %0.2f y %0.2f z %0.2f\n",nverts, new_decal->vert[nverts].xyz.x, new_decal->vert[nverts].xyz.y, new_decal->vert[nverts].xyz.z));
|
||||
temp_poly[numv] = nverts++;
|
||||
// mprintf(("temp_poly point %d, should have been set to defpoint %d, it was set to %d\n",numv, nverts-1, temp_poly[numv]));
|
||||
skip = (skip+1)%2;
|
||||
// mprintf(("skip has been set to %d\n",skip));
|
||||
numv++;
|
||||
if((skip == 0)){
|
||||
// mprintf(("adding point, becase it is after an intersection point\n", (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}
|
||||
}else{
|
||||
// mprintf(("there sould have been an intersection but there wasnt"));
|
||||
}
|
||||
|
||||
}else{
|
||||
if((skip == 0)){//don't copy the first point
|
||||
// mprintf(("segment %d %d has no itersection, copying\n", i%nv, (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}else{
|
||||
// mprintf(("skipping segment %d %d becase it isn't in front of the plane\n", i%nv, (i + 1)%nv));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mprintf(("temp poly has %d points\n", numv));
|
||||
for(int h = 0; h < numv; h++){
|
||||
decal_poly[h] = temp_poly[h];
|
||||
mprintf(("seting decal_poly point %d to %d\n",h,temp_poly[h]));
|
||||
}
|
||||
nv = numv;
|
||||
numv=0;
|
||||
// mprintf(("decal_poly now has has %d points\n", nv));
|
||||
if(nv < 3)return; //if at any time we get fewer than three points this poly is dead
|
||||
}
|
||||
|
||||
|
||||
// mprintf(("copying the poly to the decal\n"));
|
||||
//copy a triangulated version of the poly to the new decal
|
||||
if((valid == 1) && (nv > 2)){
|
||||
/* for (i=1;i<(nv-1);i++) {
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[0] = decal_poly[0];
|
||||
new_decal->poly[poly_num].point[1] = decal_poly[i];
|
||||
new_decal->poly[poly_num].point[2] = decal_poly[i+1];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
for (k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
}
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
|
||||
poly_num++;
|
||||
}
|
||||
for (i=1;i<nv;i++){
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
if(i >= MAX_DECAL_POLY_POINT){
|
||||
mprintf(("bugging out becase there are too many points in the poly\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[i] = decal_poly[i];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[i].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[i].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
|
||||
}
|
||||
poly_num++;
|
||||
}else{
|
||||
// mprintf(("no poly, all points are out side of planes"));
|
||||
}
|
||||
mprintf(("there are now %d polys in the current decal\n", poly_num));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int decal_create_sub(void *model_ptr )
|
||||
{
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
// mprintf(("entering decal_create_sub\n"));
|
||||
|
||||
ubyte *p = (ubyte *)model_ptr;
|
||||
int chunk_type, chunk_size;
|
||||
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
while (chunk_type != DP_EOF) {
|
||||
|
||||
// mprintf(( "Processing chunk type %d, len=%d\n", chunk_type, chunk_size ));
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
switch (chunk_type) {
|
||||
case DP_EOF: return 1;
|
||||
case DP_DEFPOINTS: decal_create_defpoints(p); break;
|
||||
case DP_FLATPOLY: break;// I don't want any of these anyway-Bobboau decal_create_flatpoly(p); break;
|
||||
case DP_TMAPPOLY: decal_create_tmappoly(p); break;
|
||||
case DP_SORTNORM: decal_create_sortnorm(p); break;
|
||||
case DP_BOUNDBOX:
|
||||
/* if (!mc_ray_boundingbox( vp(p+8), vp(p+20), &Mc_p0, &Mc_direction, NULL )) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mprintf(( "Bad chunk type %d, len=%d in decal_create_sub\n", chunk_type, chunk_size ));
|
||||
Int3(); // Bad chunk type!
|
||||
return 0;
|
||||
}
|
||||
// mprintf(( "current chunk offset %d\n", (int)p ));
|
||||
|
||||
p += chunk_size;
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int decal_make_model(polymodel * pm){
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
void decal_render_all(object * obj){
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
}
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
g3_rotate_vertex(&vecs[j], &dec->vert[dec->poly[i].point[j]]);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
vecs[j].u = dec->poly[i].uv[j].u;
|
||||
vecs[j].v = dec->poly[i].uv[j].v;
|
||||
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
|
||||
|
||||
}
|
||||
|
||||
gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT );
|
||||
gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void decal_render_all(object * obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
polymodel *pm = model_get( shipp->modelnum );
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
// vector g_pos;
|
||||
// vm_vec_add(&g_pos, &dec->position, &obj->pos);
|
||||
float dist = vm_vec_dist(&dec->position, &View_position);
|
||||
if(dist < (dec->radius*10)){
|
||||
mprintf(("decal %d too far away to be drawn %0.2f\n", h, dist));
|
||||
// HUD_printf("decal %d too far away to be drawn %0.2f\n", h, dist);
|
||||
continue;
|
||||
}
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
// if((pm->submodel[dec->submodel_parent].blown_off != 0) && (dec->submodel_parent > 0))continue;
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
vector pnt = dec->vert[dec->poly[i].point[j]];
|
||||
if(dec->submodel_parent != pm->detail[0]){
|
||||
matrix m;
|
||||
angles angs = pm->submodel[dec->submodel_parent].angs;
|
||||
angs.b = PI2 - angs.b;
|
||||
angs.p = PI2 - angs.p;
|
||||
angs.h = PI2 - angs.h;
|
||||
mprintf(("decal is child of a submodel, who's angles are b %0.2f p %0.2f h %0.2f, it should be rotateing with it\n", angs.b, angs.p, angs.h));
|
||||
|
||||
vector offset = pm->submodel[dec->submodel_parent].offset;
|
||||
vm_angles_2_matrix(&m, &angs);
|
||||
|
||||
vector p = pnt;
|
||||
vm_vec_rotate(&pnt, &p, &m);
|
||||
|
||||
vm_vec_add2(&pnt, &offset);
|
||||
}
|
||||
|
||||
g3_rotate_vertex(&vecs[j], &pnt);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
vecs[j].u = dec->poly[i].uv[j].u;
|
||||
vecs[j].v = dec->poly[i].uv[j].v;
|
||||
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
light_apply_rgb( &vlist[j]->r, &vlist[j]->g, &vlist[j]->b, &pnt, &dec->poly[i].norm, 0 );
|
||||
} else {
|
||||
vlist[j]->b = light_apply( &pnt, &dec->poly[i].norm, 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture > -1)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->backfaced_texture));
|
||||
}else{
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
}
|
||||
|
||||
// gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD );
|
||||
// gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -1,79 +0,0 @@
|
||||
//header file for makeing decals-Bobboau
|
||||
|
||||
#ifndef _DECAL_H
|
||||
#define _DECAL_H
|
||||
|
||||
#define MAX_DECAL_POLY 20
|
||||
#define MAX_DECAL_POLY_POINT 10
|
||||
#define MAX_DECAL_DEFPOINTS 1000
|
||||
#define MAX_DECAL_POINT 10
|
||||
#define MAX_SHIP_DECALS 25
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define DP_EOF 0
|
||||
#define DP_DEFPOINTS 1
|
||||
#define DP_FLATPOLY 2
|
||||
#define DP_TMAPPOLY 3
|
||||
#define DP_SORTNORM 4
|
||||
#define DP_BOUNDBOX 5
|
||||
|
||||
typedef struct decal_model{ //this will store a triangulated version of the ships polygons
|
||||
struct{
|
||||
int point[3]; //an index to the vert list-Bobboau
|
||||
vector center; //the center of the poly
|
||||
float radius; //the max radius of the poly
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector vert[MAX_DECAL_DEFPOINTS]; //the defpoints-Bobboau
|
||||
int n_polys;
|
||||
}decal_model;
|
||||
|
||||
//extern decal_model d_model;
|
||||
|
||||
typedef struct decal{
|
||||
struct{
|
||||
int backfaced; //flag that this poly uses the backfaced texture
|
||||
uv_pair uv[MAX_DECAL_POLY_POINT]; //uv coordanants
|
||||
int point[MAX_DECAL_POLY_POINT]; //an index to the vert list-Bobboau
|
||||
int n_poly;
|
||||
vector norm; //the normal used for lighting
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector position;
|
||||
float radius;
|
||||
int submodel_parent; //the submodel this is part of
|
||||
vector vert[1000]; //the defpoints-Bobboau
|
||||
int frames; //number of frames in an animation
|
||||
int fps; //frames per second
|
||||
int starting_keyframe; //the frame that indicates the end of the inital nonlooped portion and the start of the middle looped part
|
||||
int ending_keyframe; //the frame that indicates the end of the loopable portion and the start of the end part
|
||||
int texture; //the texture to be used, first in animation
|
||||
int backfaced_texture; //the texture to be used by backfaced polys, first in animation
|
||||
int is_valid; //this means it is a good decal that should be rendered-Bobboau
|
||||
int n_poly; //the number of polys
|
||||
int timestamp; //this is when the decal was made-Bobboau
|
||||
int lifetime; //this is how long the decal should be alive for-Bobboau
|
||||
int importance; //this is for big things large beam marks and bomb craters should last longer than the odd laser impacts-Bobboau
|
||||
int state; //1 starting, 2 looping(mostly for beams), 3 ending, 4 static
|
||||
}decal;
|
||||
|
||||
typedef struct decal_point{
|
||||
vector pnt;
|
||||
matrix orient;
|
||||
float radius;
|
||||
}decal_point;
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1);//makes the decal
|
||||
|
||||
#endif
|
||||
|
||||
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
|
||||
|
||||
void decal_render_all(object * obj); //renders all decals
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture);//makes the decal
|
||||
|
||||
int decal_create_sub(void *model_ptr);
|
||||
|
||||
/*
|
||||
|
||||
int decal_is_in_face(int n, vertex vertlist[n]);//sees if a poly is inside a decal: 0 is yes, 1 is sort of, -1 is no
|
||||
*/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 3/29/99 6:17p Dave
|
||||
* More work on demo system. Got just about everything in except for
|
||||
* blowing ships up, secondary weapons and player death/warpout.
|
||||
*
|
||||
* 2 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
#define _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
// DEMO DEFINES/VARS
|
||||
//
|
||||
|
||||
// compile in the demo system
|
||||
#define DEMO_SYSTEM
|
||||
|
||||
struct object;
|
||||
struct ship;
|
||||
|
||||
// an error reading or writing the demo file
|
||||
#define DEMO_ERROR_NONE 0 // no error
|
||||
#define DEMO_ERROR_GENERAL 1 // general problem
|
||||
#define DEMO_ERROR_FRAMESIZE 2 // frame size was too big (> 32k)
|
||||
#define DEMO_ERROR_DISK_SPACE 3 // out of disk space
|
||||
#define DEMO_ERROR_DISK_ACCESS 4 // problem accessing disk
|
||||
#define DEMO_ERROR_VERSION 5 // bad version #
|
||||
#define DEMO_ERROR_MISSION 6 // different mission file checksums
|
||||
extern int Demo_error;
|
||||
|
||||
extern int Demo_make;
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
// DEMO FUNCTIONS
|
||||
//
|
||||
|
||||
// do frame for the demo - start for the frame
|
||||
int demo_do_frame_start();
|
||||
|
||||
// do frame for the demo - end for the frame
|
||||
int demo_do_frame_end();
|
||||
|
||||
// initialize a demo for recording
|
||||
// NOTE : call this after loading the mission and going through the briefing, but _before_ physically moving into the mission
|
||||
int demo_start_record(char *file);
|
||||
|
||||
// initialize a demo for playback - calling this will load up the demo file and move the player into the playback state
|
||||
int demo_start_playback(char *file);
|
||||
|
||||
// finish the demo, whether recording or playing back
|
||||
void demo_close();
|
||||
|
||||
// if we should run the simulation for this object, or let the demo system handle it
|
||||
int demo_should_sim(object *objp);
|
||||
|
||||
|
||||
// functions for posting critical events to the demo system ------------------------------------------------------------
|
||||
|
||||
// post an object dump event (only used internally)
|
||||
void demo_POST_object_dump();
|
||||
|
||||
// post a primary fired event
|
||||
void demo_POST_primary_fired(object *objp, int banks, int linked);
|
||||
|
||||
// post a unique message
|
||||
void demo_POST_unique_message(char *id, char *who_from, int m_source, int priority);
|
||||
|
||||
// post a builtin message
|
||||
void demo_POST_builtin_message(int type, ship *shipp, int priority, int timing);
|
||||
|
||||
// post an object create message
|
||||
void demo_POST_obj_create(char *pobj_name, int signature);
|
||||
|
||||
// post a warpin event
|
||||
void demo_POST_warpin(int signature, int ship_flags);
|
||||
|
||||
// post a warpout event
|
||||
void demo_POST_warpout(int signature, int ship_flags);
|
||||
|
||||
// post a departed event
|
||||
void demo_POST_departed(int signature, int ship_flags);
|
||||
|
||||
// post a ship kill event
|
||||
void demo_POST_ship_kill(object *objp);
|
||||
|
||||
#endif
|
||||
@@ -1,324 +0,0 @@
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <commdlg.h>
|
||||
#include <tchar.h>
|
||||
#include <atlbase.h>
|
||||
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
// Local
|
||||
HRESULT InitPlayerWindow(HWND ghApp);
|
||||
HRESULT InitVideoWindow(HWND ghApp, long w, long h);
|
||||
bool HandleGraphEvent(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER
|
||||
|
||||
char error_buffer[512];
|
||||
char *ParseDShowError(HRESULT hr)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
AMGetErrorText(hr, error_buffer, 512);
|
||||
return error_buffer;
|
||||
#else
|
||||
return "DShow error";
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) " (%s) " TEXT("\n"), hr, ParseDShowError(hr)); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
BOOL g_bAudioOnly=FALSE;
|
||||
LONG g_lVolume=VOLUME_FULL;
|
||||
DWORD g_dwGraphRegister=0;
|
||||
PLAYSTATE g_psCurrent=Stopped;
|
||||
|
||||
// DirectShow interfaces
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IBasicAudio *pBA = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaPosition *pMP = NULL;
|
||||
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (pVW)
|
||||
pVW->NotifyOwnerMessage((long) hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
void SetCurrentState(PLAYSTATE state)
|
||||
{
|
||||
g_psCurrent = state;
|
||||
}
|
||||
|
||||
PLAYSTATE GetCurrentState()
|
||||
{
|
||||
return g_psCurrent;
|
||||
}
|
||||
|
||||
BOOL IsAudioOnly()
|
||||
{
|
||||
return g_bAudioOnly;
|
||||
}
|
||||
|
||||
HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
WCHAR wFile[MAX_PATH];
|
||||
HRESULT hr;
|
||||
|
||||
// Clear open dialog remnants before calling RenderFile()
|
||||
UpdateWindow(ghApp);
|
||||
|
||||
// Convert filename to wide character string
|
||||
wcscpy(wFile, T2W(szFile));
|
||||
|
||||
// Get the interface for DirectShow's GraphBuilder
|
||||
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IGraphBuilder, (void **)&pGB));
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
HRESULT load_attempt = pGB->RenderFile(wFile, NULL);
|
||||
|
||||
// Have the graph builder construct its the appropriate graph automatically
|
||||
if(FAILED(load_attempt))
|
||||
{
|
||||
return load_attempt;
|
||||
}
|
||||
|
||||
// QueryInterface for DirectShow interfaces
|
||||
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
|
||||
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
JIF(pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS));
|
||||
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
|
||||
|
||||
// Query for video interfaces, which may not be relevant for audio files
|
||||
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
|
||||
JIF(pGB->QueryInterface(IID_IBasicVideo, (void **)&pBV));
|
||||
|
||||
// Query for audio interfaces, which may not be relevant for video-only files
|
||||
JIF(pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA));
|
||||
|
||||
// Is this an audio-only file (no video component)?
|
||||
CheckVisibility();
|
||||
|
||||
// Have the graph signal event via window callbacks for performance
|
||||
JIF(pME->SetNotifyWindow((OAHWND)ghApp, WM_GRAPHNOTIFY, 0));
|
||||
|
||||
long width, height;
|
||||
pBV->get_VideoWidth(&width);
|
||||
pBV->get_VideoHeight(&height);
|
||||
|
||||
JIF(InitVideoWindow(ghApp,width, height));
|
||||
|
||||
if (!g_bAudioOnly)
|
||||
{
|
||||
JIF(pVW->put_Owner((OAHWND)ghApp));
|
||||
JIF(pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE));
|
||||
JIF(pVW->SetWindowForeground(OATRUE));
|
||||
}
|
||||
|
||||
// Run the graph to play the media file
|
||||
JIF(pMC->Run());
|
||||
g_psCurrent=Running;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(ghApp, &rect);
|
||||
|
||||
int screen_w = rect.right;
|
||||
int screen_h = rect.bottom;
|
||||
|
||||
int video_rescale_w = (video_w * screen_w) / video_w;
|
||||
int video_rescale_h = (video_rescale_w * video_h) / video_w;
|
||||
|
||||
int extra_w = (screen_w - video_rescale_w) / 2;
|
||||
int extra_h = (screen_h - video_rescale_h) / 2;
|
||||
|
||||
if(SetWindowPos(ghApp, 0, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER) == FALSE) {
|
||||
|
||||
MessageBox(ghApp,"Failed SetWindowPos","Error", MB_OK);
|
||||
}
|
||||
|
||||
JIF(pVW->SetWindowPosition(extra_w, extra_h, video_rescale_w, video_rescale_h));
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CheckVisibility(void)
|
||||
{
|
||||
long lVisible;
|
||||
HRESULT hr;
|
||||
|
||||
if ((!pVW) || (!pBV))
|
||||
{
|
||||
// Audio-only files have no video interfaces. This might also
|
||||
// be a file whose video component uses an unknown video codec.
|
||||
g_bAudioOnly = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the global flag
|
||||
g_bAudioOnly = FALSE;
|
||||
}
|
||||
|
||||
hr = pVW->get_Visible(&lVisible);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
// If this is an audio-only clip, get_Visible() won't work.
|
||||
//
|
||||
// Also, if this video is encoded with an unsupported codec,
|
||||
// we won't see any video, although the audio will work if it is
|
||||
// of a supported format.
|
||||
//
|
||||
if (hr == E_NOINTERFACE)
|
||||
{
|
||||
g_bAudioOnly = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg(TEXT("Failed(%08lx) in pVW->get_Visible()!\r\n"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName)
|
||||
{
|
||||
// Reset status variables
|
||||
g_psCurrent = Stopped;
|
||||
g_lVolume = VOLUME_FULL;
|
||||
|
||||
// Start playing the media file
|
||||
HRESULT hr = PlayMovieInWindow(ghApp, g_szFileName);
|
||||
|
||||
// If we couldn't play the clip, clean up
|
||||
if (FAILED(hr)) {
|
||||
CloseClip(ghApp);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CloseClip(HWND ghApp)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Stop media playback
|
||||
if(pMC)
|
||||
hr = pMC->Stop();
|
||||
|
||||
// Clear global flags
|
||||
g_psCurrent = Stopped;
|
||||
g_bAudioOnly = TRUE;
|
||||
|
||||
// Free DirectShow interfaces
|
||||
CloseInterfaces();
|
||||
|
||||
// No current media state
|
||||
g_psCurrent = Init;
|
||||
}
|
||||
|
||||
|
||||
void CloseInterfaces(void)
|
||||
{
|
||||
// Relinquish ownership (IMPORTANT!) after hiding video window
|
||||
if(pVW)
|
||||
pVW->put_Visible(OAFALSE);
|
||||
|
||||
// Disable event callbacks
|
||||
if (pME)
|
||||
pME->SetNotifyWindow((OAHWND)NULL, 0, 0);
|
||||
|
||||
// Release and zero DirectShow interfaces
|
||||
SAFE_RELEASE(pME);
|
||||
SAFE_RELEASE(pMS);
|
||||
SAFE_RELEASE(pMP);
|
||||
SAFE_RELEASE(pMC);
|
||||
SAFE_RELEASE(pBA);
|
||||
SAFE_RELEASE(pBV);
|
||||
SAFE_RELEASE(pVW);
|
||||
SAFE_RELEASE(pGB);
|
||||
}
|
||||
|
||||
void Msg(TCHAR *szFormat, ...)
|
||||
{
|
||||
TCHAR szBuffer[512]; // Large buffer for very long filenames (like HTTP)
|
||||
|
||||
// Format the input string
|
||||
va_list pArgs;
|
||||
va_start(pArgs, szFormat);
|
||||
_vstprintf(szBuffer, szFormat, pArgs);
|
||||
va_end(pArgs);
|
||||
|
||||
// Display a message box with the formatted string
|
||||
MessageBox(NULL, szBuffer, TEXT("PlayWnd Sample"), MB_OK);
|
||||
}
|
||||
|
||||
// returns true when finished
|
||||
bool dx8show_stream_movie(void)
|
||||
{
|
||||
LONG evCode, evParam1, evParam2;
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
// Make sure that we don't access the media event interface
|
||||
// after it has already been released.
|
||||
if (!pME) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Process all queued events
|
||||
while(SUCCEEDED(pME->GetEvent(&evCode, &evParam1,&evParam2, 0))) {
|
||||
// Free memory associated with callback, since we're not using it
|
||||
hr = pME->FreeEventParams(evCode, evParam1, evParam2);
|
||||
|
||||
// If this is the end of the clip, reset to beginning
|
||||
if(EC_COMPLETE == evCode)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName);
|
||||
void CloseClip(HWND ghApp);
|
||||
bool dx8show_stream_movie(void);
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,131 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: async.h
|
||||
* Content: AsyncData object include file
|
||||
***************************************************************************/
|
||||
#ifndef __ASYNC_INCLUDED__
|
||||
#define __ASYNC_INCLUDED__
|
||||
|
||||
|
||||
#include <ole2.h> // for DECLARE_INTERFACE and HRESULT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* GUIDS used by DPAsyncData objects
|
||||
*/
|
||||
|
||||
// {47BCD7E0-2E89-11d0-A889-00A0C905433C}
|
||||
DEFINE_GUID(IID_IDPAsyncData, 0x47bcd7e0, 0x2e89, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDPAsyncData Structures
|
||||
*
|
||||
* Various structures used to invoke DPAsyncData.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct IDPAsyncData FAR *LPDPASYNCDATA;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDPAsyncData Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDPAsyncData
|
||||
DECLARE_INTERFACE_( IDPAsyncData, IUnknown )
|
||||
{
|
||||
/* IUnknown Methods */
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/* IDPAsyncData Methods */
|
||||
STDMETHOD(AddItem) (THIS_ LPDWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Cancel) (THIS) PURE;
|
||||
STDMETHOD(GetFlags) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetItem) (THIS_ DWORD, LPVOID *) PURE;
|
||||
STDMETHOD(GetItemCount) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD, LPDWORD, HRESULT *) PURE;
|
||||
STDMETHOD(IsSnapshotCurrent) (THIS) PURE;
|
||||
STDMETHOD(RefreshSnapshot) (THIS) PURE;
|
||||
STDMETHOD(RemoveItem) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetFlags) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetItem) (THIS_ DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(SetStatus) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetStatusEvent) (THIS_ DWORD, HANDLE) PURE;
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDPAsyncData interface macros
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#define IDPAsyncData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDPAsyncData_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDPAsyncData_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDPAsyncData_AddItem(p) (p)->lpVtbl->AddItem(p)
|
||||
#define IDPAsyncData_Cancel(p) (p)->lpVtbl->Cancel(p)
|
||||
#define IDPAsyncData_GetItem(p,a,b) (p)->lpVtbl->GetItem(p,a,b)
|
||||
#define IDPAsyncData_GetItemCount(p,a) (p)->lpVtbl->GetItemCount(p,a)
|
||||
#define IDPAsyncData_GetStatus(p,a,b,c) (p)->lpVtbl->GetStatus(p,a,b,c)
|
||||
#define IDPAsyncData_IsSnapshotCurrent(p) (p)->lpVtbl->IsSnapshotCurrent(p)
|
||||
#define IDPAsyncData_RefreshSnapshot(p) (p)->lpVtbl->RefreshSnapshot(p)
|
||||
#define IDPAsyncData_RemoveItem(p) (p)->lpVtbl->RemoveItem(p)
|
||||
#define IDPAsyncData_SetFlags(p) (p)->lpVtbl->SetFlags(p)
|
||||
#define IDPAsyncData_SetItem(p) (p)->lpVtbl->SetItem(p)
|
||||
#define IDPAsyncData_SetStatus(p) (p)->lpVtbl->SetStatus(p)
|
||||
#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->lpVtbl->SetStatusEvent(p,a,b)
|
||||
|
||||
#else /* C++ */
|
||||
|
||||
#define IDPAsyncData_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDPAsyncData_AddRef(p) (p)->AddRef()
|
||||
#define IDPAsyncData_Release(p) (p)->Release()
|
||||
#define IDPAsyncData_AddItem(p) (p)->AddItem()
|
||||
#define IDPAsyncData_Cancel(p) (p)->Cancel()
|
||||
#define IDPAsyncData_GetItem(p,a,b) (p)->GetItem(a,b)
|
||||
#define IDPAsyncData_GetItemCount(p,a) (p)->GetItemCount(a)
|
||||
#define IDPAsyncData_GetStatus(p,a,b,c) (p)->GetStatus(a,b,c)
|
||||
#define IDPAsyncData_IsSnapshotCurrent(p) (p)->IsSnapshotCurrent()
|
||||
#define IDPAsyncData_RefreshSnapshot(p) (p)->RefreshSnapshot()
|
||||
#define IDPAsyncData_RemoveItem(p) (p)->RemoveItem()
|
||||
#define IDPAsyncData_SetFlags(p) (p)->SetFlags()
|
||||
#define IDPAsyncData_SetItem(p) (p)->SetItem()
|
||||
#define IDPAsyncData_SetStatus(p) (p)->SetStatus()
|
||||
#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->SetStatusEvent(a,b)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* AsyncData Flags
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* This flag is set if the ItemData is ANSI. If it is not set, the ItemData
|
||||
* is either Unicode or doesn't contain any string information.
|
||||
*/
|
||||
#define DPASYNCDATA_ANSI (0x00000001)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __ASYNC_INCLUDED__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -1,627 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dplobby.h
|
||||
* Content: DirectPlayLobby include file
|
||||
***************************************************************************/
|
||||
#ifndef __DPLOBBY_INCLUDED__
|
||||
#define __DPLOBBY_INCLUDED__
|
||||
|
||||
#include "directx/vdplay.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* GUIDS used by DirectPlay objects
|
||||
*/
|
||||
|
||||
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
|
||||
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
|
||||
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
|
||||
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
|
||||
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby Structures
|
||||
*
|
||||
* Various structures used to invoke DirectPlayLobby.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY;
|
||||
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA;
|
||||
typedef struct IDirectPlayLobby IDirectPlayLobbyA;
|
||||
|
||||
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2;
|
||||
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A;
|
||||
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
|
||||
|
||||
|
||||
/*
|
||||
* DPLAPPINFO
|
||||
* Used to hold information about a registered DirectPlay
|
||||
* application
|
||||
*/
|
||||
typedef struct DPLAPPINFO
|
||||
{
|
||||
DWORD dwSize; // Size of this structure
|
||||
GUID guidApplication; // GUID of the Application
|
||||
union
|
||||
{
|
||||
LPSTR lpszAppNameA; // Pointer to the Application Name
|
||||
LPWSTR lpszAppName;
|
||||
};
|
||||
|
||||
} DPLAPPINFO, FAR *LPDPLAPPINFO;
|
||||
|
||||
/*
|
||||
* LPCDPLAPPINFO
|
||||
* A constant pointer to DPLAPPINFO
|
||||
*/
|
||||
typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
|
||||
|
||||
/*
|
||||
* DPCOMPOUNDADDRESSELEMENT
|
||||
*
|
||||
* An array of these is passed to CreateCompoundAddresses()
|
||||
*/
|
||||
typedef struct DPCOMPOUNDADDRESSELEMENT
|
||||
{
|
||||
GUID guidDataType;
|
||||
DWORD dwDataSize;
|
||||
LPVOID lpData;
|
||||
} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
|
||||
|
||||
/*
|
||||
* LPCDPCOMPOUNDADDRESSELEMENT
|
||||
* A constant pointer to DPCOMPOUNDADDRESSELEMENT
|
||||
*/
|
||||
typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Enumeration Method Callback Prototypes
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Callback for EnumAddress()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
|
||||
REFGUID guidDataType,
|
||||
DWORD dwDataSize,
|
||||
LPCVOID lpData,
|
||||
LPVOID lpContext);
|
||||
|
||||
/*
|
||||
* Callback for EnumAddressTypes()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
|
||||
REFGUID guidDataType,
|
||||
LPVOID lpContext,
|
||||
DWORD dwFlags);
|
||||
|
||||
/*
|
||||
* Callback for EnumLocalApplications()
|
||||
*/
|
||||
typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
|
||||
LPCDPLAPPINFO lpAppInfo,
|
||||
LPVOID lpContext,
|
||||
DWORD dwFlags);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby API Prototypes
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifdef UNICODE
|
||||
#define DirectPlayLobbyCreate DirectPlayLobbyCreateW
|
||||
#else
|
||||
#define DirectPlayLobbyCreate DirectPlayLobbyCreateA
|
||||
#endif /* UNICODE */
|
||||
|
||||
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
|
||||
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby (and IDirectPlayLobbyA) Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectPlayLobby
|
||||
DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
|
||||
{
|
||||
/* IUnknown Methods */
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/* IDirectPlayLobby Methods */
|
||||
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
|
||||
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
|
||||
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
|
||||
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
|
||||
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectPlayLobby2
|
||||
DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
|
||||
{
|
||||
/* IUnknown Methods */
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/* IDirectPlayLobby Methods */
|
||||
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
|
||||
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
|
||||
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
|
||||
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
|
||||
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
|
||||
|
||||
/* IDirectPlayLobby2 Methods */
|
||||
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectPlayLobby interface macros
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
|
||||
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
|
||||
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
|
||||
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
|
||||
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
|
||||
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
|
||||
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
|
||||
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
|
||||
|
||||
#else /* C++ */
|
||||
|
||||
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectPlayLobby_AddRef(p) (p)->AddRef()
|
||||
#define IDirectPlayLobby_Release(p) (p)->Release()
|
||||
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c)
|
||||
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f)
|
||||
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d)
|
||||
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c)
|
||||
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c)
|
||||
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e)
|
||||
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d)
|
||||
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d)
|
||||
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
|
||||
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c)
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby Flags
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* This is a message flag used by ReceiveLobbyMessage. It can be
|
||||
* returned in the dwMessageFlags parameter to indicate a message from
|
||||
* the system.
|
||||
*/
|
||||
#define DPLMSG_SYSTEM 0x00000001
|
||||
|
||||
/*
|
||||
* This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
|
||||
* It is used to indicate that the message is a standard lobby message.
|
||||
* DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
|
||||
* DPLMSG_GETPROPERTYRESPONSE
|
||||
*/
|
||||
#define DPLMSG_STANDARD 0x00000002
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlayLobby messages and message data structures
|
||||
*
|
||||
* All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
|
||||
* from a call to ReceiveLobbyMessage.
|
||||
*
|
||||
* All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
|
||||
* from a call to ReceiveLobbyMessage.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* DPLMSG_GENERIC
|
||||
* Generic message structure used to identify the message type.
|
||||
*/
|
||||
typedef struct _DPLMSG_GENERIC
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
|
||||
|
||||
/*
|
||||
* DPLMSG_SETPROPERTY
|
||||
* Standard message sent by an application to a lobby to set a
|
||||
* property
|
||||
*/
|
||||
typedef struct _DPLMSG_SETPROPERTY
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
DWORD dwDataSize; // Size of data
|
||||
DWORD dwPropertyData[1]; // Buffer containing data
|
||||
} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
|
||||
|
||||
#define DPL_NOCONFIRMATION 0
|
||||
|
||||
/*
|
||||
* DPLMSG_SETPROPERTYRESPONSE
|
||||
* Standard message returned by a lobby to confirm a
|
||||
* DPLMSG_SETPROPERTY message.
|
||||
*/
|
||||
typedef struct _DPLMSG_SETPROPERTYRESPONSE
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
HRESULT hr; // Return Code
|
||||
} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
|
||||
|
||||
/*
|
||||
* DPLMSG_GETPROPERTY
|
||||
* Standard message sent by an application to a lobby to request
|
||||
* the current value of a property
|
||||
*/
|
||||
typedef struct _DPLMSG_GETPROPERTY
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
|
||||
|
||||
/*
|
||||
* DPLMSG_GETPROPERTYRESPONSE
|
||||
* Standard message returned by a lobby in response to a
|
||||
* DPLMSG_GETPROPERTY message.
|
||||
*/
|
||||
typedef struct _DPLMSG_GETPROPERTYRESPONSE
|
||||
{
|
||||
DWORD dwType; // Message type
|
||||
DWORD dwRequestID; // Request ID
|
||||
GUID guidPlayer; // Player GUID
|
||||
GUID guidPropertyTag; // Property GUID
|
||||
HRESULT hr; // Return Code
|
||||
DWORD dwDataSize; // Size of data
|
||||
DWORD dwPropertyData[1]; // Buffer containing data
|
||||
} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
|
||||
|
||||
|
||||
/******************************************
|
||||
*
|
||||
* DirectPlay Lobby message dwType values
|
||||
*
|
||||
*****************************************/
|
||||
|
||||
/*
|
||||
* The application has read the connection settings.
|
||||
* It is now O.K. for the lobby client to release
|
||||
* its IDirectPlayLobby interface.
|
||||
*/
|
||||
#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001
|
||||
|
||||
/*
|
||||
* The application's call to DirectPlayConnect failed
|
||||
*/
|
||||
#define DPLSYS_DPLAYCONNECTFAILED 0x00000002
|
||||
|
||||
/*
|
||||
* The application has created a DirectPlay session.
|
||||
*/
|
||||
#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003
|
||||
|
||||
/*
|
||||
* The application has terminated.
|
||||
*/
|
||||
#define DPLSYS_APPTERMINATED 0x00000004
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_SETPROPERTY message.
|
||||
*/
|
||||
#define DPLSYS_SETPROPERTY 0x00000005
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_SETPROPERTYRESPONSE message.
|
||||
*/
|
||||
#define DPLSYS_SETPROPERTYRESPONSE 0x00000006
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_GETPROPERTY message.
|
||||
*/
|
||||
#define DPLSYS_GETPROPERTY 0x00000007
|
||||
|
||||
/*
|
||||
* The message is a DPLMSG_GETPROPERTYRESPONSE message.
|
||||
*/
|
||||
#define DPLSYS_GETPROPERTYRESPONSE 0x00000008
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlay defined property GUIDs and associated data structures
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_MessagesSupported
|
||||
*
|
||||
* Request whether the lobby supports standard. Lobby with respond with either
|
||||
* TRUE or FALSE or may not respond at all.
|
||||
*
|
||||
* Property data is a single BOOL with TRUE or FALSE
|
||||
*/
|
||||
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_MessagesSupported,
|
||||
0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_LobbyGuid
|
||||
*
|
||||
* Request the GUID that identifies the lobby software that the application
|
||||
* is communicating with.
|
||||
*
|
||||
* Property data is a single GUID.
|
||||
*/
|
||||
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_LobbyGuid,
|
||||
0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_PlayerGuid
|
||||
*
|
||||
* Request the GUID that identifies the player on this machine for sending
|
||||
* property data back to the lobby.
|
||||
*
|
||||
* Property data is the DPLDATA_PLAYERDATA structure
|
||||
*/
|
||||
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_PlayerGuid,
|
||||
0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLDATA_PLAYERGUID
|
||||
*
|
||||
* Data structure to hold the GUID of the player and player creation flags
|
||||
* from the lobby.
|
||||
*/
|
||||
typedef struct _DPLDATA_PLAYERGUID
|
||||
{
|
||||
GUID guidPlayer;
|
||||
DWORD dwPlayerFlags;
|
||||
} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
|
||||
|
||||
/*
|
||||
* DPLPROPERTY_PlayerScore
|
||||
*
|
||||
* Used to send an array of long integers to the lobby indicating the
|
||||
* score of a player.
|
||||
*
|
||||
* Property data is the DPLDATA_PLAYERSCORE structure.
|
||||
*/
|
||||
// {48784000-D219-11d0-BA39-00C04FD7ED67}
|
||||
DEFINE_GUID(DPLPROPERTY_PlayerScore,
|
||||
0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
|
||||
|
||||
/*
|
||||
* DPLDATA_PLAYERSCORE
|
||||
*
|
||||
* Data structure to hold an array of long integers representing a player score.
|
||||
* Application must allocate enough memory to hold all the scores.
|
||||
*/
|
||||
typedef struct _DPLDATA_PLAYERSCORE
|
||||
{
|
||||
DWORD dwScoreCount;
|
||||
LONG Score[1];
|
||||
} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DirectPlay Address ID's
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* DirectPlay Address
|
||||
*
|
||||
* A DirectPlay address consists of multiple chunks of data, each tagged
|
||||
* with a GUID signifying the type of data in the chunk. The chunk also
|
||||
* has a length so that unknown chunk types can be skipped.
|
||||
*
|
||||
* The EnumAddress() function is used to parse these address data chunks.
|
||||
*/
|
||||
|
||||
/*
|
||||
* DPADDRESS
|
||||
*
|
||||
* Header for block of address data elements
|
||||
*/
|
||||
typedef struct _DPADDRESS
|
||||
{
|
||||
GUID guidDataType;
|
||||
DWORD dwDataSize;
|
||||
} DPADDRESS;
|
||||
|
||||
typedef DPADDRESS FAR *LPDPADDRESS;
|
||||
|
||||
/*
|
||||
* DPAID_TotalSize
|
||||
*
|
||||
* Chunk is a DWORD containing size of entire DPADDRESS structure
|
||||
*/
|
||||
|
||||
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
|
||||
DEFINE_GUID(DPAID_TotalSize,
|
||||
0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
|
||||
|
||||
/*
|
||||
* DPAID_ServiceProvider
|
||||
*
|
||||
* Chunk is a GUID describing the service provider that created the chunk.
|
||||
* All addresses must contain this chunk.
|
||||
*/
|
||||
|
||||
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ServiceProvider,
|
||||
0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_LobbyProvider
|
||||
*
|
||||
* Chunk is a GUID describing the lobby provider that created the chunk.
|
||||
* All addresses must contain this chunk.
|
||||
*/
|
||||
|
||||
// {59B95640-9667-11d0-A77D-0000F803ABFC}
|
||||
DEFINE_GUID(DPAID_LobbyProvider,
|
||||
0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
|
||||
|
||||
/*
|
||||
* DPAID_Phone and DPAID_PhoneW
|
||||
*
|
||||
* Chunk is a string containing a phone number (i.e. "1-800-555-1212")
|
||||
* in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_Phone,
|
||||
0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_PhoneW,
|
||||
0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_Modem and DPAID_ModemW
|
||||
*
|
||||
* Chunk is a string containing a modem name registered with TAPI
|
||||
* in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_Modem,
|
||||
0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ModemW,
|
||||
0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPAID_Inet and DPAID_InetW
|
||||
*
|
||||
* Chunk is a string containing a TCP/IP host name or an IP address
|
||||
* (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
|
||||
*/
|
||||
|
||||
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_INet,
|
||||
0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_INetW,
|
||||
0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/*
|
||||
* DPCOMPORTADDRESS
|
||||
*
|
||||
* Used to specify com port settings. The constants that define baud rate,
|
||||
* stop bits and parity are defined in WINBASE.H. The constants for flow
|
||||
* control are given below.
|
||||
*/
|
||||
|
||||
#define DPCPA_NOFLOW 0 // no flow control
|
||||
#define DPCPA_XONXOFFFLOW 1 // software flow control
|
||||
#define DPCPA_RTSFLOW 2 // hardware flow control with RTS
|
||||
#define DPCPA_DTRFLOW 3 // hardware flow control with DTR
|
||||
#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR
|
||||
|
||||
typedef struct _DPCOMPORTADDRESS
|
||||
{
|
||||
DWORD dwComPort; // COM port to use (1-4)
|
||||
DWORD dwBaudRate; // baud rate (100-256k)
|
||||
DWORD dwStopBits; // no. stop bits (1-2)
|
||||
DWORD dwParity; // parity (none, odd, even, mark)
|
||||
DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr)
|
||||
} DPCOMPORTADDRESS;
|
||||
|
||||
typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
|
||||
|
||||
/*
|
||||
* DPAID_ComPort
|
||||
*
|
||||
* Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
|
||||
*/
|
||||
|
||||
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
|
||||
DEFINE_GUID(DPAID_ComPort,
|
||||
0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* dplobby 1.0 obsolete definitions
|
||||
* Included for compatibility only.
|
||||
*
|
||||
****************************************************************************/
|
||||
#define DPLAD_SYSTEM DPLMSG_SYSTEM
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __DPLOBBY_INCLUDED__ */
|
||||
@@ -1,267 +0,0 @@
|
||||
/*==========================================================================
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsetup.h
|
||||
* Content: DirectXSetup, error codes and flags
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DSETUP_H__
|
||||
#define __DSETUP_H__
|
||||
|
||||
#include <windows.h> // windows stuff
|
||||
|
||||
#ifdef _WIN32
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// DSETUP Error Codes, must remain compatible with previous setup.
|
||||
#define DSETUPERR_SUCCESS_RESTART 1
|
||||
#define DSETUPERR_SUCCESS 0
|
||||
#define DSETUPERR_BADWINDOWSVERSION -1
|
||||
#define DSETUPERR_SOURCEFILENOTFOUND -2
|
||||
#define DSETUPERR_BADSOURCESIZE -3
|
||||
#define DSETUPERR_BADSOURCETIME -4
|
||||
#define DSETUPERR_NOCOPY -5
|
||||
#define DSETUPERR_OUTOFDISKSPACE -6
|
||||
#define DSETUPERR_CANTFINDINF -7
|
||||
#define DSETUPERR_CANTFINDDIR -8
|
||||
#define DSETUPERR_INTERNAL -9
|
||||
#define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */
|
||||
#define DSETUPERR_UNKNOWNOS -11
|
||||
#define DSETUPERR_USERHITCANCEL -12
|
||||
#define DSETUPERR_NOTPREINSTALLEDONNT -13
|
||||
|
||||
// DSETUP flags. DirectX 5.0 apps should use these flags only.
|
||||
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
|
||||
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
|
||||
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
|
||||
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
|
||||
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
|
||||
|
||||
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
|
||||
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
|
||||
// DO NOT USE THEM for DX5. They will go away in future DX releases.
|
||||
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
|
||||
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
|
||||
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
|
||||
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
|
||||
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
|
||||
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
|
||||
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
|
||||
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
|
||||
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
|
||||
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
|
||||
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
|
||||
|
||||
|
||||
|
||||
//******************************************************************
|
||||
// DirectX Setup Callback mechanism
|
||||
//******************************************************************
|
||||
|
||||
// DSETUP Message Info Codes, passed to callback as Reason parameter.
|
||||
#define DSETUP_CB_MSG_NOMESSAGE 0
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_NT 2
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_BETA 3
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5
|
||||
#define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6
|
||||
#define DSETUP_CB_MSG_PREINSTALL_NT 7
|
||||
#define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8
|
||||
#define DSETUP_CB_MSG_SETUP_INIT_FAILED 9
|
||||
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
|
||||
#define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11
|
||||
#define DSETUP_CB_MSG_OUTOFDISKSPACE 12
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15
|
||||
#define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16
|
||||
#define DSETUP_CB_MSG_FILECOPYERROR 17
|
||||
|
||||
|
||||
#define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F
|
||||
#define DSETUP_CB_UPGRADE_KEEP 0x0001
|
||||
#define DSETUP_CB_UPGRADE_SAFE 0x0002
|
||||
#define DSETUP_CB_UPGRADE_FORCE 0x0004
|
||||
#define DSETUP_CB_UPGRADE_UNKNOWN 0x0008
|
||||
|
||||
#define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
|
||||
#define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
|
||||
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
|
||||
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
|
||||
#define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
|
||||
|
||||
|
||||
typedef struct _DSETUP_CB_UPGRADEINFO
|
||||
{
|
||||
DWORD UpgradeFlags;
|
||||
} DSETUP_CB_UPGRADEINFO;
|
||||
|
||||
typedef struct _DSETUP_CB_FILECOPYERROR
|
||||
{
|
||||
DWORD dwError;
|
||||
} DSETUP_CB_FILECOPYERROR;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
//
|
||||
// Data Structures
|
||||
//
|
||||
#ifndef UNICODE_ONLY
|
||||
typedef struct _DIRECTXREGISTERAPPA {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPSTR lpszFilename;
|
||||
LPSTR lpszCommandLine;
|
||||
LPSTR lpszPath;
|
||||
LPSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
typedef struct _DIRECTXREGISTERAPPW {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPWSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPWSTR lpszFilename;
|
||||
LPWSTR lpszCommandLine;
|
||||
LPWSTR lpszPath;
|
||||
LPWSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
|
||||
#else
|
||||
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
|
||||
#endif // UNICODE
|
||||
|
||||
|
||||
//
|
||||
// API
|
||||
//
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupA(
|
||||
HWND hWnd,
|
||||
LPSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupW(
|
||||
HWND hWnd,
|
||||
LPWSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXSetup DirectXSetupW
|
||||
#else
|
||||
#define DirectXSetup DirectXSetupA
|
||||
#endif // !UNICODE
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXDeviceDriverSetupA(
|
||||
HWND hWnd,
|
||||
LPSTR lpszDriverClass,
|
||||
LPSTR lpszDriverPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXDeviceDriverSetupW(
|
||||
HWND hWnd,
|
||||
LPWSTR lpszDriverClass,
|
||||
LPWSTR lpszDriverPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
|
||||
#else
|
||||
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
|
||||
#endif // !UNICODE
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationA(
|
||||
HWND hWnd,
|
||||
LPDIRECTXREGISTERAPPA lpDXRegApp
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationW(
|
||||
HWND hWnd,
|
||||
LPDIRECTXREGISTERAPPW lpDXRegApp
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationW
|
||||
#else
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationA
|
||||
#endif // !UNICODE
|
||||
|
||||
INT
|
||||
WINAPI
|
||||
DirectXUnRegisterApplication(
|
||||
HWND hWnd,
|
||||
LPGUID lpGUID
|
||||
);
|
||||
|
||||
//
|
||||
// Function Pointers
|
||||
//
|
||||
#ifdef UNICODE
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPW);
|
||||
#else
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPA);
|
||||
#endif // UNICODE
|
||||
|
||||
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
|
||||
DWORD MsgType, /* Same as flags to MessageBox */
|
||||
LPSTR szMessage,
|
||||
LPSTR szName,
|
||||
void *pInfo);
|
||||
|
||||
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
|
||||
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,863 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsound.h
|
||||
* Content: DirectSound include file
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
|
||||
#define _FACDS 0x878
|
||||
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
|
||||
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
|
||||
|
||||
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
|
||||
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IDirectSound;
|
||||
struct IDirectSoundBuffer;
|
||||
struct IDirectSound3DListener;
|
||||
struct IDirectSound3DBuffer;
|
||||
struct IDirectSoundCapture;
|
||||
struct IDirectSoundCaptureBuffer;
|
||||
struct IDirectSoundNotify;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IDirectSound *LPDIRECTSOUND;
|
||||
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
|
||||
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
|
||||
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
|
||||
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
|
||||
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
|
||||
|
||||
typedef struct _DSCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwMinSecondarySampleRate;
|
||||
DWORD dwMaxSecondarySampleRate;
|
||||
DWORD dwPrimaryBuffers;
|
||||
DWORD dwMaxHwMixingAllBuffers;
|
||||
DWORD dwMaxHwMixingStaticBuffers;
|
||||
DWORD dwMaxHwMixingStreamingBuffers;
|
||||
DWORD dwFreeHwMixingAllBuffers;
|
||||
DWORD dwFreeHwMixingStaticBuffers;
|
||||
DWORD dwFreeHwMixingStreamingBuffers;
|
||||
DWORD dwMaxHw3DAllBuffers;
|
||||
DWORD dwMaxHw3DStaticBuffers;
|
||||
DWORD dwMaxHw3DStreamingBuffers;
|
||||
DWORD dwFreeHw3DAllBuffers;
|
||||
DWORD dwFreeHw3DStaticBuffers;
|
||||
DWORD dwFreeHw3DStreamingBuffers;
|
||||
DWORD dwTotalHwMemBytes;
|
||||
DWORD dwFreeHwMemBytes;
|
||||
DWORD dwMaxContigFreeHwMemBytes;
|
||||
DWORD dwUnlockTransferRateHwBuffers;
|
||||
DWORD dwPlayCpuOverheadSwBuffers;
|
||||
DWORD dwReserved1;
|
||||
DWORD dwReserved2;
|
||||
} DSCAPS, *LPDSCAPS;
|
||||
|
||||
typedef const DSCAPS *LPCDSCAPS;
|
||||
|
||||
typedef struct _DSBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwUnlockTransferRate;
|
||||
DWORD dwPlayCpuOverhead;
|
||||
} DSBCAPS, *LPDSBCAPS;
|
||||
|
||||
typedef const DSBCAPS *LPCDSBCAPS;
|
||||
|
||||
typedef struct _DSBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSBUFFERDESC, *LPDSBUFFERDESC;
|
||||
|
||||
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
|
||||
|
||||
typedef struct _DS3DBUFFER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
DWORD dwInsideConeAngle;
|
||||
DWORD dwOutsideConeAngle;
|
||||
D3DVECTOR vConeOrientation;
|
||||
LONG lConeOutsideVolume;
|
||||
D3DVALUE flMinDistance;
|
||||
D3DVALUE flMaxDistance;
|
||||
DWORD dwMode;
|
||||
} DS3DBUFFER, *LPDS3DBUFFER;
|
||||
|
||||
typedef const DS3DBUFFER *LPCDS3DBUFFER;
|
||||
|
||||
typedef struct _DS3DLISTENER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
D3DVECTOR vOrientFront;
|
||||
D3DVECTOR vOrientTop;
|
||||
D3DVALUE flDistanceFactor;
|
||||
D3DVALUE flRolloffFactor;
|
||||
D3DVALUE flDopplerFactor;
|
||||
} DS3DLISTENER, *LPDS3DLISTENER;
|
||||
|
||||
typedef const DS3DLISTENER *LPCDS3DLISTENER;
|
||||
|
||||
typedef struct _DSCCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwFormats;
|
||||
DWORD dwChannels;
|
||||
} DSCCAPS, *LPDSCCAPS;
|
||||
|
||||
typedef const DSCCAPS *LPCDSCCAPS;
|
||||
|
||||
typedef struct _DSCBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
|
||||
|
||||
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
|
||||
|
||||
typedef struct _DSCBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
} DSCBCAPS, *LPDSCBCAPS;
|
||||
|
||||
typedef const DSCBCAPS *LPCDSCBCAPS;
|
||||
|
||||
typedef struct _DSBPOSITIONNOTIFY
|
||||
{
|
||||
DWORD dwOffset;
|
||||
HANDLE hEventNotify;
|
||||
} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
|
||||
|
||||
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
|
||||
|
||||
//
|
||||
// Compatibility typedefs
|
||||
//
|
||||
|
||||
typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
|
||||
typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
|
||||
typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
|
||||
typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
|
||||
typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
|
||||
typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
|
||||
typedef LPVOID *LPLPVOID;
|
||||
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
|
||||
|
||||
//
|
||||
// DirectSound API
|
||||
//
|
||||
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateW
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
|
||||
#else // UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateA
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
|
||||
#endif // UNICODE
|
||||
|
||||
//
|
||||
// IDirectSound
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound methods
|
||||
STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE;
|
||||
STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
|
||||
STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE;
|
||||
STDMETHOD(Compact) (THIS) PURE;
|
||||
STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound_Release(p) (p)->Release()
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectSound_Compact(p) (p)->Compact()
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetPan) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE;
|
||||
STDMETHOD(SetVolume) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetPan) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetFrequency) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Restore) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DListener
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DListener
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE;
|
||||
STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE;
|
||||
STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(CommitDeferredSettings) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DListener_Release(p) (p)->Release()
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE;
|
||||
STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMode) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE;
|
||||
STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
|
||||
STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCapture
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCapture
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCapture methods
|
||||
STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCapture_Release(p) (p)->Release()
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCaptureBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCaptureBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCaptureBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Start) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundNotify
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundNotify
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundNotify methods
|
||||
STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundNotify_Release(p) (p)->Release()
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IKsPropertySet
|
||||
//
|
||||
|
||||
#ifndef _IKsPropertySet_
|
||||
#define _IKsPropertySet_
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IKsPropertySet;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IKsPropertySet *LPKSPROPERTYSET;
|
||||
|
||||
#define KSPROPERTY_SUPPORT_GET 0x00000001
|
||||
#define KSPROPERTY_SUPPORT_SET 0x00000002
|
||||
|
||||
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IKsPropertySet
|
||||
|
||||
DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IKsPropertySet methods
|
||||
STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
|
||||
STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
|
||||
STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->AddRef()
|
||||
#define IKsPropertySet_Release(p) (p)->Release()
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#endif // _IKsPropertySet_
|
||||
|
||||
//
|
||||
// Return Codes
|
||||
//
|
||||
|
||||
#define DS_OK 0
|
||||
|
||||
// The call failed because resources (such as a priority level)
|
||||
// were already being used by another caller.
|
||||
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
|
||||
|
||||
// The control (vol,pan,etc.) requested by the caller is not available.
|
||||
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
|
||||
|
||||
// An invalid parameter was passed to the returning function
|
||||
#define DSERR_INVALIDPARAM E_INVALIDARG
|
||||
|
||||
// This call is not valid for the current state of this object
|
||||
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
|
||||
|
||||
// An undetermined error occured inside the DirectSound subsystem
|
||||
#define DSERR_GENERIC E_FAIL
|
||||
|
||||
// The caller does not have the priority level required for the function to
|
||||
// succeed.
|
||||
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
|
||||
|
||||
// Not enough free memory is available to complete the operation
|
||||
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
|
||||
|
||||
// The specified WAVE format is not supported
|
||||
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
|
||||
|
||||
// The function called is not supported at this time
|
||||
#define DSERR_UNSUPPORTED E_NOTIMPL
|
||||
|
||||
// No sound driver is available for use
|
||||
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
|
||||
|
||||
// This object is already initialized
|
||||
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
|
||||
|
||||
// This object does not support aggregation
|
||||
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
|
||||
|
||||
// The buffer memory has been lost, and must be restored.
|
||||
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
||||
|
||||
// Another app has a higher priority level, preventing this call from
|
||||
// succeeding.
|
||||
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
|
||||
|
||||
// This object has not been initialized
|
||||
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
|
||||
|
||||
// The requested COM interface is not available
|
||||
#define DSERR_NOINTERFACE E_NOINTERFACE
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
|
||||
#define DSCAPS_PRIMARYMONO 0x00000001
|
||||
#define DSCAPS_PRIMARYSTEREO 0x00000002
|
||||
#define DSCAPS_PRIMARY8BIT 0x00000004
|
||||
#define DSCAPS_PRIMARY16BIT 0x00000008
|
||||
#define DSCAPS_CONTINUOUSRATE 0x00000010
|
||||
#define DSCAPS_EMULDRIVER 0x00000020
|
||||
#define DSCAPS_CERTIFIED 0x00000040
|
||||
#define DSCAPS_SECONDARYMONO 0x00000100
|
||||
#define DSCAPS_SECONDARYSTEREO 0x00000200
|
||||
#define DSCAPS_SECONDARY8BIT 0x00000400
|
||||
#define DSCAPS_SECONDARY16BIT 0x00000800
|
||||
|
||||
#define DSBPLAY_LOOPING 0x00000001
|
||||
|
||||
#define DSBSTATUS_PLAYING 0x00000001
|
||||
#define DSBSTATUS_BUFFERLOST 0x00000002
|
||||
#define DSBSTATUS_LOOPING 0x00000004
|
||||
|
||||
#define DSBLOCK_FROMWRITECURSOR 0x00000001
|
||||
#define DSBLOCK_ENTIREBUFFER 0x00000002
|
||||
|
||||
#define DSSCL_NORMAL 0x00000001
|
||||
#define DSSCL_PRIORITY 0x00000002
|
||||
#define DSSCL_EXCLUSIVE 0x00000003
|
||||
#define DSSCL_WRITEPRIMARY 0x00000004
|
||||
|
||||
#define DS3DMODE_NORMAL 0x00000000
|
||||
#define DS3DMODE_HEADRELATIVE 0x00000001
|
||||
#define DS3DMODE_DISABLE 0x00000002
|
||||
|
||||
#define DS3D_IMMEDIATE 0x00000000
|
||||
#define DS3D_DEFERRED 0x00000001
|
||||
|
||||
#define DS3D_MINDISTANCEFACTOR 0.0f
|
||||
#define DS3D_MAXDISTANCEFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINROLLOFFFACTOR 0.0f
|
||||
#define DS3D_MAXROLLOFFFACTOR 10.0f
|
||||
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINDOPPLERFACTOR 0.0f
|
||||
#define DS3D_MAXDOPPLERFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
|
||||
|
||||
#define DS3D_DEFAULTMINDISTANCE 1.0f
|
||||
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
|
||||
|
||||
#define DS3D_MINCONEANGLE 0
|
||||
#define DS3D_MAXCONEANGLE 360
|
||||
#define DS3D_DEFAULTCONEANGLE 360
|
||||
|
||||
#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
|
||||
|
||||
#define DSBCAPS_PRIMARYBUFFER 0x00000001
|
||||
#define DSBCAPS_STATIC 0x00000002
|
||||
#define DSBCAPS_LOCHARDWARE 0x00000004
|
||||
#define DSBCAPS_LOCSOFTWARE 0x00000008
|
||||
#define DSBCAPS_CTRL3D 0x00000010
|
||||
#define DSBCAPS_CTRLFREQUENCY 0x00000020
|
||||
#define DSBCAPS_CTRLPAN 0x00000040
|
||||
#define DSBCAPS_CTRLVOLUME 0x00000080
|
||||
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
|
||||
#define DSBCAPS_CTRLDEFAULT 0x000000E0
|
||||
#define DSBCAPS_CTRLALL 0x000001F0
|
||||
#define DSBCAPS_STICKYFOCUS 0x00004000
|
||||
#define DSBCAPS_GLOBALFOCUS 0x00008000
|
||||
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
|
||||
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
|
||||
|
||||
#define DSCBCAPS_WAVEMAPPED 0x80000000
|
||||
|
||||
#define DSSPEAKER_HEADPHONE 0x00000001
|
||||
#define DSSPEAKER_MONO 0x00000002
|
||||
#define DSSPEAKER_QUAD 0x00000003
|
||||
#define DSSPEAKER_STEREO 0x00000004
|
||||
#define DSSPEAKER_SURROUND 0x00000005
|
||||
|
||||
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
|
||||
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
|
||||
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
|
||||
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
|
||||
|
||||
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
|
||||
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
|
||||
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
|
||||
|
||||
#define DSCCAPS_EMULDRIVER 0x00000020
|
||||
|
||||
#define DSCBLOCK_ENTIREBUFFER 0x00000001
|
||||
|
||||
#define DSCBSTATUS_CAPTURING 0x00000001
|
||||
#define DSCBSTATUS_LOOPING 0x00000002
|
||||
|
||||
#define DSCBSTART_LOOPING 0x00000001
|
||||
|
||||
#define DSBFREQUENCY_MIN 100
|
||||
#define DSBFREQUENCY_MAX 100000
|
||||
#define DSBFREQUENCY_ORIGINAL 0
|
||||
|
||||
#define DSBPAN_LEFT -10000
|
||||
#define DSBPAN_CENTER 0
|
||||
#define DSBPAN_RIGHT 10000
|
||||
|
||||
#define DSBVOLUME_MIN -10000
|
||||
#define DSBVOLUME_MAX 0
|
||||
|
||||
#define DSBSIZE_MIN 4
|
||||
#define DSBSIZE_MAX 0x0FFFFFFF
|
||||
|
||||
#define DSBPN_OFFSETSTOP 0xFFFFFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __DSOUND_INCLUDED__
|
||||
Binary file not shown.
@@ -1,831 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dvp.h
|
||||
* Content: DirectDrawVideoPort include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVP_INCLUDED__
|
||||
#define __DVP_INCLUDED__
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
#else
|
||||
#define IUnknown void
|
||||
#undef CO_E_NOTINITIALIZED
|
||||
#define CO_E_NOTINITIALIZED 0x800401F0L
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GUIDS used by DirectDrawVideoPort objects
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
|
||||
DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
|
||||
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
|
||||
|
||||
/*
|
||||
* GUIDS used to describe connections
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*============================================================================
|
||||
*
|
||||
* DirectDraw Structures
|
||||
*
|
||||
* Various structures used to invoke DirectDraw.
|
||||
*
|
||||
*==========================================================================*/
|
||||
|
||||
struct IDirectDraw;
|
||||
struct IDirectDrawSurface;
|
||||
struct IDirectDrawPalette;
|
||||
struct IDirectDrawClipper;
|
||||
|
||||
typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER;
|
||||
typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT;
|
||||
|
||||
typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT;
|
||||
typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS;
|
||||
typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC;
|
||||
typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO;
|
||||
typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH;
|
||||
typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS;
|
||||
|
||||
typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS;
|
||||
typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS;
|
||||
|
||||
|
||||
/*
|
||||
* API's
|
||||
*/
|
||||
typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
|
||||
|
||||
|
||||
/*
|
||||
* INTERACES FOLLOW:
|
||||
* IDirectDrawVideoPort
|
||||
* IVideoPort
|
||||
*/
|
||||
|
||||
/*
|
||||
* IDirectDrawVideoPortContainer
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDDVideoPortContainer
|
||||
DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
/*** IDirectDrawVideoPort methods ***/
|
||||
STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
|
||||
STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
|
||||
STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
|
||||
STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
|
||||
#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
|
||||
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
|
||||
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
|
||||
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
|
||||
#else
|
||||
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
|
||||
#define IVideoPortContainer_AddRef(p) (p)->AddRef()
|
||||
#define IVideoPortContainer_Release(p) (p)->Release()
|
||||
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d)
|
||||
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d)
|
||||
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
|
||||
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* IDirectDrawVideoPort
|
||||
*/
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectDrawVideoPort
|
||||
DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
/*** IVideoPort methods ***/
|
||||
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
|
||||
STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
|
||||
STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
|
||||
STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
|
||||
STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
|
||||
STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
|
||||
STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
|
||||
STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
|
||||
STDMETHOD(StopVideo)(THIS) PURE;
|
||||
STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
|
||||
STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IVideoPort_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b)
|
||||
#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b)
|
||||
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
|
||||
#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
|
||||
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c)
|
||||
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
|
||||
#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a)
|
||||
#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a)
|
||||
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a)
|
||||
#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
|
||||
#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a)
|
||||
#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p)
|
||||
#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a)
|
||||
#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c)
|
||||
#else
|
||||
#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IVideoPort_AddRef(p) (p)->AddRef()
|
||||
#define IVideoPort_Release(p) (p)->Release()
|
||||
#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b)
|
||||
#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b)
|
||||
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
|
||||
#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a)
|
||||
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c)
|
||||
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d)
|
||||
#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a)
|
||||
#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a)
|
||||
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a)
|
||||
#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a)
|
||||
#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a)
|
||||
#define IVideoPort_StopVideo(p) (p)->StopVideo()
|
||||
#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a)
|
||||
#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTCONNECT
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTCONNECT
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure
|
||||
DWORD dwPortWidth; // Width of the video port
|
||||
GUID guidTypeID; // Description of video port connection
|
||||
DWORD dwFlags; // Connection flags
|
||||
DWORD dwReserved1; // Reserved, set to zero.
|
||||
} DDVIDEOPORTCONNECT;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTCAPS
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTCAPS
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTCAPS structure
|
||||
DWORD dwFlags; // indicates which fields contain data
|
||||
DWORD dwMaxWidth; // max width of the video port field
|
||||
DWORD dwMaxVBIWidth; // max width of the VBI data
|
||||
DWORD dwMaxHeight; // max height of the video port field
|
||||
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
|
||||
DWORD dwCaps; // Video port capabilities
|
||||
DWORD dwFX; // More video port capabilities
|
||||
DWORD dwNumAutoFlipSurfaces; // Number of autoflippable surfaces
|
||||
DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface
|
||||
DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
|
||||
DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping
|
||||
DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width
|
||||
DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x
|
||||
DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x
|
||||
DWORD dwNumVBIAutoFlipSurfaces; // Number of VBI autoflippable surfaces
|
||||
DWORD dwReserved1; // Reserved for future use
|
||||
DWORD dwReserved2; // Reserved for future use
|
||||
} DDVIDEOPORTCAPS;
|
||||
|
||||
/*
|
||||
* The dwMaxWidth and dwMaxVBIWidth members are valid
|
||||
*/
|
||||
#define DDVPD_WIDTH 0x00000001l
|
||||
|
||||
/*
|
||||
* The dwMaxHeight member is valid
|
||||
*/
|
||||
#define DDVPD_HEIGHT 0x00000002l
|
||||
|
||||
/*
|
||||
* The dwVideoPortID member is valid
|
||||
*/
|
||||
#define DDVPD_ID 0x00000004l
|
||||
|
||||
/*
|
||||
* The dwCaps member is valid
|
||||
*/
|
||||
#define DDVPD_CAPS 0x00000008l
|
||||
|
||||
/*
|
||||
* The dwFX member is valid
|
||||
*/
|
||||
#define DDVPD_FX 0x00000010l
|
||||
|
||||
/*
|
||||
* The dwNumAutoFlipSurfaces member is valid
|
||||
*/
|
||||
#define DDVPD_AUTOFLIP 0x00000020l
|
||||
|
||||
/*
|
||||
* All of the alignment members are valid
|
||||
*/
|
||||
#define DDVPD_ALIGN 0x00000040l
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTDESC
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTDESC
|
||||
{
|
||||
DWORD dwSize; // size of the DDVIDEOPORTDESC structure
|
||||
DWORD dwFieldWidth; // width of the video port field
|
||||
DWORD dwVBIWidth; // width of the VBI data
|
||||
DWORD dwFieldHeight; // height of the video port field
|
||||
DWORD dwMicrosecondsPerField; // Microseconds per video field
|
||||
DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second
|
||||
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
DWORD dwReserved3; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTDESC;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTINFO
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTINFO
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
DWORD dwOriginX; // Placement of the video data within the surface.
|
||||
DWORD dwOriginY; // Placement of the video data within the surface.
|
||||
DWORD dwVPFlags; // Video port options
|
||||
RECT rCrop; // Cropping rectangle (optional).
|
||||
DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional).
|
||||
DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional).
|
||||
LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port
|
||||
LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
|
||||
LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
|
||||
DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval.
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTINFO;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTBANDWIDTH
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTBANDWIDTH
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
DWORD dwCaps;
|
||||
DWORD dwOverlay; // Zoom factor at which overlay is supported
|
||||
DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported
|
||||
DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported
|
||||
DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
|
||||
DWORD dwReserved1; // Reserved for future use - set to zero
|
||||
DWORD dwReserved2; // Reserved for future use - set to zero
|
||||
} DDVIDEOPORTBANDWIDTH;
|
||||
|
||||
|
||||
/*
|
||||
* DDVIDEOPORTSTATUS
|
||||
*/
|
||||
typedef struct _DDVIDEOPORTSTATUS
|
||||
{
|
||||
DWORD dwSize; // Size of the structure
|
||||
BOOL bInUse; // TRUE if video port is currently being used
|
||||
DWORD dwFlags; // Currently not used
|
||||
DWORD dwReserved1; // Reserved for future use
|
||||
DDVIDEOPORTCONNECT VideoPortType; // Information about the connection
|
||||
DWORD dwReserved2; // Reserved for future use
|
||||
DWORD dwReserved3; // Reserved for future use
|
||||
} DDVIDEOPORTSTATUS;
|
||||
|
||||
/*============================================================================
|
||||
*
|
||||
* Video Port Flags
|
||||
*
|
||||
* All flags are bit flags.
|
||||
*
|
||||
*==========================================================================*/
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTCONNECT FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of double clocking the data.
|
||||
* When this is set by the client, this indicates that the video port
|
||||
* should enable double clocking. This flag is only valid with external
|
||||
* syncs.
|
||||
*/
|
||||
#define DDVPCONNECT_DOUBLECLOCK 0x00000001l
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of using an external VACT
|
||||
* signal. When this is set by the client, this indicates that the
|
||||
* video port should use the external VACT signal.
|
||||
*/
|
||||
#define DDVPCONNECT_VACT 0x00000002l
|
||||
|
||||
/*
|
||||
* When this is set by the driver and passed to the client, this
|
||||
* indicates that the video port is capable of treating even fields
|
||||
* like odd fields and visa versa. When this is set by the client,
|
||||
* this indicates that the video port should treat even fields like odd
|
||||
* fields.
|
||||
*/
|
||||
#define DDVPCONNECT_INVERTPOLARITY 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that any data written to the video port during the VREF
|
||||
* period will not be written into the frame buffer. This flag is read only.
|
||||
*/
|
||||
#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l
|
||||
|
||||
/*
|
||||
* Device will write half lines into the frame buffer, sometimes causing
|
||||
* the data to not be displayed correctly.
|
||||
*/
|
||||
#define DDVPCONNECT_HALFLINE 0x00000010l
|
||||
|
||||
/*
|
||||
* Indicates that the signal is interlaced. This flag is only
|
||||
* set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_INTERLACED 0x00000020l
|
||||
|
||||
/*
|
||||
* Indicates that video port is shareable and that this video port
|
||||
* will use the even fields. This flag is only set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_SHAREEVEN 0x00000040l
|
||||
|
||||
/*
|
||||
* Indicates that video port is shareable and that this video port
|
||||
* will use the odd fields. This flag is only set by the client.
|
||||
*/
|
||||
#define DDVPCONNECT_SHAREODD 0x00000080l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTDESC CAPS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Flip can be performed automatically to avoid tearing.
|
||||
*/
|
||||
#define DDVPCAPS_AUTOFLIP 0x00000001l
|
||||
|
||||
/*
|
||||
* Supports interlaced video
|
||||
*/
|
||||
#define DDVPCAPS_INTERLACED 0x00000002l
|
||||
|
||||
/*
|
||||
* Supports non-interlaced video
|
||||
*/
|
||||
#define DDVPCAPS_NONINTERLACED 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that the device can return whether the current field
|
||||
* of an interlaced signal is even or odd.
|
||||
*/
|
||||
#define DDVPCAPS_READBACKFIELD 0x00000008l
|
||||
|
||||
/*
|
||||
* Indicates that the device can return the current line of video
|
||||
* being written into the frame buffer.
|
||||
*/
|
||||
#define DDVPCAPS_READBACKLINE 0x00000010l
|
||||
|
||||
/*
|
||||
* Allows two gen-locked video streams to share a single video port,
|
||||
* where one stream uses the even fields and the other uses the odd
|
||||
* fields. Separate parameters (including address, scaling,
|
||||
* cropping, etc.) are maintained for both fields.)
|
||||
*/
|
||||
#define DDVPCAPS_SHAREABLE 0x00000020l
|
||||
|
||||
/*
|
||||
* Even fields of video can be automatically discarded.
|
||||
*/
|
||||
#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l
|
||||
|
||||
/*
|
||||
* Odd fields of video can be automatically discarded.
|
||||
*/
|
||||
#define DDVPCAPS_SKIPODDFIELDS 0x00000080l
|
||||
|
||||
/*
|
||||
* Indicates that the device is capable of driving the graphics
|
||||
* VSYNC with the video port VSYNC.
|
||||
*/
|
||||
#define DDVPCAPS_SYNCMASTER 0x00000100l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval can
|
||||
* be written to a different surface.
|
||||
*/
|
||||
#define DDVPCAPS_VBISURFACE 0x00000200l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can perform color operations
|
||||
* on the incoming data before it is written to the frame buffer.
|
||||
*/
|
||||
#define DDVPCAPS_COLORCONTROL 0x00000400l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can accept VBI data in a different
|
||||
* width or format than the regular video data.
|
||||
*/
|
||||
#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l
|
||||
|
||||
/*
|
||||
* Indicates that the video port can write data directly to system memory
|
||||
*/
|
||||
#define DDVPCAPS_SYSTEMMEMORY 0x00001000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTDESC FX
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Limited cropping is available to crop out the vertical interval data.
|
||||
*/
|
||||
#define DDVPFX_CROPTOPDATA 0x00000001l
|
||||
|
||||
/*
|
||||
* Incoming data can be cropped in the X direction before it is written
|
||||
* to the surface.
|
||||
*/
|
||||
#define DDVPFX_CROPX 0x00000002l
|
||||
|
||||
/*
|
||||
* Incoming data can be cropped in the Y direction before it is written
|
||||
* to the surface.
|
||||
*/
|
||||
#define DDVPFX_CROPY 0x00000004l
|
||||
|
||||
/*
|
||||
* Supports interleaving interlaced fields in memory.
|
||||
*/
|
||||
#define DDVPFX_INTERLEAVE 0x00000008l
|
||||
|
||||
/*
|
||||
* Supports mirroring left to right as the video data is written
|
||||
* into the frame buffer.
|
||||
*/
|
||||
#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l
|
||||
|
||||
/*
|
||||
* Supports mirroring top to bottom as the video data is written
|
||||
* into the frame buffer.
|
||||
*/
|
||||
#define DDVPFX_MIRRORUPDOWN 0x00000020l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily shrunk in the X direction before it
|
||||
* is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKX 0x00000040l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily shrunk in the Y direction before it
|
||||
* is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKY 0x00000080l
|
||||
|
||||
/*
|
||||
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
|
||||
* direction before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKXB 0x00000100l
|
||||
|
||||
/*
|
||||
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
|
||||
* direction before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKYB 0x00000200l
|
||||
|
||||
/*
|
||||
* Data can be shrunk in increments of 1/x in the X direction
|
||||
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
|
||||
* before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKXS 0x00000400l
|
||||
|
||||
/*
|
||||
* Data can be shrunk in increments of 1/x in the Y direction
|
||||
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
|
||||
* before it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESHRINKYS 0x00000800l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily stretched in the X direction before
|
||||
* it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHX 0x00001000l
|
||||
|
||||
/*
|
||||
* Data can be arbitrarily stretched in the Y direction before
|
||||
* it is written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHY 0x00002000l
|
||||
|
||||
/*
|
||||
* Data can be integer stretched in the X direction before it is
|
||||
* written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHXN 0x00004000l
|
||||
|
||||
/*
|
||||
* Data can be integer stretched in the Y direction before it is
|
||||
* written to the surface.
|
||||
*/
|
||||
#define DDVPFX_PRESTRETCHYN 0x00008000l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval can
|
||||
* be converted independently of the remaining video data.
|
||||
*/
|
||||
#define DDVPFX_VBICONVERT 0x00010000l
|
||||
|
||||
/*
|
||||
* Indicates that scaling can be disabled for data within the
|
||||
* vertical blanking interval.
|
||||
*/
|
||||
#define DDVPFX_VBINOSCALE 0x00020000l
|
||||
|
||||
/*
|
||||
* Indicates that the video data can ignore the left and right
|
||||
* cropping coordinates when cropping oversampled VBI data.
|
||||
*/
|
||||
#define DDVPFX_IGNOREVBIXCROP 0x00040000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORT DDVIDEOPORTINFO FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Perform automatic flipping. Auto-flipping is performed between
|
||||
* the overlay surface that was attached to the video port using
|
||||
* IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
|
||||
* are attached to the surface via the IDirectDrawSurface::AttachSurface
|
||||
* method. The flip order is the order in which the overlay surfaces
|
||||
* were. attached.
|
||||
*/
|
||||
#define DDVP_AUTOFLIP 0x00000001l
|
||||
|
||||
/*
|
||||
* Perform conversion using the ddpfOutputFormat information.
|
||||
*/
|
||||
#define DDVP_CONVERT 0x00000002l
|
||||
|
||||
/*
|
||||
* Perform cropping using the specified rectangle.
|
||||
*/
|
||||
#define DDVP_CROP 0x00000004l
|
||||
|
||||
/*
|
||||
* Indicates that interlaced fields should be interleaved in memory.
|
||||
*/
|
||||
#define DDVP_INTERLEAVE 0x00000008l
|
||||
|
||||
/*
|
||||
* Indicates that the data should be mirrored left to right as it's
|
||||
* written into the frame buffer.
|
||||
*/
|
||||
#define DDVP_MIRRORLEFTRIGHT 0x00000010l
|
||||
|
||||
/*
|
||||
* Indicates that the data should be mirrored top to bottom as it's
|
||||
* written into the frame buffer.
|
||||
*/
|
||||
#define DDVP_MIRRORUPDOWN 0x00000020l
|
||||
|
||||
/*
|
||||
* Perform pre-scaling/zooming based on the pre-scale parameters.
|
||||
*/
|
||||
#define DDVP_PRESCALE 0x00000040l
|
||||
|
||||
/*
|
||||
* Ignore input of even fields.
|
||||
*/
|
||||
#define DDVP_SKIPEVENFIELDS 0x00000080l
|
||||
|
||||
/*
|
||||
* Ignore input of odd fields.
|
||||
*/
|
||||
#define DDVP_SKIPODDFIELDS 0x00000100l
|
||||
|
||||
/*
|
||||
* Drive the graphics VSYNCs using the video port VYSNCs.
|
||||
*/
|
||||
#define DDVP_SYNCMASTER 0x00000200l
|
||||
|
||||
/*
|
||||
* The ddpfVBIOutputFormatFormat member contains data that should be used
|
||||
* to convert the data within the vertical blanking interval.
|
||||
*/
|
||||
#define DDVP_VBICONVERT 0x00000400l
|
||||
|
||||
/*
|
||||
* Indicates that data within the vertical blanking interval
|
||||
* should not be scaled.
|
||||
*/
|
||||
#define DDVP_VBINOSCALE 0x00000800l
|
||||
|
||||
/*
|
||||
* Indicates that these bob/weave decisions should not be
|
||||
* overriden by other interfaces.
|
||||
*/
|
||||
#define DDVP_OVERRIDEBOBWEAVE 0x00001000l
|
||||
|
||||
/*
|
||||
* Indicates that the video data should ignore the left and right
|
||||
* cropping coordinates when cropping the VBI data.
|
||||
*/
|
||||
#define DDVP_IGNOREVBIXCROP 0x00002000l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Return formats for the video data
|
||||
*/
|
||||
#define DDVPFORMAT_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Return formats for the VBI data
|
||||
*/
|
||||
#define DDVPFORMAT_VBI 0x00000002l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Surface should receive video data (and VBI data if a surface
|
||||
* is not explicitly attached for that purpose)
|
||||
*/
|
||||
#define DDVPTARGET_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Surface should receive VBI data
|
||||
*/
|
||||
#define DDVPTARGET_VBI 0x00000002l
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Waits until the beginning of the next VSYNC
|
||||
*/
|
||||
#define DDVPWAIT_BEGIN 0x00000001l
|
||||
|
||||
/*
|
||||
* Waits until the end of the next/current VSYNC
|
||||
*/
|
||||
#define DDVPWAIT_END 0x00000002l
|
||||
|
||||
/*
|
||||
* Waits until the beginning of the specified line
|
||||
*/
|
||||
#define DDVPWAIT_LINE 0x00000003l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRECTDRAWVIDEOPORT FLIP FLAGS
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Flips the normal video surface
|
||||
*/
|
||||
#define DDVPFLIP_VIDEO 0x00000001l
|
||||
|
||||
/*
|
||||
* Flips the VBI surface
|
||||
*/
|
||||
#define DDVPFLIP_VBI 0x00000002l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* No video signal is present at the video port
|
||||
*/
|
||||
#define DDVPSQ_NOSIGNAL 0x00000001l
|
||||
|
||||
/*
|
||||
* A valid video signal is present at the video port
|
||||
*/
|
||||
#define DDVPSQ_SIGNALOK 0x00000002l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORTBANDWIDTH Flags
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* The specified height/width refer to the size of the video port data
|
||||
* written into memory, after prescaling has occured.
|
||||
*/
|
||||
#define DDVPB_VIDEOPORT 0x00000001l
|
||||
|
||||
/*
|
||||
* The specified height/width refer to the source size of the overlay.
|
||||
*/
|
||||
#define DDVPB_OVERLAY 0x00000002l
|
||||
|
||||
/*
|
||||
* This is a query for the device to return which caps this device requires.
|
||||
*/
|
||||
#define DDVPB_TYPE 0x00000004l
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* VIDEOPORTBANDWIDTH Caps
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* The bandwidth for this device is dependant on the overlay source size.
|
||||
*/
|
||||
#define DDVPBCAPS_SOURCE 0x00000001l
|
||||
|
||||
/*
|
||||
* The bandwidth for this device is dependant on the overlay destination
|
||||
* size.
|
||||
*/
|
||||
#define DDVPBCAPS_DESTINATION 0x00000002l
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,552 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2004-03-31 05:42:26 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2004/03/06 23:28:22 bobboau
|
||||
* fixed motion debris
|
||||
* animated laser textures
|
||||
* and added a new error check called a safepoint, mostly for tracking the 'Y bug'
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/11/06 20:22:03 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
|
||||
* Release builds should have warning level set no higher than 2 (default is 1)
|
||||
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
|
||||
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
|
||||
*
|
||||
* Revision 2.1 2003/03/02 05:10:42 penguin
|
||||
* Added #ifdef _MSC_VER around strange exception-handling code
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 1 6/29/99 7:42p Dave
|
||||
*
|
||||
* 3 1/19/99 9:07a Allender
|
||||
* removed compiler warning pragma's since we are already ignoring them in
|
||||
* vtypes.h
|
||||
*
|
||||
* 2 1/18/99 4:34p Allender
|
||||
* added the exception handler routines from Game Developer for structured
|
||||
* exception handling in vsdk code
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
// Copyright © 1998 Bruce Dawson.
|
||||
/*
|
||||
This source file contains the exception handler for recording error
|
||||
information after crashes. See exceptionhandler.h for information
|
||||
on how to hook it in.
|
||||
*/
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#pragma warning(disable:4711) // function selected for inlining
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
// --------------------
|
||||
#define ONEK 1024
|
||||
#define SIXTYFOURK (64*ONEK)
|
||||
#define ONEM (ONEK*ONEK)
|
||||
#define ONEG (ONEK*ONEK*ONEK)
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Enumerated Types
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Classes
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Global Variables
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Local Variables
|
||||
//
|
||||
// --------------------
|
||||
|
||||
const int NumCodeBytes = 16; // Number of code bytes to record.
|
||||
const int MaxStackDump = 2048; // Maximum number of DWORDS in stack dumps.
|
||||
const int StackColumns = 8; // Number of columns in stack dump.
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Internal Functions
|
||||
//
|
||||
// --------------------
|
||||
|
||||
// hprintf behaves similarly to printf, with a few vital differences.
|
||||
// It uses wvsprintf to do the formatting, which is a system routine,
|
||||
// thus avoiding C run time interactions. For similar reasons it
|
||||
// uses WriteFile rather than fwrite.
|
||||
// The one limitation that this imposes is that wvsprintf, and
|
||||
// therefore hprintf, cannot handle floating point numbers.
|
||||
static void hprintf(HANDLE LogFile, char* Format, ...)
|
||||
{
|
||||
char buffer[2000]; // wvsprintf never prints more than one K.
|
||||
|
||||
va_list arglist;
|
||||
va_start( arglist, Format);
|
||||
wvsprintf(buffer, Format, arglist);
|
||||
va_end( arglist);
|
||||
|
||||
DWORD NumBytes;
|
||||
WriteFile(LogFile, buffer, lstrlen(buffer), &NumBytes, 0);
|
||||
}
|
||||
|
||||
// Print the specified FILETIME to output in a human readable format,
|
||||
// without using the C run time.
|
||||
static void PrintTime(char *output, FILETIME TimeToPrint)
|
||||
{
|
||||
WORD Date, Time;
|
||||
if (FileTimeToLocalFileTime(&TimeToPrint, &TimeToPrint) &&
|
||||
FileTimeToDosDateTime(&TimeToPrint, &Date, &Time))
|
||||
{
|
||||
// What a silly way to print out the file date/time. Oh well,
|
||||
// it works, and I'm not aware of a cleaner way to do it.
|
||||
wsprintf(output, "%d/%d/%d %02d:%02d:%02d",
|
||||
(Date / 32) & 15, Date & 31, (Date / 512) + 1980,
|
||||
(Time / 2048), (Time / 32) & 63, (Time & 31) * 2);
|
||||
} else {
|
||||
output[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Print information about a code module (DLL or EXE) such as its size,
|
||||
// location, time stamp, etc.
|
||||
static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
|
||||
{
|
||||
char ModName[MAX_PATH];
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
if (GetModuleFileName(ModuleHandle, ModName, sizeof(ModName)) > 0) {
|
||||
// If GetModuleFileName returns greater than zero then this must
|
||||
// be a valid code module address. Therefore we can try to walk
|
||||
// our way through its structures to find the link time stamp.
|
||||
IMAGE_DOS_HEADER *DosHeader = (IMAGE_DOS_HEADER*)ModuleHandle;
|
||||
if (IMAGE_DOS_SIGNATURE != DosHeader->e_magic) {
|
||||
return;
|
||||
}
|
||||
|
||||
IMAGE_NT_HEADERS *NTHeader = (IMAGE_NT_HEADERS*)((char *)DosHeader + DosHeader->e_lfanew);
|
||||
if (IMAGE_NT_SIGNATURE != NTHeader->Signature) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the code module file so that we can get its file date
|
||||
// and size.
|
||||
HANDLE ModuleFile = CreateFile(ModName, GENERIC_READ,
|
||||
FILE_SHARE_READ, 0, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, 0);
|
||||
char TimeBuffer[100] = "";
|
||||
DWORD FileSize = 0;
|
||||
if (ModuleFile != INVALID_HANDLE_VALUE) {
|
||||
FileSize = GetFileSize(ModuleFile, 0);
|
||||
FILETIME LastWriteTime;
|
||||
if (GetFileTime(ModuleFile, 0, 0, &LastWriteTime)) {
|
||||
wsprintf(TimeBuffer, " - file date is ");
|
||||
PrintTime(TimeBuffer + lstrlen(TimeBuffer), LastWriteTime);
|
||||
}
|
||||
CloseHandle(ModuleFile);
|
||||
}
|
||||
hprintf(LogFile, "%s, loaded at 0x%08x - %d bytes - %08x%s\r\n",
|
||||
ModName, ModuleHandle, FileSize,
|
||||
NTHeader->FileHeader.TimeDateStamp, TimeBuffer);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
// Handle any exceptions by continuing from this point.
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Scan memory looking for code modules (DLLs or EXEs). VirtualQuery is used
|
||||
// to find all the blocks of address space that were reserved or committed,
|
||||
// and ShowModuleInfo will display module information if they are code
|
||||
// modules.
|
||||
|
||||
static void RecordModuleList(HANDLE LogFile)
|
||||
{
|
||||
hprintf(LogFile, "\r\n"
|
||||
"\tModule list: names, addresses, sizes, time stamps "
|
||||
"and file times:\r\n");
|
||||
SYSTEM_INFO SystemInfo;
|
||||
GetSystemInfo(&SystemInfo);
|
||||
const size_t PageSize = SystemInfo.dwPageSize;
|
||||
// Set NumPages to the number of pages in the 4GByte address space,
|
||||
// while being careful to avoid overflowing ints.
|
||||
const size_t NumPages = 4 * size_t(ONEG / PageSize);
|
||||
size_t pageNum = 0;
|
||||
void *LastAllocationBase = 0;
|
||||
while (pageNum < NumPages) {
|
||||
MEMORY_BASIC_INFORMATION MemInfo;
|
||||
if (VirtualQuery((void *)(pageNum * PageSize), &MemInfo, sizeof(MemInfo))) {
|
||||
if (MemInfo.RegionSize > 0) {
|
||||
|
||||
// Adjust the page number to skip over this block of memory.
|
||||
pageNum += MemInfo.RegionSize / PageSize;
|
||||
if (MemInfo.State == MEM_COMMIT && MemInfo.AllocationBase > LastAllocationBase) {
|
||||
// Look for new blocks of committed memory, and try
|
||||
// recording their module names - this will fail
|
||||
// gracefully if they aren't code modules.
|
||||
LastAllocationBase = MemInfo.AllocationBase;
|
||||
ShowModuleInfo(LogFile, (HINSTANCE)LastAllocationBase);
|
||||
}
|
||||
} else {
|
||||
pageNum += SIXTYFOURK / PageSize;
|
||||
}
|
||||
} else {
|
||||
// If VirtualQuery fails we advance by 64K because that is the
|
||||
// granularity of address space doled out by VirtualAlloc().
|
||||
pageNum += SIXTYFOURK / PageSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Record information about the user's system, such as processor type, amount
|
||||
// of memory, etc.
|
||||
|
||||
static void RecordSystemInformation(HANDLE LogFile)
|
||||
{
|
||||
FILETIME CurrentTime;
|
||||
GetSystemTimeAsFileTime(&CurrentTime);
|
||||
char TimeBuffer[100];
|
||||
PrintTime(TimeBuffer, CurrentTime);
|
||||
hprintf(LogFile, "Error occurred at %s.\r\n", TimeBuffer);
|
||||
char ModuleName[MAX_PATH];
|
||||
if (GetModuleFileName(0, ModuleName, sizeof(ModuleName)) <= 0) {
|
||||
lstrcpy(ModuleName, "Unknown");
|
||||
}
|
||||
char UserName[200];
|
||||
DWORD UserNameSize = sizeof(UserName);
|
||||
if (!GetUserName(UserName, &UserNameSize)) {
|
||||
lstrcpy(UserName, "Unknown");
|
||||
}
|
||||
hprintf(LogFile, "%s, run by %s.\r\n", ModuleName, UserName);
|
||||
|
||||
SYSTEM_INFO SystemInfo;
|
||||
GetSystemInfo(&SystemInfo);
|
||||
hprintf(LogFile, "%d processor(s), type %d.\r\n",
|
||||
SystemInfo.dwNumberOfProcessors, SystemInfo.dwProcessorType);
|
||||
|
||||
MEMORYSTATUS MemInfo;
|
||||
MemInfo.dwLength = sizeof(MemInfo);
|
||||
GlobalMemoryStatus(&MemInfo);
|
||||
// Print out the amount of physical memory, rounded up.
|
||||
hprintf(LogFile, "%d MBytes physical memory.\r\n", (MemInfo.dwTotalPhys +
|
||||
ONEM - 1) / ONEM);
|
||||
}
|
||||
|
||||
// Translate the exception code into something human readable.
|
||||
|
||||
static const char *GetExceptionDescription(DWORD ExceptionCode)
|
||||
{
|
||||
struct ExceptionNames
|
||||
{
|
||||
DWORD ExceptionCode;
|
||||
char* ExceptionName;
|
||||
};
|
||||
|
||||
ExceptionNames ExceptionMap[] =
|
||||
{
|
||||
{0x40010005, "a Control-C"},
|
||||
{0x40010008, "a Control-Break"},
|
||||
{0x80000002, "a Datatype Misalignment"},
|
||||
{0x80000003, "a Breakpoint"},
|
||||
{0xc0000005, "an Access Violation"},
|
||||
{0xc0000006, "an In Page Error"},
|
||||
{0xc0000017, "a No Memory"},
|
||||
{0xc000001d, "an Illegal Instruction"},
|
||||
{0xc0000025, "a Noncontinuable Exception"},
|
||||
{0xc0000026, "an Invalid Disposition"},
|
||||
{0xc000008c, "a Array Bounds Exceeded"},
|
||||
{0xc000008d, "a Float Denormal Operand"},
|
||||
{0xc000008e, "a Float Divide by Zero"},
|
||||
{0xc000008f, "a Float Inexact Result"},
|
||||
{0xc0000090, "a Float Invalid Operation"},
|
||||
{0xc0000091, "a Float Overflow"},
|
||||
{0xc0000092, "a Float Stack Check"},
|
||||
{0xc0000093, "a Float Underflow"},
|
||||
{0xc0000094, "an Integer Divide by Zero"},
|
||||
{0xc0000095, "an Integer Overflow"},
|
||||
{0xc0000096, "a Privileged Instruction"},
|
||||
{0xc00000fD, "a Stack Overflow"},
|
||||
{0xc0000142, "a DLL Initialization Failed"},
|
||||
{0xe06d7363, "a Microsoft C++ Exception"},
|
||||
};
|
||||
|
||||
for (int i = 0; i < sizeof(ExceptionMap) / sizeof(ExceptionMap[0]); i++) {
|
||||
if (ExceptionCode == ExceptionMap[i].ExceptionCode) {
|
||||
return ExceptionMap[i].ExceptionName;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown exception type";
|
||||
}
|
||||
|
||||
static char* GetFilePart(char *source)
|
||||
{
|
||||
char *result = strrchr(source, '\\');
|
||||
if (result) {
|
||||
result++;
|
||||
} else {
|
||||
result = source;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// External Functions
|
||||
//
|
||||
// --------------------
|
||||
|
||||
extern char safe_string[512];
|
||||
|
||||
// Entry point into the main exception handling routine. This routine is put into an except()
|
||||
// statment at the beginning of a thread and is called anytime that there is a program exception
|
||||
// The data is stored in a file called ErrorLog.txt in the data directory.
|
||||
//
|
||||
// data: pointer to the exception data
|
||||
// Message: Any message that should be printed out in the error log file
|
||||
//
|
||||
// returns:
|
||||
//
|
||||
int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
{
|
||||
static bool BeenHere = false;
|
||||
|
||||
// Going recursive! That must mean this routine crashed!
|
||||
if (BeenHere) {
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
BeenHere = true;
|
||||
|
||||
char ModuleName[MAX_PATH];
|
||||
char FileName[MAX_PATH] = "Unknown";
|
||||
// Create a filename to record the error information to.
|
||||
// Storing it in the executable directory works well.
|
||||
if (GetModuleFileName(0, ModuleName, sizeof(ModuleName)) <= 0) {
|
||||
ModuleName[0] = 0;
|
||||
}
|
||||
|
||||
char *FilePart = GetFilePart(ModuleName);
|
||||
|
||||
// Extract the file name portion and remove it's file extension. We'll
|
||||
// use that name shortly.
|
||||
lstrcpy(FileName, FilePart);
|
||||
char *lastperiod = strrchr(FileName, '.');
|
||||
if (lastperiod) {
|
||||
lastperiod[0] = 0;
|
||||
}
|
||||
|
||||
// Replace the executable filename with our error log file name.
|
||||
lstrcpy(FilePart, "errorlog.txt");
|
||||
HANDLE LogFile = CreateFile(ModuleName, GENERIC_WRITE, 0, 0,
|
||||
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, 0);
|
||||
if (LogFile == INVALID_HANDLE_VALUE) {
|
||||
OutputDebugString("Error creating exception report");
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
// Append to the error log.
|
||||
SetFilePointer(LogFile, 0, 0, FILE_END);
|
||||
// Print out some blank lines to separate this error log from any previous ones.
|
||||
hprintf(LogFile, "\r\n\r\n\r\n\r\n");
|
||||
PEXCEPTION_RECORD Exception = data->ExceptionRecord;
|
||||
PCONTEXT Context = data->ContextRecord;
|
||||
|
||||
char CrashModulePathName[MAX_PATH];
|
||||
char *CrashModuleFileName = "Unknown";
|
||||
MEMORY_BASIC_INFORMATION MemInfo;
|
||||
// VirtualQuery can be used to get the allocation base associated with a
|
||||
// code address, which is the same as the ModuleHandle. This can be used
|
||||
// to get the filename of the module that the crash happened in.
|
||||
if (VirtualQuery((void*)Context->Eip, &MemInfo, sizeof(MemInfo)) && GetModuleFileName((HINSTANCE)MemInfo.AllocationBase, CrashModulePathName, sizeof(CrashModulePathName)) > 0) {
|
||||
CrashModuleFileName = GetFilePart(CrashModulePathName);
|
||||
}
|
||||
|
||||
// Print out the beginning of the error log in a Win95 error window
|
||||
// compatible format.
|
||||
hprintf(LogFile, "%s caused %s in module %s at %04x:%08x.\r\n",
|
||||
FileName, GetExceptionDescription(Exception->ExceptionCode),
|
||||
CrashModuleFileName, Context->SegCs, Context->Eip);
|
||||
hprintf(LogFile, "Exception handler called in %s.\r\n", Message);
|
||||
RecordSystemInformation(LogFile);
|
||||
// If the exception was an access violation, print out some additional
|
||||
// information, to the error log and the debugger.
|
||||
if (Exception->ExceptionCode == STATUS_ACCESS_VIOLATION && Exception->NumberParameters >= 2) {
|
||||
char DebugMessage[1000];
|
||||
const char* readwrite = "Read from";
|
||||
if (Exception->ExceptionInformation[0]) {
|
||||
readwrite = "Write to";
|
||||
}
|
||||
|
||||
wsprintf(DebugMessage, "%s location %08x caused an access violation.\r\n", readwrite, Exception->ExceptionInformation[1]);
|
||||
|
||||
#ifdef _DEBUG
|
||||
// The VisualC++ debugger doesn't actually tell you whether a read
|
||||
// or a write caused the access violation, nor does it tell what
|
||||
// address was being read or written. So I fixed that.
|
||||
OutputDebugString("Exception handler: ");
|
||||
OutputDebugString(DebugMessage);
|
||||
#endif
|
||||
|
||||
hprintf(LogFile, "%s", DebugMessage);
|
||||
}
|
||||
|
||||
// Print out the register values in a Win95 error window compatible format.
|
||||
hprintf(LogFile, "\r\n");
|
||||
hprintf(LogFile, "Registers:\r\n");
|
||||
hprintf(LogFile, "EAX=%08x CS=%04x EIP=%08x EFLGS=%08x\r\n",
|
||||
Context->Eax, Context->SegCs, Context->Eip, Context->EFlags);
|
||||
hprintf(LogFile, "EBX=%08x SS=%04x ESP=%08x EBP=%08x\r\n",
|
||||
Context->Ebx, Context->SegSs, Context->Esp, Context->Ebp);
|
||||
hprintf(LogFile, "ECX=%08x DS=%04x ESI=%08x FS=%04x\r\n",
|
||||
Context->Ecx, Context->SegDs, Context->Esi, Context->SegFs);
|
||||
hprintf(LogFile, "EDX=%08x ES=%04x EDI=%08x GS=%04x\r\n",
|
||||
Context->Edx, Context->SegEs, Context->Edi, Context->SegGs);
|
||||
hprintf(LogFile, "Bytes at CS:EIP:\r\n");
|
||||
|
||||
// Print out the bytes of code at the instruction pointer. Since the
|
||||
// crash may have been caused by an instruction pointer that was bad,
|
||||
// this code needs to be wrapped in an exception handler, in case there
|
||||
// is no memory to read. If the dereferencing of code[] fails, the
|
||||
// exception handler will print '??'.
|
||||
unsigned char *code = (unsigned char*)Context->Eip;
|
||||
for (int codebyte = 0; codebyte < NumCodeBytes; codebyte++) {
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
hprintf(LogFile, "%02x ", code[codebyte]);
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "?? ");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Time to print part or all of the stack to the error log. This allows
|
||||
// us to figure out the call stack, parameters, local variables, etc.
|
||||
hprintf(LogFile, "\r\n"
|
||||
"Stack dump:\r\n");
|
||||
__try {
|
||||
// Esp contains the bottom of the stack, or at least the bottom of
|
||||
// the currently used area.
|
||||
DWORD* pStack = (DWORD *)Context->Esp;
|
||||
DWORD* pStackTop;
|
||||
__asm
|
||||
{
|
||||
// Load the top (highest address) of the stack from the
|
||||
// thread information block. It will be found there in
|
||||
// Win9x and Windows NT.
|
||||
mov eax, fs:[4]
|
||||
mov pStackTop, eax
|
||||
}
|
||||
if (pStackTop > pStack + MaxStackDump) {
|
||||
pStackTop = pStack + MaxStackDump;
|
||||
}
|
||||
|
||||
int Count = 0;
|
||||
// Too many calls to WriteFile can take a long time, causing
|
||||
// confusing delays when programs crash. Therefore I implemented
|
||||
// simple buffering for the stack dumping code instead of calling
|
||||
// hprintf directly.
|
||||
char buffer[1000] = "";
|
||||
const int safetyzone = 50;
|
||||
char* nearend = buffer + sizeof(buffer) - safetyzone;
|
||||
char* output = buffer;
|
||||
while (pStack + 1 <= pStackTop) {
|
||||
if ((Count % StackColumns) == 0) {
|
||||
output += wsprintf(output, "%08x: ", pStack);
|
||||
}
|
||||
|
||||
char *Suffix = " ";
|
||||
if ((++Count % StackColumns) == 0 || pStack + 2 > pStackTop) {
|
||||
Suffix = "\r\n";
|
||||
}
|
||||
|
||||
output += wsprintf(output, "%08x%s", *pStack, Suffix);
|
||||
pStack++;
|
||||
// Check for when the buffer is almost full, and flush it to disk.
|
||||
if (output > nearend) {
|
||||
hprintf(LogFile, "%s", buffer);
|
||||
buffer[0] = 0;
|
||||
output = buffer;
|
||||
}
|
||||
}
|
||||
// Print out any final characters from the cache.
|
||||
hprintf(LogFile, "%s", buffer);
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "Exception encountered during stack dump.\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
RecordModuleList(LogFile);
|
||||
|
||||
CloseHandle(LogFile);
|
||||
// Return the magic value which tells Win32 that this handler didn't
|
||||
// actually handle the exception - so that things will proceed as per
|
||||
// normal.
|
||||
if(safe_string[0])hprintf(LogFile, "\nlast safe point \n%s\n",safe_string);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-07-07 19:55:58 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for program exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/07 02:58:10 mharris
|
||||
* ifdef around pragma
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 1 6/29/99 7:42p Dave
|
||||
*
|
||||
* 2 1/18/99 4:34p Allender
|
||||
* added the exception handler routines from Game Developer for structured
|
||||
* exception handling in vsdk code
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // Include this file only once
|
||||
#endif
|
||||
|
||||
#ifndef __EXCEPTION_HANDLER_H
|
||||
#define __EXCEPTION_HANDLER_H
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Enumerated types
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
// --------------------
|
||||
|
||||
// this is a forward declaration so we don't need to include windows.h
|
||||
|
||||
typedef struct _EXCEPTION_POINTERS EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Classes
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Variables
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Prototypes
|
||||
//
|
||||
// --------------------
|
||||
|
||||
int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message);
|
||||
|
||||
// --------------------
|
||||
//
|
||||
// Helper Macros
|
||||
//
|
||||
// --------------------
|
||||
|
||||
|
||||
#endif // __EXCEPTION_HANDLER_H
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,273 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2004-05-12 22:49:13 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/03/17 04:07:29 bobboau
|
||||
* new fighter beam code
|
||||
* fixed old after burner trails
|
||||
* had to bump a few limits, working on some dynamic solutions
|
||||
* a few fixed to background POF rendering
|
||||
* fixing asorted bugs
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/02 05:12:39 penguin
|
||||
* Moved "extern int wm" declaration inside the header #ifdef block
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 8 9/13/99 10:09a Andsager
|
||||
* Add debug console commands to lower model render detail and fireball
|
||||
* LOD for big ship explosiosns.
|
||||
*
|
||||
* 7 9/06/99 6:57p Jamesa
|
||||
* Cranked down num large fireball explosions.
|
||||
*
|
||||
* 6 9/06/99 6:14p Jamesa
|
||||
* Reduced max fireball types.
|
||||
*
|
||||
* 5 8/31/99 10:13p Andsager
|
||||
* Add Knossos warp effect fireball
|
||||
*
|
||||
* 4 4/28/99 11:13p Dave
|
||||
* Temporary checkin of artillery code.
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 34 5/15/98 3:54p John
|
||||
* Added code so that only "perishable" fireballs get removed.
|
||||
*
|
||||
* 33 4/15/98 9:42a Adam
|
||||
* added 2 more explosion types (1, actually, but placeholder for 2)
|
||||
*
|
||||
* 32 4/12/98 9:56a John
|
||||
* Made lighting detail flags work. Made explosions cast light on
|
||||
* highest.
|
||||
*
|
||||
* 31 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 30 3/18/98 12:36p John
|
||||
* Made hardware have nicer looking warp effect
|
||||
*
|
||||
* 29 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 28 2/19/98 4:32p Lawrance
|
||||
* Add asteroid explosion
|
||||
*
|
||||
* 27 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* 26 1/15/98 4:58p John
|
||||
* Made warp effect use a looping ani. Made the scaling up & down be in
|
||||
* software.
|
||||
*
|
||||
* 25 1/15/98 2:32p John
|
||||
* Added code to optionally take a velocity for a fireball.
|
||||
*
|
||||
* 24 1/02/98 5:04p John
|
||||
* Several explosion related changes. Made fireballs not be used as
|
||||
* ani's. Made ship spark system expell particles. Took away impact
|
||||
* explosion for weapon hitting ship... this needs to get added to weapon
|
||||
* info and makes shield hit more obvious. Only make sparks when hit
|
||||
* hull, not shields.
|
||||
*
|
||||
* 23 12/08/97 11:15a John
|
||||
* added parameter to warpout for life.
|
||||
*
|
||||
* 22 11/01/97 1:49p John
|
||||
* added code to page fireballs in during level load. Made player warpout
|
||||
* use Adam's new camera movement pattern. Make ships docked to warping
|
||||
* out ships render correctly.
|
||||
*
|
||||
* 21 10/24/97 6:24p John
|
||||
* added code to return the life left of a fireball
|
||||
*
|
||||
* 20 9/14/97 4:49p Lawrance
|
||||
* extern Num_fireballs
|
||||
*
|
||||
* 19 9/12/97 4:02p John
|
||||
* put in ship warp out effect.
|
||||
* put in dynamic lighting for warp in/out
|
||||
*
|
||||
* 18 9/09/97 4:49p John
|
||||
* Almost done ship warp in code
|
||||
*
|
||||
* 17 9/03/97 4:32p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 16 8/29/97 2:26p John
|
||||
* first rev of ship warp in effect. Nothing more than a fireball inside
|
||||
* of freespace, but textest.cpp contains the correct effect code that
|
||||
* needs to be transferred into the game next.
|
||||
*
|
||||
* 15 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 14 8/13/97 12:06p Lawrance
|
||||
* supporting multiple types of fireball explosions
|
||||
*
|
||||
* 13 7/21/97 11:41a Lawrance
|
||||
* clean up fireballs at the end of each level
|
||||
*
|
||||
* 12 7/11/97 11:19a Lawrance
|
||||
* fix mem leaks, move save code from State.cpp here
|
||||
*
|
||||
* 11 7/10/97 1:51p Lawrance
|
||||
* sorting anim fireballs
|
||||
*
|
||||
* 10 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 9 3/11/97 10:47p Mike
|
||||
* Add a slew of secondary weapons.
|
||||
* Support exhaust blobs.
|
||||
* Add weapons that spawn weapons.
|
||||
* Add remotely detonatable weapons.
|
||||
* Add heat-seeking missiles.
|
||||
*
|
||||
* 8 2/17/97 5:18p John
|
||||
* Added a bunch of RCS headers to a bunch of old files that don't have
|
||||
* them.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _FIREBALLS_H
|
||||
#define _FIREBALLS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
struct object;
|
||||
|
||||
// these values correspond to the fireball.tbl entries
|
||||
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
|
||||
#define FIREBALL_WARP_EFFECT 1 // Used for the warp in / warp out effect
|
||||
#define FIREBALL_KNOSSOS_EFFECT 2 // Used for the KNOSSOS warp in / warp out effect
|
||||
#define FIREBALL_ASTEROID 3
|
||||
#define FIREBALL_EXPLOSION_LARGE1 4 // Used for the big explosion when a ship breaks into pieces
|
||||
#define FIREBALL_EXPLOSION_LARGE2 5 // Used for the big explosion when a ship breaks into pieces
|
||||
// #define FIREBALL_EXPLOSION_LARGE3 6 // Used for the big explosion when a ship breaks into pieces
|
||||
#define MAX_FIREBALL_TYPES 6 // How many types there are
|
||||
|
||||
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
|
||||
|
||||
// all this moved here by Goober5000 because it makes more sense in the H file
|
||||
typedef struct fireball_lod {
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int bitmap_id;
|
||||
int num_frames;
|
||||
int fps;
|
||||
} fireball_lod;
|
||||
|
||||
typedef struct fireball_info {
|
||||
int lod_count;
|
||||
fireball_lod lod[4];
|
||||
} fireball_info;
|
||||
|
||||
// flag values for fireball struct flags member
|
||||
#define FBF_WARP_CLOSE_SOUND_PLAYED (1<<0)
|
||||
#define FBF_WARP_CAPITAL_SIZE (1<<1)
|
||||
#define FBF_WARP_CRUISER_SIZE (1<<2)
|
||||
#define FBF_WARP_FORCE_OLD (1<<3) // Goober5000
|
||||
#define FBF_WARP_VIA_SEXP (1<<4) // Goober5000
|
||||
|
||||
typedef struct fireball {
|
||||
int objnum; // If -1 this object is unused
|
||||
int fireball_info_index; // Index into Fireball_info array
|
||||
int current_bitmap;
|
||||
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
|
||||
int flags; // see #define FBF_*
|
||||
char lod; // current LOD
|
||||
float time_elapsed; // in seconds
|
||||
float total_time; // total lifetime of animation in seconds
|
||||
int warp_open_sound_index; // for warp-effect - Goober5000
|
||||
int warp_close_sound_index; // for warp-effect - Goober5000
|
||||
} fireball;
|
||||
// end move
|
||||
|
||||
void fireball_init();
|
||||
void fireball_render(object * obj);
|
||||
void fireball_delete( object * obj );
|
||||
void fireball_process_pre(object * obj, float frame_time);
|
||||
void fireball_process_post(object * obj, float frame_time);
|
||||
|
||||
// reversed is for warp_in/out effects
|
||||
// Velocity: If not NULL, the fireball will move at a constant velocity.
|
||||
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
|
||||
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
|
||||
void fireball_render_plane(int plane);
|
||||
void fireball_close();
|
||||
void fireball_level_close();
|
||||
void fireball_preload(); // page in warpout effect data
|
||||
|
||||
// Returns 1 if you can remove this fireball
|
||||
int fireball_is_perishable(object * obj);
|
||||
|
||||
// Returns 1 if this fireball is a warp
|
||||
int fireball_is_warp(object * obj);
|
||||
|
||||
// Returns life left of a fireball in seconds
|
||||
float fireball_lifeleft( object *obj );
|
||||
|
||||
// Returns life left of a fireball in percent
|
||||
float fireball_lifeleft_percent( object *obj );
|
||||
|
||||
// internal function to draw warp grid.
|
||||
extern void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old = 0 );
|
||||
extern int Warp_glow_bitmap; // Internal
|
||||
|
||||
extern int Warp_model;
|
||||
|
||||
#endif /* _FIREBALLS_H */
|
||||
@@ -1,394 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.15 $
|
||||
* $Date: 2004-05-12 22:49:13 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14 2004/05/08 01:08:48 Goober5000
|
||||
* small fix
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/03/17 04:07:29 bobboau
|
||||
* new fighter beam code
|
||||
* fixed old after burner trails
|
||||
* had to bump a few limits, working on some dynamic solutions
|
||||
* a few fixed to background POF rendering
|
||||
* fixing asorted bugs
|
||||
*
|
||||
* Revision 2.12 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/11/16 04:09:19 Goober5000
|
||||
* language
|
||||
*
|
||||
* Revision 2.10 2003/11/11 03:56:10 bobboau
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.9 2003/09/26 14:37:13 bobboau
|
||||
* commiting Hardware T&L code, everything is ifdefed out with the compile flag HTL
|
||||
* still needs a lot of work, ubt the frame rates were getting with it are incredable
|
||||
* the biggest problem it still has is a bad lightmanegment system, and the zbuffer
|
||||
* doesn't work well with things still getting rendered useing the sofware pipeline, like thrusters,
|
||||
* and weapons, I think these should be modifyed to be sent through hardware,
|
||||
* it would be slightly faster and it would likely fix the problem
|
||||
*
|
||||
* also the thruster glow/particle stuff I did is now in.
|
||||
*
|
||||
* Revision 2.8 2003/08/31 06:00:41 bobboau
|
||||
* an asortment of bugfixes, mostly with the specular code,
|
||||
* HUD flickering should be completly gone now
|
||||
*
|
||||
* Revision 2.7 2003/03/19 23:06:40 Goober5000
|
||||
* bit o' housecleaning
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/03/19 22:49:32 Goober5000
|
||||
* added some mission flags
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/18 01:44:30 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 7/22/99 1:22p Dave
|
||||
* Enable proper zbuffering for warpin glow effect.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 23 4/08/98 8:20p John
|
||||
* Made "Apex" of warp effect not move.
|
||||
*
|
||||
* 22 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 21 3/29/98 12:39p John
|
||||
* Made warp in glow page in
|
||||
*
|
||||
* 20 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 19 3/18/98 12:36p John
|
||||
* Made hardware have nicer looking warp effect
|
||||
*
|
||||
* 18 3/16/98 4:51p John
|
||||
* Added low-level code to clip all polygons against an arbritary plane.
|
||||
* Took out all old model_interp_zclip and used this new method instead.
|
||||
*
|
||||
* 17 3/10/98 4:18p John
|
||||
* Cleaned up graphics lib. Took out most unused gr functions. Made D3D
|
||||
* & Glide have popups and print screen. Took out all >8bpp software
|
||||
* support. Made Fred zbuffer. Made zbuffer allocate dynamically to
|
||||
* support Fred. Made zbuffering key off of functions rather than one
|
||||
* global variable.
|
||||
*
|
||||
* 16 3/04/98 7:07p John
|
||||
* Added debug code to try to normalize a zerolength vector.
|
||||
*
|
||||
* 15 2/26/98 3:28p John
|
||||
* fixed optimize compiler warning
|
||||
*
|
||||
* 14 2/24/98 6:36p John
|
||||
* Made warp effect draw as a 4 poly cone.
|
||||
*
|
||||
* 13 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 12 1/15/98 9:07p John
|
||||
* Added noise to warp effect glow.
|
||||
*
|
||||
* 11 1/15/98 4:58p John
|
||||
* Made warp effect use a looping ani. Made the scaling up & down be in
|
||||
* software.
|
||||
*
|
||||
* 10 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 9 12/08/97 11:15a John
|
||||
* added parameter to warpout for life.
|
||||
*
|
||||
* 8 12/05/97 3:46p John
|
||||
* made ship thruster glow scale instead of being an animation.
|
||||
*
|
||||
* 7 12/02/97 3:59p John
|
||||
* Added first rev of thruster glow, along with variable levels of
|
||||
* translucency, which retquired some restructing of palman.
|
||||
*
|
||||
* 6 10/24/97 12:18p John
|
||||
* sped up warp effect by decreasing number of polys with distance.
|
||||
*
|
||||
* 5 9/15/97 5:45p John
|
||||
* took out chunk stuff.
|
||||
* made pofview display thrusters as blue polies.
|
||||
*
|
||||
* 4 9/12/97 4:02p John
|
||||
* put in ship warp out effect.
|
||||
* put in dynamic lighting for warp in/out
|
||||
*
|
||||
* 3 9/09/97 4:49p John
|
||||
* Almost done ship warp in code
|
||||
*
|
||||
* 2 9/08/97 8:39a John
|
||||
* added in code structure for grid
|
||||
*
|
||||
* 1 9/05/97 10:07a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "math/vecmat.h"
|
||||
#include "graphics/tmapper.h"
|
||||
#include "render/3d.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "Nebula/Neb.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
extern int Warp_model;
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
if ( Dc_command ) {
|
||||
vector tmp = vmd_zero_vector;
|
||||
vm_vec_normalize(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
{
|
||||
vector norm;
|
||||
vertex *vertlist[3];
|
||||
|
||||
vm_vec_perp(&norm,(vector *)&v1->x,(vector *)&v2->x,(vector *)&v3->x);
|
||||
if ( vm_vec_dot(&norm,(vector *)&v1->x ) >= 0.0 ) {
|
||||
vertlist[0] = v3;
|
||||
vertlist[1] = v2;
|
||||
vertlist[2] = v1;
|
||||
} else {
|
||||
vertlist[0] = v1;
|
||||
vertlist[1] = v2;
|
||||
vertlist[2] = v3;
|
||||
}
|
||||
|
||||
g3_draw_poly( 3, vertlist, TMAP_FLAG_TEXTURED );
|
||||
|
||||
}
|
||||
|
||||
#define wSTUFF_VERTICES() do { verts[0]->u = 0.5f; verts[0]->v = 0.0f; verts[1]->u = 1.0f; verts[1]->v = 0.0f; verts[2]->u = 1.0f; verts[2]->v = 1.0f; verts[3]->u = 0.5f; verts[3]->v = 1.0f; } while(0);
|
||||
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
|
||||
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
|
||||
|
||||
void warpin_render(object *obj, matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old)
|
||||
{
|
||||
int i;
|
||||
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
|
||||
// gr_zbuffering = 0;
|
||||
|
||||
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
vector center;
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
// Warp_Map = texture_bitmap_num;//sets the warp map, and thus sets the interp flag for this being a warpin effect
|
||||
vector vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
if(Warp_model > -1 && !force_old && !(The_mission.flags & MISSION_FLAG_OLD_WARP_EFFECT)){
|
||||
float model_Interp_scale_x = radius /20;
|
||||
float model_Interp_scale_y = radius /20;
|
||||
float model_Interp_scale_z = radius /20;
|
||||
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
gr_set_cull(0);
|
||||
model_render( Warp_model, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
gr_set_cull(1);
|
||||
|
||||
// Warp_Map = -1;//un sets the warp map
|
||||
|
||||
model_Interp_scale_x = 1.0f;
|
||||
model_Interp_scale_y = 1.0f;
|
||||
model_Interp_scale_z = 1.0f;
|
||||
|
||||
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, -1.0f);
|
||||
|
||||
/*
|
||||
//this is that half done effect that was pissing people off-Bobboau
|
||||
|
||||
gr_set_cull(0);
|
||||
|
||||
matrix m;
|
||||
vector ray_dir;
|
||||
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
|
||||
float angle = ANG_TO_RAD(135.0f);
|
||||
if(life_percent < 0.2f){
|
||||
angle = ANG_TO_RAD(135.0f * (life_percent * 5.0f));
|
||||
}
|
||||
for(int idx=0; idx<1; idx++){
|
||||
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
|
||||
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
|
||||
vector p_temp = *pos;
|
||||
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
|
||||
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
|
||||
|
||||
vertex h1[4]; // halves of a beam section
|
||||
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
|
||||
vector top1, bottom1, top2, bottom2;
|
||||
|
||||
beam_calc_facing_pts(&top1, &bottom1, &ray_dir, pos, 1.0f, 1.0f);
|
||||
beam_calc_facing_pts(&top2, &bottom2, &ray_dir, &p_temp, 1.0f, 1.0f);
|
||||
|
||||
mprintf(( "top1 %f %f %f, botom1 %f %f %f, \n",top1.xyz.x, top1.xyz.y, top1.xyz.z, bottom1.xyz.x, bottom1.xyz.y, bottom1.xyz.z));
|
||||
mprintf(( "top2 %f %f %f, botom2 %f %f %f, \n",top2.xyz.x, top2.xyz.y, top2.xyz.z, bottom2.xyz.x, bottom2.xyz.y, bottom2.xyz.z));
|
||||
wR_VERTICES(); // rotate and project the vertices
|
||||
wP_VERTICES();
|
||||
wSTUFF_VERTICES(); // stuff the beam with creamy goodness (texture coords)
|
||||
|
||||
gr_set_bitmap(Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
|
||||
g3_draw_poly( 4, verts, TMAP_FLAG_TILED | TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT); // added TMAP_FLAG_TILED flag for beam texture tileing -Bobboau
|
||||
}
|
||||
|
||||
gr_set_cull(1);
|
||||
*/
|
||||
|
||||
vecs[4] = center; //this is for the warp glow-Bobboau
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
g3_rotate_vertex( &verts[4], &vecs[4] );
|
||||
|
||||
}else{
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
verts[1].u = 0.99f; verts[1].v = 0.01f;
|
||||
verts[2].u = 0.99f; verts[2].v = 0.99f;
|
||||
verts[3].u = 0.01f; verts[3].v = 0.99f;
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
|
||||
for (i=0; i<5; i++ ) {
|
||||
g3_rotate_vertex( &verts[i], &vecs[i] );
|
||||
}
|
||||
|
||||
draw_face( &verts[0], &verts[4], &verts[1] );
|
||||
draw_face( &verts[1], &verts[4], &verts[2] );
|
||||
draw_face( &verts[4], &verts[3], &verts[2] );
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
}
|
||||
if ( Warp_glow_bitmap != -1 ) {
|
||||
gr_set_bitmap( Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, (The_mission.flags & MISSION_FLAG_FULLNEB)?(1.0f - neb2_get_fog_intensity(obj)):1.0f );
|
||||
|
||||
float r = radius;
|
||||
|
||||
int render_it;
|
||||
|
||||
#define OUT_PERCENT1 0.80f
|
||||
#define OUT_PERCENT2 0.90f
|
||||
|
||||
#define IN_PERCENT1 0.10f
|
||||
#define IN_PERCENT2 0.20f
|
||||
|
||||
if ( life_percent < IN_PERCENT1 ) {
|
||||
// do nothing
|
||||
render_it = 0;
|
||||
} else if ( life_percent < IN_PERCENT2 ) {
|
||||
r *= ( life_percent-IN_PERCENT1 ) / (IN_PERCENT2-IN_PERCENT1);
|
||||
render_it = 1;
|
||||
} else if ( life_percent < OUT_PERCENT1 ) {
|
||||
// do nothing
|
||||
render_it = 1;
|
||||
} else if ( life_percent < OUT_PERCENT2 ) {
|
||||
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2-OUT_PERCENT1);
|
||||
render_it = 1;
|
||||
} else {
|
||||
// do nothing
|
||||
render_it = 0;
|
||||
}
|
||||
|
||||
if (render_it) {
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
gr_zbuffer_set(GR_ZBUFF_READ);
|
||||
|
||||
// Add in noise
|
||||
//float Noise[NOISE_NUM_FRAMES] = {
|
||||
int noise_frame = fl2i(Missiontime/15.0f) % NOISE_NUM_FRAMES;
|
||||
|
||||
r *= (0.40f + Noise[noise_frame]*0.30f);
|
||||
|
||||
g3_draw_bitmap( &verts[4], 0,r, TMAP_FLAG_TEXTURED );
|
||||
gr_zbuffer_set(saved_gr_zbuffering);
|
||||
}
|
||||
}
|
||||
|
||||
gr_zbuffer_set( saved_gr_zbuffering );
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.2 KiB |
File diff suppressed because it is too large.
Load diff
@@ -1,364 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
*
|
||||
* All source code herein is the property of Volition, Inc. You may not sell
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2004-04-07 03:31:53 $
|
||||
* $Author: righteous1 $
|
||||
*
|
||||
* FreeSpace, the game, not the project, header information.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 24 10/06/99 10:32a Jefff
|
||||
* oem updates
|
||||
*
|
||||
* 23 9/30/99 6:04p Jefff
|
||||
* OEM changes
|
||||
*
|
||||
* 22 9/08/99 3:22p Dave
|
||||
* Updated builtin mission list.
|
||||
*
|
||||
* 21 9/06/99 6:38p Dave
|
||||
* Improved CD detection code.
|
||||
*
|
||||
* 20 9/06/99 1:30a Dave
|
||||
* Intermediate checkin. Started on enforcing CD-in-drive to play the
|
||||
* game.
|
||||
*
|
||||
* 19 9/06/99 1:16a Dave
|
||||
* Make sure the user sees the intro movie.
|
||||
*
|
||||
* 18 9/05/99 11:19p Dave
|
||||
* Made d3d texture cache much more safe. Fixed training scoring bug where
|
||||
* it would backout scores without ever having applied them in the first
|
||||
* place.
|
||||
*
|
||||
* 17 9/03/99 1:32a Dave
|
||||
* CD checking by act. Added support to play 2 cutscenes in a row
|
||||
* seamlessly. Fixed super low level cfile bug related to files in the
|
||||
* root directory of a CD. Added cheat code to set campaign mission # in
|
||||
* main hall.
|
||||
*
|
||||
* 16 8/19/99 10:12a Alanl
|
||||
* preload mission-specific messages on machines greater than 48MB
|
||||
*
|
||||
* 15 5/19/99 4:07p Dave
|
||||
* Moved versioning code into a nice isolated common place. Fixed up
|
||||
* updating code on the pxo screen. Fixed several stub problems.
|
||||
*
|
||||
* 14 5/09/99 8:57p Dave
|
||||
* Final E3 build preparations.
|
||||
*
|
||||
* 13 5/05/99 10:06a Dave
|
||||
* Upped beta version to 0.04
|
||||
*
|
||||
* 12 4/29/99 3:02p Dave
|
||||
* New beta version.
|
||||
*
|
||||
* 11 4/25/99 3:02p Dave
|
||||
* Build defines for the E3 build.
|
||||
*
|
||||
* 10 4/09/99 2:27p Dave
|
||||
* Upped version #
|
||||
*
|
||||
* 9 4/09/99 2:21p Dave
|
||||
* Multiplayer beta stuff. CD checking.
|
||||
*
|
||||
* 8 4/08/99 2:10a Dave
|
||||
* Numerous bug fixes for the beta. Added builtin mission info for the
|
||||
* beta.
|
||||
*
|
||||
* 7 3/19/99 9:52a Dave
|
||||
* Checkin to repair massive source safe crash. Also added support for
|
||||
* pof-style nebulae, and some new weapons code.
|
||||
*
|
||||
* 6 12/03/98 5:22p Dave
|
||||
* Ported over Freespace 1 multiplayer ships.tbl and weapons.tbl
|
||||
* checksumming.
|
||||
*
|
||||
* 5 10/13/98 9:26a Dave
|
||||
* Began neatening up freespace.h.
|
||||
*
|
||||
* 4 10/09/98 1:35p Dave
|
||||
* Split off registry stuff into seperate file.
|
||||
*
|
||||
* 3 10/07/98 6:27p Dave
|
||||
* Globalized mission and campaign file extensions. Removed Silent Threat
|
||||
* special code. Moved \cache \players and \multidata into the \data
|
||||
* directory.
|
||||
*
|
||||
* 2 10/07/98 10:54a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 79 9/13/98 10:51p Dave
|
||||
* Put in newfangled icons for mission simulator room. New mdisk.vp
|
||||
* checksum and file length.
|
||||
*
|
||||
* 78 9/11/98 6:59p Dave
|
||||
* First beta/rev thingie to interplay.
|
||||
*
|
||||
* 77 9/11/98 4:14p Dave
|
||||
* Fixed file checksumming of < file_size. Put in more verbose kicking and
|
||||
* PXO stats store reporting.
|
||||
*
|
||||
* 76 9/04/98 3:51p Dave
|
||||
* Put in validated mission updating and application during stats
|
||||
* updating.
|
||||
*
|
||||
* 75 5/23/98 2:41p Mike
|
||||
* Make Easy the default skill level and prevent old pilot's skill level
|
||||
* from carrying into new pilot.
|
||||
*
|
||||
* 74 5/19/98 1:19p Allender
|
||||
* new low level reliable socket reading code. Make all missions/campaign
|
||||
* load/save to data missions folder (i.e. we are rid of the player
|
||||
* missions folder)
|
||||
*
|
||||
* 73 5/13/98 11:34p Mike
|
||||
* Model caching system.
|
||||
*
|
||||
* 72 5/10/98 10:05p Allender
|
||||
* only show cutscenes which have been seen before. Made Fred able to
|
||||
* write missions anywhere, defaulting to player misison folder, not data
|
||||
* mission folder. Fix FreeSpace code to properly read missions from
|
||||
* correct locations
|
||||
*
|
||||
* 71 5/08/98 7:08p Dave
|
||||
* Lots of UI tweaking.
|
||||
*
|
||||
* 70 5/08/98 5:31p Lawrance
|
||||
* extern cd checking routines
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _FREESPACE_H
|
||||
#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"
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// FREESPACE DEFINES/VARS
|
||||
//
|
||||
|
||||
// filename extensions
|
||||
#define FS_MISSION_FILE_EXT NOX(".fs2")
|
||||
#define FS_CAMPAIGN_FILE_EXT NOX(".fc2")
|
||||
|
||||
// CDROM volume names
|
||||
#ifdef MULTIPLAYER_BETA_BUILD
|
||||
#define FS_CDROM_VOLUME_1 NOX("FS2_BETA")
|
||||
#define FS_CDROM_VOLUME_2 NOX("FS2_BETA")
|
||||
#elif defined(E3_BUILD)
|
||||
#define FS_CDROM_VOLUME_1 NOX("FS2_E3DEMO")
|
||||
#define FS_CDROM_VOLUME_2 NOX("FS2_E3DEMO")
|
||||
#elif defined(OEM_BUILD)
|
||||
#define FS_CDROM_VOLUME_1 NOX("FS2_OEM")
|
||||
#define FS_CDROM_VOLUME_2 NOX("FS2_OEM")
|
||||
#define FS_CDROM_VOLUME_3 NOX("FS2_OEM")
|
||||
#else
|
||||
#define FS_CDROM_VOLUME_1 NOX("FREESPACE2_1")
|
||||
#define FS_CDROM_VOLUME_2 NOX("FREESPACE2_2")
|
||||
#define FS_CDROM_VOLUME_3 NOX("FREESPACE2_3")
|
||||
|
||||
// old volume names
|
||||
// #define FS_CDROM_VOLUME_1 NOX("FREESPACE_1")
|
||||
// #define FS_CDROM_VOLUME_2 NOX("FREESPACE_2")
|
||||
// #define FS_CDROM_VOLUME_3 NOX("FREESPACE_3")
|
||||
#endif
|
||||
|
||||
// frametime/missiontime variables
|
||||
extern fix Frametime;
|
||||
extern float flFrametime;
|
||||
extern fix Missiontime;
|
||||
|
||||
// 0 - 4
|
||||
extern int Game_skill_level;
|
||||
|
||||
// see GM_* defines in systemvars.h
|
||||
extern int Game_mode;
|
||||
|
||||
// if this value is set anywhere within the game_do_state_common() function, the normal do_state() will not be called
|
||||
// for this frame. Useful for getting out of sticky sequencing situations.
|
||||
extern int Game_do_state_should_skip;
|
||||
|
||||
// time compression
|
||||
extern fix Game_time_compression;
|
||||
|
||||
// Set if subspace is active this level
|
||||
extern int Game_subspace_effect;
|
||||
|
||||
// The current mission being played.
|
||||
extern char Game_current_mission_filename[MAX_FILENAME_LEN];
|
||||
|
||||
// game's CDROM directory
|
||||
extern char Game_CDROM_dir[MAX_PATH_LEN];
|
||||
|
||||
// if the ships.tbl the player has is valid
|
||||
extern int Game_ships_tbl_valid;
|
||||
|
||||
// if the weapons.tbl the player has is valid
|
||||
extern int Game_weapons_tbl_valid;
|
||||
|
||||
|
||||
// this is a mission actually designed at Volition
|
||||
#define MAX_BUILTIN_MISSIONS 100
|
||||
#define FSB_FROM_VOLITION (1<<0) // we made it in-house
|
||||
#define FSB_MULTI (1<<1) // is a multiplayer mission
|
||||
#define FSB_TRAINING (1<<2) // is a training mission
|
||||
#define FSB_CAMPAIGN (1<<3) // is a campaign mission
|
||||
#define FSB_CAMPAIGN_FILE (1<<4) // is actually a campaign file
|
||||
|
||||
typedef struct fs_builtin_mission {
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int flags; // see FSB_* defines above
|
||||
char cd_volume[MAX_FILENAME_LEN]; // cd volume which this needs
|
||||
} fs_builtin_mission;
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// FREESPACE FUNCTIONS
|
||||
//
|
||||
|
||||
// mission management -------------------------------------------------
|
||||
|
||||
// loads in the currently selected mission
|
||||
int game_start_mission();
|
||||
|
||||
// shutdown a mission
|
||||
void game_level_close();
|
||||
|
||||
|
||||
// gameplay stuff -----------------------------------------------------
|
||||
|
||||
// stop the game (mission) timer
|
||||
void game_stop_time();
|
||||
|
||||
// start the game (mission) timer
|
||||
void game_start_time();
|
||||
|
||||
// call whenever in a loop or if you need to get a keypress
|
||||
int game_check_key();
|
||||
|
||||
// poll for keypresses
|
||||
int game_poll();
|
||||
|
||||
// function to read keyboard stuff
|
||||
void game_process_keys();
|
||||
|
||||
// call this to set frametime properly (once per frame)
|
||||
void game_set_frametime(int state);
|
||||
|
||||
// Used to halt all looping game sounds
|
||||
void game_stop_looped_sounds();
|
||||
|
||||
// do stuff that may need to be done regardless of state
|
||||
void game_do_state_common(int state,int no_networking = 0);
|
||||
|
||||
|
||||
// skill level --------------------------------------------------------
|
||||
|
||||
// increase the skill level (will wrap around to min skill level)
|
||||
void game_increase_skill_level();
|
||||
|
||||
// get the default game skill level
|
||||
int game_get_default_skill_level();
|
||||
|
||||
// a keypress. See CPP file for more info.
|
||||
void game_flush();
|
||||
|
||||
// running with low-memory (less than 48MB)
|
||||
bool game_using_low_mem();
|
||||
|
||||
// misc ---------------------------------------------------------------
|
||||
|
||||
// lookup the specified filename. return an fs_builtin_mission* if found, NULL otherwise
|
||||
fs_builtin_mission *game_find_builtin_mission(char *filename);
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// GAME FLASH STUFF - code in FreeSpace.cpp
|
||||
|
||||
// Resets the flash
|
||||
void game_flash_reset();
|
||||
|
||||
// Adds a flash effect. These can be positive or negative.
|
||||
// The range will get capped at around -1 to 1, so stick
|
||||
// with a range like that.
|
||||
void game_flash( float r, float g, float b );
|
||||
|
||||
// Adds a flash for Big Ship explosions
|
||||
// cap range from 0 to 1
|
||||
void big_explosion_flash(float flash);
|
||||
|
||||
// Call once a frame to diminish the
|
||||
// flash effect to 0.
|
||||
void game_flash_diminish();
|
||||
|
||||
// Loads the best palette for this level, based
|
||||
// on nebula color and hud color. You could just call palette_load_table with
|
||||
// the appropriate filename, but who wants to do that.
|
||||
void game_load_palette();
|
||||
|
||||
//================================================================
|
||||
|
||||
// Call at the beginning of each frame
|
||||
void game_whack_reset();
|
||||
|
||||
// Call to apply a whack to a the ship. Used for force feedback
|
||||
void game_whack_apply( float x, float y );
|
||||
|
||||
// call to apply a "shudder"
|
||||
void game_shudder_apply(int time, float intensity);
|
||||
|
||||
//===================================================================
|
||||
|
||||
// make sure a CD is in the drive before continuing (returns 1 to continue, otherwise 0).
|
||||
int game_do_cd_check(char *volume_name=NULL);
|
||||
int game_do_cd_check_specific(char *volume_name, int cdnum);
|
||||
int find_freespace_cd(char *volume_name=NULL);
|
||||
int set_cdrom_path(int drive_num);
|
||||
int game_do_cd_mission_check(char *filename);
|
||||
|
||||
// Used to tell the player that a feature isn't available in the demo version of FreeSpace
|
||||
void game_feature_not_in_demo_popup();
|
||||
|
||||
// Return version string for demo or full version, depending on build.
|
||||
void get_version_string(char *str);
|
||||
|
||||
// format the specified time (fixed point) into a nice string
|
||||
void game_format_time(fix m_time,char *time_str);
|
||||
|
||||
// if the game is running using hacked data
|
||||
int game_hacked_data();
|
||||
|
||||
// show the oem upsell screens (end of campaign, or close of game
|
||||
void oem_upsell_show_screens();
|
||||
|
||||
// function to handle pausing the game when the game is minimized
|
||||
// called from osapi.cpp
|
||||
void alt_tab_pause();
|
||||
|
||||
#endif // endif of #ifndef STAMPER_PROGRAM
|
||||
#endif
|
||||
@@ -1,393 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "FreespaceResource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <windows.h>
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"FreespaceResource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include <windows.h>\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
DEBUG_MENU DIALOG DISCARDABLE 0, 0, 185, 159
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Debug Menu"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LISTBOX IDC_LIST_DEBUG,7,7,171,121,LBS_OWNERDRAWFIXED |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Ok",IDOK,7,137,171,14
|
||||
END
|
||||
|
||||
FIND_DIALOG DIALOG DISCARDABLE 0, 0, 119, 47
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Find Text"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_TEXT,7,7,105,14,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "Find",IDOK,7,26,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,62,26,50,14
|
||||
END
|
||||
|
||||
IDD_CONNECT DIALOG DISCARDABLE 0, 0, 215, 253
|
||||
STYLE DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Server"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "# Connections :",IDC_CON_COUNT,7,54,148,10
|
||||
LISTBOX IDC_CONPING,7,79,148,167,WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Address and Ping",IDC_STATIC,7,66,143,10
|
||||
PUSHBUTTON "Reset All",IDC_RESET_MULTI,162,174,46,72
|
||||
PUSHBUTTON "Kick",IDC_KICK_BUTTON,161,80,47,19
|
||||
CONTROL "",IDC_STATIC,"Static",SS_GRAYRECT,7,48,201,1
|
||||
EDITTEXT IDC_STD_NAME,64,14,144,14,ES_AUTOHSCROLL
|
||||
LTEXT "Server Name",IDC_STATIC,7,17,42,8
|
||||
EDITTEXT IDC_STD_HOST_PASSWD,64,32,144,14,ES_AUTOHSCROLL
|
||||
LTEXT "Host Password",IDC_STATIC,7,33,48,8
|
||||
PUSHBUTTON "Refresh Missions",IDC_PXO_REFRESH,161,116,47,36,
|
||||
BS_MULTILINE
|
||||
END
|
||||
|
||||
IDD_MULTI DIALOG DISCARDABLE 0, 0, 215, 253
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Multi-Player"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Frame Cap :",10,7,28,43,8
|
||||
LTEXT "",IDC_FRAMECAP_STATIC,53,29,46,10,SS_SUNKEN
|
||||
LTEXT "Realized FPS :",IDC_STATIC_A,119,30,49,12
|
||||
LTEXT "",IDC_STANDALONE_FPS,172,29,34,11,SS_SUNKEN
|
||||
LTEXT "Mission Time :",IDC_STATIC_A2,13,91,49,12
|
||||
LTEXT "",IDC_STANDALONE_MTIME,71,90,125,11,SS_SUNKEN
|
||||
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT | SS_SUNKEN,7,43,199,
|
||||
1
|
||||
LTEXT "Mission Name :",IDC_STATIC,13,80,52,11
|
||||
LTEXT "",IDC_MISSION_NAME,71,78,125,11,SS_SUNKEN
|
||||
LTEXT "Mission Goals",IDC_STATIC,7,140,74,8
|
||||
LTEXT "Netgame Information",IDC_STATIC,133,140,66,8
|
||||
LTEXT "Max Players",IDC_STATIC,117,158,42,8
|
||||
LTEXT "Max Observers",IDC_STATIC,117,184,48,8
|
||||
LTEXT "Security",IDC_STATIC,117,210,26,8
|
||||
LTEXT "Respawns",IDC_STATIC,117,236,34,8
|
||||
LTEXT "",IDC_NG_MAXPLAYERS,178,158,28,8
|
||||
LTEXT "",IDC_NG_MAXOBSERVERS,178,184,28,8
|
||||
LTEXT "",IDC_NG_SECURITY,178,210,28,8
|
||||
LTEXT "",IDC_NG_RESPAWNS,178,236,28,8
|
||||
END
|
||||
|
||||
IDD_PLAYER_DIALOG DIALOG DISCARDABLE 0, 0, 215, 253
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Player Info"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_PLAYER_LIST,77,6,112,169,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Ship Type",IDC_STATIC,7,24,38,10
|
||||
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT | SS_NOTIFY |
|
||||
SS_SUNKEN,104,24,1,54
|
||||
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT | SS_NOTIFY |
|
||||
SS_SUNKEN,7,77,201,1
|
||||
LTEXT "",IDC_PSHIP_TYPE,53,24,49,10,SS_SUNKEN
|
||||
LTEXT "Mission Stats",IDC_STATIC,133,79,44,10
|
||||
LTEXT "Primary Shots",IDC_STATIC,7,89,45,9
|
||||
LTEXT "Primary Hits",IDC_STATIC,7,100,40,9
|
||||
LTEXT "Primary BH Hits",IDC_STATIC,7,112,50,9
|
||||
LTEXT "Primary Hit %",IDC_STATIC,7,123,43,9
|
||||
LTEXT "Primary BH Hit %",IDC_STATIC,7,134,55,9
|
||||
CONTROL "",IDC_STATIC,"Static",SS_WHITERECT | SS_NOTIFY |
|
||||
SS_SUNKEN,104,78,1,168
|
||||
LTEXT "All Time Stats",IDC_STATIC,33,79,44,10
|
||||
LTEXT "Primary Shots",IDC_STATIC,107,88,45,9
|
||||
LTEXT "Primary Hits",IDC_STATIC,107,99,40,9
|
||||
LTEXT "Primary BH Hits",IDC_STATIC,107,111,50,9
|
||||
LTEXT "Primary Hit %",IDC_STATIC,107,122,43,9
|
||||
LTEXT "Primary BH Hit %",IDC_STATIC,107,133,55,9
|
||||
LTEXT "Secondary Shots",IDC_STATIC,7,145,56,9
|
||||
LTEXT "Secondary Hits",IDC_STATIC,7,156,49,9
|
||||
LTEXT "Secondary BH Hits",IDC_STATIC,7,167,63,9
|
||||
LTEXT "Secondary Hit %",IDC_STATIC,7,177,55,9
|
||||
LTEXT "Secondary BH Hit %",IDC_STATIC,7,189,65,9
|
||||
LTEXT "Secondary Shots",IDC_STATIC,107,144,56,9
|
||||
LTEXT "Secondary Hits",IDC_STATIC,107,155,49,9
|
||||
LTEXT "Secondary BH Hits",IDC_STATIC,107,166,63,9
|
||||
LTEXT "Secondary Hit %",IDC_STATIC,107,176,55,9
|
||||
LTEXT "Secondary BH Hit %",IDC_STATIC,107,187,65,9
|
||||
LTEXT "",IDC_PSHOTS,75,90,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_PHITS,75,101,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_PBHHITS,75,112,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_PPCT,75,123,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_PBHPCT,75,134,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_SSHOTS,75,145,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_SECHITS,75,156,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_SBHHITS,75,166,28,9,SS_SUNKEN
|
||||
LTEXT "",IDC_SPCT,75,178,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_SBHPCT,75,190,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MPSHOTS,180,89,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MPHITS,180,100,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MPBHHITS,180,111,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MPPCT,180,122,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MPBHPCT,180,134,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MSSHOTS,180,145,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MSECHITS,180,156,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MSBHHITS,180,167,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MSPCT,180,178,28,8,SS_SUNKEN
|
||||
LTEXT "",IDC_MSBHPCT,180,189,28,8,SS_SUNKEN
|
||||
CONTROL "",IDC_PINFO_PING,"Static",SS_WHITERECT | SS_NOTIFY |
|
||||
SS_SUNKEN,7,215,201,1
|
||||
LTEXT "Player",IDC_STATIC,44,6,20,8
|
||||
LTEXT "",IDC_PING_TIME,53,38,49,10,SS_SUNKEN
|
||||
LTEXT "Avg Ping",IDC_STATIC,7,38,32,9
|
||||
LTEXT "Assists",IDC_STATIC,7,200,54,10
|
||||
LTEXT "Assists",IDC_STATIC,107,200,54,10
|
||||
LTEXT "",IDC_ASSISTS,75,201,28,9,SS_SUNKEN
|
||||
LTEXT "",IDC_MASSISTS,180,200,28,9,SS_SUNKEN
|
||||
END
|
||||
|
||||
IDD_GODSTUFF DIALOG DISCARDABLE 0, 0, 215, 253
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "God Stuff"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_PLAYER_GOD_LIST,39,7,101,211,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "",IDC_GODSTUFF_FPS,177,7,31,8,SS_SUNKEN
|
||||
LTEXT "FPS",IDC_STATIC,154,7,16,8
|
||||
LTEXT "Player ",IDC_STATIC,7,7,20,12
|
||||
EDITTEXT IDC_GODSTUFF_BROADCAST,7,47,201,12,ES_MULTILINE
|
||||
LTEXT "Server Message",IDC_STATIC,7,39,54,8
|
||||
PUSHBUTTON "Send",IDC_GODSTUFF_SENDMESS,7,59,70,13
|
||||
LISTBOX IDC_GOD_CHAT,7,84,201,162,LBS_NOINTEGRALHEIGHT |
|
||||
LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_DEBUG_DIALOG DIALOG DISCARDABLE 0, 0, 215, 253
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Debug"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Standalone State :",IDC_STATIC,7,7,61,11
|
||||
LTEXT "",IDC_STANDALONE_STATE,71,7,125,11,SS_SUNKEN
|
||||
END
|
||||
|
||||
IDD_GEN DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_VISIBLE |
|
||||
WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "",IDC_FIELD1,27,11,136,8
|
||||
CTEXT "",IDC_FIELD2,28,30,130,8
|
||||
CTEXT "",IDC_FIELD3,27,49,138,8
|
||||
END
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
"DEBUG_MENU", DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 178
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 152
|
||||
END
|
||||
|
||||
"FIND_DIALOG", DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 112
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 40
|
||||
END
|
||||
|
||||
IDD_CONNECT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 208
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 246
|
||||
END
|
||||
|
||||
IDD_MULTI, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 206
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 246
|
||||
END
|
||||
|
||||
IDD_PLAYER_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 208
|
||||
TOPMARGIN, 6
|
||||
BOTTOMMARGIN, 246
|
||||
END
|
||||
|
||||
IDD_GODSTUFF, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 208
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 246
|
||||
END
|
||||
|
||||
IDD_DEBUG_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 208
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 246
|
||||
END
|
||||
|
||||
IDD_GEN, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
|
||||
IDD_DIALOG1, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Volition Inc.\0"
|
||||
VALUE "FileDescription", "FreeSpace\0"
|
||||
VALUE "FileVersion", "1.03.01\0"
|
||||
VALUE "InternalName", "FreeSpace\0"
|
||||
VALUE "LegalCopyright", "Copyright © 1998\0"
|
||||
VALUE "OriginalFilename", "fs.exe\0"
|
||||
VALUE "ProductName", "FreeSpace\0"
|
||||
VALUE "ProductVersion", "1.03.01\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_GOAL_INC BITMAP DISCARDABLE "goal_inc.bmp"
|
||||
IDB_GOAL_COMP BITMAP DISCARDABLE "goal_com.bmp"
|
||||
IDB_GOAL_ORD BITMAP DISCARDABLE "goal_ord.bmp"
|
||||
IDB_GOAL_NONE BITMAP DISCARDABLE "goal_none.bmp"
|
||||
IDB_GOAL_FAIL BITMAP DISCARDABLE "goal_fail.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_APP_ICON ICON DISCARDABLE "app_icon.ico"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by FreeSpace.rc
|
||||
//
|
||||
#define IDD_DEBUG_MENU 101
|
||||
#define IDD_CONNECT 108
|
||||
#define IDD_MULTI 109
|
||||
#define IDC_CURSOR1 111
|
||||
#define IDC_CURSOR2 112
|
||||
#define IDD_PLAYER_DIALOG 114
|
||||
#define IDD_GODSTUFF 115
|
||||
#define IDD_DEBUG_DIALOG 116
|
||||
#define IDB_GOAL_INC 118
|
||||
#define IDB_GOAL_COMP 119
|
||||
#define IDB_GOAL_ORD 120
|
||||
#define IDB_GOAL_NONE 121
|
||||
#define IDB_GOAL_FAIL 122
|
||||
#define IDI_APP_ICON 124
|
||||
#define IDD_GEN 127
|
||||
#define IDD_RT_VSELECT 128
|
||||
#define IDD_DIALOG1 129
|
||||
#define IDC_LIST_DEBUG 1000
|
||||
#define IDC_DEBUG_TEXT1 1001
|
||||
#define IDC_DEBUG_TEXT2 1002
|
||||
#define IDC_TEXT 1003
|
||||
#define IDC_HOST_IS 1005
|
||||
#define IDC_CONPING 1007
|
||||
#define IDC_RESET_MULTI 1011
|
||||
#define IDC_STANDALONE_STATE 1012
|
||||
#define IDC_STATIC_A 1013
|
||||
#define IDC_STANDALONE_FPS 1014
|
||||
#define IDC_STATIC_A2 1015
|
||||
#define IDC_STANDALONE_MTIME 1016
|
||||
#define IDC_PLAYER_LIST 1016
|
||||
#define IDC_PSHIP_TYPE 1017
|
||||
#define IDC_NETPLAYER_NUM 1018
|
||||
#define IDC_PHITS 1019
|
||||
#define IDC_PBHHITS 1020
|
||||
#define IDC_PPCT 1021
|
||||
#define IDC_PBHPCT 1022
|
||||
#define IDC_SSHOTS 1023
|
||||
#define IDC_MPSHOTS 1024
|
||||
#define IDC_PLAYER_GOD_LIST 1026
|
||||
#define IDC_SECHITS 1028
|
||||
#define IDC_SBHHITS 1029
|
||||
#define IDC_SPCT 1030
|
||||
#define IDC_SBHPCT 1031
|
||||
#define IDC_MPHITS 1032
|
||||
#define IDC_MPBHHITS 1033
|
||||
#define IDC_MPPCT 1034
|
||||
#define IDC_MPBHPCT 1035
|
||||
#define IDC_MSSHOTS 1036
|
||||
#define IDC_MSECHITS 1037
|
||||
#define IDC_MSBHHITS 1038
|
||||
#define IDC_MSPCT 1039
|
||||
#define IDC_MSBHPCT 1040
|
||||
#define IDC_PSHOTS 1041
|
||||
#define IDC_PING_TIME 1042
|
||||
#define IDC_MISSION_NAME 1043
|
||||
#define IDC_GODSTUFF_BROADCAST 1044
|
||||
#define IDC_GODSTUFF_SENDMESS 1045
|
||||
#define IDC_STD_GOALS 1049
|
||||
#define IDC_PLAYER_MESSAGES 1051
|
||||
#define IDC_ASSISTS 1052
|
||||
#define IDC_MASSISTS 1053
|
||||
#define IDC_KICK_BUTTON 1054
|
||||
#define IDC_STD_NAME 1055
|
||||
#define IDC_NG_MAXPLAYERS 1057
|
||||
#define IDC_NG_MAXOBSERVERS 1058
|
||||
#define IDC_NG_SECURITY 1059
|
||||
#define IDC_NG_RESPAWNS 1060
|
||||
#define IDC_GOD_CHAT 1061
|
||||
#define IDC_STD_HOST_PASSWD 1062
|
||||
#define IDC_FIELD1 1064
|
||||
#define IDC_FIELD2 1065
|
||||
#define IDC_FIELD3 1066
|
||||
#define IDC_PXO_REFRESH 1067
|
||||
#define IDC_COMBO_VCARD 1069
|
||||
#define IDC_COMBO_VMODE 1070
|
||||
#define IDC_COMBO_AATYPE 1071
|
||||
#define ID_CANCEL 1072
|
||||
#define ID_OK 1073
|
||||
#define IDC_CON_COUNT 2000
|
||||
#define IDC_FRAMECAP_STATIC 2001
|
||||
#define IDC_GODSTUFF_FPS 2002
|
||||
#define IDC_PINFO_PING 2003
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1074
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 246 B |
Binary file not shown.
|
Before Width: | Height: | Size: 246 B |
Binary file not shown.
|
Before Width: | Height: | Size: 246 B |
Binary file not shown.
|
Before Width: | Height: | Size: 246 B |
Binary file not shown.
|
Before Width: | Height: | Size: 246 B |
Loaded 100 of 576 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user