mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
573a1f2fa3 | ||
|
|
a763d84b56 | ||
|
|
c06ccbb602 | ||
|
|
ffd8a5ae2a | ||
|
|
aa753d5d6e | ||
|
|
1cf042064f | ||
|
|
a4e14a94d2 | ||
|
|
5871d644cc | ||
|
|
145a149873 | ||
|
|
7492c51ee6 | ||
|
|
be4954a69e | ||
|
|
875a95b82e | ||
|
|
f6b129577b | ||
|
|
4d30bbba3e | ||
|
|
8823dc67eb | ||
|
|
8690c9d7f6 | ||
|
|
f70d242903 | ||
|
|
5b4306dbd6 | ||
|
|
013870fc6a | ||
|
|
0e3d4e562f | ||
|
|
48d1ec4575 | ||
|
|
32ad077676 | ||
|
|
9942308fc8 |
No files matched your search
@@ -11,3 +11,5 @@
|
||||
# [<whitespace>]<filename><whitespace><error message><end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
|
||||
new_log_accum Error checking out/updating CVSROOT/new_log_accum
|
||||
@@ -13,3 +13,5 @@
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
|
||||
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
|
||||
@@ -24,3 +24,7 @@
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
|
||||
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
|
||||
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to store the last visited directory for newlogaccum.pl.
|
||||
#
|
||||
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
|
||||
use strict;
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# This routine writes a single line to a file
|
||||
sub write_line ($$) {
|
||||
my ($fname, $line) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE "$line\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Create and empty the temporary directory
|
||||
my ($tmpdir) = (tmpdir(1));
|
||||
|
||||
# Store the directory name
|
||||
write_line("$tmpdir/lastdir", shift(@ARGV));
|
||||
Executable
+757
@@ -0,0 +1,757 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# Script to accumulate log messages for an entire tree and send them along
|
||||
# with the diffs; deals correctly with all manner of branching (I hope)
|
||||
#
|
||||
# $Id: new_log_accum,v 1.1 2002-08-11 23:05:15 drevil Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($MAILER $CVS $debug $boundary);
|
||||
use MD5;
|
||||
|
||||
# Set this to the full path of a mailer that takes a list
|
||||
# of email addresses as arguments...
|
||||
$MAILER = "/usr/sbin/sendmail -oi -oeq";
|
||||
|
||||
# Set this to the path of the CVS binary responsible for this tree...
|
||||
$CVS = "/usr/bin/cvs";
|
||||
|
||||
# Don't touch this; use the -d command line option
|
||||
$debug = 0;
|
||||
|
||||
# This is initialized by build_mailheader()
|
||||
$boundary = '';
|
||||
|
||||
use POSIX qw(setsid);
|
||||
|
||||
# We have to dissociate from our parent, so that the CVS commit can
|
||||
# complete, before we try to extract the diffs
|
||||
sub daemonize {
|
||||
defined(my $pid = fork()) || die "Can't fork: $!";
|
||||
exit(0)
|
||||
if $pid;
|
||||
setsid() || die "Can't start a new session: $!";
|
||||
}
|
||||
|
||||
# Debugging output
|
||||
sub debug (@) {
|
||||
print STDERR @_
|
||||
if ($debug);
|
||||
}
|
||||
|
||||
# Constants used in the FSM below for parsing the log message
|
||||
sub STATE_NONE { 0 }
|
||||
sub STATE_MODIFIED { 1 }
|
||||
sub STATE_ADDED { 2 }
|
||||
sub STATE_REMOVED { 3 }
|
||||
sub STATE_LOG1 { 4 }
|
||||
sub STATE_LOG2 { 5 }
|
||||
|
||||
# This routine removes everything in a directory
|
||||
sub clear_dir {
|
||||
my ($dir) = @_;
|
||||
my ($file);
|
||||
|
||||
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
|
||||
while ($file = readdir(DIR)) {
|
||||
next
|
||||
if ($file eq "." || $file eq "..");
|
||||
|
||||
$file = "$dir/$file";
|
||||
|
||||
if (-d $file) {
|
||||
# It's a directory, recurse into it, then delete it.
|
||||
clear_dir($file);
|
||||
rmdir($file);
|
||||
} else {
|
||||
# It's a file, delete it.
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# This routine prepares a temporary directory, hopefully in a secure
|
||||
# fashion; it uses the process group to make secondary programs be able
|
||||
# to find it.
|
||||
sub tmpdir (;$) {
|
||||
my ($clear) = @_;
|
||||
my ($pgrp, $own, $mode, $tmpdir);
|
||||
|
||||
$pgrp = getpgrp();
|
||||
|
||||
die "Don't run $0 setuid!"
|
||||
unless ($< == $>);
|
||||
|
||||
# Decide on the directory name, using various environment variables
|
||||
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
|
||||
"/.#cvs.$pgrp";
|
||||
|
||||
# Doesn't exist, but we can't create it...
|
||||
die "Can't create temporary directory $tmpdir: $!"
|
||||
unless (-e $tmpdir || mkdir($tmpdir, 0700));
|
||||
|
||||
die "Temporary directory $tmpdir is not a directory"
|
||||
unless (-d $tmpdir);
|
||||
|
||||
# Check ownership and permissions
|
||||
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
|
||||
|
||||
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
|
||||
unless ($own == $<);
|
||||
|
||||
die "Temporary directory $tmpdir group-writable"
|
||||
if ($mode & 0020);
|
||||
die "Temporary directory $tmpdir other-writable"
|
||||
if ($mode & 0002);
|
||||
|
||||
# If we're supposed to clear the directory, do so...
|
||||
clear_dir($tmpdir)
|
||||
if ($clear);
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
# Routine to remove the temporary directory when done
|
||||
sub cleanup_dir ($) {
|
||||
# If we're debugging, we may want to look at the contents...
|
||||
return
|
||||
if ($debug);
|
||||
|
||||
clear_dir($_[0]);
|
||||
rmdir($_[0]);
|
||||
}
|
||||
|
||||
# Retrieve a single line from a specified file
|
||||
sub get_line ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
|
||||
my $line = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
# Chomp off the \n
|
||||
chomp $line;
|
||||
|
||||
return $line;
|
||||
}
|
||||
|
||||
# Routine that only allows one value to be pushed on the array;
|
||||
# implemented by making the first element of the array a hash-reference.
|
||||
# When we add a new value, we also increment the count of an element in
|
||||
# the hash with the key being the array value...
|
||||
sub push_once (\@@) {
|
||||
my ($array, @values) = @_;
|
||||
|
||||
# If the array is empty, create our hash ref
|
||||
push @{$array}, {}
|
||||
if (@{$array} == 0);
|
||||
|
||||
foreach my $value (@values) {
|
||||
push @{$array}, $value
|
||||
if (!exists($array->[0]{$value}));
|
||||
|
||||
$array->[0]{$value}++;
|
||||
}
|
||||
|
||||
return @{$array} - 1;
|
||||
}
|
||||
|
||||
# Filter //, /./, and remove leading ./ or / from filenames
|
||||
sub fname_filter ($) {
|
||||
my ($fname) = @_;
|
||||
|
||||
$fname =~ s,//,/,g;
|
||||
$fname =~ s,/\./,/,g;
|
||||
$fname =~ s,^\.?/,,g;
|
||||
|
||||
return $fname;
|
||||
}
|
||||
|
||||
# Store file data in a temporary file
|
||||
sub names_to_file ($$@) {
|
||||
my ($fname, $dir, @names) = @_;
|
||||
|
||||
if (@names > 0) {
|
||||
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
|
||||
|
||||
# Store the directory data
|
||||
print FILE "D $dir\n";
|
||||
|
||||
foreach my $name (@names) {
|
||||
# Mark record as a file...
|
||||
print FILE "F ";
|
||||
|
||||
# Store the tag, if there is one...
|
||||
print FILE "$name->{tag}"
|
||||
if (defined($name->{tag}));
|
||||
|
||||
# Then store old revision, new revision, and file name
|
||||
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
}
|
||||
}
|
||||
|
||||
# Retrieve file data from temporary file; updates branch tags with what it
|
||||
# reads
|
||||
sub file_to_names (\@$) {
|
||||
my ($btags, $fname) = @_;
|
||||
my ($dir) = (undef);
|
||||
my (@names) = ();
|
||||
|
||||
debug "Reading file names from $fname...\n";
|
||||
|
||||
# We may not have, say, added a file in this subdirectory...
|
||||
return ()
|
||||
if (!-e $fname);
|
||||
|
||||
open(FILE, "<$fname");
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
|
||||
# Get record type...
|
||||
my ($type, $data) = split(' ', $_, 2);
|
||||
|
||||
# ok, it's a directory, remember that...
|
||||
if ($type eq "D") {
|
||||
$dir = $data;
|
||||
|
||||
debug "Read directory $dir\n";
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
debug "Read file $data\n";
|
||||
|
||||
# Get all the information about the file
|
||||
my ($tag, $old, $new, $file) = split(':', $data);
|
||||
|
||||
# and store it all
|
||||
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
|
||||
dir => $dir, name => fname_filter("$dir/$file") });
|
||||
|
||||
# Remember the tags...
|
||||
push_once(@{$btags}, $tag)
|
||||
if (defined($tag) && $tag ne "");
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
return @names;
|
||||
}
|
||||
|
||||
# Create a text-formatted list of names
|
||||
sub name_to_list (\@@) {
|
||||
my ($btags, @names) = @_;
|
||||
my (@nlist, @nline) = ();
|
||||
|
||||
debug "Tags:", join(':', @{$btags}), "\n";
|
||||
|
||||
# We group them by tag
|
||||
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
|
||||
debug "Processing tag $tag...\n";
|
||||
|
||||
@nlist = ();
|
||||
|
||||
# Get a list of files by the tag...
|
||||
foreach my $name (@names) {
|
||||
debug "Processing $name->{file}...\n";
|
||||
|
||||
next
|
||||
if ($name->{tag} ne $tag);
|
||||
|
||||
debug "Pushing $name->{name} on \@nlist...\n";
|
||||
push(@nlist, $name->{name});
|
||||
}
|
||||
|
||||
# If the tag is not the empty string, list the tag...
|
||||
push(@nline, " Tag: $tag", " ")
|
||||
if ($tag ne "");
|
||||
|
||||
# Now list each file name
|
||||
foreach my $name (@nlist) {
|
||||
# indent if we run past the end of line limit
|
||||
push(@nline, " ")
|
||||
if (@nline == 0 || ($nline[$#nline] ne " " &&
|
||||
length($nline[$#nline]) + length($name) + 1 > 70));
|
||||
|
||||
# add the file name to the list
|
||||
debug "Adding $name to \@nline...\n";
|
||||
$nline[$#nline] .= " $name";
|
||||
}
|
||||
}
|
||||
|
||||
return @nline;
|
||||
}
|
||||
|
||||
# write the log message to a temporary file
|
||||
sub write_log ($@) {
|
||||
my ($fname, @text) = @_;
|
||||
|
||||
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
|
||||
print FILE join("\n", @text), "\n";
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
# Build the header of the commit message: CVSROOT, module name, any
|
||||
# branch tags, and the commit time
|
||||
sub build_header ($@) {
|
||||
my ($module, $subject, $mailto, @branch_tags) = @_;
|
||||
my (@text, @mailto);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
my ($user, $dummy);
|
||||
my ($digest);
|
||||
|
||||
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
|
||||
|
||||
@mailto = @{$mailto};
|
||||
|
||||
# generate a unique boundary by calculating the md5sum of the
|
||||
# current time
|
||||
$digest = new MD5;
|
||||
$digest->reset();
|
||||
$digest->add(time() . rand());
|
||||
$boundary = "----=MIME." . unpack("H*", $digest->digest());
|
||||
|
||||
# Build the mail header
|
||||
push(@text, "From: $user");
|
||||
push(@text, "To: " . join(' ', @mailto));
|
||||
push(@text, "Subject: $subject");
|
||||
push(@text, "MIME-Version: 1.0");
|
||||
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
|
||||
push(@text, "");
|
||||
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
|
||||
push(@text, "");
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; charset=us-ascii");
|
||||
push(@text, "Content-Disposition: inline");
|
||||
push(@text, "");
|
||||
|
||||
# Build the commit message header
|
||||
push(@text, "Commiter : $user");
|
||||
push(@text, "CVSROOT : $ENV{CVSROOT}");
|
||||
push(@text, "Module : $module");
|
||||
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
|
||||
if (@branch_tags > 0);
|
||||
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
|
||||
|
||||
return @text, "";
|
||||
}
|
||||
|
||||
# Send the mail message
|
||||
sub send_mail {
|
||||
my ($mailto, $text) = @_;
|
||||
my (@mailto, @text);
|
||||
# I <heart> perl
|
||||
@mailto = @{$mailto};
|
||||
@text = @{$text};
|
||||
|
||||
open(MAIL, "|$MAILER " . join(' ', @mailto));
|
||||
push(@text, "--$boundary--", "");
|
||||
print MAIL join("\n", @text), "\n";
|
||||
close(MAIL);
|
||||
}
|
||||
|
||||
# Find the tmp directory
|
||||
my ($tmpdir) = (tmpdir());
|
||||
|
||||
my (@mailto) = ();
|
||||
my (@files) = ();
|
||||
my (@path) = ();
|
||||
my ($modname, $repdir, $dir) = (undef, undef, undef);
|
||||
|
||||
# Process command line arguments
|
||||
while (@ARGV > 0) {
|
||||
my ($arg) = (shift(@ARGV));
|
||||
|
||||
if ($arg eq '-d') {
|
||||
# Turn on debugging
|
||||
$debug++;
|
||||
} elsif ($arg eq '-M') {
|
||||
# Module name explicitly set -- XXX Not tested, use at your own risk
|
||||
die "Argument for -M missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
$modname = shift(@ARGV);
|
||||
} elsif ($arg eq '-m') {
|
||||
# An address to mail the notification to
|
||||
die "Argument for -m missing"
|
||||
unless (@ARGV > 0);
|
||||
|
||||
push(@mailto, shift(@ARGV));
|
||||
} else {
|
||||
# the list of filenames passed by CVS--you *must* use %{sVv}!
|
||||
die "Too many arguments!"
|
||||
unless (@files == 0);
|
||||
|
||||
@files = split(" ", $arg);
|
||||
}
|
||||
}
|
||||
|
||||
die "Nobody to mail to"
|
||||
unless (@mailto > 0);
|
||||
|
||||
die "No files to process"
|
||||
unless (@files > 1);
|
||||
|
||||
# The repository directory
|
||||
$repdir = shift(@files);
|
||||
|
||||
# break it appart...
|
||||
@path = split("/", $repdir);
|
||||
|
||||
# Now we know the module name, if it wasn't explicitly set
|
||||
$modname = $path[0]
|
||||
unless (defined($modname));
|
||||
|
||||
# Figure out what our directory is
|
||||
if (@path == 1) {
|
||||
$dir = ".";
|
||||
} else {
|
||||
$dir = join("/", @path[1..$#path]);
|
||||
}
|
||||
|
||||
# append a / to it...
|
||||
$dir .= "/";
|
||||
|
||||
debug "module = $modname\n";
|
||||
debug "dir = $dir\n";
|
||||
debug "path = ", join(":", @path), "\n";
|
||||
debug "files = ", join(":", @files), "\n";
|
||||
debug "tmpdir = $tmpdir\n";
|
||||
|
||||
my (%fversions);
|
||||
|
||||
# Unless its a new directory or imported sources, create file records
|
||||
unless (defined($files[1]) && defined($files[2]) &&
|
||||
(($files[1] eq "New" && $files[2] eq "directory") ||
|
||||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
|
||||
|
||||
foreach my $fname (@files) {
|
||||
# You *must* use %{sVv} in the call in loginfo!
|
||||
die "Invalid filenames"
|
||||
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
|
||||
|
||||
$fversions{$1} = {
|
||||
old => ($2 eq "NONE" ? "0" : $2),
|
||||
new => ($3 eq "NONE" ? "0" : $3),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
# process log message
|
||||
my ($state, $tag) = (STATE_NONE, undef);
|
||||
|
||||
my (@modified, @added, @removed, @log, @branch_tags) = ();
|
||||
|
||||
while (<STDIN>) {
|
||||
chomp;
|
||||
|
||||
debug "State $state, line:$_\n";
|
||||
|
||||
# Ignore empty space at the beginning of the log message
|
||||
next
|
||||
if ($state == STATE_LOG1 && /^\s*$/);
|
||||
|
||||
# We're done ignoring empty space
|
||||
if ($state == STATE_LOG1) {
|
||||
$state = STATE_LOG2;
|
||||
}
|
||||
|
||||
if ($state == STATE_LOG2) {
|
||||
# Don't modify the lines at all if we're processing the log message
|
||||
push(@log, $_);
|
||||
next;
|
||||
} else {
|
||||
# Strip out leading and trailing space
|
||||
s/^\s*(.*?)\s*$/$1/;
|
||||
}
|
||||
|
||||
if (/^Modified Files/) {
|
||||
# Collect list of modified files
|
||||
debug "State switching to STATE_MODIFIED\n";
|
||||
|
||||
$state = STATE_MODIFIED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Added Files/) {
|
||||
# Collect list of added files
|
||||
debug "State switching to STATE_ADDED\n";
|
||||
|
||||
$state = STATE_ADDED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Removed Files/) {
|
||||
# Collect list of removed files
|
||||
debug "State switching to STATE_REMOVED\n";
|
||||
|
||||
$state = STATE_REMOVED;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Log Message/) {
|
||||
# Collect log message
|
||||
debug "State switching to STATE_LOG1\n";
|
||||
|
||||
$state = STATE_LOG1;
|
||||
$tag = undef;
|
||||
|
||||
next;
|
||||
|
||||
} elsif (/^Revision\/Branch/) {
|
||||
# Parse old-style Revision/Branch field
|
||||
debug "Found a branch tag\n";
|
||||
|
||||
/^[^:]+:\s*(.*)/;
|
||||
|
||||
push_once(@branch_tags, $1);
|
||||
|
||||
warn "Tag == $tag"
|
||||
if (defined($tag));
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
# Ignore the stuff at the top of the commit report
|
||||
next
|
||||
if ($state == STATE_NONE);
|
||||
|
||||
if (/^Tag:\s*(.*)$/) {
|
||||
# Remember the tag
|
||||
debug "Setting tag to $1\n";
|
||||
$tag = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
my (@tfiles) = ();
|
||||
|
||||
# Find the file in our command line list of files
|
||||
foreach my $file (split) {
|
||||
die "Nothing known about file $file!"
|
||||
unless (exists($fversions{$file}));
|
||||
|
||||
push @tfiles, {
|
||||
file => $file,
|
||||
tag => $tag,
|
||||
old => $fversions{$file}{old},
|
||||
new => $fversions{$file}{new},
|
||||
};
|
||||
}
|
||||
|
||||
# Store the file list in the correct array
|
||||
push(@modified, @tfiles)
|
||||
if ($state == STATE_MODIFIED);
|
||||
|
||||
push(@added, @tfiles)
|
||||
if ($state == STATE_ADDED);
|
||||
|
||||
push(@removed, @tfiles)
|
||||
if ($state == STATE_REMOVED);
|
||||
}
|
||||
|
||||
# Remove trailing blank lines from the log message
|
||||
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# If a new directory was added, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "New" && $files[2] eq "directory") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# If there was a sticky tag for the directory, make it a branch tag
|
||||
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
|
||||
push_once(@branch_tags, $1);
|
||||
pop(@log);
|
||||
}
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: New directory $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# If an import was done, we're done...
|
||||
if (defined($files[1]) && defined($files[2]) &&
|
||||
$files[1] eq "Imported" && $files[2] eq "sources") {
|
||||
|
||||
my (@text) = ();
|
||||
|
||||
# Build the message...
|
||||
push(@text, build_header($modname, "Module $modname: Imported $dir",
|
||||
\@mailto, @branch_tags));
|
||||
push(@text, "Log message:", "", @log);
|
||||
|
||||
# and send it (synchronously)
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# Clean up after ourselves and exit.
|
||||
cleanup_dir($tmpdir);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
debug "Searching for log file index...";
|
||||
|
||||
my ($i);
|
||||
|
||||
# Look for an empty log file or one that matches our current log message
|
||||
for ($i = 0; ; $i++) {
|
||||
my (@text);
|
||||
|
||||
# found one that doesn't exist...
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read in the log file
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
# If the log file was empty, use it
|
||||
last
|
||||
if (@text == 0);
|
||||
|
||||
# If the log messages are identical, use that
|
||||
last
|
||||
if (join(' ', @log) eq join(' ', @text));
|
||||
}
|
||||
|
||||
debug "$tmpdir/logfile.$i\n";
|
||||
|
||||
# Store modified, added, and removed file lists, along with the log message
|
||||
names_to_file("$tmpdir/modified.$i", $dir, @modified);
|
||||
names_to_file("$tmpdir/added.$i", $dir, @added);
|
||||
names_to_file("$tmpdir/removed.$i", $dir, @removed);
|
||||
write_log("$tmpdir/logfile.$i", @log);
|
||||
|
||||
# Now check to see if we're at the end of our rope
|
||||
my ($lastdir) = (get_line("$tmpdir/lastdir"));
|
||||
|
||||
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
|
||||
|
||||
# Nope, exit instead of sending a message
|
||||
exit(0)
|
||||
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
|
||||
|
||||
debug "At last, we've reached the end\n";
|
||||
|
||||
# We have to daemonize and sleep so that there isn't any lock hanging
|
||||
# around when we get to the cvs rdiff below...
|
||||
daemonize();
|
||||
sleep(10);
|
||||
|
||||
# Build the mail message...
|
||||
my (@text) = ();
|
||||
@files = ();
|
||||
@branch_tags = ();
|
||||
|
||||
for ($i = 0; ; $i++) {
|
||||
# No more log files
|
||||
last
|
||||
if (!-e "$tmpdir/logfile.$i");
|
||||
|
||||
# read and insert the log message
|
||||
open(FILE, "<$tmpdir/logfile.$i");
|
||||
push(@text, "Log message:", "");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
push(@text, "");
|
||||
close(FILE);
|
||||
|
||||
# read modified list and list all modified files if non-empty
|
||||
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
|
||||
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
|
||||
if (@modified > 0);
|
||||
|
||||
# read added list and list all added files if non-empty
|
||||
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
|
||||
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
|
||||
if (@added > 0);
|
||||
|
||||
# read removed list and list all removed files if non-empty
|
||||
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
|
||||
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
|
||||
if (@removed > 0);
|
||||
|
||||
# remember all the files we looked at
|
||||
push(@files, @modified, @added, @removed);
|
||||
}
|
||||
|
||||
# Now that name_to_list has rebuilt our list of branch tags, we can build the
|
||||
# header and prepend it to the message
|
||||
unshift(@text, build_header($modname, "Module $modname: Change committed",
|
||||
\@mailto, @branch_tags));
|
||||
|
||||
# sort the files out for our diff
|
||||
@files = sort { $a->{name} cmp $b->{name} } @files;
|
||||
|
||||
my ($user, $filename);
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
|
||||
$user = getpwuid($<);
|
||||
|
||||
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
|
||||
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
|
||||
|
||||
push(@text, "--$boundary");
|
||||
push(@text, "Content-Type: text/plain; name=\"$filename\"");
|
||||
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
|
||||
push(@text, "Content-Transfer-Encoding: 8bit");
|
||||
push(@text, "");
|
||||
|
||||
foreach my $file (@files) {
|
||||
debug "Diffing file $file->{name}...\n";
|
||||
|
||||
# Run cvs rdiff, extracting a diff between the old version and the new
|
||||
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
|
||||
"$modname/$file->{name}|");
|
||||
while (<DIFF>) {
|
||||
chomp;
|
||||
push(@text, $_);
|
||||
}
|
||||
close(DIFF);
|
||||
}
|
||||
|
||||
# send the mail...
|
||||
send_mail(\@mailto, \@text);
|
||||
|
||||
# and clean up after ourselves
|
||||
cleanup_dir($tmpdir);
|
||||
@@ -1,3 +1,167 @@
|
||||
ChangeLog for fs2_open. All times are UTC.
|
||||
Updated 2002-08-13 04:31
|
||||
|
||||
|
||||
2002-08-13 03:40 penguin
|
||||
|
||||
RELEASED: fs2_open 3.2 (tag: fs2_open3_2)
|
||||
|
||||
2002-08-13 03:34 penguin
|
||||
|
||||
* code/freespace2/freespace.cpp (2.6):
|
||||
|
||||
1. Disable CD checking
|
||||
2. Add CVS tag to version string
|
||||
|
||||
2002-08-13 03:32 penguin
|
||||
|
||||
* code/globalincs/version.h (2.2):
|
||||
|
||||
Bumped to version 3.2
|
||||
|
||||
2002-08-07 00:45 DTP
|
||||
|
||||
* code/graphics/grd3drender.cpp (2.3):
|
||||
|
||||
Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
|
||||
|
||||
2002-08-07 00:44 DTP
|
||||
|
||||
* code/cmdline/: cmdline.cpp (2.4), cmdline.h (2.3):
|
||||
|
||||
Implented -GF4FIX commandline switch
|
||||
|
||||
2002-08-06 16:50 phreak
|
||||
|
||||
* code/hud/hudtargetbox.cpp (2.2):
|
||||
|
||||
added wireframe targetbox feature
|
||||
|
||||
2002-08-06 16:50 phreak
|
||||
|
||||
* code/hud/hudtargetbox.h (2.1):
|
||||
|
||||
added Targetbox_wire variable to check what mode the hud targetbox
|
||||
uses
|
||||
|
||||
2002-08-06 16:49 phreak
|
||||
|
||||
* code/io/keycontrol.cpp (2.2):
|
||||
|
||||
added keybing for wireframe hud, fixed previous missile cheat
|
||||
|
||||
2002-08-06 04:39 penguin
|
||||
|
||||
* code/hud/hudwingmanstatus.cpp (2.2):
|
||||
|
||||
Use text strings for wingmen names instead of ANI
|
||||
|
||||
2002-08-06 03:50 penguin
|
||||
|
||||
* code/ui/ui.h (2.2):
|
||||
|
||||
inserted "class" keyword on "friend" definitions (ANSI C++ )
|
||||
|
||||
2002-08-06 02:42 penguin
|
||||
|
||||
* Freespace2.dsp (1.7), code/code.dsp (1.6):
|
||||
|
||||
Fixed problem w/ compile options for Debug mode
|
||||
|
||||
2002-08-06 01:49 penguin
|
||||
|
||||
* code/Makefile (2.4):
|
||||
|
||||
Removed a couple more include dirs I missed
|
||||
|
||||
2002-08-06 01:49 penguin
|
||||
|
||||
* code/: globalincs/pstypes.h (2.4), render/3dclipper.cpp (2.2),
|
||||
render/3ddraw.cpp (2.2):
|
||||
|
||||
Renamed ccode members to cc_or and cc_and
|
||||
|
||||
2002-08-04 05:43 penguin
|
||||
|
||||
* ChangeLog (1.1), code/ChangeLog (1.3):
|
||||
|
||||
Moved ChangeLog to top-level directory
|
||||
|
||||
2002-08-04 05:13 penguin
|
||||
|
||||
RELEASED: fs2_open 3.1 (tag: fs2_open3_1)
|
||||
|
||||
2002-08-04 05:13 penguin
|
||||
|
||||
* code/network/stand_gui.cpp (2.3):
|
||||
|
||||
Change version display
|
||||
|
||||
* code/menuui/playermenu.cpp (2.2):
|
||||
|
||||
Display fs2_open version instead of "Freespace 2"
|
||||
|
||||
* code/menuui/mainhallmenu.cpp (2.3):
|
||||
|
||||
Change version display location
|
||||
|
||||
* code/globalincs/version.h (2.1):
|
||||
|
||||
Update version number to 3.1
|
||||
|
||||
* code/freespace2/freespace.cpp (2.5):
|
||||
|
||||
Don't write version to registry; change way version string is
|
||||
formatted
|
||||
|
||||
* code/ChangeLog (1.1), ChangeLog (1.2):
|
||||
|
||||
Moved ChangeLog to top-level directory
|
||||
|
||||
2002-08-03 19:42 randomtiger
|
||||
|
||||
* code/graphics/grd3drender.cpp (2.2):
|
||||
|
||||
Fixed Geforce 4 bug that caused font and hall video distortion.
|
||||
Very small change in 'gr_d3d_aabitmap_ex_internal'
|
||||
|
||||
Tested and works on the following systems
|
||||
|
||||
OUTSIDER Voodoo 3 win98 OUTSIDER Geforce 2 win2000 Me Geforce 4 PNY
|
||||
4600 XP JBX-Phoenix Geforce 4 PNY XP Mehrunes GeForce 3 XP
|
||||
WMCoolmon nVidia TNT2 M64 win2000 Orange GeForce 4 4200 XP
|
||||
ShadowWolf_IH Monster2 win98 ShadowWolf_IH voodoo 2 win98
|
||||
|
||||
2002-08-03 18:34 wmcoolmon
|
||||
|
||||
* code/code.dsp (1.5), Freespace2.dsp (1.6):
|
||||
|
||||
Fixed Win32 debug configuration
|
||||
|
||||
2002-08-03 17:42 wmcoolmon
|
||||
|
||||
* Freespace2.dsp (1.5), code/code.dsp (1.4):
|
||||
|
||||
Sync with makefile 1.4
|
||||
|
||||
2002-08-01 04:04 penguin
|
||||
|
||||
* code/ChangeLog (1.2):
|
||||
|
||||
updated
|
||||
|
||||
2002-08-01 02:00 penguin
|
||||
|
||||
* fs2_open.w32.mak (1.4):
|
||||
|
||||
The big include file move
|
||||
|
||||
====
|
||||
NOTE:
|
||||
====
|
||||
below this point, all files are relative to the 'code' directory
|
||||
|
||||
|
||||
2002-08-01 01:41 penguin
|
||||
|
||||
* Makefile (2.3), anim/animplay.cpp (2.1), anim/animplay.h (2.1),
|
||||
@@ -1107,3 +1271,4 @@
|
||||
|
||||
|
||||
# generated by cvs2cl.pl
|
||||
# cvs2cl.pl -r -S --utc -f ChangeLog2
|
||||
@@ -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 "." /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "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"
|
||||
|
||||
@@ -91,9 +91,8 @@ LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-I. -Iwindows_stub \
|
||||
-I. \
|
||||
-fno-exceptions \
|
||||
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
|
||||
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-08-07 00:44:13 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
@@ -251,8 +254,7 @@ cmdline_parm mouse_coords("-coords", NULL);
|
||||
cmdline_parm timeout("-timeout", NULL);
|
||||
cmdline_parm d3d_window("-window", NULL);
|
||||
cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
|
||||
|
||||
|
||||
cmdline_parm gf4fix_arg("-GF4FIX", NULL); //DTP for random tigers GF4fix
|
||||
|
||||
int Cmdline_multi_stream_chat_to_file = 0;
|
||||
int Cmdline_freespace_no_sound = 0;
|
||||
@@ -270,7 +272,7 @@ char *Cmdline_game_password = NULL;
|
||||
char *Cmdline_rank_above= NULL;
|
||||
char *Cmdline_rank_below = NULL;
|
||||
char *Cmdline_connect_addr = NULL;
|
||||
char *Cmdline_almission = NULL; //DTP FOR AUTO-LOAD Multi MISSION
|
||||
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
|
||||
int Cmdline_multi_log = 0;
|
||||
int Cmdline_server_firing = 0;
|
||||
int Cmdline_client_dodamage = 0;
|
||||
@@ -280,6 +282,7 @@ int Cmdline_mouse_coords = 0;
|
||||
int Cmdline_timeout = -1;
|
||||
|
||||
int Cmdline_window = 0;
|
||||
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
|
||||
|
||||
static cmdline_parm Parm_list(NULL, NULL);
|
||||
static int Parm_list_inited = 0;
|
||||
@@ -643,6 +646,8 @@ int parse_cmdline(int argc, char *argv[])
|
||||
Cmdline_use_last_pilot = 1;
|
||||
Cmdline_start_netgame = 1;
|
||||
}
|
||||
|
||||
if (gf4fix_arg.found() ) {
|
||||
Cmdline_gf4fix = 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -9,11 +9,14 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-07-29 06:35:15 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-07 00:44:13 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -198,6 +201,7 @@ extern int Cmdline_timeout;
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern char *Cmdline_almission; //DTP for autoload mission
|
||||
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
|
||||
|
||||
|
||||
#endif
|
||||
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "..\Debug\Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /FI"PSTypes.h" /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_DX81" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2002-08-04 05:11:05 $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-08-13 03:34:00 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Freespace main body
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2002/08/04 05:11:05 penguin
|
||||
* Don't write version to registry; change way version string is formatted
|
||||
*
|
||||
* Revision 2.4 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -482,6 +485,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
static const char RCS_Name[] = "$Name: not supported by cvs2svn $";
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -7826,14 +7831,29 @@ void get_version_string(char *str)
|
||||
{
|
||||
//XSTR:OFF
|
||||
if ( FS_VERSION_BUILD == 0 ) {
|
||||
sprintf(str,"fs2_open %d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
|
||||
sprintf(str,"V%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
|
||||
} else {
|
||||
sprintf(str,"fs2_open %d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
|
||||
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
strcat(str, " Dbg");
|
||||
#endif
|
||||
|
||||
// append the CVS "release" version in the $Name variable, but
|
||||
// only do this if it's been tagged
|
||||
int rcs_name_len = strlen(RCS_Name);
|
||||
if (rcs_name_len > 11) {
|
||||
char buffer[100];
|
||||
strcpy(buffer, RCS_Name + 7);
|
||||
buffer[rcs_name_len-9] = 0;
|
||||
|
||||
strcat(str, " Build: ");
|
||||
strcat(str, buffer);
|
||||
} else {
|
||||
strcat(str, " (fs2_open)");
|
||||
}
|
||||
|
||||
//XSTR:ON
|
||||
/*
|
||||
HMODULE hMod;
|
||||
@@ -8607,7 +8627,8 @@ int game_do_cd_check_specific(char *volume_name, int cdnum)
|
||||
// only need to do this in RELEASE_REAL
|
||||
int game_do_cd_mission_check(char *filename)
|
||||
{
|
||||
#ifdef RELEASE_REAL
|
||||
//#ifdef RELEASE_REAL
|
||||
#if 0
|
||||
int cd_num;
|
||||
int cd_present = 0;
|
||||
int cd_drive_num;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $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.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/22 01:04:37 penguin
|
||||
* took out GAME_CD_CHECK define
|
||||
*
|
||||
@@ -269,7 +272,7 @@ typedef unsigned int uint;
|
||||
|
||||
//Stucture to store clipping codes in a word
|
||||
typedef struct ccodes {
|
||||
ubyte or,and; //or is low byte, and is high byte
|
||||
ubyte cc_or, cc_and; //or is low byte, and is high byte
|
||||
} ccodes;
|
||||
|
||||
typedef struct vector {
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-04 05:11:36 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-13 03:32:25 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/04 05:11:36 penguin
|
||||
* Update version number to 3.1
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -123,7 +126,7 @@
|
||||
// Major.Minor.Bugfix
|
||||
|
||||
#define FS_VERSION_MAJOR 3 // major version
|
||||
#define FS_VERSION_MINOR 1 // increase by 1 for minor revs
|
||||
#define FS_VERSION_MINOR 2 // increase by 1 for minor revs
|
||||
#define FS_VERSION_BUILD 0 // bugfix release
|
||||
|
||||
#define VERSION_LOC_FNAME "version.nfo"
|
||||
|
||||
@@ -9,13 +9,29 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-03 19:42:17 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-07 00:45:25 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* Code to actually render stuff using Direct3D
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/03 19:42:17 randomtiger
|
||||
* Fixed Geforce 4 bug that caused font and hall video distortion.
|
||||
* Very small change in 'gr_d3d_aabitmap_ex_internal'
|
||||
*
|
||||
* Tested and works on the following systems
|
||||
*
|
||||
* OUTSIDER Voodoo 3 win98
|
||||
* OUTSIDER Geforce 2 win2000
|
||||
* Me Geforce 4 PNY 4600 XP
|
||||
* JBX-Phoenix Geforce 4 PNY XP
|
||||
* Mehrunes GeForce 3 XP
|
||||
* WMCoolmon nVidia TNT2 M64 win2000
|
||||
* Orange GeForce 4 4200 XP
|
||||
* ShadowWolf_IH Monster2 win98
|
||||
* ShadowWolf_IH voodoo 2 win98
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -326,6 +342,7 @@
|
||||
#include "cfile/cfile.h"
|
||||
#include "nebula/neb.h"
|
||||
#include "render/3d.h"
|
||||
#include "cmdline/cmdline.h" //DTP for random tigers GF4fix, and the commandline switch.
|
||||
|
||||
typedef enum gr_texture_source {
|
||||
TEXTURE_SOURCE_NONE,
|
||||
@@ -1489,19 +1506,30 @@ void gr_d3d_aabitmap_ex_internal(int x,int y,int w,int h,int sx,int sy)
|
||||
|
||||
bm_get_info( gr_screen.current_bitmap, &bw, &bh );
|
||||
|
||||
// Rendition
|
||||
// Rendition
|
||||
if ( D3d_rendition_uvs ) {
|
||||
u0 = u_scale*(i2fl(sx)+0.5f)/i2fl(bw);
|
||||
v0 = v_scale*(i2fl(sy)+0.5f)/i2fl(bh);
|
||||
|
||||
u1 = u_scale*(i2fl(sx+w)+0.5f)/i2fl(bw);
|
||||
v1 = v_scale*(i2fl(sy+h)+0.5f)/i2fl(bh);
|
||||
} else {
|
||||
u0 = u_scale*i2fl((sx)-0.5f)/i2fl(bw);
|
||||
v0 = v_scale*i2fl((sy)-0.5f)/i2fl(bh);
|
||||
//} else { //DTP; commented out, for easy re-editing
|
||||
// u0 = u_scale*i2fl((sx)-0.5f)/i2fl(bw);
|
||||
// v0 = v_scale*i2fl((sy)-0.5f)/i2fl(bh);
|
||||
|
||||
u1 = u_scale*i2fl((sx+w)-0.5f)/i2fl(bw);
|
||||
v1 = v_scale*i2fl((sy+h)-0.5f)/i2fl(bh);
|
||||
// u1 = u_scale*i2fl((sx+w)-0.5f)/i2fl(bw);
|
||||
// v1 = v_scale*i2fl((sy+h)-0.5f)/i2fl(bh);
|
||||
//}
|
||||
} else if (!Cmdline_gf4fix) { //DTP if not set at commandline do the original code
|
||||
u0 = u_scale*i2fl(sx)/i2fl(bw);
|
||||
v0 = v_scale*i2fl(sy)/i2fl(bh);
|
||||
u1 = u_scale*i2fl(sx+w)/i2fl(bw);
|
||||
v1 = v_scale*i2fl(sy+h)/i2fl(bh);
|
||||
} else { //DTP; these next 4 lines is random tigers Fix. activated by setting -GF4FIX in the commandline.
|
||||
u0 = u_scale*(i2fl(sx)-0.5f)/i2fl(bw);
|
||||
v0 = v_scale*(i2fl(sy)-0.5f)/i2fl(bh);
|
||||
u1 = u_scale*(i2fl(sx+w)-0.5f)/i2fl(bw);
|
||||
v1 = v_scale*(i2fl(sy+h)-0.5f)/i2fl(bh);
|
||||
}
|
||||
|
||||
x1 = i2fl(x+gr_screen.offset_x);
|
||||
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 16:50:44 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* C module for drawing the target monitor box on the HUD
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
*
|
||||
* Revision 2.21 2002/08/04 23:17:40 PhReAk
|
||||
* Did the toggling code for wireframes -> CTRL+SHIFT+Q
|
||||
*
|
||||
* Revision 2.2 2002/08/04 21:53:13 PhReAk
|
||||
* Changed hud_render_target_asteroid, ...weapon, ...ship to render in wireframe
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -368,6 +378,8 @@ int Targetbox_flash_flags;
|
||||
// during the game.
|
||||
int Targetbox_show_extra_info = 1;
|
||||
|
||||
int Targetbox_wire=0;
|
||||
|
||||
// Different target states. This drives the text display right below the hull integrity on the targetbox.
|
||||
#define TS_DIS 0
|
||||
#define TS_OK 1
|
||||
@@ -794,11 +806,14 @@ void hud_render_target_asteroid(object *target_objp)
|
||||
float time_to_impact, factor;
|
||||
int subtype;
|
||||
|
||||
int flags=0; //draw flags for wireframe
|
||||
asteroidp = &Asteroids[target_objp->instance];
|
||||
|
||||
target_team = obj_team(target_objp);
|
||||
|
||||
subtype = asteroidp->asteroid_subtype;
|
||||
|
||||
time_to_impact = asteroid_time_to_impact(target_objp);
|
||||
|
||||
if ( Detail.targetview_model ) {
|
||||
// take the forward orientation to be the vector from the player to the current target
|
||||
@@ -817,7 +832,20 @@ void hud_render_target_asteroid(object *target_objp)
|
||||
|
||||
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
|
||||
model_clear_instance(Asteroid_info[asteroidp->type].model_num[subtype]);
|
||||
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
{
|
||||
if (time_to_impact>=0)
|
||||
model_set_outline_color(255,255,255);
|
||||
else
|
||||
model_set_outline_color(64,64,0);
|
||||
|
||||
flags = MR_SHOW_OUTLINE;
|
||||
if (Targetbox_wire==1)
|
||||
flags |=MR_NO_POLYS;
|
||||
}
|
||||
|
||||
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, flags |MR_NO_LIGHTING | MR_LOCK_DETAIL );
|
||||
hud_render_target_close();
|
||||
}
|
||||
|
||||
@@ -860,7 +888,7 @@ void hud_render_target_asteroid(object *target_objp)
|
||||
|
||||
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, hud_name);
|
||||
|
||||
time_to_impact = asteroid_time_to_impact(target_objp);
|
||||
|
||||
if ( time_to_impact >= 0 ) {
|
||||
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, NOX("impact: %.1f sec"), time_to_impact);
|
||||
}
|
||||
@@ -1231,6 +1259,7 @@ void hud_render_target_ship(object *target_objp)
|
||||
target_shipp = &Ships[target_objp->instance];
|
||||
target_sip = &Ship_info[target_shipp->ship_info_index];
|
||||
|
||||
int flags=0;
|
||||
if ( Detail.targetview_model ) {
|
||||
// take the forward orientation to be the vector from the player to the current target
|
||||
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
|
||||
@@ -1253,11 +1282,41 @@ void hud_render_target_ship(object *target_objp)
|
||||
// model_clear_instance(target_sip->modelnum);
|
||||
ship_model_start( target_objp );
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
{
|
||||
//set team colors
|
||||
if (target_shipp->team==Player_ship->team)
|
||||
{
|
||||
model_set_outline_color(0,255,0);
|
||||
}
|
||||
else if (((Player_ship->team==TEAM_TRAITOR) && (target_shipp->team==TEAM_FRIENDLY)) ||
|
||||
(target_shipp->team==TEAM_HOSTILE) || (target_shipp->team==TEAM_NEUTRAL))
|
||||
{
|
||||
model_set_outline_color(255,0,0);
|
||||
}
|
||||
else if (target_shipp->team==TEAM_UNKNOWN)
|
||||
{
|
||||
model_set_outline_color(255,0,255);
|
||||
}
|
||||
else
|
||||
{
|
||||
model_set_outline_color(255,255,255);
|
||||
}
|
||||
|
||||
//if a ship is tagged, it overrides team colors
|
||||
if (ship_is_tagged(target_objp))
|
||||
{
|
||||
model_set_outline_color(255,255,0);
|
||||
}
|
||||
flags = MR_SHOW_OUTLINE;
|
||||
if (Targetbox_wire==1)
|
||||
flags |=MR_NO_POLYS;
|
||||
}
|
||||
// maybe render a special hud-target-only model
|
||||
if(target_sip->modelnum_hud >= 0){
|
||||
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
} else {
|
||||
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
}
|
||||
ship_model_stop( target_objp );
|
||||
|
||||
@@ -1311,6 +1370,7 @@ void hud_render_target_debris(object *target_objp)
|
||||
vector orient_vec, up_vector;
|
||||
int target_team, base_index;
|
||||
float factor;
|
||||
int flags=0;
|
||||
|
||||
debrisp = &Debris[target_objp->instance];
|
||||
|
||||
@@ -1333,9 +1393,16 @@ void hud_render_target_debris(object *target_objp)
|
||||
// the objects position
|
||||
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
{
|
||||
model_set_outline_color(255,255,255);
|
||||
flags = MR_SHOW_OUTLINE;
|
||||
if (Targetbox_wire==1)
|
||||
flags |=MR_NO_POLYS;
|
||||
}
|
||||
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
|
||||
model_clear_instance(debrisp->model_num);
|
||||
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
|
||||
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL );
|
||||
hud_render_target_close();
|
||||
}
|
||||
|
||||
@@ -1380,6 +1447,7 @@ void hud_render_target_weapon(object *target_objp)
|
||||
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
|
||||
float factor;
|
||||
char outstr[100]; // temp buffer
|
||||
int flags=0;
|
||||
|
||||
target_team = obj_team(target_objp);
|
||||
|
||||
@@ -1408,6 +1476,31 @@ void hud_render_target_weapon(object *target_objp)
|
||||
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
|
||||
}
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
{
|
||||
if (target_team==Player_ship->team)
|
||||
{
|
||||
model_set_outline_color(0,255,0);
|
||||
}
|
||||
else if (((Player_ship->team==TEAM_TRAITOR) && (target_team==TEAM_FRIENDLY)) ||
|
||||
(target_team==TEAM_HOSTILE) || (target_team==TEAM_NEUTRAL))
|
||||
{
|
||||
model_set_outline_color(128,128,0);
|
||||
}
|
||||
else if (target_team==TEAM_UNKNOWN)
|
||||
{
|
||||
model_set_outline_color(255,0,255);
|
||||
}
|
||||
else
|
||||
{
|
||||
model_set_outline_color(255,255,255);
|
||||
}
|
||||
flags = MR_SHOW_OUTLINE;
|
||||
if (Targetbox_wire==1)
|
||||
flags |=MR_NO_POLYS;
|
||||
}
|
||||
|
||||
|
||||
// take the forward orientation to be the vector from the player to the current target
|
||||
vm_vec_sub(&orient_vec, &viewed_obj->pos, &viewer_obj->pos);
|
||||
vm_vec_normalize(&orient_vec);
|
||||
@@ -1427,7 +1520,8 @@ 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, MR_NO_LIGHTING | MR_LOCK_DETAIL );
|
||||
|
||||
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
hud_render_target_close();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:23 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-06 16:50:13 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Header file for drawing the target monitor box on the HUD
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/08/04 22:46:55 PhReAk
|
||||
* Added "Targetbox_wire" variable to toggle if wireframes are on=1 or off=0
|
||||
*
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:08 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -145,6 +152,9 @@ extern int Target_window_coords[GR_NUM_RESOLUTIONS][4];
|
||||
// during the game.
|
||||
extern int Targetbox_show_extra_info;
|
||||
|
||||
//used to track if the player has wireframe hud target box turned on
|
||||
extern int Targetbox_wire;
|
||||
|
||||
void hud_targetbox_init();
|
||||
void hud_targetbox_init_flash();
|
||||
void hud_render_target_model();
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDWingmanStatus.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 04:39:26 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Module for the wingman status gauge
|
||||
*
|
||||
* $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:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -172,6 +175,13 @@ static int HUD_wingman_flash_duration[HUD_WINGMAN_MAX_WINGS][HUD_WINGMAN_MAX_SHI
|
||||
static int HUD_wingman_flash_next[HUD_WINGMAN_MAX_WINGS][HUD_WINGMAN_MAX_SHIPS_PER_WINGS];
|
||||
static int HUD_wingman_flash_is_bright;
|
||||
|
||||
|
||||
//XSTR:OFF
|
||||
// Text versions of wingman names (instead of bitmaps in winman5.ani)
|
||||
static char *Wingman_status_name_abbr[6] = { "alp", "bet", "gam", "del", "eps", "zet" };
|
||||
//XSTR:ON
|
||||
|
||||
|
||||
// coords to draw wingman status icons, for 1-5 wings (0-4)
|
||||
int HUD_wingman_left_coords[GR_NUM_RESOLUTIONS][5][2] = {
|
||||
{ // GR_640
|
||||
@@ -691,8 +701,6 @@ void hud_wingman_status_blit_dots(int wing_index, int screen_index, int num_wing
|
||||
}
|
||||
|
||||
// draw wing name
|
||||
bitmap = Wingman_status_frames[WINGMAN_STATUS_NAMES].first_frame + wing_index;
|
||||
|
||||
if ( num_wings_to_draw == 1 ) {
|
||||
sx = HUD_wingman_status_single_coords[gr_screen.res][0][0] - 8;
|
||||
sy = HUD_wingman_status_single_coords[gr_screen.res][0][1] + 26;
|
||||
@@ -700,15 +708,8 @@ void hud_wingman_status_blit_dots(int wing_index, int screen_index, int num_wing
|
||||
sx = HUD_wingman_status_name_coords[gr_screen.res][screen_pos][0];
|
||||
sy = HUD_wingman_status_name_coords[gr_screen.res][screen_pos][1];
|
||||
}
|
||||
|
||||
// hud_set_default_color();
|
||||
hud_set_gauge_color(HUD_WINGMEN_STATUS);
|
||||
if ( bitmap > -1 ) {
|
||||
GR_AABITMAP(bitmap, sx, sy);
|
||||
// gr_set_bitmap(bitmap);
|
||||
// gr_aabitmap(sx, sy);
|
||||
}
|
||||
|
||||
gr_string(sx, sy, Wingman_status_name_abbr[wing_index]);
|
||||
}
|
||||
|
||||
int hud_wingman_status_wingmen_exist(int num_wings_to_draw)
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 16:49:22 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Routines to read and deal with keyboard input.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
*
|
||||
* Revision 2.2 2002/08/04 23:15:40 PhReAk
|
||||
* Fixed previous missile cheat, commented out beam_test(x) lines
|
||||
* in process_debug_keys(). beam_test(x) caused assertion failure in
|
||||
* beam.cpp apprx line 3147. Also added toggle for wire_hud in process_player_ship_keys()
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -1066,7 +1075,7 @@ void process_debug_keys(int k)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
case KEY_DEBUGGED + KEY_SHIFTED + KEY_9: {
|
||||
case KEY_DEBUGGED1 + KEY_SHIFTED + KEY_9:
|
||||
ship* shipp;
|
||||
@@ -1079,7 +1088,7 @@ void process_debug_keys(int k)
|
||||
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Secondary Weapon forced to %s", 18), Weapon_info[shipp->weapons.secondary_bank_weapons[shipp->weapons.current_secondary_bank]].name);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FS2_DEMO
|
||||
case KEY_DEBUGGED + KEY_U: {
|
||||
@@ -1251,7 +1260,7 @@ void process_debug_keys(int k)
|
||||
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Skill level set to %s.", 25), Skill_level_names(Game_skill_level));
|
||||
break;
|
||||
|
||||
// kill all missiles
|
||||
/*// kill all missiles
|
||||
case KEY_DEBUGGED + KEY_SHIFTED + KEY_1:
|
||||
beam_test(1);
|
||||
break;
|
||||
@@ -1288,7 +1297,7 @@ void process_debug_keys(int k)
|
||||
break;
|
||||
case KEY_DEBUGGED + KEY_CTRLED + KEY_3:
|
||||
beam_test_new(3);
|
||||
break;
|
||||
break;*/
|
||||
|
||||
#ifndef NO_SOUND
|
||||
case KEY_DEBUGGED + KEY_T: {
|
||||
@@ -1368,6 +1377,7 @@ void process_debug_keys(int k)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} // end switch
|
||||
|
||||
}
|
||||
@@ -1499,6 +1509,17 @@ void process_player_ship_keys(int k)
|
||||
return;
|
||||
}
|
||||
|
||||
//phreak 2002/08/04 - put this here for now
|
||||
if (k==KEY_SHIFTED + KEY_CTRLED + KEY_Q)
|
||||
{
|
||||
extern int Targetbox_wire;
|
||||
Targetbox_wire++;
|
||||
if (Targetbox_wire==3)
|
||||
Targetbox_wire=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// pass the key to the squadmate messaging code. If the messaging code took the key, then return
|
||||
// from here immediately since we don't want to do further key processing.
|
||||
if ( hud_squadmsg_read_key(k) )
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Render/3dClipper.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:09 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 01:49:08 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Polygon clipping functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:27 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -259,7 +262,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
|
||||
src[*nv] = src[0];
|
||||
src[*nv+1] = src[1];
|
||||
|
||||
cc->and = 0xff; cc->or = 0;
|
||||
cc->cc_and = 0xff;
|
||||
cc->cc_or = 0;
|
||||
|
||||
for (i=1;i<=*nv;i++) {
|
||||
|
||||
@@ -268,16 +272,16 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
|
||||
if (! (src[i-1]->codes & plane_flag)) { //prev not off?
|
||||
|
||||
*dest = clip_edge(plane_flag,src[i-1],src[i],flags);
|
||||
cc->or |= (*dest)->codes;
|
||||
cc->and &= (*dest)->codes;
|
||||
cc->cc_or |= (*dest)->codes;
|
||||
cc->cc_and &= (*dest)->codes;
|
||||
dest++;
|
||||
}
|
||||
|
||||
if (! (src[i+1]->codes & plane_flag)) {
|
||||
|
||||
*dest = clip_edge(plane_flag,src[i+1],src[i],flags);
|
||||
cc->or |= (*dest)->codes;
|
||||
cc->and &= (*dest)->codes;
|
||||
cc->cc_or |= (*dest)->codes;
|
||||
cc->cc_and &= (*dest)->codes;
|
||||
dest++;
|
||||
}
|
||||
|
||||
@@ -290,8 +294,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
|
||||
|
||||
*dest++ = src[i];
|
||||
|
||||
cc->or |= src[i]->codes;
|
||||
cc->and &= src[i]->codes;
|
||||
cc->cc_or |= src[i]->codes;
|
||||
cc->cc_and &= src[i]->codes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,11 +310,11 @@ vertex **clip_polygon(vertex **src,vertex **dest,int *nv,ccodes *cc,uint flags)
|
||||
|
||||
for (plane_flag=1;plane_flag<=CC_OFF_USER;plane_flag<<=1)
|
||||
|
||||
if (cc->or & plane_flag) {
|
||||
if (cc->cc_or & plane_flag) {
|
||||
|
||||
*nv = clip_plane(plane_flag,src,dest,nv,cc,flags);
|
||||
|
||||
if (cc->and) //clipped away
|
||||
if (cc->cc_and) //clipped away
|
||||
return dest;
|
||||
|
||||
t = src; src = dest; dest = t;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Render/3ddraw.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:09 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 01:49:08 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* 3D rendering primitives
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:27 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -323,7 +326,8 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
|
||||
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
cc.or = 0; cc.and = 0xff;
|
||||
cc.cc_or = 0;
|
||||
cc.cc_and = 0xff;
|
||||
|
||||
bufptr = Vbuf0;
|
||||
|
||||
@@ -332,19 +336,19 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
|
||||
|
||||
p = bufptr[i] = pointlist[i];
|
||||
|
||||
cc.and &= p->codes;
|
||||
cc.or |= p->codes;
|
||||
cc.cc_and &= p->codes;
|
||||
cc.cc_or |= p->codes;
|
||||
}
|
||||
|
||||
if (cc.and)
|
||||
if (cc.cc_and)
|
||||
return 1; //all points off screen
|
||||
|
||||
if (cc.or) {
|
||||
if (cc.cc_or) {
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
bufptr = clip_polygon(Vbuf0,Vbuf1,&nv,&cc,tmap_flags);
|
||||
|
||||
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
|
||||
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
vertex *p = bufptr[i];
|
||||
@@ -405,7 +409,7 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
|
||||
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
cc.or = 0; cc.and = 0xff;
|
||||
cc.cc_or = 0; cc.cc_and = 0xff;
|
||||
|
||||
bufptr = Vbuf0;
|
||||
|
||||
@@ -414,19 +418,19 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
|
||||
|
||||
p = bufptr[i] = pointlist[i];
|
||||
|
||||
cc.and &= p->codes;
|
||||
cc.or |= p->codes;
|
||||
cc.cc_and &= p->codes;
|
||||
cc.cc_or |= p->codes;
|
||||
}
|
||||
|
||||
if (cc.and)
|
||||
if (cc.cc_and)
|
||||
return 1; //all points off screen
|
||||
|
||||
if (cc.or) {
|
||||
if (cc.cc_or) {
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
|
||||
|
||||
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
|
||||
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
vertex *p = bufptr[i];
|
||||
@@ -812,7 +816,8 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
|
||||
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
cc.or = 0; cc.and = 0xff;
|
||||
cc.cc_or = 0;
|
||||
cc.cc_and = 0xff;
|
||||
|
||||
bufptr = Vbuf0;
|
||||
|
||||
@@ -821,20 +826,20 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
|
||||
|
||||
p = bufptr[i] = pointlist[i];
|
||||
|
||||
cc.and &= p->codes;
|
||||
cc.or |= p->codes;
|
||||
cc.cc_and &= p->codes;
|
||||
cc.cc_or |= p->codes;
|
||||
}
|
||||
|
||||
if (cc.and){
|
||||
if (cc.cc_and){
|
||||
return 0.0f; //all points off screen
|
||||
}
|
||||
|
||||
if (cc.or) {
|
||||
if (cc.cc_or) {
|
||||
Assert( G3_count == 1 );
|
||||
|
||||
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
|
||||
|
||||
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
|
||||
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
vertex *p = bufptr[i];
|
||||
|
||||
+39
-36
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ui/UI.H $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:10 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-06 03:50:48 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for our user interface.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:10 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:29 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -379,17 +382,17 @@ class UI_DOT_SLIDER_NEW;
|
||||
|
||||
class UI_GADGET
|
||||
{
|
||||
friend UI_WINDOW;
|
||||
friend UI_BUTTON;
|
||||
friend UI_KEYTRAP;
|
||||
friend UI_CHECKBOX;
|
||||
friend UI_RADIO;
|
||||
friend UI_SCROLLBAR;
|
||||
friend UI_LISTBOX;
|
||||
friend UI_INPUTBOX;
|
||||
// friend UI_SLIDER;
|
||||
friend UI_DOT_SLIDER;
|
||||
friend UI_DOT_SLIDER_NEW;
|
||||
friend class UI_WINDOW;
|
||||
friend class UI_BUTTON;
|
||||
friend class UI_KEYTRAP;
|
||||
friend class UI_CHECKBOX;
|
||||
friend class UI_RADIO;
|
||||
friend class UI_SCROLLBAR;
|
||||
friend class UI_LISTBOX;
|
||||
friend class UI_INPUTBOX;
|
||||
// friend class UI_SLIDER;
|
||||
friend class UI_DOT_SLIDER;
|
||||
friend class UI_DOT_SLIDER_NEW;
|
||||
|
||||
protected:
|
||||
char *bm_filename;
|
||||
@@ -513,10 +516,10 @@ typedef struct UI_XSTR {
|
||||
|
||||
class UI_BUTTON : public UI_GADGET
|
||||
{
|
||||
friend UI_SCROLLBAR;
|
||||
// friend UI_SLIDER;
|
||||
friend UI_DOT_SLIDER;
|
||||
friend UI_DOT_SLIDER_NEW;
|
||||
friend class UI_SCROLLBAR;
|
||||
// friend class UI_SLIDER;
|
||||
friend class UI_DOT_SLIDER;
|
||||
friend class UI_DOT_SLIDER_NEW;
|
||||
|
||||
char *text;
|
||||
int position; // indicates position of button (0 - up, 1 - down by mouse click 2 - down by keypress
|
||||
@@ -711,8 +714,8 @@ class UI_RADIO : public UI_GADGET
|
||||
|
||||
class UI_SCROLLBAR : public UI_GADGET
|
||||
{
|
||||
friend UI_LISTBOX;
|
||||
friend UI_BUTTON;
|
||||
friend class UI_LISTBOX;
|
||||
friend class UI_BUTTON;
|
||||
int horz;
|
||||
int start;
|
||||
int stop;
|
||||
@@ -749,7 +752,7 @@ class UI_SCROLLBAR : public UI_GADGET
|
||||
|
||||
class UI_SLIDER2 : public UI_GADGET
|
||||
{
|
||||
friend UI_BUTTON;
|
||||
friend class UI_BUTTON;
|
||||
private:
|
||||
int numberItems; // total range
|
||||
int numberPositions; // total positions (height - bitmapbuttonheight)
|
||||
@@ -807,7 +810,7 @@ class UI_SLIDER2 : public UI_GADGET
|
||||
// to be phased out eventually in FS2
|
||||
class UI_DOT_SLIDER : public UI_GADGET
|
||||
{
|
||||
friend UI_BUTTON;
|
||||
friend class UI_BUTTON;
|
||||
|
||||
UI_BUTTON button;
|
||||
UI_BUTTON up_button;
|
||||
@@ -827,7 +830,7 @@ class UI_DOT_SLIDER : public UI_GADGET
|
||||
|
||||
class UI_DOT_SLIDER_NEW : public UI_GADGET
|
||||
{
|
||||
friend UI_BUTTON;
|
||||
friend class UI_BUTTON;
|
||||
UI_BUTTON button;
|
||||
UI_BUTTON up_button;
|
||||
UI_BUTTON down_button;
|
||||
@@ -900,19 +903,19 @@ class UI_LISTBOX : public UI_GADGET
|
||||
|
||||
class UI_WINDOW
|
||||
{
|
||||
friend UI_GADGET;
|
||||
friend UI_BUTTON;
|
||||
friend UI_KEYTRAP;
|
||||
friend UI_CHECKBOX;
|
||||
friend UI_RADIO;
|
||||
friend UI_SCROLLBAR;
|
||||
friend UI_LISTBOX;
|
||||
friend UI_INPUTBOX;
|
||||
// friend UI_SLIDER;
|
||||
friend UI_SLIDER2;
|
||||
friend UI_DOT_SLIDER;
|
||||
friend UI_DOT_SLIDER_NEW;
|
||||
friend UI_ICON;
|
||||
friend class UI_GADGET;
|
||||
friend class UI_BUTTON;
|
||||
friend class UI_KEYTRAP;
|
||||
friend class UI_CHECKBOX;
|
||||
friend class UI_RADIO;
|
||||
friend class UI_SCROLLBAR;
|
||||
friend class UI_LISTBOX;
|
||||
friend class UI_INPUTBOX;
|
||||
// friend class UI_SLIDER;
|
||||
friend class UI_SLIDER2;
|
||||
friend class UI_DOT_SLIDER;
|
||||
friend class UI_DOT_SLIDER_NEW;
|
||||
friend class UI_ICON;
|
||||
|
||||
protected:
|
||||
int flags;
|
||||
@@ -1007,7 +1010,7 @@ void ui_sort_filenames( int n, char **list );
|
||||
/*
|
||||
class UI_SLIDER : public UI_GADGET
|
||||
{
|
||||
friend UI_BUTTON;
|
||||
friend class UI_BUTTON;
|
||||
int horz;
|
||||
int position;
|
||||
int window_size;
|
||||
|
||||
Reference in new issue
Block a user