Compare commits

..
33 changed files with 1240 additions and 1507 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
-89
View File
@@ -1,92 +1,3 @@
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)
+1 -1
View File
@@ -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" /U "NDEBUG" /Fr /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 BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -91,8 +91,9 @@ LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
CXXFLAGS = \
-g \
-I/usr/local/include/SDL \
-I. \
-I. -Iwindows_stub \
-fno-exceptions \
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
+7 -12
View File
@@ -9,14 +9,11 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 2.4 $
* $Date: 2002-08-07 00:44:13 $
* $Author: DTP $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* $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.
*
@@ -254,7 +251,8 @@ 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;
@@ -272,7 +270,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 autoload multi mission.
char *Cmdline_almission = NULL; //DTP FOR AUTO-LOAD Multi MISSION
int Cmdline_multi_log = 0;
int Cmdline_server_firing = 0;
int Cmdline_client_dodamage = 0;
@@ -282,7 +280,6 @@ 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;
@@ -646,8 +643,6 @@ 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;
}
+2 -6
View File
@@ -9,14 +9,11 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.3 $
* $Date: 2002-08-07 00:44:13 $
* $Revision: 2.2 $
* $Date: 2002-07-29 06:35:15 $
* $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
*
@@ -201,7 +198,6 @@ 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
+1 -1
View File
@@ -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" /U "NDEBUG" /FR /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 BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
+5 -26
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
* $Revision: 2.6 $
* $Date: 2002-08-13 03:34:00 $
* $Revision: 2.5 $
* $Date: 2002-08-04 05:11:05 $
* $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
*
@@ -485,8 +482,6 @@
*
*/
static const char RCS_Name[] = "$Name: not supported by cvs2svn $";
#include <stdlib.h>
#include <time.h>
@@ -7831,29 +7826,14 @@ void get_version_string(char *str)
{
//XSTR:OFF
if ( FS_VERSION_BUILD == 0 ) {
sprintf(str,"V%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
sprintf(str,"fs2_open %d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
} else {
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
sprintf(str,"fs2_open %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;
@@ -8627,8 +8607,7 @@ 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
#if 0
#ifdef RELEASE_REAL
int cd_num;
int cd_present = 0;
int cd_drive_num;
+3 -6
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
* $Revision: 2.4 $
* $Date: 2002-08-06 01:49:08 $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $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
*
@@ -272,7 +269,7 @@ typedef unsigned int uint;
//Stucture to store clipping codes in a word
typedef struct ccodes {
ubyte cc_or, cc_and; //or is low byte, and is high byte
ubyte or,and; //or is low byte, and is high byte
} ccodes;
typedef struct vector {
+3 -6
View File
@@ -9,15 +9,12 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
* $Revision: 2.2 $
* $Date: 2002-08-13 03:32:25 $
* $Revision: 2.1 $
* $Date: 2002-08-04 05:11:36 $
* $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
*
@@ -126,7 +123,7 @@
// Major.Minor.Bugfix
#define FS_VERSION_MAJOR 3 // major version
#define FS_VERSION_MINOR 2 // increase by 1 for minor revs
#define FS_VERSION_MINOR 1 // increase by 1 for minor revs
#define FS_VERSION_BUILD 0 // bugfix release
#define VERSION_LOC_FNAME "version.nfo"
+9 -37
View File
@@ -9,29 +9,13 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-07 00:45:25 $
* $Author: DTP $
* $Revision: 2.2 $
* $Date: 2002-08-03 19:42:17 $
* $Author: randomtiger $
*
* 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
*
@@ -342,7 +326,6 @@
#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,
@@ -1506,30 +1489,19 @@ 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 { //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);
} else {
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 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);
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 -103
View File
@@ -9,23 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 16:50:44 $
* $Author: phreak $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* 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
*
@@ -378,8 +368,6 @@ 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
@@ -806,14 +794,11 @@ 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
@@ -832,20 +817,7 @@ 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]);
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 );
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
@@ -888,7 +860,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);
}
@@ -1259,7 +1231,6 @@ 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);
@@ -1282,41 +1253,11 @@ 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, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
} else {
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
}
ship_model_stop( target_objp );
@@ -1370,7 +1311,6 @@ 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];
@@ -1393,16 +1333,9 @@ 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, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL );
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
@@ -1447,7 +1380,6 @@ 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);
@@ -1476,31 +1408,6 @@ 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);
@@ -1520,8 +1427,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);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
+3 -13
View File
@@ -9,20 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.h $
* $Revision: 2.1 $
* $Date: 2002-08-06 16:50:13 $
* $Author: phreak $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
*
* 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
*
@@ -152,9 +145,6 @@ 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();
+12 -13
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDWingmanStatus.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 04:39:26 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $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
*
@@ -175,13 +172,6 @@ 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
@@ -701,6 +691,8 @@ 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;
@@ -708,8 +700,15 @@ 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);
gr_string(sx, sy, Wingman_status_name_abbr[wing_index]);
if ( bitmap > -1 ) {
GR_AABITMAP(bitmap, sx, sy);
// gr_set_bitmap(bitmap);
// gr_aabitmap(sx, sy);
}
}
int hud_wingman_status_wingmen_exist(int num_wings_to_draw)
+7 -28
View File
@@ -9,22 +9,13 @@
/*
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 16:49:22 $
* $Author: phreak $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
*
* 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
*
@@ -1075,7 +1066,7 @@ void process_debug_keys(int k)
break;
}
/*
case KEY_DEBUGGED + KEY_SHIFTED + KEY_9: {
case KEY_DEBUGGED1 + KEY_SHIFTED + KEY_9:
ship* shipp;
@@ -1088,7 +1079,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: {
@@ -1260,7 +1251,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;
@@ -1297,7 +1288,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: {
@@ -1377,7 +1368,6 @@ void process_debug_keys(int k)
break;
}
} // end switch
}
@@ -1509,17 +1499,6 @@ 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) )
+11 -15
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Render/3dClipper.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 01:49:08 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $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
*
@@ -262,8 +259,7 @@ 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->cc_and = 0xff;
cc->cc_or = 0;
cc->and = 0xff; cc->or = 0;
for (i=1;i<=*nv;i++) {
@@ -272,16 +268,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->cc_or |= (*dest)->codes;
cc->cc_and &= (*dest)->codes;
cc->or |= (*dest)->codes;
cc->and &= (*dest)->codes;
dest++;
}
if (! (src[i+1]->codes & plane_flag)) {
*dest = clip_edge(plane_flag,src[i+1],src[i],flags);
cc->cc_or |= (*dest)->codes;
cc->cc_and &= (*dest)->codes;
cc->or |= (*dest)->codes;
cc->and &= (*dest)->codes;
dest++;
}
@@ -294,8 +290,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
*dest++ = src[i];
cc->cc_or |= src[i]->codes;
cc->cc_and &= src[i]->codes;
cc->or |= src[i]->codes;
cc->and &= src[i]->codes;
}
}
@@ -310,11 +306,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->cc_or & plane_flag) {
if (cc->or & plane_flag) {
*nv = clip_plane(plane_flag,src,dest,nv,cc,flags);
if (cc->cc_and) //clipped away
if (cc->and) //clipped away
return dest;
t = src; src = dest; dest = t;
+20 -25
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Render/3ddraw.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 01:49:08 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $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
*
@@ -326,8 +323,7 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
Assert( G3_count == 1 );
cc.cc_or = 0;
cc.cc_and = 0xff;
cc.or = 0; cc.and = 0xff;
bufptr = Vbuf0;
@@ -336,19 +332,19 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
p = bufptr[i] = pointlist[i];
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
cc.and &= p->codes;
cc.or |= p->codes;
}
if (cc.cc_and)
if (cc.and)
return 1; //all points off screen
if (cc.cc_or) {
if (cc.or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0,Vbuf1,&nv,&cc,tmap_flags);
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
@@ -409,7 +405,7 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
Assert( G3_count == 1 );
cc.cc_or = 0; cc.cc_and = 0xff;
cc.or = 0; cc.and = 0xff;
bufptr = Vbuf0;
@@ -418,19 +414,19 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
p = bufptr[i] = pointlist[i];
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
cc.and &= p->codes;
cc.or |= p->codes;
}
if (cc.cc_and)
if (cc.and)
return 1; //all points off screen
if (cc.cc_or) {
if (cc.or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
@@ -816,8 +812,7 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
Assert( G3_count == 1 );
cc.cc_or = 0;
cc.cc_and = 0xff;
cc.or = 0; cc.and = 0xff;
bufptr = Vbuf0;
@@ -826,20 +821,20 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
p = bufptr[i] = pointlist[i];
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
cc.and &= p->codes;
cc.or |= p->codes;
}
if (cc.cc_and){
if (cc.and){
return 0.0f; //all points off screen
}
if (cc.cc_or) {
if (cc.or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
+36 -39
View File
@@ -9,16 +9,13 @@
/*
* $Logfile: /Freespace2/code/Ui/UI.H $
* $Revision: 2.2 $
* $Date: 2002-08-06 03:50:48 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:10 $
* $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
*
@@ -382,17 +379,17 @@ class UI_DOT_SLIDER_NEW;
class UI_GADGET
{
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;
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;
protected:
char *bm_filename;
@@ -516,10 +513,10 @@ typedef struct UI_XSTR {
class UI_BUTTON : public UI_GADGET
{
friend class UI_SCROLLBAR;
// friend class UI_SLIDER;
friend class UI_DOT_SLIDER;
friend class UI_DOT_SLIDER_NEW;
friend UI_SCROLLBAR;
// friend UI_SLIDER;
friend UI_DOT_SLIDER;
friend UI_DOT_SLIDER_NEW;
char *text;
int position; // indicates position of button (0 - up, 1 - down by mouse click 2 - down by keypress
@@ -714,8 +711,8 @@ class UI_RADIO : public UI_GADGET
class UI_SCROLLBAR : public UI_GADGET
{
friend class UI_LISTBOX;
friend class UI_BUTTON;
friend UI_LISTBOX;
friend UI_BUTTON;
int horz;
int start;
int stop;
@@ -752,7 +749,7 @@ class UI_SCROLLBAR : public UI_GADGET
class UI_SLIDER2 : public UI_GADGET
{
friend class UI_BUTTON;
friend UI_BUTTON;
private:
int numberItems; // total range
int numberPositions; // total positions (height - bitmapbuttonheight)
@@ -810,7 +807,7 @@ class UI_SLIDER2 : public UI_GADGET
// to be phased out eventually in FS2
class UI_DOT_SLIDER : public UI_GADGET
{
friend class UI_BUTTON;
friend UI_BUTTON;
UI_BUTTON button;
UI_BUTTON up_button;
@@ -830,7 +827,7 @@ class UI_DOT_SLIDER : public UI_GADGET
class UI_DOT_SLIDER_NEW : public UI_GADGET
{
friend class UI_BUTTON;
friend UI_BUTTON;
UI_BUTTON button;
UI_BUTTON up_button;
UI_BUTTON down_button;
@@ -903,19 +900,19 @@ class UI_LISTBOX : public UI_GADGET
class UI_WINDOW
{
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;
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;
protected:
int flags;
@@ -1010,7 +1007,7 @@ void ui_sort_filenames( int n, char **list );
/*
class UI_SLIDER : public UI_GADGET
{
friend class UI_BUTTON;
friend UI_BUTTON;
int horz;
int position;
int window_size;