Compare commits

..
189 changed files with 4562 additions and 45679 deletions

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
new_log_accum Error checking out/updating CVSROOT/new_log_accum
-17
View File
@@ -1,17 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-30
View File
@@ -1,30 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-104
View File
@@ -1,104 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to store the last visited directory for newlogaccum.pl.
#
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
use strict;
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# This routine writes a single line to a file
sub write_line ($$) {
my ($fname, $line) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE "$line\n";
close(FILE);
}
# Create and empty the temporary directory
my ($tmpdir) = (tmpdir(1));
# Store the directory name
write_line("$tmpdir/lastdir", shift(@ARGV));
-757
View File
@@ -1,757 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to accumulate log messages for an entire tree and send them along
# with the diffs; deals correctly with all manner of branching (I hope)
#
# $Id: new_log_accum,v 1.1 2002-08-11 23:05:15 drevil Exp $
#
use strict;
use vars qw($MAILER $CVS $debug $boundary);
use MD5;
# Set this to the full path of a mailer that takes a list
# of email addresses as arguments...
$MAILER = "/usr/sbin/sendmail -oi -oeq";
# Set this to the path of the CVS binary responsible for this tree...
$CVS = "/usr/bin/cvs";
# Don't touch this; use the -d command line option
$debug = 0;
# This is initialized by build_mailheader()
$boundary = '';
use POSIX qw(setsid);
# We have to dissociate from our parent, so that the CVS commit can
# complete, before we try to extract the diffs
sub daemonize {
defined(my $pid = fork()) || die "Can't fork: $!";
exit(0)
if $pid;
setsid() || die "Can't start a new session: $!";
}
# Debugging output
sub debug (@) {
print STDERR @_
if ($debug);
}
# Constants used in the FSM below for parsing the log message
sub STATE_NONE { 0 }
sub STATE_MODIFIED { 1 }
sub STATE_ADDED { 2 }
sub STATE_REMOVED { 3 }
sub STATE_LOG1 { 4 }
sub STATE_LOG2 { 5 }
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# Routine to remove the temporary directory when done
sub cleanup_dir ($) {
# If we're debugging, we may want to look at the contents...
return
if ($debug);
clear_dir($_[0]);
rmdir($_[0]);
}
# Retrieve a single line from a specified file
sub get_line ($) {
my ($fname) = @_;
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
my $line = <FILE>;
close(FILE);
# Chomp off the \n
chomp $line;
return $line;
}
# Routine that only allows one value to be pushed on the array;
# implemented by making the first element of the array a hash-reference.
# When we add a new value, we also increment the count of an element in
# the hash with the key being the array value...
sub push_once (\@@) {
my ($array, @values) = @_;
# If the array is empty, create our hash ref
push @{$array}, {}
if (@{$array} == 0);
foreach my $value (@values) {
push @{$array}, $value
if (!exists($array->[0]{$value}));
$array->[0]{$value}++;
}
return @{$array} - 1;
}
# Filter //, /./, and remove leading ./ or / from filenames
sub fname_filter ($) {
my ($fname) = @_;
$fname =~ s,//,/,g;
$fname =~ s,/\./,/,g;
$fname =~ s,^\.?/,,g;
return $fname;
}
# Store file data in a temporary file
sub names_to_file ($$@) {
my ($fname, $dir, @names) = @_;
if (@names > 0) {
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
# Store the directory data
print FILE "D $dir\n";
foreach my $name (@names) {
# Mark record as a file...
print FILE "F ";
# Store the tag, if there is one...
print FILE "$name->{tag}"
if (defined($name->{tag}));
# Then store old revision, new revision, and file name
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
}
close(FILE);
}
}
# Retrieve file data from temporary file; updates branch tags with what it
# reads
sub file_to_names (\@$) {
my ($btags, $fname) = @_;
my ($dir) = (undef);
my (@names) = ();
debug "Reading file names from $fname...\n";
# We may not have, say, added a file in this subdirectory...
return ()
if (!-e $fname);
open(FILE, "<$fname");
while(<FILE>) {
chomp;
# Get record type...
my ($type, $data) = split(' ', $_, 2);
# ok, it's a directory, remember that...
if ($type eq "D") {
$dir = $data;
debug "Read directory $dir\n";
next;
}
debug "Read file $data\n";
# Get all the information about the file
my ($tag, $old, $new, $file) = split(':', $data);
# and store it all
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
dir => $dir, name => fname_filter("$dir/$file") });
# Remember the tags...
push_once(@{$btags}, $tag)
if (defined($tag) && $tag ne "");
}
close(FILE);
return @names;
}
# Create a text-formatted list of names
sub name_to_list (\@@) {
my ($btags, @names) = @_;
my (@nlist, @nline) = ();
debug "Tags:", join(':', @{$btags}), "\n";
# We group them by tag
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
debug "Processing tag $tag...\n";
@nlist = ();
# Get a list of files by the tag...
foreach my $name (@names) {
debug "Processing $name->{file}...\n";
next
if ($name->{tag} ne $tag);
debug "Pushing $name->{name} on \@nlist...\n";
push(@nlist, $name->{name});
}
# If the tag is not the empty string, list the tag...
push(@nline, " Tag: $tag", " ")
if ($tag ne "");
# Now list each file name
foreach my $name (@nlist) {
# indent if we run past the end of line limit
push(@nline, " ")
if (@nline == 0 || ($nline[$#nline] ne " " &&
length($nline[$#nline]) + length($name) + 1 > 70));
# add the file name to the list
debug "Adding $name to \@nline...\n";
$nline[$#nline] .= " $name";
}
}
return @nline;
}
# write the log message to a temporary file
sub write_log ($@) {
my ($fname, @text) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE join("\n", @text), "\n";
close(FILE);
}
# Build the header of the commit message: CVSROOT, module name, any
# branch tags, and the commit time
sub build_header ($@) {
my ($module, $subject, $mailto, @branch_tags) = @_;
my (@text, @mailto);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
my ($user, $dummy);
my ($digest);
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
@mailto = @{$mailto};
# generate a unique boundary by calculating the md5sum of the
# current time
$digest = new MD5;
$digest->reset();
$digest->add(time() . rand());
$boundary = "----=MIME." . unpack("H*", $digest->digest());
# Build the mail header
push(@text, "From: $user");
push(@text, "To: " . join(' ', @mailto));
push(@text, "Subject: $subject");
push(@text, "MIME-Version: 1.0");
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
push(@text, "");
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
push(@text, "");
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; charset=us-ascii");
push(@text, "Content-Disposition: inline");
push(@text, "");
# Build the commit message header
push(@text, "Commiter : $user");
push(@text, "CVSROOT : $ENV{CVSROOT}");
push(@text, "Module : $module");
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
if (@branch_tags > 0);
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
return @text, "";
}
# Send the mail message
sub send_mail {
my ($mailto, $text) = @_;
my (@mailto, @text);
# I <heart> perl
@mailto = @{$mailto};
@text = @{$text};
open(MAIL, "|$MAILER " . join(' ', @mailto));
push(@text, "--$boundary--", "");
print MAIL join("\n", @text), "\n";
close(MAIL);
}
# Find the tmp directory
my ($tmpdir) = (tmpdir());
my (@mailto) = ();
my (@files) = ();
my (@path) = ();
my ($modname, $repdir, $dir) = (undef, undef, undef);
# Process command line arguments
while (@ARGV > 0) {
my ($arg) = (shift(@ARGV));
if ($arg eq '-d') {
# Turn on debugging
$debug++;
} elsif ($arg eq '-M') {
# Module name explicitly set -- XXX Not tested, use at your own risk
die "Argument for -M missing"
unless (@ARGV > 0);
$modname = shift(@ARGV);
} elsif ($arg eq '-m') {
# An address to mail the notification to
die "Argument for -m missing"
unless (@ARGV > 0);
push(@mailto, shift(@ARGV));
} else {
# the list of filenames passed by CVS--you *must* use %{sVv}!
die "Too many arguments!"
unless (@files == 0);
@files = split(" ", $arg);
}
}
die "Nobody to mail to"
unless (@mailto > 0);
die "No files to process"
unless (@files > 1);
# The repository directory
$repdir = shift(@files);
# break it appart...
@path = split("/", $repdir);
# Now we know the module name, if it wasn't explicitly set
$modname = $path[0]
unless (defined($modname));
# Figure out what our directory is
if (@path == 1) {
$dir = ".";
} else {
$dir = join("/", @path[1..$#path]);
}
# append a / to it...
$dir .= "/";
debug "module = $modname\n";
debug "dir = $dir\n";
debug "path = ", join(":", @path), "\n";
debug "files = ", join(":", @files), "\n";
debug "tmpdir = $tmpdir\n";
my (%fversions);
# Unless its a new directory or imported sources, create file records
unless (defined($files[1]) && defined($files[2]) &&
(($files[1] eq "New" && $files[2] eq "directory") ||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
foreach my $fname (@files) {
# You *must* use %{sVv} in the call in loginfo!
die "Invalid filenames"
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
$fversions{$1} = {
old => ($2 eq "NONE" ? "0" : $2),
new => ($3 eq "NONE" ? "0" : $3),
};
}
}
# process log message
my ($state, $tag) = (STATE_NONE, undef);
my (@modified, @added, @removed, @log, @branch_tags) = ();
while (<STDIN>) {
chomp;
debug "State $state, line:$_\n";
# Ignore empty space at the beginning of the log message
next
if ($state == STATE_LOG1 && /^\s*$/);
# We're done ignoring empty space
if ($state == STATE_LOG1) {
$state = STATE_LOG2;
}
if ($state == STATE_LOG2) {
# Don't modify the lines at all if we're processing the log message
push(@log, $_);
next;
} else {
# Strip out leading and trailing space
s/^\s*(.*?)\s*$/$1/;
}
if (/^Modified Files/) {
# Collect list of modified files
debug "State switching to STATE_MODIFIED\n";
$state = STATE_MODIFIED;
$tag = undef;
next;
} elsif (/^Added Files/) {
# Collect list of added files
debug "State switching to STATE_ADDED\n";
$state = STATE_ADDED;
$tag = undef;
next;
} elsif (/^Removed Files/) {
# Collect list of removed files
debug "State switching to STATE_REMOVED\n";
$state = STATE_REMOVED;
$tag = undef;
next;
} elsif (/^Log Message/) {
# Collect log message
debug "State switching to STATE_LOG1\n";
$state = STATE_LOG1;
$tag = undef;
next;
} elsif (/^Revision\/Branch/) {
# Parse old-style Revision/Branch field
debug "Found a branch tag\n";
/^[^:]+:\s*(.*)/;
push_once(@branch_tags, $1);
warn "Tag == $tag"
if (defined($tag));
next;
}
# Ignore the stuff at the top of the commit report
next
if ($state == STATE_NONE);
if (/^Tag:\s*(.*)$/) {
# Remember the tag
debug "Setting tag to $1\n";
$tag = $1;
next;
}
my (@tfiles) = ();
# Find the file in our command line list of files
foreach my $file (split) {
die "Nothing known about file $file!"
unless (exists($fversions{$file}));
push @tfiles, {
file => $file,
tag => $tag,
old => $fversions{$file}{old},
new => $fversions{$file}{new},
};
}
# Store the file list in the correct array
push(@modified, @tfiles)
if ($state == STATE_MODIFIED);
push(@added, @tfiles)
if ($state == STATE_ADDED);
push(@removed, @tfiles)
if ($state == STATE_REMOVED);
}
# Remove trailing blank lines from the log message
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
pop(@log);
}
# If a new directory was added, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "New" && $files[2] eq "directory") {
my (@text) = ();
# If there was a sticky tag for the directory, make it a branch tag
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
push_once(@branch_tags, $1);
pop(@log);
}
# Build the message...
push(@text, build_header($modname, "Module $modname: New directory $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
# If an import was done, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "Imported" && $files[2] eq "sources") {
my (@text) = ();
# Build the message...
push(@text, build_header($modname, "Module $modname: Imported $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
debug "Searching for log file index...";
my ($i);
# Look for an empty log file or one that matches our current log message
for ($i = 0; ; $i++) {
my (@text);
# found one that doesn't exist...
last
if (!-e "$tmpdir/logfile.$i");
# read in the log file
open(FILE, "<$tmpdir/logfile.$i");
while (<FILE>) {
chomp;
push(@text, $_);
}
close(FILE);
# If the log file was empty, use it
last
if (@text == 0);
# If the log messages are identical, use that
last
if (join(' ', @log) eq join(' ', @text));
}
debug "$tmpdir/logfile.$i\n";
# Store modified, added, and removed file lists, along with the log message
names_to_file("$tmpdir/modified.$i", $dir, @modified);
names_to_file("$tmpdir/added.$i", $dir, @added);
names_to_file("$tmpdir/removed.$i", $dir, @removed);
write_log("$tmpdir/logfile.$i", @log);
# Now check to see if we're at the end of our rope
my ($lastdir) = (get_line("$tmpdir/lastdir"));
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
# Nope, exit instead of sending a message
exit(0)
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
debug "At last, we've reached the end\n";
# We have to daemonize and sleep so that there isn't any lock hanging
# around when we get to the cvs rdiff below...
daemonize();
sleep(10);
# Build the mail message...
my (@text) = ();
@files = ();
@branch_tags = ();
for ($i = 0; ; $i++) {
# No more log files
last
if (!-e "$tmpdir/logfile.$i");
# read and insert the log message
open(FILE, "<$tmpdir/logfile.$i");
push(@text, "Log message:", "");
while (<FILE>) {
chomp;
push(@text, $_);
}
push(@text, "");
close(FILE);
# read modified list and list all modified files if non-empty
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
if (@modified > 0);
# read added list and list all added files if non-empty
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
if (@added > 0);
# read removed list and list all removed files if non-empty
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
if (@removed > 0);
# remember all the files we looked at
push(@files, @modified, @added, @removed);
}
# Now that name_to_list has rebuilt our list of branch tags, we can build the
# header and prepend it to the message
unshift(@text, build_header($modname, "Module $modname: Change committed",
\@mailto, @branch_tags));
# sort the files out for our diff
@files = sort { $a->{name} cmp $b->{name} } @files;
my ($user, $filename);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
$user = getpwuid($<);
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; name=\"$filename\"");
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
push(@text, "Content-Transfer-Encoding: 8bit");
push(@text, "");
foreach my $file (@files) {
debug "Diffing file $file->{name}...\n";
# Run cvs rdiff, extracting a diff between the old version and the new
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
"$modname/$file->{name}|");
while (<DIFF>) {
chomp;
push(@text, $_);
}
close(DIFF);
}
# send the mail...
send_mail(\@mailto, \@text);
# and clean up after ourselves
cleanup_dir($tmpdir);
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-9
View File
@@ -1,9 +0,0 @@
drevil:f76FWdDTUBG5c:fs2source
mysterial:f7nJUwoIhmSrg:fs2source
wmcoolmon:f7JRB.js9Q1sE:fs2source
inquisitor:f7BVkOvwjDlWk:fs2source
penguin:Jh.dOjaiO2jHk:fs2source
DTP:f7M92Z/6/uep.:fs2source
unknownplayer:f79BgAn.IzJs6:fs2source
phreak:f7WQyGiT/jzlM:fs2source
anonymous:oIKtWP1q6GDt6:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-4
View File
@@ -1,4 +0,0 @@
drevil
inquisitor
mysterial
penguin
-29
View File
@@ -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
-13
View File
@@ -1,13 +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.
Binary file not shown.
+2 -2
View File
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "_MBCS" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /U "_DEBUG" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-27
View File
@@ -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
-5
View File
@@ -1,5 +0,0 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = code
-506
View File
@@ -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:
-3
View File
@@ -1,3 +0,0 @@
This file is required to keep autoconf/automake from complaining.
See the ChangeLog for what's new.
-4
View File
@@ -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.
+700
View File
@@ -0,0 +1,700 @@
TARGET = fs2
ifeq ($(USE_SOUND), 1)
SOUND_DEF=
SOUND_OBJS= \
gamesnd/eventmusic.o \
gamesnd/gamesnd.o \
object/objectsnd.o \
sound/acm.o \
sound/audiostr.o \
sound/ds.o \
sound/ds3d.o \
sound/dscap.o \
sound/midifile.o \
sound/rbaudio.o \
sound/rtvoice.o \
sound/sound.o \
sound/winmidi.o \
sound/winmidi_base.o \
vcodec/codec1.o
else
SOUND_DEF=-DNO_SOUND
SOUND_OBJS=
endif # USE_SOUND
ifeq ($(USE_JOYSTICK), 1)
JOYSTICK_DEF=
JOYSTICK_OBJS= \
io/joy.o \
io/joy_ff.o \
io/swff_lib.o
else
JOYSTICK_DEF=-DNO_JOYSTICK
JOYSTICK_OBJS=
endif # USE_JOYSTICK
ifeq ($(USE_NETWORK), 1)
# no support for standalone server yet... (UI is Win32 specific)
NETWORK_DEF=-DNO_STANDALONE
NETWORK_OBJS= \
hud/hudobserver.o \
network/multi.o \
network/multimsgs.o \
network/multiteamselect.o \
network/multiui.o \
network/multiutil.o \
network/multi_campaign.o \
network/multi_data.o \
network/multi_dogfight.o \
network/multi_endgame.o \
network/multi_ingame.o \
network/multi_kick.o \
network/multi_log.o \
network/multi_obj.o \
network/multi_observer.o \
network/multi_options.o \
network/multi_pause.o \
network/multi_pinfo.o \
network/multi_ping.o \
network/multi_pmsg.o \
network/multi_rate.o \
network/multi_respawn.o \
network/multi_team.o \
network/multi_voice.o \
network/multi_xfer.o \
network/psnet.o \
network/psnet2.o \
menuui/optionsmenumulti.o \
missionui/chatbox.o
#
# Network/stand_gui.o
#
else
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
NETWORK_OBJS=
endif # USE_NETWORK
ifeq ($(USE_OPENGL), 0)
OPENGL_DEF=
else
OPENGL_DEF=-DUSE_OPENGL
endif # USE_OPENGL
LDFLAGS = -g
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
CXXFLAGS = \
-g \
-I/usr/local/include/SDL \
-I. \
-fno-exceptions \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
ANIM_OBJFILES = \
anim/animplay.o \
anim/packunpack.o
ASTEROID_OBJFILES = \
asteroid/asteroid.o
BMPMAN_OBJFILES = \
bmpman/bmpman.o
CFILE_OBJFILES = \
cfile/cfile.o \
cfile/cfilearchive.o \
cfile/cfilelist.o \
cfile/cfilesystem.o
CMDLINE_OBJFILES = \
cmdline/cmdline.o
CMEASURE_OBJFILES = \
cmeasure/cmeasure.o
CONTROLCONFIG_OBJFILES = \
controlconfig/controlsconfig.o \
controlconfig/controlsconfigcommon.o
CUTSCENE_OBJFILES = \
cutscene/cutscenes.o
DEBRIS_OBJFILES = \
debris/debris.o
DEBUGCONSOLE_OBJFILES = \
debugconsole/console.o
DEMO_OBJFILES = \
demo/demo.o
EXCEPTIONHANDLER_OBJFILES = \
exceptionhandler/exceptionhandler.o
FIREBALL_OBJFILES = \
fireball/fireballs.o \
fireball/warpineffect.o
GAMEHELP_OBJFILES = \
gamehelp/contexthelp.o \
gamehelp/gameplayhelp.o
GAMESEQUENCE_OBJFILES = \
gamesequence/gamesequence.o
# gamesnd/eventmusic.o
# gamesnd/gamesnd.o
GAMESND_OBJFILES =
# glide/glide.o
GLIDE_OBJFILES =
# globalincs/windebug.o
GLOBALINCS_OBJFILES = \
globalincs/alphacolors.o \
globalincs/crypt.o \
globalincs/systemvars.o \
globalincs/version.o
# graphics/grd3d.o
# graphics/grd3drender.o
# graphics/grd3dtexture.o
# graphics/grdirectdraw.o
# graphics/grglide.o
# graphics/grglidetexture.o
# graphics/grsoft.o
# graphics/scaler.o
# graphics/tmapgenericscans.o
# graphics/tmapscantiled128x128.o
# graphics/tmapscantiled16x16.o
# graphics/tmapscantiled256x256.o
# graphics/tmapscantiled32x32.o
# graphics/tmapscantiled64x64.o
# graphics/tmapscanline.o
# graphics/tmapper.o
GRAPHICS_OBJFILES = \
graphics/2d.o \
graphics/aaline.o \
graphics/bitblt.o \
graphics/circle.o \
graphics/colors.o \
graphics/font.o \
graphics/gradient.o \
graphics/gropengl.o \
graphics/grzbuffer.o \
graphics/line.o \
graphics/pixel.o \
graphics/rect.o \
graphics/shade.o
# hud/hudobserver.o
HUD_OBJFILES = \
hud/hud.o \
hud/hudartillery.o \
hud/hudbrackets.o \
hud/hudconfig.o \
hud/hudescort.o \
hud/hudets.o \
hud/hudlock.o \
hud/hudmessage.o \
hud/hudreticle.o \
hud/hudshield.o \
hud/hudsquadmsg.o \
hud/hudtarget.o \
hud/hudtargetbox.o \
hud/hudwingmanstatus.o
INETFILE_OBJFILES = \
inetfile/cftp.o \
inetfile/chttpget.o \
inetfile/inetgetfile.o
# io/joy.o
# io/joy_ff.o
# io/swff_lib.o
IO_OBJFILES = \
io/key.o \
io/keycontrol.o \
io/mouse.o \
io/timer.o \
io/xmouse.o
JUMPNODE_OBJFILES = \
jumpnode/jumpnode.o
LIGHTING_OBJFILES = \
lighting/lighting.o
LOCALIZATION_OBJFILES = \
localization/fhash.o \
localization/localize.o
MATH_OBJFILES = \
math/fix.o \
math/floating.o \
math/fvi.o \
math/spline.o \
math/staticrand.o \
math/vecmat.o
# menuui/optionsmenumulti.o
MENUUI_OBJFILES = \
menuui/barracks.o \
menuui/credits.o \
menuui/fishtank.o \
menuui/mainhallmenu.o \
menuui/mainhalltemp.o \
menuui/optionsmenu.o \
menuui/playermenu.o \
menuui/readyroom.o \
menuui/snazzyui.o \
menuui/techmenu.o \
menuui/trainingmenu.o
MISSION_OBJFILES = \
mission/missionbriefcommon.o \
mission/missioncampaign.o \
mission/missiongoals.o \
mission/missiongrid.o \
mission/missionhotkey.o \
mission/missionload.o \
mission/missionlog.o \
mission/missionmessage.o \
mission/missionparse.o \
mission/missiontraining.o
# missionui/chatbox.o
MISSIONUI_OBJFILES = \
missionui/missionbrief.o \
missionui/missioncmdbrief.o \
missionui/missiondebrief.o \
missionui/missionloopbrief.o \
missionui/missionpause.o \
missionui/missionrecommend.o \
missionui/missionscreencommon.o \
missionui/missionshipchoice.o \
missionui/missionstats.o \
missionui/missionweaponchoice.o \
missionui/redalert.o
MODEL_OBJFILES = \
model/modelcollide.o \
model/modelinterp.o \
model/modeloctant.o \
model/modelread.o
NEBULA_OBJFILES = \
nebula/neb.o \
nebula/neblightning.o
# network/multi.o
# network/multi_campaign.o
# network/multi_data.o
# network/multi_dogfight.o
# network/multi_endgame.o
# network/multi_ingame.o
# network/multi_kick.o
# network/multi_log.o
# network/multimsgs.o
# network/multi_obj.o
# network/multi_observer.o
# network/multi_oo.o
# network/multi_options.o
# network/multi_pause.o
# network/multi_pinfo.o
# network/multi_ping.o
# network/multi_pmsg.o
# network/multi_rate.o
# network/multi_respawn.o
# network/multi_team.o
# network/multi_update.o
# network/multi_voice.o
# network/multi_xfer.o
# network/multilag.o
# network/multiteamselect.o
# network/multiui.o
# network/psnet.o
# network/psnet2.o
# network/stand_gui.o
NETWORK_OBJFILES = \
network/multiutil.o
# object/objectsnd.o
OBJECT_OBJFILES = \
object/collidedebrisship.o \
object/collidedebrisweapon.o \
object/collideshipship.o \
object/collideshipweapon.o \
object/collideweaponweapon.o \
object/objcollide.o \
object/object.o \
object/objectsort.o
OBSERVER_OBJFILES = \
observer/observer.o
OSAPI_OBJFILES = \
osapi/osapi_unix.o \
osapi/osregistry_unix.o \
osapi/outwnd_unix.o
PALMAN_OBJFILES = \
palman/palman.o
PARSE_OBJFILES = \
parse/encrypt.o \
parse/parselo.o \
parse/sexp.o
PARTICLE_OBJFILES = \
particle/particle.o
PCXUTILS_OBJFILES = \
pcxutils/pcxutils.o
PHYSICS_OBJFILES = \
physics/physics.o
PLAYERMAN_OBJFILES = \
playerman/managepilot.o \
playerman/playercontrol.o
POPUP_OBJFILES = \
popup/popup.o \
popup/popupdead.o
RADAR_OBJFILES = \
radar/radar.o
RENDER_OBJFILES = \
render/3dclipper.o \
render/3ddraw.o \
render/3dlaser.o \
render/3dmath.o \
render/3dsetup.o
SHIP_OBJFILES = \
ship/afterburner.o \
ship/ai.o \
ship/aibig.o \
ship/aicode.o \
ship/aigoals.o \
ship/awacs.o \
ship/shield.o \
ship/ship.o \
ship/shipcontrails.o \
ship/shipfx.o \
ship/shiphit.o
SOUND_OBJFILES = \
sound/acm.o \
sound/audiostr.o \
sound/ds.o \
sound/ds3d.o \
sound/dscap.o \
sound/midifile.o \
sound/rbaudio.o \
sound/rtvoice.o \
sound/sound.o \
sound/winmidi.o \
sound/winmidi_base.o
STARFIELD_OBJFILES = \
starfield/nebula.o \
starfield/starfield.o \
starfield/supernova.o
STATS_OBJFILES = \
stats/medals.o \
stats/scoring.o \
stats/stats.o
TGAUTILS_OBJFILES = \
tgautils/tgautils.o
UI_OBJFILES = \
ui/button.o \
ui/checkbox.o \
ui/gadget.o \
ui/icon.o \
ui/inputbox.o \
ui/keytrap.o \
ui/listbox.o \
ui/radio.o \
ui/scroll.o \
ui/slider.o \
ui/slider2.o \
ui/uidraw.o \
ui/uimouse.o \
ui/window.o
VCODEC_OBJFILES = \
vcodec/codec1.o
WEAPON_OBJFILES = \
weapon/beam.o \
weapon/corkscrew.o \
weapon/emp.o \
weapon/flak.o \
weapon/muzzleflash.o \
weapon/shockwave.o \
weapon/swarm.o \
weapon/trails.o \
weapon/weapons.o
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
OBJFILES = \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CFILE_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
NETWORK_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
LIB_OBJFILES = \
$(ANIM_OBJFILES) \
$(ASTEROID_OBJFILES) \
$(BMPMAN_OBJFILES) \
$(CFILE_OBJFILES) \
$(CMDLINE_OBJFILES) \
$(CMEASURE_OBJFILES) \
$(CONTROLCONFIG_OBJFILES) \
$(CUTSCENE_OBJFILES) \
$(DEBRIS_OBJFILES) \
$(DEBUGCONSOLE_OBJFILES) \
$(FIREBALL_OBJFILES) \
$(GAMEHELP_OBJFILES) \
$(GAMESEQUENCE_OBJFILES) \
$(GAMESND_OBJFILES) \
$(GLIDE_OBJFILES) \
$(GLOBALINCS_OBJFILES) \
$(GRAPHICS_OBJFILES) \
$(HUD_OBJFILES) \
$(IO_OBJFILES) \
$(JUMPNODE_OBJFILES) \
$(LIGHTING_OBJFILES) \
$(MATH_OBJFILES) \
$(MENUUI_OBJFILES) \
$(MISSION_OBJFILES) \
$(MISSIONUI_OBJFILES) \
$(MODEL_OBJFILES) \
$(NETWORK_OBJFILES) \
$(OBJECT_OBJFILES) \
$(OBSERVER_OBJFILES) \
$(OSAPI_OBJFILES) \
$(PALMAN_OBJFILES) \
$(PARSE_OBJFILES) \
$(PARTICLE_OBJFILES) \
$(PCXUTILS_OBJFILES) \
$(PHYSICS_OBJFILES) \
$(PLAYERMAN_OBJFILES) \
$(POPUP_OBJFILES) \
$(RADAR_OBJFILES) \
$(RENDER_OBJFILES) \
$(SHIP_OBJFILES) \
$(STARFIELD_OBJFILES) \
$(STATS_OBJFILES) \
$(UI_OBJFILES) \
$(VCODEC_OBJFILES) \
$(WEAPON_OBJFILES) \
$(NEBULA_OBJFILES) \
$(LOCALIZATION_OBJFILES) \
$(TGAUTILS_OBJFILES) \
$(DEMO_OBJFILES) \
$(SOUND_OBJS) \
$(JOYSTICK_OBJS) \
$(NETWORK_OBJS)
FREESPACE2_OBJFILES = \
freespace2/freespace.o \
freespace2/levelpaging.o
STUB_OBJFILES = \
windows_stub/stubs.o
# ==============================
.PHONY: all clean code \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
SOUND_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES \
INETFILE_OBJFILES \
EXCEPTIONHANDLER_OBJFILES \
NETWORK_OBJFILES
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: $(TARGET)
clean:
rm -f $(TARGET) libcode.a core *.o *~
find -name *.o -exec rm {} \;
find -name *~ -exec rm {} \;
code: libcode.a
# ==============================
libcode.a: $(LIB_OBJFILES)
$(AR) -r $@ $(LIB_OBJFILES)
# $(CXX) -o $@ $(LIB_OBJFILES)
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
# exceptions to the rule...
freespace2/freespace.o: freespace2/freespace.cpp
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
ANIM_OBJFILES: $(ANIM_OBJFILES)
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
HUD_OBJFILES: $(HUD_OBJFILES)
IO_OBJFILES: $(IO_OBJFILES)
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
MATH_OBJFILES: $(MATH_OBJFILES)
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
MISSION_OBJFILES: $(MISSION_OBJFILES)
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
MODEL_OBJFILES: $(MODEL_OBJFILES)
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
PARSE_OBJFILES: $(PARSE_OBJFILES)
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
POPUP_OBJFILES: $(POPUP_OBJFILES)
RADAR_OBJFILES: $(RADAR_OBJFILES)
RENDER_OBJFILES: $(RENDER_OBJFILES)
SHIP_OBJFILES: $(SHIP_OBJFILES)
SOUND_OBJFILES: $(SOUND_OBJFILES)
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
STATS_OBJFILES: $(STATS_OBJFILES)
UI_OBJFILES: $(UI_OBJFILES)
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
DEMO_OBJFILES: $(DEMO_OBJFILES)
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
NETWORK_OBJFILES: $(NETWORK_OBJFILES)
-305
View File
@@ -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
+28 -286
View File
@@ -9,42 +9,13 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
* $Revision: 2.11 $
* $Date: 2003-01-19 01:07:41 $
* $Author: bobboau $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code to load and manage all bitmaps for the game
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2003/01/18 19:55:16 phreak
* fixed around the bmpman system to now accept compressed textures
*
* Revision 2.9 2003/01/09 22:23:38 inquisitor
* Rollback to 2.7 to fix glow code issue that phreak noticed.
* -Quiz
*
* Revision 2.7 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.6 2002/12/02 23:26:08 Goober5000
* fixed misspelling
*
* Revision 2.5 2002/12/02 20:46:41 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.4 2002/11/22 20:55:27 phreak
* changed around some page-in functions to work with opengl
* changed bm_set_components_opengl
* -phreak
*
* Revision 2.3 2002/11/18 21:27:13 phreak
* added bm_select_components functions for OpenGL -phreak
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
@@ -279,7 +250,7 @@
* Added code to print the number of bitmap slots in use between levels.
*
* 82 2/16/98 3:54p John
* Changed a bunch of mprintfs to categorize to BmpInfo
* Changed a bunch of mprintfs to catagorize to BmpInfo
*
* 81 2/13/98 5:00p John
* Made user bitmaps not get wrote to level cache file.
@@ -520,17 +491,11 @@
#include "graphics/grinternal.h"
#include "tgautils/tgautils.h"
#include "ship/ship.h"
#include "ddsutils/ddsutils.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#endif
extern int Texture_compression_enabled;
int GLOWMAP = -1;
// keep this defined to use per-ship nondarkening pixels
#define BMPMAN_SPECIAL_NONDARK
@@ -541,9 +506,6 @@ int bm_inited = 0;
#define BM_TYPE_USER 2
#define BM_TYPE_ANI 3 // in-house ANI format
#define BM_TYPE_TGA 4 // 16 bit targa
#define BM_TYPE_DXT1 5 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 6 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 7 // 32 bit with 8 bit alpha (compressed)
typedef union bm_extra_info {
struct {
@@ -582,7 +544,6 @@ typedef struct bitmap_entry {
// Data for animations and user bitmaps
bm_extra_info info;
int mem_taken; //how much memory it takes up
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
@@ -790,6 +751,8 @@ void bm_init()
#endif
bm_free_data(i); // clears flags, bbp, data, etc
}
}
#ifdef BMPMAN_NDEBUG
@@ -936,15 +899,16 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
}
// try and find the file
/*
CFILE *test = cfopen(filename, "rb");
if(test != NULL){
cfclose(test);
return 0;
}
*/
// could not be found
return -1;
return 0;
}
// This loads a bitmap so we can draw with it later.
@@ -958,10 +922,8 @@ int bm_load( char * real_filename )
int w, h, bpp;
char filename[MAX_FILENAME_LEN];
int tga = 0;
int dds = 0;
int handle;
int found = 0;
unsigned char type;
if ( !bm_inited ) bm_init();
@@ -978,51 +940,23 @@ int bm_load( char * real_filename )
//Int3();
*p = 0;
}
// try and find a compressed tex first
// unless we're cant do so
if (Texture_compression_enabled)
{
switch(bm_load_sub(filename, ".dds", &handle)){
// error
case -1:
break;
// found as a file
case 0:
found = 1;
dds=1;
strcat(filename, ".dds");
break;
// found as pre-existing
case 1:
found = 1;
return handle;
}
}
if (!found)
{
// try and find the pcx file
switch(bm_load_sub(filename, ".pcx", &handle)){
// error
case -1:
break;
// try and find the pcx file
switch(bm_load_sub(filename, ".pcx", &handle)){
// error
case -1:
break;
// found as a file
case 0:
found = 1;
strcat(filename, ".pcx");
break;
// found as a file
case 0:
found = 1;
strcat(filename, ".pcx");
break;
// found as pre-existing
// found as pre-existing
case 1:
found = 1;
return handle;
}
}
if(!found){
@@ -1045,45 +979,13 @@ int bm_load( char * real_filename )
}
}
if (dds)
{
int ct;
int dds_error=dds_read_header ( filename, &w, &h, &bpp, &ct);
if (dds_error != DDS_ERROR_NONE)
{
mprintf(("Couldn't open '%s -- error description %s\n", filename, dds_error_string(dds_error)));
return -1;
}
mprintf(("Found a .dds file! %s\n", filename));
switch (ct)
{
case DDS_DXT1:
type=BM_TYPE_DXT1;
break;
case DDS_DXT3:
type=BM_TYPE_DXT3;
break;
case DDS_DXT5:
type=BM_TYPE_DXT5;
break;
default:
Error(LOCATION, "bad DDS file compression. Not using DXT1,3,5 %s", filename);
return -1;
}
}
// if its a tga file
else if(tga){
if(tga){
int tga_error=targa_read_header( filename, &w, &h, &bpp, NULL );
if ( tga_error != TARGA_ERROR_NONE ) {
mprintf(( "Couldn't open '%s'\n", filename ));
return -1;
}
type = BM_TYPE_TGA;
}
// if its a pcx file
else {
@@ -1092,7 +994,6 @@ int bm_load( char * real_filename )
mprintf(( "Couldn't open '%s'\n", filename ));
return -1;
}
type=BM_TYPE_PCX;
}
// Error( LOCATION, "Unknown bitmap type %s\n", filename );
@@ -1118,7 +1019,7 @@ int bm_load( char * real_filename )
// Mark the slot as filled, because cf_read might load a new bitmap
// into this slot.
bm_bitmaps[n].type = type;
bm_bitmaps[n].type = tga ? (ubyte)BM_TYPE_TGA : (ubyte)BM_TYPE_PCX;
bm_bitmaps[n].signature = Bm_next_signature++;
Assert ( strlen(filename) < MAX_FILENAME_LEN );
strncpy(bm_bitmaps[n].filename, filename, MAX_FILENAME_LEN-1 );
@@ -1769,35 +1670,6 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
bm_convert_format( bitmapnum, bmp, bpp, flags );
}
//lock a dds file
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
{
uint data;
int size;
int error;
Assert(Texture_compression_enabled);
Assert(&be->bm == bmp);
#ifdef BMPMAN_NDEBUG
Assert( be->data_size > 0 );
#endif
//data is malloc'ed in the function
error=dds_read_bitmap( be->filename, &size, &data );
if (error != DDS_ERROR_NONE)
{
Error(LOCATION, "error loading %s -- %s", be->filename, dds_error_string(error));
}
bmp->bpp=bpp;
bmp->data=data;
bmp->flags =0;
be->mem_taken=size;
}
MONITOR( NumBitmapPage );
MONITOR( SizeBitmapPage );
@@ -1831,19 +1703,9 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
} else {
if(flags & BMP_AABITMAP){
Assert( bpp == 8 );
} else if ((flags & BMP_TEX_NONCOMP) && (!(flags & BMP_TEX_COMP))) {
} else {
Assert( bpp == 16 );
}
else if (flags & BMP_TEX_DXT1){
Assert(bpp==24);
}
else if (flags & (BMP_TEX_DXT3 | BMP_TEX_DXT5)){
Assert(bpp==32);
}
else
{
Assert(0); //?
}
}
}
@@ -1926,12 +1788,6 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
bm_lock_tga( handle, bitmapnum, be, bmp, bpp, flags );
break;
case BM_TYPE_DXT1:
case BM_TYPE_DXT3:
case BM_TYPE_DXT5:
bm_lock_dds( handle, bitmapnum, be, bmp, bpp, flags );
break;
default:
Warning(LOCATION, "Unsupported type in bm_lock -- %d\n", be->type );
return NULL;
@@ -2194,8 +2050,6 @@ DCF(bmpman,"Shows/changes bitmap caching parameters and usage")
}
}
extern int OGL_inited;
// Marks a texture as being used for this level
void bm_page_in_texture( int bitmapnum, int nframes )
{
@@ -2205,27 +2059,7 @@ void bm_page_in_texture( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 1;
//check if its compressed
if (OGL_inited)
{
switch (bm_bitmaps[n+i].type)
{
case BM_TYPE_DXT1:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
continue;
case BM_TYPE_DXT3:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
continue;
case BM_TYPE_DXT5:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
continue;
}
}
if ( D3D_enabled || OGL_inited ) {
if ( D3D_enabled ) {
bm_bitmaps[n+i].used_flags = BMP_TEX_OTHER;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2243,7 +2077,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 4;
if ( D3D_enabled || OGL_inited ) {
if ( D3D_enabled ) {
bm_bitmaps[n+i].used_flags = BMP_TEX_NONDARK;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2262,26 +2096,7 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
bm_bitmaps[n+i].preloaded = 3;
//check if its compressed
if (OGL_inited)
{
switch (bm_bitmaps[n+i].type)
{
case BM_TYPE_DXT1:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
continue;
case BM_TYPE_DXT3:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
continue;
case BM_TYPE_DXT5:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
continue;
}
}
if ( D3D_enabled || OGL_inited ) {
if ( D3D_enabled ) {
// bm_bitmaps[n+i].used_flags = BMP_NO_PALETTE_MAP;
bm_bitmaps[n+i].used_flags = BMP_TEX_XPARENT;
} else {
@@ -2300,7 +2115,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 2;
if ( D3D_enabled || OGL_inited ) {
if ( D3D_enabled ) {
bm_bitmaps[n+i].used_flags = BMP_AABITMAP;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2423,10 +2238,7 @@ int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
{
int n = bitmap_id % MAX_BITMAPS;
if( bm_bitmaps[n].handle != bitmap_id ){//this should rightfully squash the invalid bitmap handel bug for the glow mapping
mprintf(("bitmap handel %d is not equil to bitmap id %d",bm_bitmaps[n].handle,bitmap_id));
return -1; // INVALID BITMAP HANDLE
}
Assert( bm_bitmaps[n].handle == bitmap_id ); // INVALID BITMAP HANDLE
bitmap_entry *be = &bm_bitmaps[n];
@@ -2522,22 +2334,6 @@ void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte
}
}
void bm_set_components_opengl(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
{
// rgba
*((ushort*)pixel) |= (ushort)(( (int)*rv / Gr_current_red->scale ) << Gr_current_red->shift);
*((ushort*)pixel) |= (ushort)(( (int)*gv / Gr_current_green->scale ) << Gr_current_green->shift);
*((ushort*)pixel) |= (ushort)(( (int)*bv / Gr_current_blue->scale ) << Gr_current_blue->shift);
*((ushort*)pixel) &= ~(0x8000);
if (*((ushort*)pixel) == (ushort)Gr_current_green->mask) {
*((ushort*)pixel) = 0;
} else {
if(*av){
*((ushort*)pixel) |= 0x8000;
}
}
}
// for selecting pixel formats
void BM_SELECT_SCREEN_FORMAT()
{
@@ -2565,13 +2361,6 @@ void BM_SELECT_SCREEN_FORMAT()
#endif // ifndef NO_DIRECT3D
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_screen;
#endif // ifdef WIN32
@@ -2603,12 +2392,6 @@ void BM_SELECT_TEX_FORMAT()
#endif
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
@@ -2640,12 +2423,6 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
#endif
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
@@ -2834,38 +2611,3 @@ void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
*w = sx < (sections->num_x - 1) ? MAX_BMAP_SECTION_SIZE : bw - sections->sx[sx];
*h = sy < (sections->num_y - 1) ? MAX_BMAP_SECTION_SIZE : bh - sections->sy[sy];
}
int bm_is_compressed(int num)
{
int n=num % MAX_BITMAPS;
//duh
if (!Texture_compression_enabled)
return 0;
Assert(num==bm_bitmaps[n].handle);
switch (bm_bitmaps[n].type)
{
case BM_TYPE_DXT1:
return 1;
case BM_TYPE_DXT3:
return 2;
case BM_TYPE_DXT5:
return 3;
}
return 0;
}
//needed only for compressed bitmaps
int bm_get_size(int num)
{
int n=num % MAX_BITMAPS;
if (!bm_is_compressed(num))
return 0;
Assert(num==bm_bitmaps[n].handle);
return bm_bitmaps[n].mem_taken;
}
+3 -19
View File
@@ -9,24 +9,13 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
* $Revision: 2.3 $
* $Date: 2003-01-19 01:07:41 $
* $Author: bobboau $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2003/01/18 19:55:16 phreak
* fixed around the bmpman system to now accept compressed textures
*
* Revision 2.1 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -362,9 +351,4 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// given a bitmap and a section, return the size (w, h)
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
int bm_is_compressed(int num);
int bm_get_size(int num);
#endif
+3 -37
View File
@@ -9,30 +9,11 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 2.17 $
* $Date: 2003-02-22 04:13:17 $
* $Author: wmcoolmon $
* $Revision: 2.11 $
* $Date: 2002-11-10 16:32:42 $
* $Author: DTP $
*
* $Log: not supported by cvs2svn $
* Revision 2.16 2002/12/21 13:39:25 DTP
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
*
* Revision 2.15 2002/12/17 03:08:18 DTP
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
*
* Revision 2.14 2002/12/17 02:22:34 DTP
* wrong name :)
*
* Revision 2.13 2002/12/17 02:21:06 DTP
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
*
* Revision 2.12 2002/12/14 17:09:08 phreak
* added a command line that displays frames per second when enabled.
* use "-fps"
*
* Revision 2.11 2002/11/10 16:32:42 DTP
* -DTP reworked mod support,
*
* Revision 2.10 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
@@ -297,9 +278,7 @@ cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
cmdline_parm gf4fix_arg("-GF4FIX", NULL); //DTP for random tigers GF4fix
cmdline_parm allslev_arg("-ALLSLEV", NULL); //Give access to all single player missions
cmdline_parm phreak_arg("-phreak", NULL); // Change to phreaks options including new targetting code
cmdline_parm dshowvid_arg("-dshowvid", NULL); // Allows video streaming
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
cmdline_parm fps_arg("-fps", NULL);
int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_freespace_no_sound = 0;
@@ -331,8 +310,6 @@ int Cmdline_window = 0;
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
int Cmdline_allslev = 0;
int Cmdline_phreak = 0;
int Cmdline_dshowvid = 0;
int Cmdline_show_fps = 0;
@@ -711,20 +688,9 @@ int parse_cmdline(int argc, char *argv[])
Cmdline_phreak = 1;
}
if(dshowvid_arg.found() ) {
Cmdline_dshowvid = 1;
}
if(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
}
if (fps_arg.found())
{
Cmdline_show_fps = 1;
}
return 1;
}
+3 -22
View File
@@ -10,26 +10,11 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.17 $
* $Date: 2003-02-22 04:13:17 $
* $Author: wmcoolmon $
* $Revision: 2.12 $
* $Date: 2002-11-10 16:30:53 $
* $Author: DTP $
*
* $Log: not supported by cvs2svn $
* Revision 2.16 2002/12/21 13:39:25 DTP
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
*
* Revision 2.15 2002/12/17 03:08:18 DTP
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
*
* Revision 2.14 2002/12/17 02:22:34 DTP
* wrong name :)
*
* Revision 2.13 2002/12/17 02:21:06 DTP
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
*
* Revision 2.12 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
* Revision 2.11 2002/10/31 21:14:16 DTP
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
*
@@ -240,10 +225,6 @@ extern char *Cmdline_almission; //DTP for autoload mission
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
extern int Cmdline_allslev;
extern int Cmdline_phreak;
extern int Cmdline_dshowvid; //WMC Toggles movie playing support
extern char *Cmdline_mod; //DTP for mod support
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
#endif
+7 -51
View File
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "..\Release\Profile"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "_WINDOWS" /D "WIN32" /D "NDEBUG" /U "_DEBUG" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "..\Debug\Profile"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_OPENGL" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -207,14 +207,6 @@ SOURCE=.\Cutscene\Cutscenes.cpp
SOURCE=.\Cutscene\Cutscenes.h
# End Source File
# Begin Source File
SOURCE=.\cutscene\movie.cpp
# End Source File
# Begin Source File
SOURCE=.\cutscene\movie.h
# End Source File
# End Group
# Begin Group "Debris"
@@ -257,14 +249,6 @@ SOURCE=.\debugconsole\timerbar.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\directx\dx8show.cpp
# End Source File
# Begin Source File
SOURCE=.\directx\dx8show.h
# End Source File
# Begin Source File
SOURCE=.\DirectX\vasync.h
# End Source File
# Begin Source File
@@ -333,6 +317,10 @@ SOURCE=.\DirectX\vdvp.h
# End Source File
# Begin Source File
SOURCE=.\DirectX\vDdraw.lib
# End Source File
# Begin Source File
SOURCE=.\DirectX\vDinput.lib
# End Source File
# Begin Source File
@@ -341,15 +329,7 @@ SOURCE=.\DirectX\vDsound.lib
# End Source File
# Begin Source File
SOURCE=.\directx\ddraw.lib
# End Source File
# Begin Source File
SOURCE=.\directx\dxguid.lib
# End Source File
# Begin Source File
SOURCE=.\directx\strmiids.lib
SOURCE=.\DirectX\vDxguid.lib
# End Source File
# End Group
# Begin Group "Fireball"
@@ -2511,29 +2491,5 @@ SOURCE=.\Network\stand_gui.cpp
SOURCE=.\Network\stand_gui.h
# End Source File
# End Group
# Begin Group "Decals"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\decals\decals.cpp
# End Source File
# Begin Source File
SOURCE=.\decals\decals.h
# End Source File
# End Group
# Begin Group "ddsutils"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\ddsutils\ddsutils.cpp
# End Source File
# Begin Source File
SOURCE=.\ddsutils\ddsutils.h
# End Source File
# End Group
# End Target
# End Project
+4 -10
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.4 $
* $Date: 2002-12-02 23:52:02 $
* $Author: Goober5000 $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/02 20:47:28 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.2 2002/10/19 19:29:27 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.1 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
@@ -305,7 +299,7 @@
typedef struct config_item {
short key_default; // default key bound to action
short joy_default; // default joystick button bound to action
char tab; // what tab (category) it belongs in
char tab; // what tab (catagory) 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
-175
View File
@@ -1,175 +0,0 @@
#include <windows.h>
#include "movie.h"
#include "directx/dx8show.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "graphics/2d.h"
#include "debugconsole/dbugfile.h"
#include "graphics/gropengl.h"
bool movie_shutdown_fgx = false;
void movie_set_shutdown_fgx(bool state)
{
movie_shutdown_fgx = state;
}
bool movie_play(char *name, int unknown_value)
{
// This should not be uncommented
if(!Cmdline_dshowvid)
{
return true;
}
/*
** Check file exists
*/
FILE *fp = fopen(name,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name);
if(fp == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
return true;
}
fclose(fp);
if(movie_shutdown_fgx == true)
{
gr_activate(0);
}
#ifdef _WIN32
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_cleanup(0);
}
os_app_activate_set(false);
dx8show_set_hwnd((void *) os_get_window());
// ShowWindow((HWND) os_get_window(),SW_HIDE);
// ShowWindow((HWND) os_get_window(),SW_MINIMIZE);
dx8show_play_cutscene(name);
// ShowWindow((HWND) os_get_window(),SW_RESTORE);
// ShowWindow((HWND) os_get_window(),SW_SHOW);
os_app_activate_set(true);
/*
// Comment this back in if the freespace window isnt coming back after the movie ends
if((HWND) os_get_window() != NULL)
{
if(GetForegroundWindow() != (HWND) os_get_window())
{
DBUGFILE_OUTPUT_0("Using SetForegroundWindow last");
SetForegroundWindow((HWND) os_get_window());
}
}
*/
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_init(1);
}
#endif // _WIN32
if(movie_shutdown_fgx == true)
{
gr_activate(1);
}
return true;
}
bool movie_play_two(char *name1, char *name2, int unknown_value)
{
bool result = true;
// This should not be uncommented
if(!Cmdline_dshowvid)
{
return true;
}
/*
** Check file exists
*/
FILE *fp = fopen(name1,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name1);
if(fp == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
/*
** Check second file exists
*/
FILE *fp2 = fopen(name2,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name2);
if(fp2 == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
return true;
}
fclose(fp2);
}
fclose(fp);
if(movie_shutdown_fgx == true)
{
gr_activate(0);
}
#ifdef _WIN32
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_cleanup();
}
os_app_activate_set(false);
dx8show_play_cutscene(name1);
{
MSG msg;
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
dx8show_play_cutscene(name2);
os_app_activate_set(true);
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_init(1);
}
#endif
if(movie_shutdown_fgx == true)
{
gr_activate(1);
}
return result;
}
-8
View File
@@ -1,8 +0,0 @@
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
void movie_set_shutdown_fgx(bool state);
bool movie_play(char *name, int unknown_value = 0);
bool movie_play_two(char *name1, char *name2, int unknown_value = 0);
#endif
-175
View File
@@ -1,175 +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)
{
char code[5];
CFILE *ddsfile;
char real_name[MAX_FILENAME_LEN];
char *p;
int retval=DDS_ERROR_NONE;
int ct;
int bits=0;
//this better not happen.. ever
Assert(filename!=NULL);
//make sure there is an extension
strcpy(real_name, filename);
p=strchr(real_name, '.');
if (p) *p=0;
strcat(real_name, ".dds");
memset(code,0,sizeof(code));
//try to open the file
ddsfile = cfopen(real_name, "rb");
//file not found
if (!ddsfile)
{
return DDS_ERROR_INVALID_FILENAME;
}
//read the code
cfread(code,1,4,ddsfile);
code[4]=0;
//check it
if (strncmp(code,DDS_FILECODE,4)!=0)
{
return DDS_ERROR_BAD_HEADER;
}
//read the header
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
//stuff important info
if (width) *width=lpddsd->dwWidth;
if (height) *height=lpddsd->dwHeight;
switch(lpddsd->ddpfPixelFormat.dwFourCC)
{
case FOURCC_DXT1:
bits=24;
ct=DDS_DXT1;
break;
case FOURCC_DXT3:
bits=32;
ct=DDS_DXT3;
break;
case FOURCC_DXT5:
bits=32;
ct=DDS_DXT5;
break;
//dxt2 and dxt4 aren't supported
case FOURCC_DXT2:
case FOURCC_DXT4:
retval=DDS_ERROR_INVALID_FORMAT;
ct=DDS_DXT_INVALID;
break;
//none of the above
default:
retval=DDS_ERROR_UNCOMPRESSED;
ct=DDS_DXT_INVALID;
break;
}
if (bpp) *bpp=bits;
if (compression_type) *compression_type=ct;
//close file and return
cfclose(ddsfile);
return retval;
}
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type)
{
DDSURFACEDESC2 ddsd;
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type);
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, int *size, uint* data)
{
int retval;
DDSURFACEDESC2 ddsd;
int w,h,ct,bpp;
CFILE *cfp;
ubyte* tmp;
//this must be set
Assert(size!=NULL);
//read the header -- if its at this stage, it should be legal.
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct);
Assert(retval==DDS_ERROR_NONE);
//get some more info from the surface
*size=ddsd.dwMipMapCount > 1 ? ddsd.dwLinearSize * 2 : ddsd.dwLinearSize;
//open it up and go to the data section
cfp=cfopen(filename,"rb");
cfseek(cfp,DDS_OFFSET, CF_SEEK_SET);
//get the data
tmp=(ubyte*)malloc(*size);
if (!tmp)
{
cfclose(cfp);
return DDS_ERROR_NO_MEM; //barf
}
cfread(tmp,1,*size,cfp);
*data=(uint)tmp;
//we look done here
cfclose(cfp);
return DDS_ERROR_NONE;
}
//returns string representation of DDS_** error code
const char *dds_error_string(int code)
{
switch (code)
{
case DDS_ERROR_NONE:
return "No error";
case DDS_ERROR_NO_MEM:
return "Insufficient memory";
case DDS_ERROR_INVALID_FILENAME:
return "File not found";
case DDS_ERROR_BAD_HEADER:
return "Filecode did not equal \"DDS \"";
case DDS_ERROR_INVALID_FORMAT:
return "File was compressed, but it was DXT2 or DXT4";
case DDS_ERROR_UNCOMPRESSED:
return "*.DDS files must be compressed and use DXT1, DXT3, or DXT5 compression";
default:
return "Abort, retry, fail?";
}
//get a warning otherwise
return "Abort, retry, fail?";
}
-119
View File
@@ -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);
//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
+1 -1
View File
@@ -79,7 +79,7 @@ void timerbar_end_frame()
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
// break condition in else
for (;;)
while(1)
{
// if bar runs over
if(last_xpos + xsize > WIDTH)
-830
View File
@@ -1,830 +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){
ship *shipp = &Ships[obj->instance];
int oldest = shipp->decals[0].timestamp;
int i;
for(i = 0; i < MAX_SHIP_DECALS; i++){
if(shipp->decals[i].is_valid != 1){ //use up all the unused decals first
return i%MAX_SHIP_DECALS;
}
}
for(i = 1; i < MAX_SHIP_DECALS; i++){
if(shipp->decals[i].timestamp > oldest){ //then get the oldest one
oldest = i;
}
}
return oldest%MAX_SHIP_DECALS;
}
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
#ifdef DECALS_ENABLED
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
if(obj->type != OBJ_SHIP){
return 0;
}
// vertex vert[1][2];
// vector vec[4];
vector center = point->pnt;
float rad = point->radius;
if(rad <=0) rad = 10;
mprintf(("radius %f\n",rad));
vector plain_point[4];
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
plain_point[0] = point->orient.vec.uvec;
plain_point[1] = plain_point[0];
vm_vec_negate(&plain_point[1]);
plain_point[2] = point->orient.vec.rvec;
plain_point[3] = plain_point[2];
vm_vec_negate(&plain_point[3]);
mprintf(("\n"));
int dinx = decal_find_next(obj);
ship *shipp = &Ships[obj->instance];
decal *dec = shipp->decals;
vm_vec_scale_add( &dec[0].vert[0], &center, &plain_point[0], rad );
vm_vec_scale_add( &dec[0].vert[1], &center, &plain_point[2], rad );
vm_vec_scale_add( &dec[0].vert[2], &center, &plain_point[1], rad );
vm_vec_scale_add( &dec[0].vert[3], &center, &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, &center, &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(&center, &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
}
-80
View File
@@ -1,80 +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"
#include "object/object.h"
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
typedef struct decal_model{ //this will store a triangulated version of the ships polygons
struct{
int point[3]; //an index to the vert list-Bobboau
vector center; //the center of the poly
float radius; //the max radius of the poly
}poly[MAX_DECAL_POLY];
vector vert[MAX_DECAL_DEFPOINTS]; //the defpoints-Bobboau
int n_polys;
}decal_model;
//extern decal_model d_model;
typedef struct decal{
struct{
int backfaced; //flag that this poly uses the backfaced texture
uv_pair uv[MAX_DECAL_POLY_POINT]; //uv coordanants
int point[MAX_DECAL_POLY_POINT]; //an index to the vert list-Bobboau
int n_poly;
vector norm; //the normal used for lighting
}poly[MAX_DECAL_POLY];
vector position;
float radius;
int submodel_parent; //the submodel this is part of
vector vert[1000]; //the defpoints-Bobboau
int frames; //number of frames in an animation
int fps; //frames per second
int starting_keyframe; //the frame that indicates the end of the inital nonlooped portion and the start of the middle looped part
int ending_keyframe; //the frame that indicates the end of the loopable portion and the start of the end part
int texture; //the texture to be used, first in animation
int backfaced_texture; //the texture to be used by backfaced polys, first in animation
int is_valid; //this means it is a good decal that should be rendered-Bobboau
int n_poly; //the number of polys
int timestamp; //this is when the decal was made-Bobboau
int lifetime; //this is how long the decal should be alive for-Bobboau
int importance; //this is for big things large beam marks and bomb craters should last longer than the odd laser impacts-Bobboau
int state; //1 starting, 2 looping(mostly for beams), 3 ending, 4 static
}decal;
typedef struct decal_point{
vector pnt;
matrix orient;
float radius;
}decal_point;
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1);//makes the decal
#endif
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture);//makes the decal
int decal_create_sub(void *model_ptr);
/*
int decal_is_in_face(int n, vertex vertlist[n]);//sees if a poly is inside a decal: 0 is yes, 1 is sort of, -1 is no
*/
Binary file not shown.
-240
View File
@@ -1,240 +0,0 @@
#include <dshow.h>
#include <stdio.h>
#include "osapi/osapi.h"
#include "dx8show.h"
#include "debugconsole/dbugfile.h"
//
// Constants
//
const int KEYBOARD_SAMPLE_FREQ = 200; // Sample user input on an interval
//
// Globals
//
IGraphBuilder *pGB = NULL;
IMediaControl *pMC = NULL;
IVideoWindow *pVW = NULL;
IMediaEvent *pME = NULL;
//
// Function prototypes
//
HRESULT get_interfaces(void);
bool play_media(LPTSTR movie_filename);
bool set_fullscreen(void);
void cleanup_interfaces(void);
HWND internal_hwnd = NULL;
// This define, 0 by default, if set to 1 will run window binding code which currently
// doesnt work, left in for fun
#define VIS_CODE 0
//
// Helper Macros (Jump-If-Failed, Log-If-Failed)
//
#define RUN_FUNCTION_ROF(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED in " #x); return false;}
#define RUN_FUNCTION_GET_INTERFACE(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED " #x); cleanup_interfaces(); return hr;}
#define RUN_FUNCTION(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED " #x);}
#define RELEASE(i) {if (i) i->Release(); i = NULL;}
void process_messages(HWND hwnd)
{
MSG msg;
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void dx8show_set_hwnd(void *hwnd)
{
internal_hwnd = (HWND) hwnd;
}
bool dx8show_play_cutscene(char *movie_file)
{
HRESULT hr;
// Initialize COM
RUN_FUNCTION_ROF(CoInitialize(NULL));
// Get DirectShow interfaces
RUN_FUNCTION_ROF(get_interfaces());
if(internal_hwnd == NULL)
{
internal_hwnd = (HWND) os_get_window();
}
#if VIS_CODE
RUN_FUNCTION(pVW->put_Visible(OATRUE));
RUN_FUNCTION(pVW->put_Owner((OAHWND) internal_hwnd));
#endif
// Play the movie / cutscene
play_media(movie_file);
#if VIS_CODE
RUN_FUNCTION(pVW->put_Visible(OAFALSE));
RUN_FUNCTION(pVW->put_Owner(NULL));
#endif
// Release DirectShow interfaces
cleanup_interfaces();
CoUninitialize();
return true;
}
HRESULT get_interfaces(void)
{
HRESULT hr = S_OK;
// Instantiate filter graph interface
RUN_FUNCTION_GET_INTERFACE(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **) &pGB));
// Get interfaces to control playback & screensize
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaControl, (void **) &pMC));
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IVideoWindow, (void **) &pVW));
// Get interface to allow the app to wait for completion of playback
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
return hr;
}
void cleanup_interfaces(void)
{
// Release the DirectShow interfaces
RELEASE(pMC);
RELEASE(pVW);
RELEASE(pME);
RELEASE(pGB);
}
bool play_media(LPTSTR movie_filename)
{
HRESULT hr;
WCHAR file_name[MAX_PATH];
#ifndef UNICODE
MultiByteToWideChar(CP_ACP, 0, movie_filename, -1, file_name, MAX_PATH);
#else
lstrcpy(file_name, movie_filename);
#endif
// Allow DirectShow to create the FilterGraph for this media file
RUN_FUNCTION_ROF(pGB->RenderFile(file_name, NULL));
// Set the message drain of the video window to point to our hidden application window. This allows
// keyboard input to be transferred to our main window for processing.
//
// If this is an audio-only or MIDI file, then put_MessageDrain will fail.
//
RUN_FUNCTION(pVW->put_MessageDrain((OAHWND) internal_hwnd));
if(set_fullscreen() == false)
{
return false;
}
// Display first frame of the movie and play
RUN_FUNCTION_ROF(pMC->Pause());
RUN_FUNCTION_ROF(pMC->Run());
// Update state variables
bool movie_continue = true;
// Enter a loop of checking for events and sampling keyboard input
while (movie_continue)
{
long event_code, param1, param2;
// Has there been a media event? Look for end of stream condition.
if(E_ABORT != pME->GetEvent(&event_code, &param1, &param2, 0))
{
// Is this the end of the movie?
if (event_code == EC_COMPLETE)
{
movie_continue = false;
}
// Free the media event resources.
RUN_FUNCTION(pME->FreeEventParams(event_code, param1, param2));
}
// Give system threads time to run (and don't sample user input madly)
Sleep(KEYBOARD_SAMPLE_FREQ);
MSG msg;
// Quits movie if escape, space or return is pressed
while(PeekMessage(&msg, internal_hwnd, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
if(msg.message != WM_KEYDOWN)
{
DispatchMessage(&msg);
continue;
}
switch(msg.wParam )
{
case VK_ESCAPE:
case VK_SPACE:
case VK_RETURN:
{
DBUGFILE_OUTPUT_0("User skipped cut scene");
movie_continue = false;
}
}
}
}
return true;
}
bool set_fullscreen(void)
{
HRESULT hr;
LONG mode;
HWND drain=0;
if (!pVW)
{
return S_FALSE;
}
// Read current state
RUN_FUNCTION_ROF(pVW->get_FullScreenMode(&mode));
if (mode == OAFALSE)
{
// Save current message drain
RUN_FUNCTION_ROF(pVW->get_MessageDrain((OAHWND *) &drain));
// This is very important. It ensures that the video window doesnt end
// up playing behind the main window
SetFocus(drain);
// Set message drain to application main window
RUN_FUNCTION_ROF(pVW->put_MessageDrain((OAHWND) internal_hwnd));
// Switch to full-screen mode
mode = OATRUE;
RUN_FUNCTION_ROF(pVW->put_FullScreenMode(mode));
}
return true;
}
-8
View File
@@ -1,8 +0,0 @@
#ifndef _DX8SHOW_HEADER_FILE
#define _DX8SHOW_HEADER_FILE
bool dx8show_play_cutscene(char *filename);
void dx8show_set_hwnd(void *hwnd);
#endif
Binary file not shown.
Binary file not shown.
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
* $Revision: 2.1 $
* $Date: 2003-03-02 05:10:42 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Author: penguin $
*
* Main file for dealing with exception handling
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -142,9 +139,7 @@ static void PrintTime(char *output, FILETIME TimeToPrint)
static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
{
char ModName[MAX_PATH];
#ifdef _MSC_VER
__try {
#endif
if (GetModuleFileName(ModuleHandle, ModName, sizeof(ModName)) > 0) {
// If GetModuleFileName returns greater than zero then this must
// be a valid code module address. Therefore we can try to walk
@@ -179,13 +174,11 @@ static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
ModName, ModuleHandle, FileSize,
NTHeader->FileHeader.TimeDateStamp, TimeBuffer);
}
#ifdef _MSC_VER
}
// Handle any exceptions by continuing from this point.
__except(EXCEPTION_EXECUTE_HANDLER)
{
}
#endif
}
// Scan memory looking for code modules (DLLs or EXEs). VirtualQuery is used
@@ -443,19 +436,15 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
// exception handler will print '??'.
unsigned char *code = (unsigned char*)Context->Eip;
for (int codebyte = 0; codebyte < NumCodeBytes; codebyte++) {
#ifdef _MSC_VER
__try {
#endif
hprintf(LogFile, "%02x ", code[codebyte]);
#ifdef _MSC_VER
}
__except(EXCEPTION_EXECUTE_HANDLER) {
hprintf(LogFile, "?? ");
}
#endif
}
#ifdef _MSC_VER
// Time to print part or all of the stack to the error log. This allows
// us to figure out the call stack, parameters, local variables, etc.
hprintf(LogFile, "\r\n"
@@ -511,7 +500,6 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
__except(EXCEPTION_EXECUTE_HANDLER) {
hprintf(LogFile, "Exception encountered during stack dump.\r\n");
}
#endif
RecordModuleList(LogFile);
+5 -23
View File
@@ -9,21 +9,13 @@
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
* $Revision: 2.3 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code to move, render and otherwise deal with fireballs.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -351,9 +343,7 @@
#include "gamesnd/gamesnd.h"
#include "localization/localize.h"
int wm;
#define WARPHOLE_GROW_TIME (3.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
#define WARPHOLE_GROW_TIME (1.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
#define MAX_FIREBALL_LOD 4
@@ -518,9 +508,7 @@ void fireball_load_data()
if ( Warp_glow_bitmap == -1 ) {
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
}
// polymodel Warp_pm;
}
}
@@ -549,11 +537,6 @@ void fireball_init()
Fireballs[i].objnum = -1;
}
mprintf(("loading warp model"));
wm = -1;
wm = model_load("warp.pof", 0, NULL, 0);
mprintf((" %d\n", wm));
}
@@ -647,7 +630,6 @@ void fireball_render(object * obj)
//rad = (fb->total_time - t )*obj->radius/WARPHOLE_GROW_TIME;
}
//rad = obj->radius;
// obj->alt_rad = rad;
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius );
+3 -13
View File
@@ -5,25 +5,17 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:12:39 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Prototypes for fireball functions
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -214,6 +206,4 @@ float fireball_lifeleft_percent( object *obj );
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
extern int Warp_glow_bitmap; // Internal
extern int wm;
#endif /* _FIREBALLS_H */
+38 -113
View File
@@ -7,23 +7,15 @@
*
*/
/*
/*
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
* $Revision: 2.3 $
* $Date: 2003-01-05 23:41:50 $
* $Author: bobboau $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code for rendering the warp in effects for ships
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -143,9 +135,6 @@
#include "fireball/fireballs.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "Weapon/Beam.h"
extern int wm;
DCF(norm,"normalize a zero length vector")
{
@@ -175,19 +164,15 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
}
#define wSTUFF_VERTICES() do { verts[0]->u = 0.5f; verts[0]->v = 0.0f; verts[1]->u = 1.0f; verts[1]->v = 0.0f; verts[2]->u = 1.0f; verts[2]->v = 1.0f; verts[3]->u = 0.5f; verts[3]->v = 1.0f; } while(0);
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius )
{
int i;
int saved_gr_zbuffering = gr_zbuffer_get();
// gr_zbuffering = 0;
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
float Grid_depth = radius/2.5f;
@@ -195,109 +180,43 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
vm_vec_scale_add( &center, 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(wm > -1){
float model_Interp_scale_x = radius /20;
float model_Interp_scale_y = radius /20;
float model_Interp_scale_z = max_radius /20;
vm_vec_scale_add( &vecs[0], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
float dist = vm_vec_dist_quick( pos, &Eye_position );
vm_vec_scale_add( &vecs[1], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
model_set_detail_level((int)(dist / (radius * 10.0f)));
gr_set_cull(0);
model_render( wm, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
gr_set_cull(1);
vm_vec_scale_add( &vecs[2], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
// Warp_Map = -1;//un sets the warp map
vm_vec_scale_add( &vecs[3], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
model_Interp_scale_x = 1.0f;
model_Interp_scale_y = 1.0f;
model_Interp_scale_z = 1.0f;
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, 0.0f);
gr_set_cull(0);
/*
//this is that half done effect that was pissing people off-Bobboau
matrix m;
vector ray_dir;
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
float angle = ANG_TO_RAD(135.0f);
if(life_percent < 0.2f){
angle = ANG_TO_RAD(135.0f * (life_percent * 5.0f));
}
for(int idx=0; idx<1; idx++){
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
vector p_temp = *pos;
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
// vm_vec_scale_add( &vecs[4], &center, &orient->vec.fvec, -Grid_depth );
vecs[4] = center;
vertex h1[4]; // halves of a beam section
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
vector top1, bottom1, top2, bottom2;
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;
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], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[1], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[2], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[3], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
// vm_vec_scale_add( &vecs[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] );
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, 1.0f );
@@ -346,3 +265,9 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
gr_zbuffer_set( saved_gr_zbuffering );
}
+61 -207
View File
@@ -9,62 +9,13 @@
/*
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
* $Revision: 2.27 $
* $Date: 2003-03-02 05:23:34 $
* $Author: penguin $
* $Revision: 2.13 $
* $Date: 2002-10-22 17:42:09 $
* $Author: randomtiger $
*
* Freespace main body
*
* $Log: not supported by cvs2svn $
* Revision 2.26 2003/02/23 20:55:57 wmcoolmon
* Refixed the splash screen loading code so that it still works with the demo VPs (Loading "2_PreLoad" and "PreLoad") and put logo support back in. Logo support does nothing unless "PreLoadLogo" and/or"2_PreLoadLogo" exist within the search path.
*
* Revision 2.25 2003/02/16 19:00:56 phreak
* stupid typo -- my bad
*
* Revision 2.24 2003/02/16 18:53:59 phreak
* fixed around splash screen
* 2_splash.pcx is loaded in 1024x768
* splash.pcx is loaded in 640x480 or 2_splash.pcx isn't found
*
* Revision 2.23 2003/01/30 23:18:21 phreak
* cleaned up debug output
*
* Revision 2.22 2003/01/26 20:04:32 wmcoolmon
* Minor mod to preload screen code, added separate 1024x768 logo
* -C
*
* Revision 2.21 2003/01/26 02:58:33 wmcoolmon
* Added title screen support to retail version. When FS2 loads, it will build a list of PCX files in the current directory, then attempt to display one. If no PCX files exist, it will try to display one of the title screens defined in the code. Freespace 2 will then attempt to superimpose a logo in the upper-left hand corner of the screen. If neither can be displayed, FS2 will function normally.
*
* Revision 2.20 2003/01/20 05:40:49 bobboau
* added several sExps for turning glow points and glow maps on and off
*
* Revision 2.19 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.18 2003/01/15 21:26:35 anonymous
* fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory.
*
* Revision 2.17 2003/01/14 04:00:16 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 2.16 2002/12/21 13:39:03 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/18 22:21:23 phreak
* tidied up game_init() a bit.. took out a bunch of unneeded ifdefs like E3_BUILD
* Added option to access OpenGL from the registry keys. searches for "OpenGL-"
* whoever is in charge of the launcher might want to know this.
*
* Revision 2.14 2002/11/18 21:34:16 phreak
* made ogl be used if "NDEBUG" is not defined and "USE_OPENGL" is defined - phreak
*
* Revision 2.13 2002/10/22 17:42:09 randomtiger
* Fixed lighting bug that caused special pause to crash on debug build.
* Also added TAB functionality for special pause that toggles HUD. - RT
*
* Revision 2.12 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
@@ -1116,25 +1067,17 @@ static char *Game_loading_ani_fname[GR_NUM_RESOLUTIONS] = {
};
#if defined(FS2_DEMO)
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoad",
"2_PreLoad"
};
#elif defined(OEM_BUILD)
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"OEMPreLoad",
"2_OEMPreLoad"
};
#else
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoad",
"2_PreLoad"
};
#endif
static char *Game_logo_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoadLogo",
"2_PreLoadLogo"
};
#ifdef _WIN32
// cdrom stuff
@@ -1271,7 +1214,7 @@ void game_framerate_check()
Gf_critical_time += flFrametime;
}
if((!Show_framerate) || (!Cmdline_show_fps)) {
if(!Show_framerate){
return;
}
@@ -1532,7 +1475,7 @@ void game_flash_diminish(float frametime)
if ( Use_palette_flash ) {
int r,g,b;
static int o_r=0, o_g=0, o_b=0;
static int or=0, og=0, ob=0;
// Change the 200 to change the color range of colors.
r = fl2i( Game_flash_red*128.0f );
@@ -1560,9 +1503,9 @@ void game_flash_diminish(float frametime)
//mprintf(( "Flash! %d,%d,%d\n", r, g, b ));
o_r = r;
o_g = g;
o_b = b;
or = r;
og = g;
ob = b;
}
}
@@ -2037,7 +1980,7 @@ int game_start_mission()
game_post_level_init();
load_post_level_init = time(NULL) - load_post_level_init;
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
#ifndef NDEBUG
{
void Do_model_timings_test();
Do_model_timings_test();
@@ -2425,38 +2368,44 @@ void game_init()
int trying_d3d = 0;
if (!Is_standalone && ptr && (strstr(ptr, NOX("3DFX Glide")))) {
#ifdef E3_BUILD
// always 640 for E3
gr_init(GR_640, GR_GLIDE);
#else
// regular or hi-res ?
#ifdef NDEBUG
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
#else
if(strstr(ptr, NOX("(1024x768)"))){
#endif
gr_init(GR_1024, GR_GLIDE);
} else {
gr_init(GR_640, GR_GLIDE);
}
#endif
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("Direct 3D -") ))) {
#ifdef E3_BUILD
// always 640 for E3
trying_d3d = 1;
gr_init(GR_640, GR_DIRECT3D, depth);
#else
// regular or hi-res ?
#ifdef NDEBUG
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
#else
if(strstr(ptr, NOX("(1024x768)"))){
#endif
// Direct 3D
trying_d3d = 1;
gr_init(GR_1024, GR_DIRECT3D, depth);
} else {
// Direct 3D
trying_d3d = 1;
gr_init(GR_640, GR_DIRECT3D, depth);
}
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("OpenGL -") ))){
if (has_sparky_hi && strstr(ptr,NOX("1024x768"))){
gr_init(GR_1024, GR_OPENGL, depth);
} else {
gr_init(GR_640, GR_OPENGL, depth);
}
#endif
} else {
// Software
//NOT USED ANYMORE
Error(LOCATION,"Software mode is unsupported, use hardware acceleration. If not using software mode, then something was misspelled. GET A PROGRAMMER!!");
/*
#ifndef NDEBUG
if ( Use_fullscreen_at_startup && !Is_standalone) {
gr_init(GR_640, GR_DIRECTDRAW);
@@ -2470,7 +2419,6 @@ void game_init()
gr_init(GR_640, GR_SOFTWARE);
}
#endif
*/
}
// tried d3d ?
@@ -2507,12 +2455,12 @@ void game_init()
gr_set_gamma(Freespace_gamma);
//#if defined(FS2_DEMO) || defined(OEM_BUILD)
#if defined(FS2_DEMO) || defined(OEM_BUILD)
// add title screen
if(!Is_standalone){
display_title_screen();
}
//#endif
#endif
#ifndef NO_NETWORK
// attempt to load up master tracker registry info (login and password)
@@ -2561,9 +2509,7 @@ void game_init()
control_config_common_init(); // sets up localization stuff in the control config
parse_rank_tbl();
#ifndef FS2_DEMO
parse_medal_tbl();
#endif
cutscene_init();
key_init();
mouse_init();
@@ -2683,7 +2629,7 @@ void game_get_framerate()
}
Framecount++;
if ((Show_framerate) || (Cmdline_show_fps)) {
if (Show_framerate) {
gr_set_color_fast(&HUD_color_debug);
gr_string( 570, 2, text );
}
@@ -4015,8 +3961,6 @@ void game_flip_page_and_time_it()
void game_simulation_frame()
{
// mprintf(("about to render a frame\n"));
#ifndef NO_NETWORK
// blow ships up in multiplayer dogfight
if((Game_mode & GM_MULTIPLAYER) && (Net_player != NULL) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT) && (f2fl(Missiontime) >= 2.0f) && !dogfight_blown){
@@ -4048,7 +3992,6 @@ void game_simulation_frame()
// process AWACS stuff - do this first thing
awacs_process();
//mprintf(("awacs procesed\n"));
// single player, set Player hits_this_frame to 0
if ( !(Game_mode & GM_MULTIPLAYER) && Player ) {
@@ -4070,7 +4013,6 @@ void game_simulation_frame()
// the basic idea being that because it con be confusing to deal with them on a multi-frame basis, they are only valid for
// frame
ship_process_targeting_lasers();
//mprintf(("targeting lasers procesed\n"));
// do this here so that it works for multiplayer
if ( Viewer_obj ) {
@@ -4097,7 +4039,6 @@ void game_simulation_frame()
} else {
physics_set_viewer( NULL, PHYSICS_VIEWER_FRONT );
}
//mprintf(("view stuff done\n"));
#define VM_PADLOCK_UP (1 << 7)
#define VM_PADLOCK_REAR (1 << 8)
@@ -4141,14 +4082,11 @@ void game_simulation_frame()
mission_eval_goals();
}
#endif // ifndef NO_NETWORK
//mprintf(("arivals\\departures done\n"));
// always check training objectives, even in multiplayer missions. we need to do this so that the directives gauge works properly on clients
if(!(Game_mode & GM_DEMO_PLAYBACK)){
training_check_objectives();
}
// mprintf(("objectives procesed\n"));
#ifndef NO_NETWORK
// do all interpolation now
@@ -4164,15 +4102,12 @@ void game_simulation_frame()
// move all objects - does interpolation now as well
obj_move_all(flFrametime);
}
// mprintf(("interpolation procesed\n"));
#endif // ifndef NO_NETWORK
// only process the message queue when the player is "in" the game
if ( !Pre_player_entry ){
message_queue_process(); // process any messages send to the player
}
//mprintf(("message queue procesed\n"));
if(!(Game_mode & GM_DEMO_PLAYBACK)){
message_maybe_distort(); // maybe distort incoming message if comms damaged
@@ -4180,14 +4115,12 @@ void game_simulation_frame()
player_process_pending_praise(); // maybe send off a delayed praise message to the player
player_maybe_play_all_alone_msg(); // mabye tell the player he is all alone
}
//mprintf(("assorted player stuff procesed\n"));
if(!(Game_mode & GM_STANDALONE_SERVER)){
// process some stuff every frame (before frame is rendered)
emp_process_local();
hud_update_frame(); // update hud systems
//mprintf(("HUD updated\n"));
if (!physics_paused) {
// Move particle system
@@ -4204,11 +4137,9 @@ void game_simulation_frame()
shockwave_move_all(flFrametime); // update all the shockwaves
}
//mprintf(("physics stuff procesed\n"));
// subspace missile strikes
ssm_process();
//mprintf(("SSM procesed\n"));
#ifndef NO_SOUND
obj_snd_do_frame(); // update the object-linked persistant sounds
@@ -4221,10 +4152,8 @@ void game_simulation_frame()
if ( Game_subspace_effect ) {
game_start_subspace_ambient_sound();
}
//mprintf(("sound procesed\n"));
#endif
}
// mprintf(("frame rendered\n"));
}
}
// Maybe render and process the dead-popup
@@ -4809,9 +4738,6 @@ void game_do_frame()
game_set_frametime(GS_STATE_GAME_PLAY);
game_update_missiontime();
// if (Player_ship->flags & SF_DYING)
// flFrametime /= 15.0;
#if !defined(NO_NETWORK) && !defined(NO_STANDALONE)
if (Game_mode & GM_STANDALONE_SERVER) {
std_multi_set_standalone_missiontime(f2fl(Missiontime));
@@ -6093,7 +6019,11 @@ void game_enter_state( int old_state, int new_state )
#if defined(PRESS_TOUR_BUILD) || defined(PD_BUILD)
mht_init();
#else
main_hall_init(Player->main_hall);
if (Player->on_bastion) {
main_hall_init(1);
} else {
main_hall_init(0);
}
#endif
break;
@@ -7185,7 +7115,7 @@ int WinMainSub(int argc, char *argv[])
// movie_play( NOX("intro.mve"), 0 );
// debug version, movie will only play with -showmovies
#elif !defined(NDEBUG)
#else if !defined(NDEBUG)
// no soup for you!
// movie_play( NOX("intro.mve"), 0);
@@ -7243,18 +7173,14 @@ int main(int argc, char *argv[])
int result = -1;
#ifdef _WIN32
#if defined(_MSC_VER)
__try {
#endif
result = WinMainSub(hInst, hPrev, szCmdLine, nCmdShow);
#if defined(_MSC_VER)
} __except(RecordExceptionInfo(GetExceptionInformation(), "Freespace 2 Main Thread")) {
// Do nothing here - RecordExceptionInfo() has already done
// everything that is needed. Actually this code won't even
// get called unless you return EXCEPTION_EXECUTE_HANDLER from
// the __except clause.
}
#endif
#else
try {
result = WinMainSub(argc, argv);
@@ -7742,7 +7668,7 @@ void game_show_event_debug(float frametime)
#endif // NDEBUG
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
#ifndef NDEBUG
FILE * Time_fp;
FILE * Texture_fp;
@@ -7983,10 +7909,6 @@ if ( FS_VERSION_BUILD == 0 ) {
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
}
#ifdef FS2_DEMO
strcat(str, " Demo");
#endif
#ifdef _DEBUG
strcat(str, " Dbg");
#endif
@@ -8882,18 +8804,16 @@ int game_do_cd_mission_check(char *filename)
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
#define NUM_SHIPS_TBL_CHECKSUMS 1
#ifdef FS2_DEMO
/*
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
//-463907578, // US - beta 1
-463907578, // US - beta 1
1696074201, // FS2 demo
};
#else
*/
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
// -1022810006, // 1.0 FULL
-1254285366 // 1.2 FULL (German)
};
#endif
void verify_ships_tbl()
{
@@ -8951,18 +8871,16 @@ DCF(shipspew, "display the checksum for the current ships.tbl")
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
#define NUM_WEAPONS_TBL_CHECKSUMS 1
#ifdef FS2_DEMO
/*
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
//141718090, // US - beta 1
141718090, // US - beta 1
-266420030, // demo 1
};
#else
*/
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
// 399297860, // 1.0 FULL
-553984927 // 1.2 FULL (german)
};
#endif
void verify_weapons_tbl()
{
@@ -9026,64 +8944,17 @@ int game_hacked_data()
return 0;
}
//#define MAX_SPLASHSCREENS 64
//char Splash_screens[MAX_SPLASHSCREENS][MAX_FILENAME_LEN];
void display_title_screen()
{
int title_bitmap = -1;
int title_logo =-1;
/* _finddata_t find;
long find_handle;
char current_dir[256];
#if defined(FS2_DEMO) || defined(OEM_BUILD)
///int title_bitmap;
//Get the find string
_getcwd(current_dir, 256);
strcat(current_dir, DIR_SEPARATOR_STR);
strcat(current_dir, "*.pcx");
//Let the search begin!
find_handle = _findfirst(current_dir, &find);
int i = 0;
if(find_handle != -1)
{
char *p;
do {
if(!(find.attrib & _A_SUBDIR) && (strlen(find.name) < MAX_FILENAME_LEN)) {
p = strchr( find.name, '.' );
if(p) {
*p = '\0';
}
if(stricmp(find.name, Game_logo_screen_fname[gr_screen.res])
&& stricmp(find.name, Game_title_screen_fname[gr_screen.res]))
{
strcpy(Splash_screens[i], find.name);
i++;
}
if(i == MAX_SPLASHSCREENS) {
break;
}
}
} while(!_findnext(find_handle, &find));
// load bitmap
int title_bitmap = bm_load(Game_demo_title_screen_fname[gr_screen.res]);
if (title_bitmap == -1) {
return;
}
if(i) {
srand(time(NULL));
title_bitmap = bm_load(Splash_screens[rand() % i]);
} else {
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
}
if (title_bitmap == -1 && title_logo == -1) {
// return;
}
*/
#ifndef NO_DIRECT3D
// d3d
if((gr_screen.mode == GR_DIRECT3D) && (Gr_bitmap_poly)){
@@ -9092,31 +8963,11 @@ void display_title_screen()
}
#endif
title_logo = bm_load(Game_logo_screen_fname[gr_screen.res]);
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
// set
gr_set_bitmap(title_bitmap);
if(title_bitmap != -1)
{
// set
gr_set_bitmap(title_bitmap);
//Get bitmap's width and height
int width, height;
bm_get_info(title_bitmap, &width, &height);
//Draw it in the center of the screen
gr_bitmap((gr_screen.max_w - width)/2, (gr_screen.max_h - height)/2);
bm_unload(title_bitmap);
}
if(title_logo != -1)
{
gr_set_bitmap(title_logo);
gr_bitmap(0,0);
bm_unload(title_logo);
}
// draw
gr_bitmap(0, 0);
#ifndef NO_DIRECT3D
// d3d
@@ -9128,6 +8979,9 @@ void display_title_screen()
// flip
gr_flip();
bm_unload(title_bitmap);
#endif // FS2_DEMO || OEM_BUILD
}
// return true if the game is running with "low memory", which is less than 48MB
+3 -30
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
* $Revision: 2.2 $
* $Date: 2003-01-25 04:17:39 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* C module for high-level control of event driven music
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -1418,30 +1415,6 @@ int event_music_next_soundtrack(int delta)
return Current_soundtrack_num;
}
// Goober5000 - along the same lines; this is for the sexp
void event_sexp_change_music(char *name)
{
Assert(name);
int i, new_soundtrack = -1;
if ( Event_music_enabled == FALSE || Event_music_level_inited == FALSE )
{
return;
}
for (i=0; i<Num_soundtracks; i++)
{
if (!stricmp(name, Soundtracks[i].name))
{
new_soundtrack = i;
}
}
event_music_level_close();
event_music_level_init(new_soundtrack);
}
// ----------------------------------------------------------------
// event_music_get_soundtrack_name()
//
+4 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
* $Revision: 2.2 $
* $Date: 2003-01-25 04:17:39 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Header file for high-level control of event driven music
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -188,7 +185,7 @@ typedef struct tagSOUNDTRACK_INFO {
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
} SOUNDTRACK_INFO;
#define MAX_SOUNDTRACKS 25
#define MAX_SOUNDTRACKS 10
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
extern int Num_soundtracks;
@@ -220,7 +217,6 @@ void event_music_start_default();
void event_music_get_info(char *outbuf);
void event_music_get_soundtrack_name(char *outbuf);
int event_music_next_soundtrack(int delta);
void event_sexp_change_music(char *name);
void event_music_set_soundtrack(char *name);
void event_music_set_score(int score_index, char *name);
int event_music_get_spooled_music_index(char *name);
+4 -10
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
* $Revision: 2.2 $
* $Date: 2002-12-10 05:43:35 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Routines to keep track of which sound files go where
*
* $Log: not supported by cvs2svn $
* Revision 2.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
*
@@ -533,10 +530,6 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
// copilot
#define SND_COPILOT 162
// added for ballistic primaries - Goober5000
#define SND_BALLISTIC_START_LOAD 165
#define SND_BALLISTIC_LOAD 166
// supernova 1 and supernova 2
#define SND_SUPERNOVA_1 173
#define SND_SUPERNOVA_2 174
@@ -545,6 +538,7 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
#define SND_LIGHTNING_1 180
#define SND_LIGHTNING_2 181
//---------------------------------------------------
// Interface sounds
//---------------------------------------------------
-3
View File
@@ -62,9 +62,6 @@ typedef struct { float r, g, b, a; } FxColor4;
#elif defined(__unix__)
#define FX_ENTRY extern
#define FX_CALL
#elif defined(__GNUC__)
#define FX_ENTRY extern
#define FX_CALL
#else
#warning define FX_ENTRY & FX_CALL for your compiler
#define FX_ENTRY extern
+11 -36
View File
@@ -9,25 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
* $Revision: 2.8 $
* $Date: 2003-03-02 05:27:44 $
* $Revision: 2.4 $
* $Date: 2002-08-06 01:49:08 $
* $Author: penguin $
*
* Header file containg global typedefs, constants and macros
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2003/01/18 19:48:19 phreak
* added some defines that deal with mages using DXTC
*
* Revision 2.6 2002/12/02 23:56:12 Goober5000
* fixed misspelling
*
* Revision 2.5 2002/12/02 20:49:14 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.4 2002/08/06 01:49:08 penguin
* Renamed ccode members to cc_or and cc_and
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
@@ -340,22 +328,13 @@ typedef struct vertex {
ubyte pad[2]; // pad structure to be 4 byte aligned.
} vertex;
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) // transparent texture
#define BMP_TEX_NONDARK (1<<2) // nondarkening texture
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<4) // dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<5) // dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<6) // dxt5 compressed 8r8g8b8a (32bit)
//compressed texture types
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
//non compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
// any texture type
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
#define BMP_TEX_ANY ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
// max res == 1024x768. max texture size == 256
#define MAX_BMAP_SECTIONS_X 4
@@ -404,12 +383,12 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
// or,
// Error( LOCATION, "Error opening %s", filename );
//#if defined(NDEBUG)
#if defined(NDEBUG)
#define Assert(x) do {} while (0)
//#else
//void gr_activate(int);
//#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
//#endif
#else
void gr_activate(int);
#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
#endif
//#define Int3() _asm { int 3 }
@@ -437,12 +416,8 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
#endif // NDEBUG && DEMO
#endif // INTERPLAYQA
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#define PI 3.141592654f
#define PI2 (3.141592654f*2.0f) // PI*2
@@ -522,7 +497,7 @@ extern float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is th
void dc_printf( char *format, ... );
// Each dc_arg_type can have one or more of these flags set.
// This is because some things can fit into two categories.
// This is because some things can fit into two catagories.
// Like 1 can be an integer, a float, a string, or a true boolean
// value.
#define ARG_NONE (1<<0) // no argument
+4 -9
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
* $Revision: 2.2 $
* $Date: 2002-11-22 20:56:15 $
* $Author: phreak $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Variables and constants common to FreeSpace and Fred.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -236,9 +233,7 @@ int Fred_found_unknown_ship_during_parsing = 0;
// If true, then we are using Direct3D hardware. This is used for game type stuff
// that changes when you're using hardware.
int D3D_enabled = 0;
int OGL_inited=0;
int D3D_enabled = 0;
// Values used for noise for thruster animations
float Noise[NOISE_NUM_FRAMES] = {
+4 -14
View File
@@ -9,22 +9,12 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
* $Revision: 2.6 $
* $Date: 2003-02-05 07:04:31 $
* $Author: Goober5000 $
* $Revision: 2.3 $
* $Date: 2002-11-10 20:40:02 $
* $Author: inquisitor $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2003/01/30 23:24:34 phreak
* bumped to 3.50
*
* Revision 2.4 2002/12/31 20:09:14 Goober5000
* bumped to 3.4
* --Goober5000
*
* Revision 2.3 2002/11/10 20:40:02 inquisitor
* Bumped to 3.3
*
* Revision 2.2 2002/08/13 03:32:25 penguin
* Bumped to version 3.2
*
@@ -139,7 +129,7 @@
// Major.Minor.Bugfix
#define FS_VERSION_MAJOR 3 // major version
#define FS_VERSION_MINOR 5 // increase by 1 for minor revs
#define FS_VERSION_MINOR 3 // increase by 1 for minor revs
#define FS_VERSION_BUILD 0 // bugfix release
#define VERSION_LOC_FNAME "version.nfo"
+17 -34
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/WinDebug.cpp $
* $Revision: 2.2 $
* $Date: 2003-03-02 05:30:26 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Debug stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -119,26 +116,12 @@
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <crtdbg.h>
#include "globalincs/pstypes.h"
#ifdef _MSC_VER
#include <crtdbg.h>
//Uncomment SHOW_CALL_STACK to show the call stack in Asserts, Warnings, and Errors
#define SHOW_CALL_STACK
#endif // _MSC_VER
#ifndef __ASSERT
#ifndef _DEBUG
#define _ASSERT(expr) ((void)0)
#else
#define _ASSERT(expr) (assert(expr))
// #error _ASSERT is not defined yet for debug mode with non-MSVC compilers
#endif
#endif
#ifdef SHOW_CALL_STACK
@@ -1023,6 +1006,8 @@ void getmem()
#ifndef NDEBUG
#include <crtdbg.h>
int TotalRam = 0;
#define nNoMansLandSize 4
@@ -1045,9 +1030,6 @@ typedef struct _CrtMemBlockHeader
#define pHdr(pbData) (((_CrtMemBlockHeader *)pbData)-1)
// this block of code is never referenced...
#if 0
int __cdecl MyAllocHook(
int nAllocType,
void * pvData,
@@ -1085,9 +1067,6 @@ int __cdecl MyAllocHook(
return( TRUE ); // Allow the memory operation to proceed
}
#endif // #if 0
void windebug_memwatch_init()
{
@@ -1141,7 +1120,7 @@ void *vm_malloc( int size, char *filename, int line )
void *vm_malloc( int size )
#endif
{
#if (!defined(NDEBUG)) && defined(_MSC_VER)
#ifndef NDEBUG
if ( !Heap ) {
TotalRam += size;
@@ -1200,23 +1179,27 @@ void vm_free( void *ptr )
return;
}
#if (!defined(NDEBUG)) && defined(_MSC_VER)
#ifndef NDEBUG
if ( !Heap ) {
#ifndef NDEBUG
_CrtMemBlockHeader *phd = pHdr(ptr);
int nSize = phd->nDataSize;
TotalRam -= nSize;
#endif
_free_dbg(ptr,_NORMAL_BLOCK);
return;
}
#endif
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
if ( Watch_malloc ) {
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
}
TotalRam -= actual_size;
#endif
#ifndef NDEBUG
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
if ( Watch_malloc ) {
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
}
TotalRam -= actual_size;
#endif
HeapFree( Heap, HEAP_FLAG, ptr );
HeapCompact(Heap, HEAP_FLAG);
}
+38 -69
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/2d.cpp $
* $Revision: 2.5 $
* $Date: 2003-03-02 05:41:52 $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Main file for 2d primitives.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2002/11/18 21:32:11 phreak
* added some ogl functionality - phreak
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/30 14:29:15 unknownplayer
*
* Started work on DX8.1 implementation. Updated the project files to encompass
@@ -519,6 +513,9 @@ void gr_close()
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
gr_soft_cleanup();
break;
case GR_DIRECTDRAW:
Int3();
gr_directdraw_cleanup();
@@ -531,12 +528,6 @@ void gr_close()
break;
#endif
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
gr_soft_cleanup();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
gr_opengl_cleanup();
@@ -896,6 +887,9 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
if ( Gr_inited ) {
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
gr_soft_cleanup();
break;
case GR_DIRECTDRAW:
Int3();
gr_directdraw_cleanup();
@@ -910,13 +904,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
case GR_GLIDE:
gr_glide_cleanup();
break;
#endif // ifdef _WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
gr_soft_cleanup();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#endif
#ifdef USE_OPENGL
case GR_OPENGL:
@@ -933,7 +921,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
#if defined(HARDWARE_ONLY) && defined(_WIN32)
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D) && (mode != GR_OPENGL)){
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D)){
mprintf(("Forcing glide startup!\n"));
mode = GR_GLIDE;
}
@@ -990,6 +978,10 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
gr_soft_init();
break;
// directdraw, direct3d,
case GR_DIRECTDRAW:
Int3();
@@ -1028,18 +1020,8 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
gr_soft_init();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
Gr_bitmap_poly=1;
gr_screen.bits_per_pixel=depth;
gr_screen.bytes_per_pixel=depth/8;
gr_opengl_init();
break;
#endif // ifdef USE_OPENGL
@@ -1081,6 +1063,12 @@ void gr_force_windowed()
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
{
extern void gr_soft_force_windowed();
gr_soft_force_windowed();
}
break;
case GR_DIRECTDRAW:
{
Int3();
@@ -1098,19 +1086,8 @@ void gr_force_windowed()
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
{
extern void gr_soft_force_windowed();
gr_soft_force_windowed();
}
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
extern void opengl_minimize();
opengl_minimize();
break;
#endif // ifdef USE_OPENGL
@@ -1130,6 +1107,13 @@ void gr_activate(int active)
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
{
extern void gr_soft_activate(int active);
gr_soft_activate(active);
return;
}
break;
case GR_DIRECTDRAW:
{
Int3();
@@ -1154,20 +1138,8 @@ void gr_activate(int active)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
{
extern void gr_soft_activate(int active);
gr_soft_activate(active);
return;
}
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
extern void gr_opengl_activate(int active);
gr_opengl_activate(active);
break;
#endif // ifdef USE_OPENGL
@@ -1231,8 +1203,8 @@ void gr_bitmap(int x, int y)
int x_line, y_line;
int w, h;
// d3d and glide support texture poly shiz, ogl does too
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE) || (gr_screen.mode== GR_OPENGL)) && Gr_bitmap_poly){
// d3d and glide support texture poly shiz
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE)) && Gr_bitmap_poly){
int idx, s_idx;
// float u_scale, v_scale;
bitmap_section_info *sections;
@@ -1264,6 +1236,10 @@ void gr_bitmap(int x, int y)
// old school bitmaps
switch(gr_screen.mode){
#ifdef _WIN32
case GR_SOFTWARE:
grx_bitmap(x, y);
break;
case GR_DIRECTDRAW:
grx_bitmap(x, y);
break;
@@ -1275,13 +1251,8 @@ void gr_bitmap(int x, int y)
case GR_GLIDE:
gr_glide_bitmap(x, y);
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
grx_bitmap(x, y);
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#endif // ifdef WIN32
#ifdef USE_OPENGL
case GR_OPENGL:
@@ -1296,6 +1267,10 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
{
switch(gr_screen.mode){
#ifdef _WIN32
case GR_SOFTWARE:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
case GR_DIRECTDRAW:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
@@ -1309,12 +1284,6 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
gr_opengl_bitmap_ex(x, y, w, h, sx, sy);
+4 -23
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/aaline.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:42:25 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Code to draw antialiased lines
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -249,12 +246,11 @@ void aaline_init_tables()
// less than 1.0 and less total bits are sufficient.
// Some of the steps here are not needed. This was originally
// written to simulate exact hardware behavior.
#if defined _WIN32
#if defined( _WIN32 ) && defined( _MSC_VER )
long int fix_xy_mult(long int oa, fix_xy ob)
{
int retval;
#if defined _MSC_VER
_asm {
mov edx, oa
mov eax, ob
@@ -262,26 +258,11 @@ long int fix_xy_mult(long int oa, fix_xy ob)
shrd eax,edx,20
mov retval, eax
}
#elif defined __GNUC__
asm(
"mov %1,%%edx;"
"mov %2,%%eax;"
"imul %%edx;"
"shrd $20,%%eax,%%edx;"
"mov %%eax,%0"
: "=g" (retval) // outputs
: "g" (oa), "g" (ob) // inputs
: "eax", "edx" // clobbered registers
);
#else
#error unknown compiler
#endif
return retval;
}
#else
#error unknown OS
long int fix_xy_mult(long int oa, fix_xy ob);
#endif
#endif // if defined( _WIN32 ) && defined( _MSC_VER )
+3 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/Font.cpp $
* $Revision: 2.4 $
* $Date: 2003-03-02 05:41:52 $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* source file for font stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 20:12:31 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
@@ -647,7 +644,6 @@ void gr8_string(int sx, int sy, char *s )
gr_unlock();
}
#ifndef NO_SOFTWARE_RENDERING
#ifdef _WIN32
HFONT MyhFont = NULL;
extern HDC hDibDC;
@@ -737,8 +733,7 @@ void gr_get_string_size_win(int *w, int *h, char *text)
if (h)
*h += size.cy;
}
#endif // ifdef _WIN32
#endif // ifndef NO_SOFTWARE_RENDERING
#endif
char grx_printf_text[2048];
-373
View File
@@ -1,373 +0,0 @@
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glaux.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Auxiliary Library.
--*/
#ifndef __GLAUX_H__
#define __GLAUX_H__
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** ToolKit Window Types
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
*/
#define AUX_RGB 0
#define AUX_RGBA AUX_RGB
#define AUX_INDEX 1
#define AUX_SINGLE 0
#define AUX_DOUBLE 2
#define AUX_DIRECT 0
#define AUX_INDIRECT 4
#define AUX_ACCUM 8
#define AUX_ALPHA 16
#define AUX_DEPTH24 32 /* 24-bit depth buffer */
#define AUX_STENCIL 64
#define AUX_AUX 128
#define AUX_DEPTH16 256 /* 16-bit depth buffer */
#define AUX_FIXED_332_PAL 512
#define AUX_DEPTH AUX_DEPTH16 /* default is 16-bit depth buffer */
/*
** Window Masks
*/
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
#define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
#define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
/*
** ToolKit Event Structure
*/
typedef struct _AUX_EVENTREC {
GLint event;
GLint data[4];
} AUX_EVENTREC;
/*
** ToolKit Event Types
*/
#define AUX_EXPOSE 1
#define AUX_CONFIG 2
#define AUX_DRAW 4
#define AUX_KEYEVENT 8
#define AUX_MOUSEDOWN 16
#define AUX_MOUSEUP 32
#define AUX_MOUSELOC 64
/*
** Toolkit Event Data Indices
*/
#define AUX_WINDOWX 0
#define AUX_WINDOWY 1
#define AUX_MOUSEX 0
#define AUX_MOUSEY 1
#define AUX_MOUSESTATUS 3
#define AUX_KEY 0
#define AUX_KEYSTATUS 1
/*
** ToolKit Event Status Messages
*/
#define AUX_LEFTBUTTON 1
#define AUX_RIGHTBUTTON 2
#define AUX_MIDDLEBUTTON 4
#define AUX_SHIFT 1
#define AUX_CONTROL 2
/*
** ToolKit Key Codes
*/
#define AUX_RETURN 0x0D
#define AUX_ESCAPE 0x1B
#define AUX_SPACE 0x20
#define AUX_LEFT 0x25
#define AUX_UP 0x26
#define AUX_RIGHT 0x27
#define AUX_DOWN 0x28
#define AUX_A 'A'
#define AUX_B 'B'
#define AUX_C 'C'
#define AUX_D 'D'
#define AUX_E 'E'
#define AUX_F 'F'
#define AUX_G 'G'
#define AUX_H 'H'
#define AUX_I 'I'
#define AUX_J 'J'
#define AUX_K 'K'
#define AUX_L 'L'
#define AUX_M 'M'
#define AUX_N 'N'
#define AUX_O 'O'
#define AUX_P 'P'
#define AUX_Q 'Q'
#define AUX_R 'R'
#define AUX_S 'S'
#define AUX_T 'T'
#define AUX_U 'U'
#define AUX_V 'V'
#define AUX_W 'W'
#define AUX_X 'X'
#define AUX_Y 'Y'
#define AUX_Z 'Z'
#define AUX_a 'a'
#define AUX_b 'b'
#define AUX_c 'c'
#define AUX_d 'd'
#define AUX_e 'e'
#define AUX_f 'f'
#define AUX_g 'g'
#define AUX_h 'h'
#define AUX_i 'i'
#define AUX_j 'j'
#define AUX_k 'k'
#define AUX_l 'l'
#define AUX_m 'm'
#define AUX_n 'n'
#define AUX_o 'o'
#define AUX_p 'p'
#define AUX_q 'q'
#define AUX_r 'r'
#define AUX_s 's'
#define AUX_t 't'
#define AUX_u 'u'
#define AUX_v 'v'
#define AUX_w 'w'
#define AUX_x 'x'
#define AUX_y 'y'
#define AUX_z 'z'
#define AUX_0 '0'
#define AUX_1 '1'
#define AUX_2 '2'
#define AUX_3 '3'
#define AUX_4 '4'
#define AUX_5 '5'
#define AUX_6 '6'
#define AUX_7 '7'
#define AUX_8 '8'
#define AUX_9 '9'
/*
** ToolKit Gets and Sets
*/
#define AUX_FD 1 /* return fd (long) */
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
#define AUX_GREYSCALEMAP 4
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
/*
** Color Macros
*/
#define AUX_BLACK 0
#define AUX_RED 13
#define AUX_GREEN 14
#define AUX_YELLOW 15
#define AUX_BLUE 16
#define AUX_MAGENTA 17
#define AUX_CYAN 18
#define AUX_WHITE 19
extern float auxRGBMap[20][3];
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
/*
** RGB Image Structure
*/
typedef struct _AUX_RGBImageRec {
GLint sizeX, sizeY;
unsigned char *data;
} AUX_RGBImageRec;
/*
** Prototypes
*/
void APIENTRY auxInitDisplayMode(GLenum);
void APIENTRY auxInitPosition(int, int, int, int);
/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
#ifdef UNICODE
#define auxInitWindow auxInitWindowW
#else
#define auxInitWindow auxInitWindowA
#endif
GLenum APIENTRY auxInitWindowA(LPCSTR);
GLenum APIENTRY auxInitWindowW(LPCWSTR);
void APIENTRY auxCloseWindow(void);
void APIENTRY auxQuit(void);
void APIENTRY auxSwapBuffers(void);
typedef void (CALLBACK* AUXMAINPROC)(void);
void APIENTRY auxMainLoop(AUXMAINPROC);
typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
typedef void (CALLBACK* AUXIDLEPROC)(void);
void APIENTRY auxIdleFunc(AUXIDLEPROC);
typedef void (CALLBACK* AUXKEYPROC)(void);
void APIENTRY auxKeyFunc(int, AUXKEYPROC);
typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
int APIENTRY auxGetColorMapSize(void);
void APIENTRY auxGetMouseLoc(int *, int *);
void APIENTRY auxSetOneColor(int, float, float, float);
void APIENTRY auxSetFogRamp(int, int);
void APIENTRY auxSetGreyRamp(void);
void APIENTRY auxSetRGBMap(int, float *);
/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
#ifdef UNICODE
#define auxRGBImageLoad auxRGBImageLoadW
#else
#define auxRGBImageLoad auxRGBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
#ifdef UNICODE
#define auxDIBImageLoad auxDIBImageLoadW
#else
#define auxDIBImageLoad auxDIBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
void APIENTRY auxCreateFont(void);
/* void APIENTRY auxDrawStr(LPCTSTR); */
#ifdef UNICODE
#define auxDrawStr auxDrawStrW
#else
#define auxDrawStr auxDrawStrA
#endif
void APIENTRY auxDrawStrA(LPCSTR);
void APIENTRY auxDrawStrW(LPCWSTR);
void APIENTRY auxWireSphere(GLdouble);
void APIENTRY auxSolidSphere(GLdouble);
void APIENTRY auxWireCube(GLdouble);
void APIENTRY auxSolidCube(GLdouble);
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxWireTorus(GLdouble, GLdouble);
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
void APIENTRY auxWireIcosahedron(GLdouble);
void APIENTRY auxSolidIcosahedron(GLdouble);
void APIENTRY auxWireOctahedron(GLdouble);
void APIENTRY auxSolidOctahedron(GLdouble);
void APIENTRY auxWireTetrahedron(GLdouble);
void APIENTRY auxSolidTetrahedron(GLdouble);
void APIENTRY auxWireDodecahedron(GLdouble);
void APIENTRY auxSolidDodecahedron(GLdouble);
void APIENTRY auxWireCone(GLdouble, GLdouble);
void APIENTRY auxSolidCone(GLdouble, GLdouble);
void APIENTRY auxWireTeapot(GLdouble);
void APIENTRY auxSolidTeapot(GLdouble);
/*
** Window specific functions
** hwnd, hdc, and hglrc valid after auxInitWindow()
*/
HWND APIENTRY auxGetHWND(void);
HDC APIENTRY auxGetHDC(void);
HGLRC APIENTRY auxGetHGLRC(void);
/*
** Viewperf support functions and constants
*/
/* Display Mode Selection Criteria */
enum {
AUX_USE_ID = 1,
AUX_EXACT_MATCH,
AUX_MINIMUM_CRITERIA
};
void APIENTRY auxInitDisplayModePolicy(GLenum);
GLenum APIENTRY auxInitDisplayModeID(GLint);
GLenum APIENTRY auxGetDisplayModePolicy(void);
GLint APIENTRY auxGetDisplayModeID(void);
GLenum APIENTRY auxGetDisplayMode(void);
#ifdef __cplusplus
}
#endif
#endif /* __GLAUX_H__ */
-584
View File
@@ -1,584 +0,0 @@
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glu.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Utility Library.
--*/
#ifndef __glu_h__
#ifndef __GLU_H__
#define __glu_h__
#define __GLU_H__
#include <GL/gl.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright 1991-1993, Silicon Graphics, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of Silicon Graphics, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
*/
/*
** Return the error string associated with a particular error code.
** This will return 0 for an invalid error code.
**
** The generic function prototype that can be compiled for ANSI or Unicode
** is defined as follows:
**
** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
*/
#ifdef UNICODE
#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
#else
#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
#endif
const GLubyte* APIENTRY gluErrorString (
GLenum errCode);
const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
GLenum errCode);
const GLubyte* APIENTRY gluGetString (
GLenum name);
void APIENTRY gluOrtho2D (
GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top);
void APIENTRY gluPerspective (
GLdouble fovy,
GLdouble aspect,
GLdouble zNear,
GLdouble zFar);
void APIENTRY gluPickMatrix (
GLdouble x,
GLdouble y,
GLdouble width,
GLdouble height,
GLint viewport[4]);
void APIENTRY gluLookAt (
GLdouble eyex,
GLdouble eyey,
GLdouble eyez,
GLdouble centerx,
GLdouble centery,
GLdouble centerz,
GLdouble upx,
GLdouble upy,
GLdouble upz);
int APIENTRY gluProject (
GLdouble objx,
GLdouble objy,
GLdouble objz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *winx,
GLdouble *winy,
GLdouble *winz);
int APIENTRY gluUnProject (
GLdouble winx,
GLdouble winy,
GLdouble winz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *objx,
GLdouble *objy,
GLdouble *objz);
int APIENTRY gluScaleImage (
GLenum format,
GLint widthin,
GLint heightin,
GLenum typein,
const void *datain,
GLint widthout,
GLint heightout,
GLenum typeout,
void *dataout);
int APIENTRY gluBuild1DMipmaps (
GLenum target,
GLint components,
GLint width,
GLenum format,
GLenum type,
const void *data);
int APIENTRY gluBuild2DMipmaps (
GLenum target,
GLint components,
GLint width,
GLint height,
GLenum format,
GLenum type,
const void *data);
#ifdef __cplusplus
class GLUnurbs;
class GLUquadric;
class GLUtesselator;
/* backwards compatibility: */
typedef class GLUnurbs GLUnurbsObj;
typedef class GLUquadric GLUquadricObj;
typedef class GLUtesselator GLUtesselatorObj;
typedef class GLUtesselator GLUtriangulatorObj;
#else
typedef struct GLUnurbs GLUnurbs;
typedef struct GLUquadric GLUquadric;
typedef struct GLUtesselator GLUtesselator;
/* backwards compatibility: */
typedef struct GLUnurbs GLUnurbsObj;
typedef struct GLUquadric GLUquadricObj;
typedef struct GLUtesselator GLUtesselatorObj;
typedef struct GLUtesselator GLUtriangulatorObj;
#endif
GLUquadric* APIENTRY gluNewQuadric (void);
void APIENTRY gluDeleteQuadric (
GLUquadric *state);
void APIENTRY gluQuadricNormals (
GLUquadric *quadObject,
GLenum normals);
void APIENTRY gluQuadricTexture (
GLUquadric *quadObject,
GLboolean textureCoords);
void APIENTRY gluQuadricOrientation (
GLUquadric *quadObject,
GLenum orientation);
void APIENTRY gluQuadricDrawStyle (
GLUquadric *quadObject,
GLenum drawStyle);
void APIENTRY gluCylinder (
GLUquadric *qobj,
GLdouble baseRadius,
GLdouble topRadius,
GLdouble height,
GLint slices,
GLint stacks);
void APIENTRY gluDisk (
GLUquadric *qobj,
GLdouble innerRadius,
GLdouble outerRadius,
GLint slices,
GLint loops);
void APIENTRY gluPartialDisk (
GLUquadric *qobj,
GLdouble innerRadius,
GLdouble outerRadius,
GLint slices,
GLint loops,
GLdouble startAngle,
GLdouble sweepAngle);
void APIENTRY gluSphere (
GLUquadric *qobj,
GLdouble radius,
GLint slices,
GLint stacks);
void APIENTRY gluQuadricCallback (
GLUquadric *qobj,
GLenum which,
void (CALLBACK* fn)());
GLUtesselator* APIENTRY gluNewTess(
void );
void APIENTRY gluDeleteTess(
GLUtesselator *tess );
void APIENTRY gluTessBeginPolygon(
GLUtesselator *tess,
void *polygon_data );
void APIENTRY gluTessBeginContour(
GLUtesselator *tess );
void APIENTRY gluTessVertex(
GLUtesselator *tess,
GLdouble coords[3],
void *data );
void APIENTRY gluTessEndContour(
GLUtesselator *tess );
void APIENTRY gluTessEndPolygon(
GLUtesselator *tess );
void APIENTRY gluTessProperty(
GLUtesselator *tess,
GLenum which,
GLdouble value );
void APIENTRY gluTessNormal(
GLUtesselator *tess,
GLdouble x,
GLdouble y,
GLdouble z );
void APIENTRY gluTessCallback(
GLUtesselator *tess,
GLenum which,
void (CALLBACK *fn)());
void APIENTRY gluGetTessProperty(
GLUtesselator *tess,
GLenum which,
GLdouble *value );
GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
void APIENTRY gluDeleteNurbsRenderer (
GLUnurbs *nobj);
void APIENTRY gluBeginSurface (
GLUnurbs *nobj);
void APIENTRY gluBeginCurve (
GLUnurbs *nobj);
void APIENTRY gluEndCurve (
GLUnurbs *nobj);
void APIENTRY gluEndSurface (
GLUnurbs *nobj);
void APIENTRY gluBeginTrim (
GLUnurbs *nobj);
void APIENTRY gluEndTrim (
GLUnurbs *nobj);
void APIENTRY gluPwlCurve (
GLUnurbs *nobj,
GLint count,
GLfloat *array,
GLint stride,
GLenum type);
void APIENTRY gluNurbsCurve (
GLUnurbs *nobj,
GLint nknots,
GLfloat *knot,
GLint stride,
GLfloat *ctlarray,
GLint order,
GLenum type);
void APIENTRY
gluNurbsSurface(
GLUnurbs *nobj,
GLint sknot_count,
float *sknot,
GLint tknot_count,
GLfloat *tknot,
GLint s_stride,
GLint t_stride,
GLfloat *ctlarray,
GLint sorder,
GLint torder,
GLenum type);
void APIENTRY
gluLoadSamplingMatrices (
GLUnurbs *nobj,
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4] );
void APIENTRY
gluNurbsProperty (
GLUnurbs *nobj,
GLenum property,
GLfloat value );
void APIENTRY
gluGetNurbsProperty (
GLUnurbs *nobj,
GLenum property,
GLfloat *value );
void APIENTRY
gluNurbsCallback (
GLUnurbs *nobj,
GLenum which,
void (CALLBACK* fn)() );
/**** Callback function prototypes ****/
/* gluQuadricCallback */
typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
/* gluTessCallback */
typedef void (CALLBACK* GLUtessBeginProc) (GLenum);
typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
typedef void (CALLBACK* GLUtessVertexProc) (void *);
typedef void (CALLBACK* GLUtessEndProc) (void);
typedef void (CALLBACK* GLUtessErrorProc) (GLenum);
typedef void (CALLBACK* GLUtessCombineProc) (GLdouble[3],
void*[4],
GLfloat[4],
void** );
typedef void (CALLBACK* GLUtessBeginDataProc) (GLenum, void *);
typedef void (CALLBACK* GLUtessEdgeFlagDataProc) (GLboolean, void *);
typedef void (CALLBACK* GLUtessVertexDataProc) (void *, void *);
typedef void (CALLBACK* GLUtessEndDataProc) (void *);
typedef void (CALLBACK* GLUtessErrorDataProc) (GLenum, void *);
typedef void (CALLBACK* GLUtessCombineDataProc) (GLdouble[3],
void*[4],
GLfloat[4],
void**,
void* );
/* gluNurbsCallback */
typedef void (CALLBACK* GLUnurbsErrorProc) (GLenum);
/**** Generic constants ****/
/* Version */
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
/* Errors: (return value 0 = no error) */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
/* StringName */
#define GLU_VERSION 100800
#define GLU_EXTENSIONS 100801
/* Boolean */
#define GLU_TRUE GL_TRUE
#define GLU_FALSE GL_FALSE
/**** Quadric constants ****/
/* QuadricNormal */
#define GLU_SMOOTH 100000
#define GLU_FLAT 100001
#define GLU_NONE 100002
/* QuadricDrawStyle */
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
/* QuadricOrientation */
#define GLU_OUTSIDE 100020
#define GLU_INSIDE 100021
/* Callback types: */
/* GLU_ERROR 100103 */
/**** Tesselation constants ****/
#define GLU_TESS_MAX_COORD 1.0e150
/* TessProperty */
#define GLU_TESS_WINDING_RULE 100140
#define GLU_TESS_BOUNDARY_ONLY 100141
#define GLU_TESS_TOLERANCE 100142
/* TessWinding */
#define GLU_TESS_WINDING_ODD 100130
#define GLU_TESS_WINDING_NONZERO 100131
#define GLU_TESS_WINDING_POSITIVE 100132
#define GLU_TESS_WINDING_NEGATIVE 100133
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
/* TessCallback */
#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut) */
#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
void *polygon_data) */
#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
void *polygon_data) */
#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
void *polygon_data) */
#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
void *polygon_data) */
#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut,
void *polygon_data) */
/* TessError */
#define GLU_TESS_ERROR1 100151
#define GLU_TESS_ERROR2 100152
#define GLU_TESS_ERROR3 100153
#define GLU_TESS_ERROR4 100154
#define GLU_TESS_ERROR5 100155
#define GLU_TESS_ERROR6 100156
#define GLU_TESS_ERROR7 100157
#define GLU_TESS_ERROR8 100158
#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
/**** NURBS constants ****/
/* NurbsProperty */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_METHOD 100205
#define GLU_U_STEP 100206
#define GLU_V_STEP 100207
/* NurbsSampling */
#define GLU_PATH_LENGTH 100215
#define GLU_PARAMETRIC_ERROR 100216
#define GLU_DOMAIN_DISTANCE 100217
/* NurbsTrim */
#define GLU_MAP1_TRIM_2 100210
#define GLU_MAP1_TRIM_3 100211
/* NurbsDisplay */
/* GLU_FILL 100012 */
#define GLU_OUTLINE_POLYGON 100240
#define GLU_OUTLINE_PATCH 100241
/* NurbsCallback */
/* GLU_ERROR 100103 */
/* NurbsErrors */
#define GLU_NURBS_ERROR1 100251
#define GLU_NURBS_ERROR2 100252
#define GLU_NURBS_ERROR3 100253
#define GLU_NURBS_ERROR4 100254
#define GLU_NURBS_ERROR5 100255
#define GLU_NURBS_ERROR6 100256
#define GLU_NURBS_ERROR7 100257
#define GLU_NURBS_ERROR8 100258
#define GLU_NURBS_ERROR9 100259
#define GLU_NURBS_ERROR10 100260
#define GLU_NURBS_ERROR11 100261
#define GLU_NURBS_ERROR12 100262
#define GLU_NURBS_ERROR13 100263
#define GLU_NURBS_ERROR14 100264
#define GLU_NURBS_ERROR15 100265
#define GLU_NURBS_ERROR16 100266
#define GLU_NURBS_ERROR17 100267
#define GLU_NURBS_ERROR18 100268
#define GLU_NURBS_ERROR19 100269
#define GLU_NURBS_ERROR20 100270
#define GLU_NURBS_ERROR21 100271
#define GLU_NURBS_ERROR22 100272
#define GLU_NURBS_ERROR23 100273
#define GLU_NURBS_ERROR24 100274
#define GLU_NURBS_ERROR25 100275
#define GLU_NURBS_ERROR26 100276
#define GLU_NURBS_ERROR27 100277
#define GLU_NURBS_ERROR28 100278
#define GLU_NURBS_ERROR29 100279
#define GLU_NURBS_ERROR30 100280
#define GLU_NURBS_ERROR31 100281
#define GLU_NURBS_ERROR32 100282
#define GLU_NURBS_ERROR33 100283
#define GLU_NURBS_ERROR34 100284
#define GLU_NURBS_ERROR35 100285
#define GLU_NURBS_ERROR36 100286
#define GLU_NURBS_ERROR37 100287
/**** Backwards compatibility for old tesselator ****/
void APIENTRY gluBeginPolygon( GLUtesselator *tess );
void APIENTRY gluNextContour( GLUtesselator *tess,
GLenum type );
void APIENTRY gluEndPolygon( GLUtesselator *tess );
/* Contours types -- obsolete! */
#define GLU_CW 100120
#define GLU_CCW 100121
#define GLU_INTERIOR 100122
#define GLU_EXTERIOR 100123
#define GLU_UNKNOWN 100124
/* Names without "TESS_" prefix */
#define GLU_BEGIN GLU_TESS_BEGIN
#define GLU_VERTEX GLU_TESS_VERTEX
#define GLU_END GLU_TESS_END
#define GLU_ERROR GLU_TESS_ERROR
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
#ifdef __cplusplus
}
#endif
#endif /* __GLU_H__ */
#endif /* __glu_h__ */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-582
View File
@@ -1,582 +0,0 @@
#ifndef __wglext_h_
#define __wglext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2002/03/22 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define WGL_WGLEXT_VERSION 4
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
#endif
#ifndef WGL_ARB_multisample
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#endif
#ifndef WGL_ARB_extensions_string
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_STEREO_ARB 0x2012
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#endif
#ifndef WGL_ARB_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
#endif
#ifndef WGL_ARB_render_texture
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_NO_TEXTURE_ARB 0x2077
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_CUBE_MAP_FACE_ARB 0x207C
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
#endif
#ifndef WGL_EXT_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
#define WGL_ACCELERATION_EXT 0x2003
#define WGL_NEED_PALETTE_EXT 0x2004
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
#define WGL_SWAP_METHOD_EXT 0x2007
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
#define WGL_TRANSPARENT_EXT 0x200A
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
#define WGL_SHARE_DEPTH_EXT 0x200C
#define WGL_SHARE_STENCIL_EXT 0x200D
#define WGL_SHARE_ACCUM_EXT 0x200E
#define WGL_SUPPORT_GDI_EXT 0x200F
#define WGL_SUPPORT_OPENGL_EXT 0x2010
#define WGL_DOUBLE_BUFFER_EXT 0x2011
#define WGL_STEREO_EXT 0x2012
#define WGL_PIXEL_TYPE_EXT 0x2013
#define WGL_COLOR_BITS_EXT 0x2014
#define WGL_RED_BITS_EXT 0x2015
#define WGL_RED_SHIFT_EXT 0x2016
#define WGL_GREEN_BITS_EXT 0x2017
#define WGL_GREEN_SHIFT_EXT 0x2018
#define WGL_BLUE_BITS_EXT 0x2019
#define WGL_BLUE_SHIFT_EXT 0x201A
#define WGL_ALPHA_BITS_EXT 0x201B
#define WGL_ALPHA_SHIFT_EXT 0x201C
#define WGL_ACCUM_BITS_EXT 0x201D
#define WGL_ACCUM_RED_BITS_EXT 0x201E
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
#define WGL_DEPTH_BITS_EXT 0x2022
#define WGL_STENCIL_BITS_EXT 0x2023
#define WGL_AUX_BUFFERS_EXT 0x2024
#define WGL_NO_ACCELERATION_EXT 0x2025
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
#define WGL_FULL_ACCELERATION_EXT 0x2027
#define WGL_SWAP_EXCHANGE_EXT 0x2028
#define WGL_SWAP_COPY_EXT 0x2029
#define WGL_SWAP_UNDEFINED_EXT 0x202A
#define WGL_TYPE_RGBA_EXT 0x202B
#define WGL_TYPE_COLORINDEX_EXT 0x202C
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
#define WGL_PBUFFER_LARGEST_EXT 0x2033
#define WGL_PBUFFER_WIDTH_EXT 0x2034
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
#endif
#ifndef WGL_EXT_depth_float
#define WGL_DEPTH_FLOAT_EXT 0x2040
#endif
#ifndef WGL_3DFX_multisample
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
#define WGL_SAMPLES_3DFX 0x2061
#endif
#ifndef WGL_EXT_multisample
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
#define WGL_SAMPLES_EXT 0x2042
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
#endif
#ifndef WGL_I3D_gamma
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
#endif
#ifndef WGL_I3D_genlock
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
#endif
#ifndef WGL_I3D_swap_frame_lock
#endif
/*************************************************************/
#ifndef WGL_ARB_pbuffer
DECLARE_HANDLE(HPBUFFERARB);
#endif
#ifndef WGL_EXT_pbuffer
DECLARE_HANDLE(HPBUFFEREXT);
#endif
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif
#ifndef WGL_ARB_multisample
#define WGL_ARB_multisample 1
#endif
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
extern HDC WINAPI wglGetCurrentReadDCARB (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
#endif
#ifndef WGL_EXT_extensions_string
#define WGL_EXT_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#endif
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSwapIntervalEXT (int);
extern int WINAPI wglGetSwapIntervalEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
#endif
#ifndef WGL_EXT_depth_float
#define WGL_EXT_depth_float 1
#endif
#ifndef WGL_NV_vertex_array_range
#define WGL_NV_vertex_array_range 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
extern void WINAPI wglFreeMemoryNV (void *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#endif
#ifndef WGL_3DFX_multisample
#define WGL_3DFX_multisample 1
#endif
#ifndef WGL_EXT_multisample
#define WGL_EXT_multisample 1
#endif
#ifndef WGL_OML_sync_control
#define WGL_OML_sync_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
#endif
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
#endif
#ifndef WGL_I3D_swap_frame_lock
#define WGL_I3D_swap_frame_lock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableFrameLockI3D (void);
extern BOOL WINAPI wglDisableFrameLockI3D (void);
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
#endif
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif
#ifdef __cplusplus
}
#endif
#endif
+10 -20
View File
@@ -9,23 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3D.cpp $
* $Revision: 2.5 $
* $Date: 2003-03-02 05:43:48 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Code for our Direct3D renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2003/01/14 05:53:58 Goober5000
* commented out some mprintfs that were clogging up the debug spew
* --Goober5000
*
* Revision 2.3 2002/10/05 16:46:09 randomtiger
* Added us fs2_open people to the credits. Worth looking at just for that.
* Added timer bar code, by default its not compiled in.
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
* Added the new timebar files with the new code.
*
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
@@ -671,14 +661,14 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
OP_NOP( D3D_ex_ptr );
}
OP_TRIANGLE_LIST( (unsigned short)(dwVertexCount-2), D3D_ex_ptr );
OP_TRIANGLE_LIST( unsigned short(dwVertexCount-2), D3D_ex_ptr );
LPD3DTRIANGLE tri = ( LPD3DTRIANGLE )D3D_ex_ptr;
for (i=0; i<(int)dwVertexCount-2; i++ ) {
tri->v1 = (unsigned short)(D3D_num_verts+0);
tri->v2 = (unsigned short)(D3D_num_verts+i+1);
tri->v3 = (unsigned short)(D3D_num_verts+i+2);
tri->v1 = unsigned short(D3D_num_verts+0);
tri->v2 = unsigned short(D3D_num_verts+i+1);
tri->v3 = unsigned short(D3D_num_verts+i+2);
tri->wFlags = D3DTRIFLAG_EDGEENABLETRIANGLE;
tri++;
@@ -718,8 +708,8 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
for (i=0; i<(int)nlines; i++ ) {
LPD3DLINE line = (LPD3DLINE )D3D_ex_ptr;
line->v1 = (unsigned short)(D3D_num_verts);
line->v2 = (unsigned short)(D3D_num_verts+1);
line->v1 = unsigned short(D3D_num_verts);
line->v2 = unsigned short(D3D_num_verts+1);
D3D_ex_ptr = (void *)(((LPD3DLINE)D3D_ex_ptr) + 1);
}
@@ -1821,7 +1811,7 @@ void gr_d3d_flip()
}
ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
if ( ddrval == DDERR_SURFACELOST ) {
// mprintf(( "Front surface lost... attempting to restore...\n" ));
mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
// os poll?
+12 -54
View File
@@ -9,37 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
* $Revision: 2.10 $
* $Date: 2003-03-02 05:43:48 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Code to actually render stuff using Direct3D
*
* $Log: not supported by cvs2svn $
* Revision 2.9 2003/02/16 05:14:28 bobboau
* added glow map nebula bug fix for d3d, someone should add a fix for glide too
* more importantly I (think I) have fixed all major bugs with fighter beams, and added a bit of new functionality
*
* Revision 2.8 2003/01/20 05:40:49 bobboau
* added several sExps for turning glow points and glow maps on and off
*
* Revision 2.7 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.6 2003/01/09 21:20:21 phreak
* fixed a small error in bob's code
*
* Revision 2.5 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.4 2002/10/05 16:46:09 randomtiger
* Added us fs2_open people to the credits. Worth looking at just for that.
* Added timer bar code, by default its not compiled in.
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
* Added the new timebar files with the new code.
*
* Revision 2.3 2002/08/07 00:45:25 DTP
* Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
*
@@ -735,7 +711,6 @@ float flCAP( float x, float minx, float maxx)
}
#define NEBULA_COLORS 20
static float Interp_fog_level;
void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_scaler )
{
@@ -1000,11 +975,10 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
src_v++;
}
int ra = 0, ga = 0, ba = 0;
// if we're rendering against a fullneb background
if(flags & TMAP_FLAG_PIXEL_FOG){
int r, g, b;
// int ra, ga, ba;
int ra, ga, ba;
ra = ga = ba = 0;
// get the average pixel color behind the vertices
@@ -1024,26 +998,10 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
//this is my hack to get some sort of luminence mapping-Bobboau
if(GLOWMAP > 0){
gr_screen.gf_set_bitmap(GLOWMAP, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.0);
if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy )) {
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
return;
}
gr_d3d_set_state( TEXTURE_SOURCE_DECAL, ALPHA_BLEND_ALPHA_ADDITIVE, zbuffer_type );
for (i=0; i<nverts; i++ ) {
if(flags & TMAP_FLAG_PIXEL_FOG)d3d_verts[i].color = RGBA_MAKE((255 - ra), (255 - ga), (255 - ba), ((ba + ga + ra)/2));
else d3d_verts[i].color = RGBA_MAKE(255, 255, 255, 0);
}
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_FOG, ra, ga, ba);
}
// turn off fog
// if(flags & TMAP_FLAG_PIXEL_FOG){
// gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
// }
}
void gr_d3d_tmapper( int nverts, vertex **verts, uint flags )
@@ -1308,9 +1266,9 @@ void gr_d3d_reset_clip()
void gr_d3d_init_color(color *c, int r, int g, int b)
{
c->screen_sig = gr_screen.signature;
c->red = (unsigned char) r;
c->green = (unsigned char) g;
c->blue = (unsigned char) b;
c->red = unsigned char(r);
c->green = unsigned char(g);
c->blue = unsigned char(b);
c->alpha = 255;
c->ac_type = AC_TYPE_NONE;
c->alphacolor = -1;
@@ -1327,7 +1285,7 @@ void gr_d3d_init_alphacolor( color *clr, int r, int g, int b, int alpha, int typ
gr_d3d_init_color( clr, r, g, b );
clr->alpha = (unsigned char) alpha;
clr->alpha = unsigned char(alpha);
clr->ac_type = (ubyte)type;
clr->alphacolor = -1;
clr->is_alphacolor = 1;
+3 -10
View File
@@ -9,19 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DTexture.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:43:48 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Code to manage loading textures into VRAM for Direct3D
*
* $Log: not supported by cvs2svn $
* Revision 2.2 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.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -630,7 +624,7 @@ int d3d_create_texture_sub(int bitmap_type, int texture_handle, ushort *data, in
g /= Gr_ta_green.scale;
b /= Gr_ta_blue.scale;
a /= Gr_ta_alpha.scale;
xlat[i] = (unsigned short)(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
xlat[i] = unsigned short(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
}
xlat[15] = xlat[1];
@@ -969,7 +963,6 @@ int d3d_tcache_set(int bitmap_id, int bitmap_type, float *u_scale, float *v_scal
}
int n = bm_get_cache_slot( bitmap_id, 1 );
// if(n == -1)return -1;//for a bad handel, this was triping some assertion errors in the glowmap code
tcache_slot_d3d * t = &Textures[n];
if ( (D3D_last_bitmap_id == bitmap_id) && (D3D_last_bitmap_type==bitmap_type) && (t->bitmap_id == bitmap_id) && (D3D_last_section_x == sx) && (D3D_last_section_y == sy)) {
+5 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrDirectDraw.cpp $
* $Revision: 2.2 $
* $Date: 2003-01-14 05:53:58 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Code for software 8-bpp rendering using DirectDraw
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -422,7 +419,7 @@ TryFlipAgain:
HRESULT ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
if ( ddrval == DDERR_SURFACELOST ) {
// mprintf(( "Front surface lost... attempting to restore...\n" ));
mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
goto TryFlipAgain;
} else if (ddrval != DD_OK ) {
@@ -466,7 +463,7 @@ TryFlipAgain:
}
ddrval = lpFrontBuffer->Blt( &dst_rect, lpBackBuffer, &src_rect, DDBLT_WAIT, 0 );
if ( ddrval == DDERR_SURFACELOST ) {
// mprintf(( "Front surface lost... attempting to restore...\n" ));
mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
goto TryFlipAgain;
} else if (ddrval != DD_OK ) {
+6 -9
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrGlide.cpp $
* $Revision: 2.2 $
* $Date: 2003-03-02 05:43:49 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Code that uses 3DFX's Glide graphics library
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -2173,9 +2170,9 @@ void gr_glide_set_palette(ubyte *new_palette, int force_flag )
void gr_glide_init_color(color *c, int r, int g, int b)
{
c->screen_sig = gr_screen.signature;
c->red = (unsigned char)(r);
c->green = (unsigned char)(g);
c->blue = (unsigned char)(b);
c->red = unsigned char(r);
c->green = unsigned char(g);
c->blue = unsigned char(b);
c->alpha = 255;
c->ac_type = AC_TYPE_NONE;
c->alphacolor = -1;
@@ -2192,7 +2189,7 @@ void gr_glide_init_alphacolor( color *clr, int r, int g, int b, int alpha, int t
gr_glide_init_color( clr, r, g, b );
clr->alpha = (unsigned char)(alpha);
clr->alpha = unsigned char(alpha);
clr->ac_type = (ubyte)type;
clr->alphacolor = -1;
clr->is_alphacolor = 1;
+3 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrInternal.h $
* $Revision: 2.2 $
* $Date: 2003-01-18 19:49:02 $
* $Author: phreak $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Include file for our Graphics directory
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -220,7 +217,6 @@ extern int Gr_gamma_lookup[256];
#define TCACHE_TYPE_XPARENT 2 // Bitmap with 0,255,0 = transparent. Alpha=0 if transparent, 1 if not.
#define TCACHE_TYPE_NONDARKENING 3 // Bitmap with 255,255,255 = non-darkening. Alpha=1 if non-darkening, 0 if not.
#define TCACHE_TYPE_BITMAP_SECTION 4 // section of a bitmap
#define TCACHE_TYPE_COMPRESSED (1<<31)
#endif
File diff suppressed because it is too large. Load diff
+5 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrOpenGL.h $
* $Revision: 2.1 $
* $Date: 2003-03-07 00:15:45 $
* $Author: phreak $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
*
* Include file for OpenGL renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -39,8 +36,8 @@
#ifndef _GROPENGL_H
#define _GROPENGL_H
void gr_opengl_init(int reinit=0);
void gr_opengl_cleanup(int minimize=1);
void gr_opengl_init();
void gr_opengl_cleanup();
void gr_opengl_bitmap(int x, int y);
void gr_opengl_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
File diff suppressed because it is too large. Load diff
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrSoft.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:43:49 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Code for our software renderer using standard Win32 functions. (Dibsections, etc)
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -570,7 +567,7 @@ void gr_buffer_create( int w, int h, int bpp )
Gr_blue.mask = 0xff;
DibInfo.Header.biCompression = BI_RGB;
DibInfo.Header.biBitCount = (unsigned short)(bpp);
DibInfo.Header.biBitCount = unsigned short(bpp);
break;
default:
+10 -61
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/Scaler.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:45:04 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Routines to scale a bitmap.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -820,9 +817,8 @@ void gr8_scaler(vertex *va, vertex *vb )
spixels = (ubyte *)bp->data;
gr_lock();
#ifndef NO_SOFTWARE_RENDERING
Tmap.pScreenBits = (uint)gr_screen.offscreen_buffer_base;
#endif
uint *zbuf;
for (y=dy0; y<=dy1; v += dv, y++ ) {
@@ -840,8 +836,7 @@ void gr8_scaler(vertex *va, vertex *vb )
}
if ( Gr_scaler_zbuffering && gr_zbuffering ) {
// zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
}
#ifdef USE_COMPILED_CODE
@@ -881,7 +876,7 @@ void gr8_scaler(vertex *va, vertex *vb )
}
*/
#if defined _WIN32 && defined _MSC_VER
#ifdef _WIN32
_asm push esi
_asm push edi
_asm push edx
@@ -903,33 +898,8 @@ void gr8_scaler(vertex *va, vertex *vb )
_asm pop edx
_asm pop edi
_asm pop esi
#elif defined __GNUC__
asm(
"push %%esi;"
"push %%edi;"
"push %%edx;"
"push %%ecx;"
"push %%ebx;"
"push %%eax;"
"mov %0,%%ecx;" // lookup
"mov %1,%%esi;" // sbits
"mov %2,%%edi;" // dbits
"mov %3,%%eax;" // cc
"mov %4,%%edx;" // zbuf
"push %%ebp;"
"mov %5,%%ebp;" // Gr_global_z
"call *%%eax;"
"pop %%ebp;"
"pop %%eax;"
"pop %%ebx;"
"pop %%ecx;"
"pop %%edx;"
"pop %%edi;"
"pop %%esi;"
: /* no outputs */
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc), "g" (zbuf), "g" (Gr_global_z));
#else
#error asm not implemented
#warning not implemented
#endif
}
#else
@@ -1130,8 +1100,7 @@ void gr8_aascaler(vertex *va, vertex *vb )
int x, tmp_u;
tmp_u = u;
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
for (x=0; x<w; x++ ) {
if ( fx_w > *zbuf ) {
@@ -1144,7 +1113,7 @@ void gr8_aascaler(vertex *va, vertex *vb )
tmp_u += du;
}
} else {
#if defined _WIN32 && defined _MSC_VER
#ifdef _WIN32
_asm push esi
_asm push edi
_asm push ecx
@@ -1160,27 +1129,8 @@ void gr8_aascaler(vertex *va, vertex *vb )
_asm pop ecx
_asm pop edi
_asm pop esi
#elif defined __GNUC__
asm(
"push %%esi;"
"push %%edi;"
"push %%ecx;"
"push %%ebx;"
"push %%eax;"
"mov %0,%%ecx;" // lookup
"mov %1,%%esi;" // sbits
"mov %2,%%edi;" // dbits
"mov %3,%%eax;" // cc
"call *%%eax;"
"pop %%eax;"
"pop %%ebx;"
"pop %%ecx;"
"pop %%edi;"
"pop %%esi;"
: /* no outputs */
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc));
#else
#error asm not implemented
#warning not implemented
#endif
}
#else
@@ -1188,8 +1138,7 @@ void gr8_aascaler(vertex *va, vertex *vb )
int x, tmp_u;
tmp_u = u;
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
for (x=0; x<w; x++ ) {
if ( fx_w > *zbuf ) {
+4 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/Shade.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:40:28 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* Routines to shade an area.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -200,7 +197,7 @@ void gr8_shade(int x,int y,int w,int h)
int left_over = w1 % 4;
if ( wd4 > 0 ) {
#if defined _WIN32 && !defined __GNUC__
#ifdef _WIN32
_asm push eax
_asm push ebx
_asm push ecx
@@ -251,8 +248,7 @@ void gr8_shade(int x,int y,int w,int h)
_asm pop ebx
_asm pop eax
#else
#warning asm not implemented
Error(LOCATION, "asm not implemented");
#warning not implemented
#endif
}
+16 -20
View File
@@ -9,22 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.cpp $
* $Revision: 2.4 $
* $Date: 2003-01-19 07:02:15 $
* $Author: Goober5000 $
* $Revision: 2.2 $
* $Date: 2002-10-17 20:40:50 $
* $Author: randomtiger $
*
* C module that contains all the HUD functions at a high level
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2003/01/17 07:59:09 Goober5000
* fixed some really strange behavior with strings not being truncated at the
* # symbol
* --Goober5000
*
* 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:05 penguin
* The big include file move
*
@@ -2481,14 +2472,7 @@ void hud_support_view_blit()
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
} else {
if ( Hud_support_objnum == -1 ) {
if (The_mission.support_ships.arrival_location == ARRIVE_FROM_DOCK_BAY)
{
sprintf(outstr, XSTR( "exiting hangar", -1));
}
else
{
sprintf(outstr, XSTR( "warping in", 230));
}
sprintf(outstr, XSTR( "warping in", 230));
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
} else {
ai_info *aip;
@@ -3117,6 +3101,18 @@ void hud_maybe_render_multi_text()
}
#endif
// cut any text off after (and including) '#' char
void hud_end_string_at_first_hash_symbol(char *src)
{
char *pointer_to_last_char;
pointer_to_last_char = strstr(src, NOX("#"));
if ( pointer_to_last_char ) {
*pointer_to_last_char = 0;
}
}
// set the offset values for this render frame
void HUD_set_offsets(object *viewer_obj, int wiggedy_wack)
{
+6 -7
View File
@@ -9,17 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.h $
* $Revision: 2.3 $
* $Date: 2003-01-17 07:59:09 $
* $Author: Goober5000 $
* $Revision: 2.2 $
* $Date: 2002-10-17 20:40:50 $
* $Author: randomtiger $
*
* Header file for functions that contain HUD functions at a high level
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
@@ -351,6 +347,9 @@ void hud_start_text_flash(char *txt, int t);
// convert a string to use mono spaced numbers
void hud_num_make_mono(char *num_str);
// cut any text off after (and including) '#' char
void hud_end_string_at_first_hash_symbol(char *src);
// functions for handling hud animations
void hud_anim_init(hud_anim *ha, int sx, int sy, char *filename);
int hud_anim_render(hud_anim *ha, float frametime, int draw_alpha=0, int loop=1, int hold_last=0, int reverse=0);
+15 -22
View File
@@ -9,24 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDbrackets.cpp $
* $Revision: 2.4 $
* $Date: 2003-01-27 07:46:33 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* C file that contains functions for drawing target brackets on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/14 17:09:28 Goober5000
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
* --Goober5000
*
* Revision 2.2 2002/12/14 01:55:04 Goober5000
* added mission flag to show subsystem damage for fighterbays
* ~Goober5000~
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -238,7 +227,6 @@
#include "bmpman/bmpman.h"
#include "globalincs/linklist.h"
#include "weapon/emp.h"
#include "mission/missionparse.h"
#define FADE_FACTOR 2 // how much the bounding brackets get faded
#define LOWEST_RED 50 // lowest r value for bounding bracket
@@ -545,6 +533,16 @@ void draw_brackets_diamond_quick(int x1, int y1, int x2, int y2, int thick)
gr_line(center_x-x_delta, center_y+y_delta, center_x+x_delta, center_y-y_delta);
}
int subsys_is_fighterbay(ship_subsys *ss)
{
if ( !strnicmp(NOX("fighter"), ss->system_info->name, 7) ) {
return 1;
}
return 0;
}
// Draw bounding brackets for a subobject.
void draw_bounding_brackets_subobject()
{
@@ -610,13 +608,8 @@ void draw_bounding_brackets_subobject()
// determine if subsystem is on far or near side of the ship
Player->subsys_in_view = ship_subsystem_in_sight(targetp, subsys, &View_position, &subobj_pos, 0);
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
// Goober5000: this will now execute for fighterbays if the bay has been given a
// percentage subsystem strength in ships.tbl
// Goober5000: this will now execute for any subsys that takes damage and will not
// execute for any subsys that doesn't take damage
if ( (Player_ai->targeted_subsys->current_hits <= 0) && ( ship_subsys_takes_damage(Player_ai->targeted_subsys) ) )
{
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
if ( (Player_ai->targeted_subsys->current_hits <= 0) && (!subsys_is_fighterbay(Player_ai->targeted_subsys)) ) {
gr_set_color_fast(&IFF_colors[IFF_COLOR_MESSAGE][1]);
} else {
hud_set_iff_color( targetp, 1 );
+3 -10
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDconfig.cpp $
* $Revision: 2.3 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* C module to handle HUD configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/18 20:07:49 penguin
* Fixed bug (potential access of unitialized pointer) in hud_config_render_gauges() -- thanks to DTP for finding it!
*
@@ -506,10 +503,8 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
HC_gauge_region("HCB_38", 342, 138, 38, 0, 0, -1, 0, 0), // text flash gauge
HC_gauge_region("HCB_52", 465, 8, 52, 0, 0, -1, 0, 0), // comm menu
#ifndef FS2_DEMO
HC_gauge_region("HCB_46", 324, 264, 46, 0, 0, -1, 0, 0), // support view gauge
HC_gauge_region("HCB_47", 418, 262, 47, 0, 0, -1, 0, 0), // netlag icon gauge
#endif
//XSTR:ON
},
{ // GR_1024
@@ -551,10 +546,8 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
HC_gauge_region("2_HCB_38", 548, 222, 38, 0, 0, -1, 0, 0), // text flash gauge
HC_gauge_region("2_HCB_52", 744, 14, 52, 0, 0, -1, 0, 0), // comm menu
#ifndef FS2_DEMO
HC_gauge_region("2_HCB_46", 520, 422, 46, 0, 0, -1, 0, 0), // support view gauge
HC_gauge_region("2_HCB_47", 670, 419, 47, 0, 0, -1, 0, 0), // netlag icon gauge
#endif
//XSTR:ON
}
};
+6 -32
View File
@@ -9,24 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDescort.cpp $
* $Revision: 2.4 $
* $Date: 2003-01-18 09:25:41 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* C module for managing and displaying ships that are in an escort
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/31 07:26:40 Goober5000
* added damaged-escort-priority-all sexp
* --Goober5000
*
* Revision 2.2 2002/12/31 05:17:13 Goober5000
* fixed escort list behavior for stealthy ships
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -136,6 +125,9 @@ escort_info Escort_ships[MAX_ESCORT_SHIPS];
int Num_escort_ships;
// size of complete escort list, including all those wanting to get onto list but without space
#define MAX_COMPLETE_ESCORT_LIST 20
#define NUM_ESCORT_FRAMES 3
hud_frames Escort_gauges[NUM_ESCORT_FRAMES];
@@ -382,24 +374,6 @@ void hud_create_complete_escort_list(escort_info *escorts, int *num_escorts)
continue;
}
// don't process most stealth ships
if ( (Ships[objp->instance].flags2 & SF2_STEALTH) )
{
if ( Ships[objp->instance].team == TEAM_FRIENDLY )
{
// friendly stealths are only not seen when explicitly specified
if ( Ships[objp->instance].flags2 & SF2_FRIENDLY_STEALTH_INVIS )
{
continue;
}
}
// non-friendly stealths are never seen
else
{
continue;
}
}
// don't process ships that are dying, or objects that should be dead
if ( (Ships[objp->instance].flags & (SF_DYING|SF_DEPARTING)) || (objp->flags & OF_SHOULD_BE_DEAD) ){
continue;
+37 -129
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDets.cpp $
* $Revision: 2.2 $
* $Date: 2002-12-10 05:43:34 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* C file that contains code to manage and display the Energy Transfer System (ETS)
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -505,29 +502,12 @@ void hud_show_ets()
return;
}
// if at least two gauges are not shown, don't show any
i = 0;
if (Player_obj->flags & OF_NO_LASERS) i++;
if (Player_obj->flags & OF_NO_SHIELDS) i++;
if (Player_obj->flags & OF_NO_ENGINES) i++;
if (i >= 2) return;
hud_set_gauge_color(HUD_ETS_GAUGE);
// draw the letters for the gauges first, before any clipping occurs
i = 0;
for ( j = 0; j < 3; j++ )
{
if (j == 0 && Player_obj->flags & OF_NO_LASERS)
{
continue;
}
if (j == 1 && Player_obj->flags & OF_NO_SHIELDS)
{
continue;
}
if (j == 2 && Player_obj->flags & OF_NO_ENGINES)
{
for ( j = 0; j < 3; j++ ) {
if ( j == 1 && Player_obj->flags & OF_NO_SHIELDS ) {
continue;
}
Assert(Ets_gauge_info != NULL);
@@ -542,24 +522,15 @@ void hud_show_ets()
switch (j) {
case 0:
index = ship_p->weapon_recharge_index;
if ( Player_obj->flags & OF_NO_LASERS )
{
continue;
}
break;
case 1:
index = ship_p->shield_recharge_index;
if ( Player_obj->flags & OF_NO_SHIELDS )
{
if ( Player_obj->flags & OF_NO_SHIELDS ) {
continue;
}
break;
case 2:
index = ship_p->engine_recharge_index;
if ( Player_obj->flags & OF_NO_ENGINES )
{
continue;
}
break;
}
@@ -638,13 +609,13 @@ void set_default_recharge_rates(object* obj)
return;
ship_properties = 0;
if (!(obj->flags & OF_NO_LASERS))
if ( ship_info_p->max_weapon_reserve )
ship_properties |= HAS_WEAPONS;
if (!(obj->flags & OF_NO_SHIELDS))
ship_properties |= HAS_SHIELDS;
if (!(obj->flags & OF_NO_ENGINES))
if ( ship_info_p->max_speed )
ship_properties |= HAS_ENGINES;
// the default charge rate depends on what systems are on each ship
@@ -709,74 +680,43 @@ void increase_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
switch ( ship_system ) {
case WEAPONS:
if ( obj->flags & OF_NO_LASERS )
return;
gain_index = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->shield_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
lose_index1 = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
lose_index2 = NULL;
else
lose_index2 = &ship_p->engine_recharge_index;
} else {
lose_index2 = &ship_p->shield_recharge_index;
}
break;
case SHIELDS:
if ( obj->flags & OF_NO_SHIELDS )
if ( obj->flags & OF_NO_SHIELDS ) {
return;
}
gain_index = &ship_p->shield_recharge_index;
if ( obj->flags & OF_NO_LASERS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
lose_index2 = NULL;
else
lose_index2 = &ship_p->engine_recharge_index;
lose_index1 = &ship_p->weapon_recharge_index;
lose_index2 = &ship_p->engine_recharge_index;
break;
case ENGINES:
if ( obj->flags & OF_NO_ENGINES )
return;
gain_index = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_LASERS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
lose_index2 = NULL;
else
} else {
lose_index2 = &ship_p->shield_recharge_index;
}
break;
} // end switch
// return if we can't transfer energy
if (!lose_index1 && !lose_index2)
return;
// already full, nothing to do
count = MAX_ENERGY_INDEX - *gain_index;
if ( count > 2 )
count = 2;
if ( count <= 0 )
{
if ( obj == Player_obj )
{
if ( count <= 0 ) {
if ( obj == Player_obj ) {
snd_play( &Snds[SND_ENERGY_TRANS_FAIL], 0.0f );
}
return;
@@ -830,65 +770,39 @@ void decrease_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
switch ( ship_system ) {
case WEAPONS:
if ( obj->flags & OF_NO_LASERS )
return;
lose_index = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
if ( obj->flags & OF_NO_SHIELDS ) {
gain_index1 = NULL;
else
} else {
gain_index1 = &ship_p->shield_recharge_index;
}
if ( obj->flags & OF_NO_ENGINES )
gain_index2 = NULL;
else
gain_index2 = &ship_p->engine_recharge_index;
gain_index2 = &ship_p->engine_recharge_index;
break;
case SHIELDS:
if ( obj->flags & OF_NO_SHIELDS )
if ( obj->flags & OF_NO_SHIELDS ) {
return;
}
lose_index = &ship_p->shield_recharge_index;
if ( obj->flags & OF_NO_LASERS )
gain_index1 = NULL;
else
gain_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
gain_index2 = NULL;
else
gain_index2 = &ship_p->engine_recharge_index;
gain_index1 = &ship_p->weapon_recharge_index;
gain_index2 = &ship_p->engine_recharge_index;
break;
case ENGINES:
if ( obj->flags & OF_NO_ENGINES )
return;
lose_index = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_LASERS )
if ( obj->flags & OF_NO_SHIELDS ) {
gain_index1 = NULL;
else
gain_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
gain_index2 = NULL;
else
gain_index2 = &ship_p->shield_recharge_index;
} else {
gain_index1 = &ship_p->shield_recharge_index;
}
gain_index2 = &ship_p->weapon_recharge_index;
break;
} // end switch
// return if we can't transfer energy
if (!gain_index1 && !gain_index2)
return;
// check how much there is to lose
count = min(2, *lose_index);
if ( count <= 0 ) {
@@ -968,8 +882,7 @@ void transfer_energy_to_shields(object* obj)
if (ship_p->flags & SF_DYING)
return;
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
{
if ( obj->flags & OF_NO_SHIELDS ) {
return;
}
@@ -987,11 +900,6 @@ void transfer_energy_to_weapons(object* obj)
if (ship_p->flags & SF_DYING)
return;
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
{
return;
}
transfer_energy_weapon_common(obj, get_shield_strength(obj), ship_p->weapon_energy, &ship_p->target_shields_delta, &ship_p->target_weapon_energy_delta, sinfo_p->max_weapon_reserve, 1.0f);
}
+3 -10
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDgauges.h $
* $Revision: 2.1 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
*
* HUD data common to FRED and FreeSpace
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -83,11 +80,7 @@
#define __HUD_COMMON_H__
// HUD gauge types
#ifdef FS2_DEMO
#define NUM_HUD_GAUGES 37
#else
#define NUM_HUD_GAUGES 39
#endif
#define HUD_LEAD_INDICATOR 0
#define HUD_ORIENTATION_TEE 1
+3 -10
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDshield.h $
* $Revision: 2.1 $
* $Date: 2003-01-06 17:14:52 $
* $Author: Goober5000 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
*
* Header file for the display and management of the HUD shield
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -92,8 +89,4 @@ void hud_shield_hit_reset(int player=0);
void shield_info_reset(shield_hit_info *shi);
// random page in stuff - moved here by Goober5000
extern void hud_ship_icon_page_in(ship_info *sip);
#endif /* __FREESPACE_HUDSHIELDBOX_H__ */
+6 -23
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDsquadmsg.cpp $
* $Revision: 2.2 $
* $Date: 2003-01-19 22:20:23 $
* $Author: Goober5000 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
*
* File to control sqaudmate messaging
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -1177,27 +1174,13 @@ void hud_squadmsg_repair_rearm_abort( int toggle_state, object *obj)
hud_squadmsg_toggle(); // take us out of message mode
}
// Goober5000 - redone and added a bit
// returns 1 if an order is valid for a ship. Applies to things like departure when engines are blown, etc.
int hud_squadmsg_ship_order_valid( int shipnum, int order )
{
switch ( order )
{
case DEPART_ITEM:
// disabled ships can't depart.
if (Ships[shipnum].flags & SF_DISABLED)
return 0;
// disabled ships can't depart.
if ( (order == DEPART_ITEM) && (Ships[shipnum].flags & SF_DISABLED) )
return 0;
// Goober5000: also can't depart if no subspace drives and no capships in the area
if (Ships[shipnum].flags2 & SF2_NO_SUBSPACE_DRIVE)
{
// locate a capital ship on the same team:
if (ship_get_ship_with_dock_bay(Ships[shipnum].team) < 0)
return 0;
}
break;
}
return 1;
}
+93 -359
View File
@@ -9,52 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $
* $Revision: 2.12 $
* $Date: 2003-01-17 07:59:09 $
* $Author: Goober5000 $
* $Revision: 2.2 $
* $Date: 2002-09-20 20:02:00 $
* $Author: phreak $
*
* C module to provide HUD targeting functions
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2003/01/03 21:58:08 Goober5000
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
* has primitive sensors it can't target anything and objects don't appear
* on radar if they're outside a certain range. This range can be modified
* via the sexp primitive-sensors-set-range.
* --Goober5000
*
* Revision 2.10 2002/12/31 19:18:41 Goober5000
* if it ain't broke, don't fix it
* --Goober5000
*
* Revision 2.8 2002/12/22 21:31:01 Goober5000
* tweaked positioning of the new HUD graphics
* --Goober5000
*
* Revision 2.7 2002/12/21 18:03:49 Goober5000
* commented out the warning if you don't have the new ballistic HUD graphics - it would probably get annoying (just use the old ones without comment)
* --Goober5000
*
* Revision 2.6 2002/12/19 10:54:37 Goober5000
* oops - squashed a bug :)
* --Goober5000
*
* Revision 2.5 2002/12/19 10:46:14 Goober5000
* implemented the revised HUD weapon display for ballistic primaries
* --Goober5000
*
* Revision 2.4 2002/12/13 08:13:30 Goober5000
* small tweaks and bug fixes for the ballistic primary conversion
* ~Goober5000~
*
* Revision 2.3 2002/12/10 05:42:42 Goober5000
* Full-fledged ballistic primary support added! Try it and see! :)
*
* Fixed lead indicator behavior; Phreak's version didn't work properly.
*
* Revision 2.2 2002/09/20 20:02:00 phreak
* lead indicator for dumbfire missiles
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
@@ -324,8 +285,6 @@ float Max_front_seperation[GR_NUM_RESOLUTIONS] = {
// This means the variables are not player-specific
static int Target_in_reticle = 0;
static int ballistic_hud_index = 0; // Goober5000
extern object obj_used_list; // dummy node in linked list of active objects
extern char *Cargo_names[];
@@ -524,97 +483,47 @@ static int Toggle_text_alpha = 255;
// animation files for the weapons gauge
#define NUM_WEAPON_GAUGES 5
#define NUM_HUD_SETTINGS 2
hud_frames Weapon_gauges[NUM_HUD_SETTINGS][NUM_WEAPON_GAUGES];
hud_frames Weapon_gauges[NUM_WEAPON_GAUGES];
int Weapon_gauges_loaded = 0;
// for primaries
int Weapon_gauge_primary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][3][2] =
{
{ // normal HUD
{ // GR_640
// based on the # of primaries
{509, 273}, // top of weapon gauge, first frame, always
{497, 293}, // for the first primary
{497, 305} // for the second primary
},
{ // GR_1024
// based on the # of primaries
{892, 525}, // top of weapon gauge, first frame, always
{880, 545}, // for the first primary
{880, 557} // for the second primary
}
int Weapon_gauge_primary_coords[GR_NUM_RESOLUTIONS][3][2] = {
{ // GR_640
// based on the # of primaries
{509, 273}, // top of weapon gauge, first frame, always
{497, 293}, // for the first primary
{497, 305} // for the second primary
},
{ // ballistic HUD - slightly different alignment
{ // GR_640
// based on the # of primaries
{485, 273}, // top of weapon gauge, first frame, always
{485, 293}, // for the first primary
{485, 305} // for the second primary
},
{ // GR_1024
// based on the # of primaries
{868, 525}, // top of weapon gauge, first frame, always
{868, 545}, // for the first primary
{868, 557} // for the second primary
}
{ // GR_1024
// based on the # of primaries
{892, 525}, // top of weapon gauge, first frame, always
{880, 545}, // for the first primary
{880, 557} // for the second primary
}
};
int Weapon_gauge_secondary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][5][2] =
{
{ // normal HUD
{ // GR_640
// based on the # of secondaries
{497, 318}, // bottom of gauge, 0 secondaries
{497, 318}, // bottom of gauge, 1 secondaries
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 335} // bottom of gauge, 3 secondaries
},
{ // GR_1024
// based on the # of secondaries
{880, 570}, // bottom of gauge, 0 secondaries
{880, 570}, // bottom of gauge, 1 secondaries
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 587} // bottom of gauge, 3 secondaries
}
int Weapon_gauge_secondary_coords[GR_NUM_RESOLUTIONS][5][2] = {
{ // GR_640
// based on the # of secondaries
{497, 318}, // bottom of gauge, 0 secondaries
{497, 318}, // bottom of gauge, 1 secondaries
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 335} // bottom of gauge, 3 secondaries
},
{ // ballistic HUD - slightly different alignment
{ // GR_640
// based on the # of secondaries
{485, 318}, // bottom of gauge, 0 secondaries
{485, 318}, // bottom of gauge, 1 secondaries
{485, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{485, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{485, 335} // bottom of gauge, 3 secondaries
},
{ // GR_1024
// based on the # of secondaries
{868, 570}, // bottom of gauge, 0 secondaries
{868, 570}, // bottom of gauge, 1 secondaries
{868, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{868, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{868, 587} // bottom of gauge, 3 secondaries
}
{ // GR_1024
// based on the # of secondaries
{880, 570}, // bottom of gauge, 0 secondaries
{880, 570}, // bottom of gauge, 1 secondaries
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 587} // bottom of gauge, 3 secondaries
}
};
int Weapon_title_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][2] =
{
{ // normal HUD
{ // GR_640
518, 274
},
{ // GR_1024
901, 527
}
int Weapon_title_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
518, 275
},
{ // ballistic HUD - slightly different alignment
{ // GR_640
487, 274
},
{ // GR_1024
870, 527
}
{ // GR_1024
901, 527
}
};
int Weapon_plink_coords[GR_NUM_RESOLUTIONS][2][2] = {
@@ -657,16 +566,6 @@ int Weapon_secondary_y[GR_NUM_RESOLUTIONS][3] = {
579 // y location of where to draw text for the third secondary
}
};
int Weapon_primary_y[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
285, // y location of where to draw text for the first primary
295 // y location of where to draw text for the second primary
},
{ // GR_1024
537, // y location of where to draw text for the first primary
547 // y location of where to draw text for the second primary
}
};
int Weapon_secondary_name_x[GR_NUM_RESOLUTIONS] = {
536, // x location of where to draw weapon name
919
@@ -675,48 +574,26 @@ int Weapon_secondary_ammo_x[GR_NUM_RESOLUTIONS] = {
525, // x location of where to draw weapon ammo count
908
};
int Weapon_primary_ammo_x[GR_NUM_RESOLUTIONS] = {
525, // x location of where to draw primary weapon ammo count
908
};
int Weapon_secondary_reload_x[GR_NUM_RESOLUTIONS] = {
615, // x location of where to draw the weapon reload time
998
};
char *Weapon_gauge_fnames[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
char *Weapon_gauge_fnames[GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
{
//XSTR:OFF
{ // normal HUD
{ // GR_640
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
},
{ // GR_1024
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
}
},
{ // ballistic HUD - slightly different alignment
{ // GR_640
"weapons1_b",
"weapons2_b",
"weapons3_b",
"weapons4_b",
"weapons5_b"
},
{ // GR_1024
"weapons1_b",
"weapons2_b",
"weapons3_b",
"weapons4_b",
"weapons5_b"
}
{ // GR_640
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
},
{ // GR_1024
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
}
//XSTR:ON
};
@@ -758,7 +635,7 @@ int hud_target_invalid_awacs(object *objp)
// if objp is ship object, first check if can be targeted with team info
if (objp->type == OBJ_SHIP) {
if (Player_ship != NULL) {
if (ship_is_visible_by_team_new(objp, Player_ship)) {
if (ship_is_visible_by_team(objp->instance, Player_ship->team)) {
return 0;
}
}
@@ -1050,8 +927,8 @@ object *hud_reticle_pick_target()
return return_objp;
}
// hud_target_hotkey_add_remove takes as its parameter which hotkey (1-0) to add/remove the current
// target from. This function behaves like the Shift-<selection> does in Windows -- using shift # will toggle
// hud_target_hotkey_add_remove takes as it's parameter which hotkey (1-0) to add/remove the current
// target from. This functio behaves like the Shift-<selection> does in Windows -- using shift # will toggle
// the current target in and out of the selection set.
void hud_target_hotkey_add_remove( int k, object *ctarget, int how_to_add )
{
@@ -1280,7 +1157,7 @@ void hud_keyed_targets_clear()
// Init data used for the weapons display on the HUD
void hud_weapons_init()
{
int i, j, k, hud_index, gauge_index, hud_warned;
int i;
Weapon_flash_info.is_bright = 0;
for ( i = 0; i < MAX_WEAPON_FLASH_LINES; i++ ) {
@@ -1288,71 +1165,13 @@ void hud_weapons_init()
Weapon_flash_info.flash_next[i] = 1;
}
if ( !Weapon_gauges_loaded )
{
hud_warned = 0;
for (hud_index = 0; hud_index < NUM_HUD_SETTINGS; hud_index++)
{
for ( gauge_index = 0; gauge_index < NUM_WEAPON_GAUGES; gauge_index++ )
{
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
// file not found?
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
{
// if this is the ballistic hud setting, load the conventional ani
if (hud_index)
{
// give a single warning
if (!hud_warned)
{
// commented because it gets annoying, and the warning really isn't needed anyway - Goober5000
//Warning(LOCATION, "Warning: Ballistic HUD graphics not found. Defaulting to original graphics.\n");
hud_warned = 1;
}
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[0][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
// and test again
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
{
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
}
}
// otherwise, display the regular warning
else
{
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
}
}
if ( !Weapon_gauges_loaded ) {
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
Weapon_gauges[i].first_frame = bm_load_animation(Weapon_gauge_fnames[gr_screen.res][i], &Weapon_gauges[i].num_frames);
if ( Weapon_gauges[i].first_frame < 0 ) {
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[gr_screen.res][i]);
}
}
// reset the old coordinates if hud_warned
if (hud_warned)
{
// don't reset the first one, but reset all others
for (hud_index = 1; hud_index < NUM_HUD_SETTINGS; hud_index++)
{
for (i = 0; i < GR_NUM_RESOLUTIONS; i++)
{
for (k = 0; k < 2; k++)
{
for (j = 0; j < 3; j++)
{
Weapon_gauge_primary_coords[hud_index][i][j][k] = Weapon_gauge_primary_coords[0][i][j][k];
}
for (j = 0; j < 5; j++)
{
Weapon_gauge_secondary_coords[hud_index][i][j][k] = Weapon_gauge_secondary_coords[0][i][j][k];
}
Weapon_title_coords[hud_index][i][k] = Weapon_title_coords[0][i][k];
}
}
}
}
Weapon_gauges_loaded = 1;
}
}
@@ -1372,19 +1191,6 @@ void hud_init_targeting()
{
Assert(Player_ai != NULL);
int i;
// decide whether to realign HUD for ballistic primaries
ballistic_hud_index = 0;
for (i = 0; i < Player_ship->weapons.num_primary_banks; i++)
{
if (Weapon_info[Player_ship->weapons.primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
{
ballistic_hud_index = 1;
break;
}
}
// make sure there is no current target
set_target_objnum( Player_ai, -1 );
Player_ai->last_target = -1;
@@ -1450,6 +1256,8 @@ void hud_init_targeting()
} else {
Toggle_text_alpha = 160;
}
}
// Target the next or previous subobject on the currently selected ship, based on next_flag.
@@ -3380,7 +3188,7 @@ void hud_show_remote_detonate_missile()
}
}
// routine to possibly draw a bounding box around a ship sending a message to the player
// routine to possibly draw a bouding box around a ship sending a message to the player
void hud_show_message_sender()
{
object *targetp;
@@ -4006,28 +3814,18 @@ int hud_get_best_primary_bank(float *range)
num_to_test = min(1, swp->num_primary_banks);
}
for ( i = 0; i < num_to_test; i++ )
{
bank_to_fire = (swp->current_primary_bank+i)%MAX_SUPPORTED_PRIMARY_BANKS; // Max supported banks is 2
for ( i = 0; i < num_to_test; i++ ) {
bank_to_fire = (swp->current_primary_bank+i)%2; // Max supported banks is 2
// calculate the range of the weapon, and only display the lead target indicator
// calculate the range of the weapon, and only display the lead target indicator when
// if the weapon can actually hit the target
Assert(bank_to_fire >= 0);
Assert(swp->primary_bank_weapons[bank_to_fire] >= 0);
wip = &Weapon_info[swp->primary_bank_weapons[bank_to_fire]];
weapon_range = wip->max_speed * wip->lifetime;
// don't consider this primary if it's a ballistic that's out of ammo - Goober5000
if ( wip->wi_flags2 & WIF2_BALLISTIC )
{
if ( swp->primary_bank_ammo[bank_to_fire] <= 0)
{
continue;
}
}
if ( weapon_range > farthest_weapon_range )
{
if ( weapon_range > farthest_weapon_range ) {
best_bank = bank_to_fire;
farthest_weapon_range = weapon_range;
}
@@ -4177,24 +3975,17 @@ void hud_show_lead_indicator(vector *target_world_pos)
srange = ship_get_secondary_weapon_range(Player_ship);
if ( swp->current_secondary_bank >= 0 )
{
if ( swp->current_secondary_bank >= 0 ) {
int bank = swp->current_secondary_bank;
tmp = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( tmp->wi_flags & WIF_HOMING_ASPECT )
{
if ( !Player->target_in_lock_cone )
{
if ( tmp->wi_flags & WIF_HOMING_ASPECT ) {
if ( !Player->target_in_lock_cone ) {
srange = -1.0f;
}
}
}
frame_offset = hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
/* Commented out by Goober5000, because it's a bit buggy. The original Volition code
// is A-1 SUPAR and ought to work for dumbfires as well. O_o
--------------- Phreak's Non-Working Code (TM) ------------
//frame_offset=hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
if (dist_to_target < prange)
{
frame_offset=2;
@@ -4215,11 +4006,10 @@ void hud_show_lead_indicator(vector *target_world_pos)
{
if((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
{
frame_offset=0; // and this probably should be 2 - Goober5000
frame_offset=0;
}
}
}
----------------------------------------------------------- */
if ( frame_offset < 0 ) {
return;
@@ -4827,26 +4617,16 @@ void hud_show_weapon_energy_gauge()
float percent_left;
int clip_h, i, w, h;
if ( Energy_bar_gauges.first_frame == -1 )
{
if ( Energy_bar_gauges.first_frame == -1 ){
return;
}
if ( Player_ship->weapons.num_primary_banks <= 0 )
{
if ( Player_ship->weapons.num_primary_banks <= 0 ){
return;
}
// also leave if no energy can be stored for weapons
if (Objects[Player_ship->objnum].flags & OF_NO_LASERS)
{
return;
}
percent_left = Player_ship->weapon_energy/Ship_info[Player_ship->ship_info_index].max_weapon_reserve;
if ( percent_left > 1 )
{
if ( percent_left > 1 ) {
percent_left = 1.0f;
}
@@ -4861,12 +4641,9 @@ void hud_show_weapon_energy_gauge()
}
hud_set_gauge_color(HUD_WEAPONS_ENERGY);
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ )
{
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) )
{
if ( Weapon_flash_info.is_bright & (1<<i) )
{
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ ) {
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) ) {
if ( Weapon_flash_info.is_bright & (1<<i) ) {
// hud_set_bright_color();
hud_set_gauge_color(HUD_WEAPONS_ENERGY, HUD_C_BRIGHT);
break;
@@ -4931,7 +4708,7 @@ void hud_show_target_triangle_indicator(vertex *projected_v)
}
}
// called from hud_show_weapons() to plot out the secondary weapon name and ammo
// called from hud_show_weapons() to plot out the secondary weapon name and amo
void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
{
char ammo_str[32];
@@ -4955,7 +4732,7 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
strcpy(weapon_name, wip->name);
}
end_string_at_first_hash_symbol(weapon_name);
hud_end_string_at_first_hash_symbol(weapon_name);
if ( sw->current_secondary_bank == i ) {
emp_hud_printf(Weapon_sunlinked_x[gr_screen.res], Weapon_secondary_y[gr_screen.res][i] - np*12, EG_NULL, "%c", Lcl_special_chars + 2);
@@ -4987,29 +4764,6 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
}
}
// called from hud_show_weapons() to plot out the primary weapon ammo - Goober5000
void hud_show_primary_weapon_ammo(int count, ship_weapon *sw)
{
char ammo_str[32];
int i, w, h;
for ( i = 0; i < count; i++ )
{
// for all ballistic weapons
if (Weapon_info[sw->primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
{
// print out the ammo right justified
sprintf(ammo_str, "%d", sw->primary_bank_ammo[i]);
hud_num_make_mono(ammo_str);
gr_get_string_size(&w, &h, ammo_str);
emp_hud_string(Weapon_primary_ammo_x[gr_screen.res] - w, Weapon_primary_y[gr_screen.res][i], EG_NULL, ammo_str);
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
}
}
}
// start the weapon line (on the HUD) flashing
void hud_start_flash_weapon(int index)
{
@@ -5084,8 +4838,6 @@ void hud_show_cmeasure_gague()
void hud_show_weapons()
{
ship_weapon *sw;
int ship_is_ballistic;
int np, ns; // np == num primary, ns == num secondary
char name[NAME_LENGTH];
@@ -5096,7 +4848,6 @@ void hud_show_weapons()
Assert(Player_obj->instance >= 0 && Player_obj->instance < MAX_SHIPS);
sw = &Ships[Player_obj->instance].weapons;
ship_is_ballistic = (Ship_info[Ships[Player_obj->instance].ship_info_index].flags & SIF_BALLISTIC_PRIMARIES);
np = sw->num_primary_banks;
ns = sw->num_secondary_banks;
@@ -5109,14 +4860,14 @@ void hud_show_weapons()
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
// draw top of primary display
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][0].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][1]);
GR_AABITMAP(Weapon_gauges[0].first_frame, Weapon_gauge_primary_coords[gr_screen.res][0][0], Weapon_gauge_primary_coords[gr_screen.res][0][1]);
emp_hud_string(Weapon_title_coords[ballistic_hud_index][gr_screen.res][0], Weapon_title_coords[ballistic_hud_index][gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
emp_hud_string(Weapon_title_coords[gr_screen.res][0], Weapon_title_coords[gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
switch ( np ) {
case 0:
// draw bottom of border
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P1, XSTR( "<none>", 329));
@@ -5125,7 +4876,7 @@ void hud_show_weapons()
case 1:
// draw bottom of border
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
if (Lcl_gr) {
@@ -5142,20 +4893,14 @@ void hud_show_weapons()
emp_hud_printf(Weapon_plink_coords[gr_screen.res][0][0], Weapon_plink_coords[gr_screen.res][0][1], EG_NULL, "%c", Lcl_special_chars + 2);
emp_hud_printf(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P2, "%s", name);
// check ballistic - Goober5000
if (ship_is_ballistic)
{
hud_show_primary_weapon_ammo(1, sw);
}
break;
case 2:
// draw border to accomodate second primary weapon
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][1].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[1].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
// draw bottom of border
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][1]);
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][2][0], Weapon_gauge_primary_coords[gr_screen.res][2][1]);
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
if (Lcl_gr) {
@@ -5190,13 +4935,6 @@ void hud_show_weapons()
}
emp_hud_printf(Weapon_pname_coords[gr_screen.res][1][0], Weapon_pname_coords[gr_screen.res][1][1], EG_WEAPON_P2, "%s", name);
np = 0;
// check ballistic - Goober5000
if (ship_is_ballistic)
{
hud_show_primary_weapon_ammo(2, sw);
}
break;
default:
@@ -5210,37 +4948,37 @@ void hud_show_weapons()
switch ( ns ) {
case 0:
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][1] - 12*np - 1);
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][0][0], Weapon_gauge_secondary_coords[gr_screen.res][0][1] - 12*np - 1);
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_secondary_y[gr_screen.res][0] - np*12, EG_WEAPON_S1, XSTR( "<none>", 329));
break;
case 1:
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][1] - 12*np - 1);
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][1][0], Weapon_gauge_secondary_coords[gr_screen.res][1][1] - 12*np - 1);
hud_show_secondary_weapon(1, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
case 2:
// draw the middle border, only present when there are 2 or more secondaries
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - 12*np);
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - 12*np);
hud_show_secondary_weapon(2, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
case 3:
// draw the middle border, only present when there are 2 or more secondaries
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
// draw the bottm border, only present when there are 3 secondaries
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - np*12);
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - np*12);
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][1] - 12*np);
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][4][0], Weapon_gauge_secondary_coords[gr_screen.res][4][1] - 12*np);
hud_show_secondary_weapon(3, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
@@ -5497,10 +5235,6 @@ void hud_show_auto_icons()
if ( Toggle_gauge.first_frame == -1 )
return;
// don't draw auto icons if we have primitive sensors - Goober5000
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
return;
// display auto target icon
if ( hud_gauge_active(HUD_AUTO_TARGET) ) {
show_flag=1;
@@ -5928,7 +5662,7 @@ void hudtarget_page_in()
int i;
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
bm_page_in_aabitmap( Weapon_gauges[ballistic_hud_index][i].first_frame, Weapon_gauges[ballistic_hud_index][i].num_frames);
bm_page_in_aabitmap( Weapon_gauges[i].first_frame, Weapon_gauges[i].num_frames);
}
bm_page_in_aabitmap( Lead_indicator_gauge.first_frame, Lead_indicator_gauge.num_frames);
bm_page_in_aabitmap( Energy_bar_gauges.first_frame, Energy_bar_gauges.num_frames);
+23 -69
View File
@@ -9,54 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
* $Revision: 2.13 $
* $Date: 2003-01-27 07:46:33 $
* $Author: Goober5000 $
* $Revision: 2.4 $
* $Date: 2002-10-22 23:02:40 $
* $Author: randomtiger $
*
* C module for drawing the target monitor box on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.12 2003/01/17 07:59:09 Goober5000
* fixed some really strange behavior with strings not being truncated at the
* # symbol
* --Goober5000
*
* Revision 2.11 2003/01/17 01:48:50 Goober5000
* added capability to the $Texture replace code to substitute the textures
* without needing and extra model, however, this way you can't substitute
* transparent or animated textures
* --Goober5000
*
* Revision 2.10 2003/01/15 20:49:10 Goober5000
* did the XSTR for the turret thing
* --Goober5000
*
* Revision 2.9 2003/01/15 16:52:27 Goober5000
* oops, that'll introduce a bug - naming it just plain "Turret" instead
* --Goober5000
*
* Revision 2.8 2003/01/15 16:48:59 Goober5000
* capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
* --Goober5000
*
* Revision 2.7 2003/01/15 07:09:09 Goober5000
* changed most references to modelnum to use ship instead of ship_info --
* this will help with the change-model sexp and any other instances of model
* changing
* --Goober5000
*
* Revision 2.6 2002/12/14 17:09:28 Goober5000
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
* --Goober5000
*
* Revision 2.5 2002/12/14 01:55:04 Goober5000
* added mission flag to show subsystem damage for fighterbays
* ~Goober5000~
*
* Revision 2.4 2002/10/22 23:02:40 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.3 2002/09/20 20:01:30 phreak
* extra effects during cargo scan
*
@@ -955,21 +914,13 @@ void get_turret_subsys_name(model_subsystem *system_info, char *outstr)
} else {
if (Weapon_info[system_info->turret_weapon_type].subtype == WP_LASER) {
// ballistic too! - Goober5000
if (Weapon_info[system_info->turret_weapon_type].wi_flags2 & WIF2_BALLISTIC)
{
sprintf(outstr, "%s", XSTR("Turret", 1487));
}
else
{
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
}
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
} else if (Weapon_info[system_info->turret_weapon_type].subtype == WP_MISSILE) {
sprintf(outstr, "%s", XSTR("Missile lnchr", 1569));
} else {
// Illegal subtype
Int3();
sprintf(outstr, "%s", XSTR("Turret", 1487));
sprintf(outstr, "%s", NOX("Turret"));
}
}
} else {
@@ -1029,7 +980,10 @@ void hud_render_target_ship_info(object *target_objp)
mission_parse_lookup_alt_index(target_shipp->alt_type_index, temp_name);
} else {
strcpy(temp_name, Ship_info[base_index].name);
end_string_at_first_hash_symbol(temp_name);
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
strcpy(temp_name, Ship_info[base_index].name);
hud_end_string_at_first_hash_symbol(temp_name);
}
}
if (Lcl_gr) {
@@ -1097,10 +1051,7 @@ void hud_render_target_ship_info(object *target_objp)
// AL 23-3-98: Fighter bays are a special case. Player cannot destroy them, so don't
// show the subsystem strength
// Goober5000: don't display any strength if we can't destroy this subsystem - but sometimes
// fighterbays can be destroyed
if ( ship_subsys_takes_damage(Player_ai->targeted_subsys) )
{
if ( strnicmp(NOX("fighter"), Player_ai->targeted_subsys->system_info->name, 7) ) {
sprintf(outstr,XSTR( "%d%%", 341),screen_integrity);
gr_get_string_size(&w,&h,outstr);
gr_printf(Target_window_coords[gr_screen.res][0]+Target_window_coords[gr_screen.res][2]-w-1, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3] - h, "%s", outstr);
@@ -1348,7 +1299,7 @@ void hud_render_target_ship(object *target_objp)
// hud_targetbox_get_eye(&camera_eye, &camera_orient, Player_obj->instance);
hud_render_target_setup(&camera_eye, &camera_orient, target_sip->closeup_zoom);
// model_clear_instance(target_shipp->modelnum);
// model_clear_instance(target_sip->modelnum);
ship_model_start( target_objp );
if (Targetbox_wire!=0)
@@ -1385,7 +1336,7 @@ void hud_render_target_ship(object *target_objp)
if(target_sip->modelnum_hud >= 0){
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
} else {
model_render( target_shipp->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, target_shipp->replacement_textures);
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
}
ship_model_stop( target_objp );
@@ -1488,9 +1439,13 @@ void hud_render_target_debris(object *target_objp)
base_index = ship_info_base_lookup( debrisp->ship_info_index );
// print out ship class that debris came from
char printable_ship_class[NAME_LENGTH];
strcpy(printable_ship_class, Ship_info[base_index].name);
end_string_at_first_hash_symbol(printable_ship_class);
char *printable_ship_class = Ship_info[base_index].name;
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
char temp_name[NAME_LENGTH];
strcpy(temp_name, Ship_info[base_index].name);
hud_end_string_at_first_hash_symbol(temp_name);
printable_ship_class = temp_name;
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, XSTR( "debris", 348));
@@ -1510,7 +1465,6 @@ void hud_render_target_weapon(object *target_objp)
weapon_info *target_wip = NULL;
weapon *wp = NULL;
object *viewer_obj, *viewed_obj;
int *replacement_textures = NULL;
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
float factor;
char outstr[100]; // temp buffer
@@ -1541,7 +1495,6 @@ void hud_render_target_weapon(object *target_objp)
viewed_obj = wp->homing_object;
missile_view = TRUE;
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
replacement_textures = Ships[wp->homing_object->instance].replacement_textures;
}
if (Targetbox_wire!=0)
@@ -1589,7 +1542,7 @@ void hud_render_target_weapon(object *target_objp)
hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3);
model_clear_instance(viewed_model_num);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, replacement_textures);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
hud_render_target_close();
}
@@ -1609,8 +1562,9 @@ void hud_render_target_weapon(object *target_objp)
gr_get_string_size(&w,&h,outstr);
// drop name past the # sign
end_string_at_first_hash_symbol(outstr);
if ( strstr(outstr, NOX("#")) ) {
hud_end_string_at_first_hash_symbol(outstr);
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);
// If a homing weapon, show time to impact
+7 -102
View File
@@ -9,31 +9,13 @@
/*
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
* $Revision: 2.9 $
* $Date: 2003-01-18 10:00:43 $
* $Author: Goober5000 $
* $Revision: 2.4 $
* $Date: 2002-10-19 03:50:29 $
* $Author: randomtiger $
*
* Routines to read and deal with keyboard input.
*
* $Log: not supported by cvs2svn $
* Revision 2.8 2003/01/03 21:58:08 Goober5000
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
* has primitive sensors it can't target anything and objects don't appear
* on radar if they're outside a certain range. This range can be modified
* via the sexp primitive-sensors-set-range.
* --Goober5000
*
* Revision 2.7 2002/12/31 18:59:43 Goober5000
* if it ain't broke, don't fix it
* --Goober5000
*
* Revision 2.5 2002/12/10 05:43:34 Goober5000
* Full-fledged ballistic primary support added! Try it and see! :)
*
* Revision 2.4 2002/10/19 03:50:29 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.3 2002/10/17 20:40:51 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.
@@ -777,32 +759,9 @@ void debug_max_secondary_weapons(object *objp)
int index;
ship *shipp = &Ships[objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
ship_weapon *swp = &shipp->weapons;
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ )
{
swp->secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
}
}
void debug_max_primary_weapons(object *objp) // Goober5000
{
int index;
ship *shipp = &Ships[objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
ship_weapon *swp = &shipp->weapons;
weapon_info *wip;
if (sip->flags & SIF_BALLISTIC_PRIMARIES)
{
for ( index = 0; index < MAX_PRIMARY_BANKS; index++ )
{
wip = &Weapon_info[swp->primary_bank_weapons[index]];
if (wip->wi_flags2 & WIF2_BALLISTIC)
{
swp->primary_bank_ammo[index] = sip->primary_bank_ammo_capacity[index];
}
}
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ ) {
shipp->weapons.secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
}
}
@@ -1088,14 +1047,12 @@ void process_debug_keys(int k)
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Weapon energy and missile count will always be at full for player", 16));
debug_max_secondary_weapons(Player_obj);
debug_max_primary_weapons(Player_obj);
if (k & KEY_SHIFTED) {
object *objp;
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
if (objp->type == OBJ_SHIP)
debug_max_secondary_weapons(objp);
debug_max_primary_weapons(objp);
}
} else
@@ -2366,7 +2323,6 @@ int button_function_demo_valid(int n)
}
// execute function corresponding to action n (BUTTON_ #define from KeyControl.h)
// Goober5000: function returns 1 when action was taken
int button_function(int n)
{
Assert(n >= 0);
@@ -2381,58 +2337,7 @@ int button_function(int n)
if (Game_mode & GM_DEAD_DIED){
return 0;
}
// Goober5000 - if the ship doesn't have subspace drive, jump key doesn't work: so test and exit early
if (Player_ship->flags2 & SF2_NO_SUBSPACE_DRIVE)
{
switch(n)
{
case END_MISSION:
control_used(n); // set the timestamp for when we used the control, in case we need it
return 1; // pretend we took the action: if we return 0, strange stuff may happen
}
}
// Goober5000 - if we have primitive sensors, some keys don't work: so test and exit early
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
{
switch (n)
{
case MATCH_TARGET_SPEED:
case TOGGLE_AUTO_MATCH_TARGET_SPEED:
case TOGGLE_AUTO_TARGETING:
case TARGET_NEXT:
case TARGET_PREV:
case TARGET_NEXT_CLOSEST_HOSTILE:
case TARGET_PREV_CLOSEST_HOSTILE:
case TARGET_NEXT_CLOSEST_FRIENDLY:
case TARGET_PREV_CLOSEST_FRIENDLY:
case TARGET_SHIP_IN_RETICLE:
case TARGET_LAST_TRANMISSION_SENDER:
case TARGET_CLOSEST_REPAIR_SHIP:
case TARGET_CLOSEST_SHIP_ATTACKING_TARGET:
case STOP_TARGETING_SHIP:
case TARGET_CLOSEST_SHIP_ATTACKING_SELF:
case TARGET_TARGETS_TARGET:
case TARGET_SUBOBJECT_IN_RETICLE:
case TARGET_NEXT_SUBOBJECT:
case TARGET_PREV_SUBOBJECT:
case STOP_TARGETING_SUBSYSTEM:
case TARGET_NEXT_BOMB:
case TARGET_PREV_BOMB:
case TARGET_NEXT_UNINSPECTED_CARGO:
case TARGET_PREV_UNINSPECTED_CARGO:
case TARGET_NEWEST_SHIP:
case TARGET_NEXT_LIVE_TURRET:
case TARGET_PREV_LIVE_TURRET:
case TARGET_NEXT_ESCORT_SHIP:
control_used(n); // set the timestamp for when we used the control, in case we need it
return 1; // pretend we took the action: if we return 0, strange stuff may happen
}
}
// now handle keys the regular way
switch (n) {
// cycle to next primary weapon
case CYCLE_NEXT_PRIMARY:
@@ -2485,7 +2390,7 @@ int button_function(int n)
// undefined in multiplayer for clients right now
// match target speed
case MATCH_TARGET_SPEED:
case MATCH_TARGET_SPEED:
control_used(MATCH_TARGET_SPEED);
// If player is auto-matching, break auto-match speed
if ( Player->flags & PLAYER_FLAGS_AUTO_MATCH_SPEED ) {
+2 -2
View File
@@ -778,8 +778,8 @@ BOOL SWFF_WriteRegString(
// close the key
RegCloseKey(hKey);
/* if(lRet != ERROR_SUCCESS) // eh, this is unreachable code
return FALSE;*/
if(lRet != ERROR_SUCCESS)
return FALSE;
// if we have reached this point, then it was a success
return TRUE;
+15 -92
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Io/Timer.cpp $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:46:28 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* Include file for timer stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -193,12 +190,11 @@ fix timer_get_fixed_seconds()
return 0;
}
#if defined(_WIN32)
#if defined(_WIN32) && defined(_MSC_VER)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
#if defined(_MSC_VER)
// Timing in fixed point (16.16) seconds.
// Can be used for up to 1000 hours
_asm mov edx, temp_large.HighPart
@@ -216,37 +212,9 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = fixed point seconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in fixed point (16.16) seconds.
// Can be used for up to 1000 hours
asm(
"mov %1, %%edx;" // temp_large.HighPart
"mov %2, %%eax;" // temp_large.LowPart
"shld $16,%%edx,%%eax;" // Keep 32+11 bits
"shl $16,%%eax;"
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again:"
"sub %%ebx,%%edx;" // subtract until negative...
"jns sub_again;" // ...to prevent divide overflow..."
"add %%ebx,%%edx;" // ...then add in to get correct value."
"div %%ebx;"
//eax = fixed point seconds elapsed...
"mov %%eax,%0;" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx" );
#else
#error unknown Win32 compiler
#endif
return tmp;
#elif defined unix
@@ -279,13 +247,14 @@ int timer_get_milliseconds()
return 0;
}
#if defined(_WIN32)
#if defined(_WIN32) && defined(_MSC_VER)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
temp_large.QuadPart *= (longlong)1000;
#if defined(_MSC_VER)
// Timing in milliseconds.
_asm mov edx, temp_large.HighPart
_asm mov eax, temp_large.LowPart
@@ -294,6 +263,7 @@ int timer_get_milliseconds()
//_asm shl eax, 16
// edx:eax = number of 1.19Mhz pulses elapsed.
_asm mov ebx, Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
sub_again:
_asm sub edx, ebx ; subtract until negative...
@@ -301,41 +271,17 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = milliseconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in milliseconds.
asm(
"mov %1,%%edx;\n" // temp_large.HighPart
"mov %2,%%eax;\n" // temp_large.LowPart
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;\n" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again2:"
"sub %%ebx,%%edx;\n" // subtract until negative...
"jns sub_again2;\n" // ...to prevent divide overflow...
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
"div %%ebx;\n"
//eax = milliseconds elapsed...
"mov %%eax,%0;\n" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx");
#else
#error unknown Win32 compiler
#endif
_asm mov tmp, eax
return tmp;
#elif defined unix
#else
timeval tmp_tv;
timer_get(&tmp_tv);
return (tmp_tv.tv_sec * 1000) + (tmp_tv.tv_usec / 1000);
#else
#error unknown architecture/compiler
#endif
}
@@ -347,13 +293,13 @@ int timer_get_microseconds()
return 0;
}
#if defined(_WIN32)
#if defined(_WIN32) && defined(_MSC_VER)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
temp_large.QuadPart *= (longlong)1000000;
#if defined(_MSC_VER)
timer_get(&temp_large);
temp_large.QuadPart *= (longlong)1000000;
// Timing in milliseconds.
_asm mov edx, temp_large.HighPart
@@ -371,29 +317,8 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = milliseconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in milliseconds.
asm(
"mov %1,%%edx;\n" // temp_large.HighPart
"mov %2,%%eax;\n" // temp_large.LowPart
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;\n" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again3:"
"sub %%ebx,%%edx;\n" // subtract until negative...
"jns sub_again3;\n" // ...to prevent divide overflow...
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
"div %%ebx;\n"
//eax = milliseconds elapsed...
"mov %%eax,%0;\n" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx");
#else
#error unknown Win32 compiler
#endif
_asm mov tmp, eax
return tmp;
@@ -403,8 +328,6 @@ sub_again:
timer_get(&tmp_tv);
return (tmp_tv.tv_sec * 1000000) + tmp_tv.tv_usec;
#else
#error unknown architecture/compiler
#endif
}
+4 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/JumpNode/JumpNode.h $
* $Revision: 2.2 $
* $Date: 2002-12-17 01:56:36 $
* $Author: DTP $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* Header for everything to do with jump nodes
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -44,7 +41,7 @@
#include "parse/parselo.h"
#define MAX_JUMP_NODES 50
#define MAX_JUMP_NODES 3
typedef struct {
int modelnum;
+3 -21
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Math/Fvi.cpp $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* Routines to find intersections of various 3d things.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -207,21 +204,6 @@ void fvi_two_lines_in_3space(vector *p1, vector *v1, vector *p2, vector *v2, flo
}
}
//tells distance from a plain to a point-Bobboau
float fvi_point_dist_plane( vector *plane_pnt, vector *plane_norm, // Plane description, a point and a normal
vector *point //a point to test
)
{
float dist,D;
D = -vm_vec_dot(plane_norm,plane_pnt);
dist = vm_vec_dot(plane_norm, point) + D;
return dist;
}
//--------------------------------------------------------------------
// fvi_ray_plane - Finds the point on the specified plane where the
+3 -9
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Math/Fvi.h $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* Prototypes for fvi stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -84,9 +81,6 @@
#include "globalincs/pstypes.h"
//finds distance from point to plane
float fvi_point_dist_plane( vector *plane_pnt,vector *plane_norm, vector *point);
// fvi functions - fvi stands for Find Vector Intersection
// fvi_a_b - means find the intersection of something of type a with something of type b
// type can be:
+3 -66
View File
@@ -9,28 +9,13 @@
/*
* $Logfile: /Freespace2/code/Math/VecMat.cpp $
* $Revision: 2.4 $
* $Date: 2003-03-02 07:39:34 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* C module containg functions for manipulating vectors and matricies
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2003/02/25 06:22:48 bobboau
* fixed a bunch of fighter beam bugs,
* most notabley the sound now works corectly,
* and they have limeted range with atenuated damage (table option)
* added bank specific compatabilities
*
* Revision 2.2 2002/12/07 01:37:41 bobboau
* inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
* collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
* it needs a better renderer, but is in prety good shape for now,
* I also (think) I squashed a bug in the warpmodel code
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -407,41 +392,6 @@ void vm_vec_sub2(vector *dest,vector *src)
}
#endif
void vm_vert2vec(vertex *vert, vector *vec) //takes a vertex and makes it into a vector-Bobboau
{
vec->xyz.x = vert->x;
vec->xyz.y = vert->y;
vec->xyz.z = vert->z;
}
void vm_vec2vert(vector *vec, vertex *vert) //takes a vector and makes it into a vertex-Bobboau
{
vert->x = vec->xyz.x;
vert->y = vec->xyz.y;
vert->z = vec->xyz.z;
}
//averages n vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg_n(vector *dest, int n, vector src[])
{
float x=0,y=0,z=0;
for(int i = 0; i<n; i++){
x += src[i].xyz.x;
y += src[i].xyz.y;
z += src[i].xyz.z;
}
dest->xyz.x = x / n;
dest->xyz.y = y / n;
dest->xyz.z = z / n;
return dest;
}
//averages two vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
@@ -453,15 +403,6 @@ vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
return dest;
}
//averages four vectors. returns ptr to dest
//dest can equal any source
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2)
{
dest->xyz.x = (src0->xyz.x + src1->xyz.x + src2->xyz.x) * 0.333333333f;
dest->xyz.y = (src0->xyz.y + src1->xyz.y + src2->xyz.y) * 0.333333333f;
dest->xyz.z = (src0->xyz.z + src1->xyz.z + src2->xyz.z) * 0.333333333f;
return dest;
}
//averages four vectors. returns ptr to dest
//dest can equal any source
@@ -664,18 +605,14 @@ float vm_vec_dist_quick(vector *v0,vector *v1)
//normalize a vector. returns mag of source vec
float vm_vec_copy_normalize(vector *dest,vector *src)
{
static int ben_warned = false;//added this so the warning could be sounded and you can still get on with playing-Bobboau
float m;
m = vm_vec_mag(src);
// Mainly here to trap attempts to normalize a null vector.
if (m <= 0.0f) {
if(!ben_warned){
Warning(LOCATION, "Null vector in vector normalize.\n"
Warning(LOCATION, "Null vector in vector normalize.\n"
"Trace out of vecmat.cpp and find offending code.\n");
ben_warned = true;
}
dest->xyz.x = 1.0f;
dest->xyz.y = 0.0f;
dest->xyz.z = 0.0f;
+3 -15
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Math/VecMat.h $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:42 $
* $Author: bobboau $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* Header file for functions that manipulate vectors and matricies
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -299,16 +296,11 @@ void vm_vec_sub(vector *dest,vector *src0,vector *src1);
void vm_vec_sub2(vector *dest,vector *src);
#endif
//averages n vectors
vector *vm_vec_avg_n(vector *dest, int n, vector src[]);
//averages two vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1);
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2);
//averages four vectors. returns ptr to dest
//dest can equal any source
vector *vm_vec_avg4(vector *dest,vector *src0,vector *src1,vector *src2,vector *src3);
@@ -659,9 +651,5 @@ void vm_vec_random_in_circle(vector *out, vector *in, matrix *orient, float radi
// returns 0 if the point is inside the line segment, -1 if "before" the line segment and 1 ir "after" the line segment
int vm_vec_dist_to_line(vector *p, vector *l0, vector *l1, vector *nearest, float *dist);
void vm_vert2vec(vertex *vert, vector *vec);
void vm_vec2vert(vector *vec, vertex *vert);
#endif
+3 -7
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/MenuUI/Credits.cpp $
* $Revision: 2.7 $
* $Date: 2002-12-03 22:14:06 $
* $Author: Goober5000 $
* $Revision: 2.6 $
* $Date: 2002-11-02 22:25:26 $
* $Author: inquisitor $
*
* C source file for displaying game credits
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2002/11/02 22:25:26 inquisitor
* Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan.
*
* Revision 2.5 2002/11/02 22:11:35 DTP
* DOH forgot \n
*
@@ -202,7 +199,6 @@ char *fs2_open_credit_text =
"\n"
"\"Bobboau\"\n"
"Dennis \"DTP\" Pedersen\n"
"Ian \"Goober5000\" Warfield\n"
"Joe \"Righteous1\" Dowd\n"
"Mike \"penguin\" Harris\n"
"\"Mysterial\"\n"
+3 -8
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.cpp $
* $Revision: 2.6 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
* $Revision: 2.5 $
* $Date: 2002-08-27 13:38:58 $
* $Author: penguin $
*
* Header file for main-hall menu code
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/08/27 13:38:58 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.3 2002/08/04 05:12:10 penguin
* Change version display location
*
@@ -2039,10 +2036,8 @@ void main_hall_read_table()
stuff_string(m->bitmap, F_NAME, NULL, MAX_FILENAME_LEN);
required_string("+Mask:");
stuff_string(m->mask, F_NAME, NULL, MAX_FILENAME_LEN);
#ifndef FS2_DEMO
required_string("+Music:");
stuff_string(m->music, F_NAME, NULL, MAX_FILENAME_LEN);
#endif
// intercom sounds
required_string("+Num Intercom Sounds:");
+4 -11
View File
@@ -9,20 +9,13 @@
/*
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.h $
* $Revision: 2.2 $
* $Date: 2003-01-15 05:19:07 $
* $Author: Goober5000 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:24 $
* $Author: penguin $
*
* Header file for main-hall menu code
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2003/01/14 04:00:15 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:09 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -70,7 +63,7 @@
#define _MAIN_HALL_MENU_HEADER_FILE
// the # of main halls we're supporting
#define NUM_MAIN_HALLS 10 // Goober5000 - bumped down to 10; don't go above 256 (size of ubyte)
#define NUM_MAIN_HALLS 2
// initialize the main hall proper
void main_hall_init(int main_hall_num);
Loaded 100 of 189 files, more files were not shown because too many files have changed in this diff. Show more