* Added support for building shaders in your mod

* Added nav mesh support
* fixed many warnings and misc bugs
* Fixed the create*projects scripts in mp
* Added a bunch of stuff to .gitignore
This commit is contained in:
Joe Ludwig 2013-07-17 18:26:59 -07:00
parent 6a271d4a68
commit e16ea21dc8
434 changed files with 55921 additions and 3578 deletions

2
.gitignore vendored
View File

@ -51,4 +51,6 @@ server.dylib.dSYM/
# files generated by running a mod
config.cfg
# shader files
*.tmp

View File

@ -0,0 +1,7 @@
"Mod_Example_Model"
{
"$basetexture" "Models/props_c17/Oil_Drum001g"
// "$basetexturetransform" "center 0 0 scale 1 2 rotate 0 translate 0 0"
// "$AlphaTestReference" "0.5"
"$surfaceprop" "metal"
}

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
#!/bin/bash
devtools/bin/vpc /hl2 /episodic +everything /mksln everything
devtools/bin/vpc /hl2mp +everything /mksln everything

View File

@ -1,4 +1,4 @@
#!/bin/bash
devtools/bin/vpc /hl2 /episodic +game /mksln games
devtools/bin/vpc /hl2mp +game /mksln games

View File

@ -0,0 +1,22 @@
use File::DosGlob;
@ARGV = map {
my @g = File::DosGlob::glob($_) if /[*?]/;
@g ? @g : $_;
} @ARGV;
open FILE, ">__tmpshaderlist.txt";
foreach $arg (@ARGV)
{
if( $arg =~ m/\.fxc$/i || $arg =~ m/\.vsh$/i || $arg =~ m/\.psh$/i )
{
print $arg . "\n";
print FILE $arg . "\n";
}
}
close FILE;
system "buildshaders.bat __tmpshaderlist";
unlink "__tmpshaderlist.txt";

View File

@ -0,0 +1,116 @@
use String::CRC32;
BEGIN {use File::Basename; push @INC, dirname($0); }
require "valve_perl_helpers.pl";
sub GetShaderType
{
my $shadername = shift;
my $shadertype;
if( $shadername =~ m/\.vsh/i )
{
$shadertype = "vsh";
}
elsif( $shadername =~ m/\.psh/i )
{
$shadertype = "psh";
}
elsif( $shadername =~ m/\.fxc/i )
{
$shadertype = "fxc";
}
else
{
die;
}
return $shadertype;
}
sub GetShaderSrc
{
my $shadername = shift;
if ( $shadername =~ m/^(.*)-----/i )
{
return $1;
}
else
{
return $shadername;
}
}
sub GetShaderType
{
my $shadername = shift;
my $shadertype;
if( $shadername =~ m/\.vsh/i )
{
$shadertype = "vsh";
}
elsif( $shadername =~ m/\.psh/i )
{
$shadertype = "psh";
}
elsif( $shadername =~ m/\.fxc/i )
{
$shadertype = "fxc";
}
else
{
die;
}
return $shadertype;
}
sub GetShaderBase
{
my $shadername = shift;
if ( $shadername =~ m/-----(.*)$/i )
{
return $1;
}
else
{
my $shadertype = &GetShaderType( $shadername );
$shadername =~ s/\.$shadertype//i;
return $shadername;
}
}
$g_x360 = 0;
$g_vcsext = ".vcs";
while( 1 )
{
$inputbase = shift;
if( $inputbase =~ m/-x360/ )
{
$g_x360 = 1;
$g_vcsext = ".360.vcs";
}
else
{
last;
}
}
# rip the txt off the end if it's there.
$inputbase =~ s/\.txt//i;
my @srcfiles = &LoadShaderListFile( $inputbase );
foreach $srcfile ( @srcfiles )
{
my $shadertype = &GetShaderType( $srcfile );
my $shaderbase = &GetShaderBase( $srcfile );
my $shadersrc = &GetShaderSrc( $srcfile );
my $vcsFileName = "..\\..\\..\\game\\hl2\\shaders\\$shadertype\\$shaderbase" . $g_vcsext;
# print "shadersrc: $shadersrc vcsFileName: $vcsFileName\n";
if( $g_x360 && ( $shaderbase =~ m/_ps20$/i ) )
{
next; # skip _ps20 files for 360
}
&CheckCRCAgainstTarget( $shadersrc, $vcsFileName, 1 );
}

View File

@ -0,0 +1,75 @@
BEGIN {use File::Basename; push @INC, dirname($0); }
require "valve_perl_helpers.pl";
use Cwd;
use String::CRC32;
my $txtfilename = shift;
my $arg = shift;
my $is360 = 0;
my $platformextension = "";
if( $arg =~ m/-x360/i )
{
$is360 = 1;
$platformextension = ".360";
}
open TXTFILE, "<$txtfilename";
my $src;
my $dst;
while( $src = <TXTFILE> )
{
# get rid of comments
$src =~ s,//.*,,g;
# skip blank lines
if( $src =~ m/^\s*$/ )
{
next;
}
# Get rid of newlines.
$src =~ s/\n//g;
# Save off the shader source filename.
my $dst = $src;
$dst =~ s/_tmp//gi;
# Does the dst exist?
my $dstexists = -e $dst;
my $srcexists = -e $src;
# What are the time stamps for the src and dst?
my $srcmodtime = ( stat $src )[9];
my $dstmodtime = ( stat $dst )[9];
# Open for edit or add if different than what is in perforce already.
if( !$dstexists || ( $srcmodtime != $dstmodtime ) )
{
# Make the target writable if it exists
if( $dstexists )
{
MakeFileWritable( $dst );
}
my $dir = $dst;
$dir =~ s,([^/\\]*$),,; # rip the filename off the end
my $filename = $1;
# create the target directory if it doesn't exist
if( !$dstexists )
{
&MakeDirHier( $dir, 0777 );
}
# copy the file to its targets. . . we want to see STDERR here if there is an error.
my $cmd = "copy $src $dst > nul";
# print STDERR "$cmd\n";
system $cmd;
MakeFileReadOnly( $dst );
}
}
close TXTFILE;

View File

@ -0,0 +1,172 @@
BEGIN {use File::Basename; push @INC, dirname($0); }
require "valve_perl_helpers.pl";
use Cwd;
use String::CRC32;
sub ReadInputFileWithIncludes
{
local( $filename ) = shift;
local( *INPUT );
local( $output );
open INPUT, "<$filename" || die;
local( $line );
local( $linenum ) = 1;
while( $line = <INPUT> )
{
if( $line =~ m/\#include\s+\"(.*)\"/i )
{
$output.= ReadInputFileWithIncludes( $1 );
}
else
{
$output .= $line;
}
}
close INPUT;
return $output;
}
sub PatchCRC
{
my $filename = shift;
my $crc = shift;
# print STDERR "PatchCRC( $filename, $crc )\n";
local( *FP );
open FP, "+<$filename" || die;
binmode( FP );
seek FP, 6 * 4, 0;
my $uInt = "I";
if( $filename =~ m/360/ )
{
$uInt = "N";
}
print FP pack $uInt, $crc;
close FP;
}
my $txtfilename = shift;
my $arg = shift;
my $is360 = 0;
my $platformextension = "";
if( $arg =~ m/-x360/i )
{
$is360 = 1;
$platformextension = ".360";
}
# Get the changelist number for the Shader Auto Checkout changelist. Will create the changelist if it doesn't exist.
my $changelistnumber = `valve_p4_create_changelist.cmd ..\\..\\..\\game\\hl2\\shaders \"Shader Auto Checkout VCS\"`;
# Get rid of the newline
$changelistnumber =~ s/\n//g;
my $changelistarg = "";
if( $changelistnumber != 0 )
{
$changelistarg = "-c $changelistnumber"
}
open TXTFILE, "<$txtfilename";
my $src;
my $dst;
while( $src = <TXTFILE> )
{
# get rid of comments
$src =~ s,//.*,,g;
# skip blank lines
if( $src =~ m/^\s*$/ )
{
next;
}
# Get rid of newlines.
$src =~ s/\n//g;
# Save off the shader source filename.
my $shadersrcfilename = $src;
$shadersrcfilename =~ s/-----.*$//;
# use only target basename.
$src =~ s/^.*-----//;
# where the binary vcs file is
my $spath = "";
if ( $shadersrcfilename =~ m@\.fxc@i )
{
$spath = "shaders\\fxc\\";
}
if ( $shadersrcfilename =~ m@\.vsh@i )
{
$spath = "shaders\\vsh\\";
}
if ( $shadersrcfilename =~ m@\.psh@i )
{
$spath = "shaders\\psh\\";
}
# make the source have path and extension
$src = $spath . $src . $platformextension . ".vcs";
# build the dest filename.
$dst = $src;
$dst =~ s/shaders\\/..\\..\\..\\game\\hl2\\shaders\\/i;
# Does the dst exist?
my $dstexists = -e $dst;
my $srcexists = -e $src;
# What are the time stamps for the src and dst?
my $srcmodtime = ( stat $src )[9];
my $dstmodtime = ( stat $dst )[9];
# Write $dst to a file so that we can do perforce stuff to it later.
local( *VCSLIST );
open VCSLIST, ">>vcslist.txt" || die;
print VCSLIST $dst . "\n";
close VCSLIST;
# Open for edit or add if different than what is in perforce already.
if( !$dstexists || ( $srcmodtime != $dstmodtime ) )
{
if ( $srcexists && $shadersrcfilename =~ m@\.fxc@i )
{
# Get the CRC for the source file.
my $srccode = ReadInputFileWithIncludes( $shadersrcfilename );
my $crc = crc32( $srccode );
# Patch the source VCS file with the CRC32 of the source code used to build that file.
PatchCRC( $src, $crc );
}
# Make the target vcs writable if it exists
if( $dstexists )
{
MakeFileWritable( $dst );
}
my $dir = $dst;
$dir =~ s,([^/\\]*$),,; # rip the filename off the end
my $filename = $1;
# create the target directory if it doesn't exist
if( !$dstexists )
{
&MakeDirHier( $dir, 0777 );
}
# copy the file to its targets. . . we want to see STDERR here if there is an error.
my $cmd = "copy $src $dst > nul";
# print STDERR "$cmd\n";
system $cmd;
MakeFileReadOnly( $dst );
}
}
close TXTFILE;

Binary file not shown.

View File

@ -0,0 +1,110 @@
#!perl
use File::Find;
&BuildRemapTable;
find(\&convert, "." );
sub convert
{
return unless (/\.pcf$/i);
return if (/^tmp\.pcf$/i);
return if (/^tmp2\.pcf$/i);
return if (/360\.pcf$/i);
print STDERR "process ", $File::Find::name," ($_) dir=",`cd`," \n";
my $fname=$_;
print `p4 edit $fname`;
print `dmxconvert -i $_ -o tmp.pcf -oe keyvalues2`;
open(TMP, "tmp.pcf" ) || return;
open(OUT, ">tmp2.pcf" ) || die;
while(<TMP>)
{
s/[\n\r]//g;
if ( (/^(\s*\"functionName\"\s*\"string\"\s*\")(.*)\"(.*)$/) &&
length($map{$2}) )
{
$_=$1.$map{$2}.'"'.$3;
}
if ( (/^(\s*\"name\"\s*\"string\"\s*\")(.*)\"(.*)$/) &&
length($map{$2}) )
{
$_=$1.$map{$2}.'"'.$3;
}
print OUT "$_\n";
}
close OUT;
close TMP;
print `dmxconvert -i tmp2.pcf -o $fname -ie keyvalues2 -oe binary`;
unlink "tmp.pcf";
unlink "tmp2.pcf";
}
sub BuildRemapTable
{
$map{"alpha_fade"}= "Alpha Fade and Decay";
$map{"alpha_fade_in_random"}= "Alpha Fade In Random";
$map{"alpha_fade_out_random"}= "Alpha Fade Out Random";
$map{"basic_movement"}= "Movement Basic";
$map{"color_fade"}= "Color Fade";
$map{"controlpoint_light"}= "Color Light From Control Point";
$map{"Dampen Movement Relative to Control Point"}= "Movement Dampen Relative to Control Point";
$map{"Distance Between Control Points Scale"}= "Remap Distance Between Two Control Points to Scalar";
$map{"Distance to Control Points Scale"}= "Remap Distance to Control Point to Scalar";
$map{"lifespan_decay"}= "Lifespan Decay";
$map{"lock to bone"}= "Movement Lock to Bone";
$map{"postion_lock_to_controlpoint"}= "Movement Lock to Control Point";
$map{"maintain position along path"}= "Movement Maintain Position Along Path";
$map{"Match Particle Velocities"}= "Movement Match Particle Velocities";
$map{"Max Velocity"}= "Movement Max Velocity";
$map{"noise"}= "Noise Scalar";
$map{"vector noise"}= "Noise Vector";
$map{"oscillate_scalar"}= "Oscillate Scalar";
$map{"oscillate_vector"}= "Oscillate Vector";
$map{"Orient Rotation to 2D Direction"}= "Rotation Orient to 2D Direction";
$map{"radius_scale"}= "Radius Scale";
$map{"Random Cull"}= "Cull Random";
$map{"remap_scalar"}= "Remap Scalar";
$map{"rotation_movement"}= "Rotation Basic";
$map{"rotation_spin"}= "Rotation Spin Roll";
$map{"rotation_spin yaw"}= "Rotation Spin Yaw";
$map{"alpha_random"}= "Alpha Random";
$map{"color_random"}= "Color Random";
$map{"create from parent particles"}= "Position From Parent Particles";
$map{"Create In Hierarchy"}= "Position In CP Hierarchy";
$map{"random position along path"}= "Position Along Path Random";
$map{"random position on model"}= "Position on Model Random";
$map{"sequential position along path"}= "Position Along Path Sequential";
$map{"position_offset_random"}= "Position Modify Offset Random";
$map{"position_warp_random"}= "Position Modify Warp Random";
$map{"position_within_box"}= "Position Within Box Random";
$map{"position_within_sphere"}= "Position Within Sphere Random";
$map{"Inherit Velocity"}= "Velocity Inherit from Control Point";
$map{"Initial Repulsion Velocity"}= "Velocity Repulse from World";
$map{"Initial Velocity Noise"}= "Velocity Noise";
$map{"Initial Scalar Noise"}= "Remap Noise to Scalar";
$map{"Lifespan from distance to world"}= "Lifetime from Time to Impact";
$map{"Pre-Age Noise"}= "Lifetime Pre-Age Noise";
$map{"lifetime_random"}= "Lifetime Random";
$map{"radius_random"}= "Radius Random";
$map{"random yaw"}= "Rotation Yaw Random";
$map{"Randomly Flip Yaw"}= "Rotation Yaw Flip Random";
$map{"rotation_random"}= "Rotation Random";
$map{"rotation_speed_random"}= "Rotation Speed Random";
$map{"sequence_random"}= "Sequence Random";
$map{"second_sequence_random"}= "Sequence Two Random";
$map{"trail_length_random"}= "Trail Length Random";
$map{"velocity_random"}= "Velocity Random";
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,36 @@
#! perl
my $fname=shift || die "format is shaderinfo blah.vcs";
open(SHADER, $fname) || die "can't open $fname";
binmode SHADER;
read(SHADER,$header,20);
($ver,$ntotal,$ndynamic,$flags,$centroidmask)=unpack("LLLLL",$header);
#print "Version $ver total combos=$ntotal, num dynamic combos=$ndynamic,\n flags=$flags, centroid mask=$centroidmask\n";
read(SHADER,$refsize,4);
$refsize=unpack("L",$refsize);
#print "Size of reference shader for diffing=$refsize\n";
seek(SHADER,$refsize,1);
$nskipped_combos=0;
for(1..$ntotal)
{
read(SHADER,$combodata,8);
($ofs,$combosize)=unpack("LL",$combodata);
if ( $ofs == 0xffffffff)
{
$nskipped_combos++;
}
else
{
}
}
#print "$nskipped_combos skipped, for an actual total of ",$ntotal-$nskipped_combos,"\n";
#print "Real to skipped ratio = ",($ntotal-$nskipped_combos)/$ntotal,"\n";
# csv output - name, real combos, virtual combos, dynamic combos
my $real_combos=$ntotal-$nskipped_combos;
print "$fname,$real_combos,$ntotal,$ndynamic\n";

View File

@ -0,0 +1,54 @@
$infilename = shift;
$outfilename1 = shift;
$outfilename2 = shift;
open INPUT, $infilename || die;
@input = <INPUT>;
close INPUT;
open MERGEDMINE, ">$outfilename1" || die;
open MERGEDTHEIRS, ">$outfilename2" || die;
for( $i = 0; $i < scalar( @input ); $i++ )
{
$line = $input[$i];
if( $line =~ m/^(.*)<<<<<<</ )
{
$first = 1;
$second = 0;
print MERGEDMINE $1;
print MERGEDTHEIRS $1;
next;
}
# Make sure that we are in a split block so that comments with ======= don't mess us up.
if( $line =~ m/^(.*)=======$/ && $first == 1 )
{
$first = 0;
$second = 1;
print MERGEDMINE $1;
next;
}
if( $line =~ m/^(.*)>>>>>>>/ )
{
$first = $second = 0;
print MERGEDTHEIRS $1;
next;
}
if( $first )
{
print MERGEDMINE $line;
}
elsif( $second )
{
print MERGEDTHEIRS $line;
}
else
{
print MERGEDMINE $line;
print MERGEDTHEIRS $line;
}
}
close MERGEDMINE;
close MERGEDTHEIRS;

View File

@ -0,0 +1,6 @@
foreach $_ (sort <> )
{
next if( defined( $prevline ) && $_ eq $prevline );
$prevline = $_;
print;
}

View File

@ -0,0 +1,558 @@
sub BackToForwardSlash
{
my( $path ) = shift;
$path =~ s,\\,/,g;
return $path;
}
sub RemoveFileName
{
my( $in ) = shift;
$in = &BackToForwardSlash( $in );
$in =~ s,/[^/]*$,,;
return $in;
}
sub RemovePath
{
my( $in ) = shift;
$in = &BackToForwardSlash( $in );
$in =~ s,^(.*)/([^/]*)$,$2,;
return $in;
}
sub MakeDirHier
{
my( $in ) = shift;
# print "MakeDirHier( $in )\n";
$in = &BackToForwardSlash( $in );
my( @path );
while( $in =~ m,/, ) # while $in still has a slash
{
my( $end ) = &RemovePath( $in );
push @path, $end;
# print $in . "\n";
$in = &RemoveFileName( $in );
}
my( $i );
my( $numelems ) = scalar( @path );
my( $curpath );
for( $i = $numelems - 1; $i >= 0; $i-- )
{
$curpath .= "/" . $path[$i];
my( $dir ) = $in . $curpath;
if( !stat $dir )
{
# print "mkdir $dir\n";
mkdir $dir, 0777;
}
}
}
sub FileExists
{
my $filename = shift;
my @statresult = stat $filename;
my $iswritable = @statresult != 0;
return $iswritable;
}
sub MakeFileWritable
{
my $filename = shift;
if ( &FileExists( $filename ) )
{
chmod 0666, $filename || die;
}
}
sub MakeFileReadOnly
{
my $filename = shift;
chmod 0444, $filename || die;
}
# Run a command and get stdout and stderr to an array
sub RunCommand
{
my $cmd = shift;
# print STDERR "command: $cmd\n";
system "$cmd > cmdout.txt 2>&1" || die;
local( *FILE );
open FILE, "<cmdout.txt" || die;
my @output = <FILE>;
# print STDERR "command output: @output\n";
close FILE;
unlink "cmdout.txt" || die;
return @output;
}
sub PerforceEditOrAdd
{
return;
my $filename = shift;
my $changelistarg = shift;
# Is the file on the client?
my $cmd = "p4 fstat \"$filename\"";
my @p4output = &RunCommand( $cmd );
my $p4output = join "", @p4output;
if( $p4output =~ m/no such file/ )
{
# not on client. . add
my $cmd = "p4 add $changelistarg $filename";
my @p4output = &RunCommand( $cmd );
my $p4output = join "", @p4output;
if( $p4output =~ m/opened for add/ )
{
print $p4output;
return;
}
print "ERROR: $p4output";
return;
}
# The file is known to be on the client at this point.
# Is it open for edit?
if( $p4output =~ m/action edit/ )
{
# Is is open for edit, let's see if it's still different.
# check for opened files that are not different from the revision in the depot.
my $cmd = "p4 diff -sr \"$filename\"";
my @p4output = &RunCommand( $cmd );
my $outputstring = join "", @p4output;
# check for empty string
if( !( $outputstring =~ m/^\s*$/ ) )
{
my $cmd = "p4 revert \"$filename\"";
my @p4output = &RunCommand( $cmd );
my $outputstring = join "", @p4output;
print $outputstring;
return;
}
}
# check for unopened files that are different from the revision in the depot.
my $cmd = "p4 diff -se \"$filename\"";
my @p4output = &RunCommand( $cmd );
my $outputstring = join "", @p4output;
# check for empty string
if( $outputstring =~ m/^\s*$/ )
{
&MakeFileReadOnly( $filename );
return;
}
# We need to edit the file since it is known to be different here.
my $cmd = "p4 edit $changelistarg \"$filename\"";
my @p4output = &RunCommand( $cmd );
my $line;
foreach $line ( @p4output )
{
if( $line =~ m/not on client/ )
{
#print "notonclient...";
print "ERROR: @p4output\n";
return;
}
if( $line =~ m/currently opened for edit/ )
{
return;
}
if( $line =~ m/opened for edit/ )
{
print $line;
}
}
}
sub FileIsWritable
{
local( $filename ) = shift;
local( @statresult ) = stat $filename;
local( $mode, $iswritable );
$mode = oct( $statresult[2] );
$iswritable = ( $mode & 2 ) != 0;
return $iswritable;
}
sub TouchFile
{
my $filename = shift;
if( !&FileExists( $filename ) )
{
if( !open FILE, ">$filename" )
{
die;
}
close FILE;
}
my $now = time;
local( *FILE );
utime $now, $now, $filename;
}
sub FileExistsInPerforce
{
my $filename = shift;
my @output = &RunCommand( "p4 fstat $filename" );
my $line;
foreach $line (@output)
{
if( $line =~ m/no such file/ )
{
return 0;
}
}
return 1;
}
sub PerforceWriteFile
{
my $filename = shift;
my $filecontents = shift;
# my $changelistname = shift;
# Get the changelist number for the Shader Auto Checkout changelist. Will create the changelist if it doesn't exist.
# my $changelistnumber = `valve_p4_create_changelist.cmd . \"$changelistname\"`;
# Get rid of the newline
# $changelistnumber =~ s/\n//g;
# my $changelistarg = "";
# if( $changelistnumber != 0 )
# {
# $changelistarg = "-c $changelistnumber"
# }
# Make the target vcs writable if it exists
MakeFileWritable( $filename );
# Write the file.
local( *FP );
open FP, ">$filename";
print FP $filecontents;
close FP;
# Do whatever needs to happen with perforce for this file.
# &PerforceEditOrAdd( $filename, $changelistarg );
}
sub WriteFile
{
my $filename = shift;
my $filecontents = shift;
# Make the target vcs writable if it exists
MakeFileWritable( $filename );
# Write the file.
local( *FP );
open FP, ">$filename";
print FP $filecontents;
close FP;
}
sub PrintCleanPerforceOutput
{
my $line;
while( $line = shift )
{
if( $line =~ m/currently opened/i )
{
next;
}
if( $line =~ m/already opened for edit/i )
{
next;
}
if( $line =~ m/also opened/i )
{
next;
}
if( $line =~ m/add of existing file/i )
{
next;
}
print $line;
}
}
# HACK!!!! Need to pass something in to do this rather than hard coding.
sub NormalizePerforceFilename
{
my $line = shift;
# remove newlines.
$line =~ s/\n//;
# downcase.
$line =~ tr/[A-Z]/[a-z]/;
# backslash to forwardslash
$line =~ s,\\,/,g;
# for inc files HACK!
$line =~ s/^.*(fxctmp9.*)/$1/i;
$line =~ s/^.*(vshtmp9.*)/$1/i;
# for vcs files. HACK!
$line =~ s,^.*game/hl2/shaders/,,i;
return $line;
}
sub MakeSureFileExists
{
local( $filename ) = shift;
local( $testexists ) = shift;
local( $testwrite ) = shift;
local( @statresult ) = stat $filename;
if( !@statresult && $testexists )
{
die "$filename doesn't exist!\n";
}
local( $mode, $iswritable );
$mode = oct( $statresult[2] );
$iswritable = ( $mode & 2 ) != 0;
if( !$iswritable && $testwrite )
{
die "$filename isn't writable!\n";
}
}
sub LoadShaderListFile_GetShaderType
{
my $shadername = shift;
my $shadertype;
if( $shadername =~ m/\.vsh/i )
{
$shadertype = "vsh";
}
elsif( $shadername =~ m/\.psh/i )
{
$shadertype = "psh";
}
elsif( $shadername =~ m/\.fxc/i )
{
$shadertype = "fxc";
}
else
{
die;
}
return $shadertype;
}
sub LoadShaderListFile_GetShaderSrc
{
my $shadername = shift;
if ( $shadername =~ m/^(.*)-----/i )
{
return $1;
}
else
{
return $shadername;
}
}
sub LoadShaderListFile_GetShaderBase
{
my $shadername = shift;
if ( $shadername =~ m/-----(.*)$/i )
{
return $1;
}
else
{
my $shadertype = &LoadShaderListFile_GetShaderType( $shadername );
$shadername =~ s/\.$shadertype//i;
return $shadername;
}
}
sub LoadShaderListFile
{
my $inputbase = shift;
my @srcfiles;
&MakeSureFileExists( "$inputbase.txt", 1, 0 );
open SHADERLISTFILE, "<$inputbase.txt" || die;
my $line;
while( $line = <SHADERLISTFILE> )
{
$line =~ s/\/\/.*$//; # remove comments "//..."
$line =~ s/^\s*//; # trim leading whitespace
$line =~ s/\s*$//; # trim trailing whitespace
next if( $line =~ m/^\s*$/ );
if( $line =~ m/\.fxc/ || $line =~ m/\.vsh/ || $line =~ m/\.psh/ )
{
my $shaderbase = &LoadShaderListFile_GetShaderBase( $line );
if( $ENV{"DIRECTX_FORCE_MODEL"} =~ m/^30$/i ) # forcing all shaders to be ver. 30
{
my $targetbase = $shaderbase;
$targetbase =~ s/_ps2x/_ps30/i;
$targetbase =~ s/_ps20b/_ps30/i;
$targetbase =~ s/_ps20/_ps30/i;
$targetbase =~ s/_vs20/_vs30/i;
$targetbase =~ s/_vsxx/_vs30/i;
push @srcfiles, ( $line . "-----" . $targetbase );
}
else
{
if( $shaderbase =~ m/_ps2x/i )
{
my $targetbase = $shaderbase;
$targetbase =~ s/_ps2x/_ps20/i;
push @srcfiles, ( $line . "-----" . $targetbase );
$targetbase = $shaderbase;
$targetbase =~ s/_ps2x/_ps20b/i;
push @srcfiles, ( $line . "-----" . $targetbase );
}
elsif( $shaderbase =~ m/_vsxx/i )
{
my $targetbase = $shaderbase;
$targetbase =~ s/_vsxx/_vs11/i;
push @srcfiles, ( $line . "-----" . $targetbase );
$targetbase = $shaderbase;
$targetbase =~ s/_vsxx/_vs20/i;
push @srcfiles, ( $line . "-----" . $targetbase );
}
else
{
push @srcfiles, ( $line . "-----" . $shaderbase );
}
}
}
}
close SHADERLISTFILE;
return @srcfiles;
}
sub ReadInputFileWithIncludes
{
local( $filename ) = shift;
# print STDERR "ReadInputFileWithIncludes: $filename\n";
local( *INPUT );
local( $output );
# print STDERR "before open\n";
open INPUT, "<$filename" || die;
# print STDERR "after open\n";
local( $line );
while( $line = <INPUT> )
{
# print STDERR $line;
if( $line =~ m/\#include\s+\"(.*)\"/i )
{
$output.= ReadInputFileWithIncludes( $1 );
}
else
{
$output .= $line;
}
}
close INPUT;
return $output;
}
sub GetCRCFromSourceFile
{
my $filename = shift;
my $data = &ReadInputFileWithIncludes( $filename );
# print STDERR $data;
$crc = crc32( $data );
# print STDERR "GetCRCFromSourceFile: $crc\n";
return $crc;
}
sub GetCRCFromVCSFile
{
my $filename = shift;
# print STDERR "GetCRCFromVCSFile $filename\n";
local( *FP );
open FP, "<$filename" || die "GetCRCFromVCSFile: can't open file $filename\n";
binmode( FP );
# unpack arguments
my $sInt = "i";
my $uInt = "I";
if( $filename =~ m/\.360\./ )
{
# Change arguments to "big endian long"
$sInt = "N";
$uInt = "N";
}
my $header;
read FP, $header, 7 * 4 || die "updateshaders.pl:GetCRCFromVCSFile: can't read header for $filename\n";
my $version,$numCombos,$numDynamicCombos,$flags,$centroidMask,$refSize,$crc;
($version,$numCombos,$numDynamicCombos,$flags,$centroidMask,$refSize,$crc) = unpack "$sInt$sInt$sInt$uInt$uInt$uInt$uInt", $header;
unless( $version == 4 || $version == 5 || $version == 6 )
{
print STDERR "ERROR: GetCRCFromVCSFile: $filename is version $version\n";
return 0;
}
# print STDERR "version: $version\n";
# print STDERR "numCombos: $numCombos\n";
# print STDERR "numDynamicCombos: $numDynamicCombos\n";
# print STDERR "flags: $flags\n";
# print STDERR "centroidMask: $centroidMask\n";
# print STDERR "refSize: $refSize\n";
# print STDERR "GetCRCFromVCSFile: $crc\n";
close( FP );
return $crc;
}
sub CheckCRCAgainstTarget
{
my $srcFileName = shift;
my $vcsFileName = shift;
my $warn = shift;
# Make sure both files exist.
# print STDERR "$srcFileName doesn't exist\n" if( !( -e $srcFileName ) );
# print STDERR "$vcsFileName doesn't exist\n" if( !( -e $vcsFileName ) );
if( !( -e $srcFileName ) )
{
if( $warn )
{
print "$srcFileName missing\n";
}
return 0;
}
if( !( -e $vcsFileName ) )
{
if( $warn )
{
print "$vcsFileName missing\n";
}
return 0;
}
# print STDERR "CheckCRCAgainstTarget( $srcFileName, $vcsFileName );\n";
# print STDERR "vcsFileName: $vcsFileName\n";
# print STDERR "vcsFileName: $srcFileName\n";
my $vcsCRC = &GetCRCFromVCSFile( $vcsFileName );
my $srcCRC = &GetCRCFromSourceFile( $srcFileName );
if( $warn && ( $vcsCRC != $srcCRC ) )
{
print "$vcsFileName checksum ($vcsCRC) != $srcFileName checksum: ($srcCRC)\n";
}
# return 0; # use this to skip crc checking.
# if( $vcsCRC == $srcCRC )
# {
# print STDERR "CRC passed for $srcFileName $vcsFileName $vcsCRC\n";
# }
return $vcsCRC == $srcCRC;
}
1;

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -1543,6 +1543,8 @@ void C_BaseAnimating::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quater
ApplyBoneMatrixTransform( GetBoneForWrite( i ) );
}
}
}
//-----------------------------------------------------------------------------
@ -3233,7 +3235,7 @@ int C_BaseAnimating::InternalDrawModel( int flags )
if ( !GetModelPtr() )
return 0;
UpdateBoneAttachments( flags );
UpdateBoneAttachments( );
if ( IsEffectActive( EF_ITEM_BLINK ) )
{
@ -6255,7 +6257,7 @@ bool C_BaseAnimating::ShouldResetSequenceOnNewModel( void )
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_BaseAnimating::UpdateBoneAttachments( int flags )
void C_BaseAnimating::UpdateBoneAttachments( void )
{
if ( !m_pAttachedTo )
return;

View File

@ -228,7 +228,7 @@ public:
int GetNumBoneAttachments();
C_BaseAnimating* GetBoneAttachment( int i );
virtual void NotifyBoneAttached( C_BaseAnimating* attachTarget );
virtual void UpdateBoneAttachments( int flags );
virtual void UpdateBoneAttachments( void );
//bool solveIK(float a, float b, const Vector &Foot, const Vector &Knee1, Vector &Knee2);
//void DebugIK( mstudioikchain_t *pikchain );

View File

@ -743,6 +743,7 @@ public:
virtual void SetHealth(int iHealth) {}
virtual int GetHealth() const { return 0; }
virtual int GetMaxHealth() const { return 1; }
virtual bool IsVisibleToTargetID( void ) { return false; }
// Returns the health fraction
float HealthFraction() const;
@ -1004,6 +1005,7 @@ public:
virtual bool IsBaseObject( void ) const { return false; }
virtual bool IsBaseCombatWeapon( void ) const { return false; }
virtual class C_BaseCombatWeapon *MyCombatWeaponPointer() { return NULL; }
virtual bool IsCombatItem( void ) const { return false; }
virtual bool IsBaseTrain( void ) const { return false; }

View File

@ -87,7 +87,10 @@ IMPLEMENT_CLIENTCLASS_DT_NOBASE(C_BaseTeamObjectiveResource, DT_BaseTeamObjectiv
RecvPropArray3( RECVINFO_ARRAY(m_iTeamInZone), RecvPropInt( RECVINFO(m_iTeamInZone[0]) ) ),
RecvPropArray3( RECVINFO_ARRAY(m_bBlocked), RecvPropInt( RECVINFO(m_bBlocked[0]) ) ),
RecvPropArray3( RECVINFO_ARRAY(m_iOwner), RecvPropInt( RECVINFO(m_iOwner[0]), 0, RecvProxy_Owner ) ),
RecvPropArray3( RECVINFO_ARRAY(m_bCPCapRateScalesWithPlayers), RecvPropBool( RECVINFO(m_bCPCapRateScalesWithPlayers[0]) ) ),
RecvPropString( RECVINFO(m_pszCapLayoutInHUD), 0, RecvProxy_CapLayout ),
RecvPropFloat( RECVINFO(m_flCustomPositionX) ),
RecvPropFloat( RECVINFO(m_flCustomPositionY) ),
END_RECV_TABLE()
C_BaseTeamObjectiveResource *g_pObjectiveResource = NULL;
@ -151,6 +154,9 @@ C_BaseTeamObjectiveResource::C_BaseTeamObjectiveResource()
m_flNodeHillData[i] = 0;
}
m_flCustomPositionX = -1.f;
m_flCustomPositionY = -1.f;
g_pObjectiveResource = this;
}
@ -173,6 +179,9 @@ void C_BaseTeamObjectiveResource::OnPreDataChanged( DataUpdateType_t updateType
m_iOldUpdateCapHudParity = m_iUpdateCapHudParity;
m_bOldControlPointsReset = m_bControlPointsReset;
m_flOldCustomPositionX = m_flCustomPositionX;
m_flOldCustomPositionY = m_flCustomPositionY;
memcpy( m_flOldLazyCapPerc, m_flLazyCapPerc, sizeof(float)*m_iNumControlPoints );
memcpy( m_flOldUnlockTimes, m_flUnlockTimes, sizeof(float)*m_iNumControlPoints );
memcpy( m_flOldCPTimerTimes, m_flCPTimerTimes, sizeof(float)*m_iNumControlPoints );
@ -229,6 +238,11 @@ void C_BaseTeamObjectiveResource::OnDataChanged( DataUpdateType_t updateType )
}
}
}
if ( m_flOldCustomPositionX != m_flCustomPositionX || m_flOldCustomPositionY != m_flCustomPositionY )
{
UpdateControlPoint( "controlpoint_updatelayout" );
}
}
//-----------------------------------------------------------------------------
@ -373,7 +387,7 @@ void C_BaseTeamObjectiveResource::ClientThink()
if ( iPlayersCapping > 0 )
{
float flReduction = gpGlobals->curtime - m_flCapLastThinkTime[i];
if ( mp_capstyle.GetInt() == 1 )
if ( mp_capstyle.GetInt() == 1 && m_bCPCapRateScalesWithPlayers[i] )
{
// Diminishing returns for successive players.
for ( int iPlayer = 1; iPlayer < iPlayersCapping; iPlayer++ )
@ -423,7 +437,8 @@ void C_BaseTeamObjectiveResource::ClientThink()
if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->TeamMayCapturePoint(m_iCappingTeam[i],i) )
{
float flCapLength = m_flTeamCapTime[ TEAM_ARRAY(i,m_iCappingTeam[i]) ];
float flDecrease = (flCapLength / mp_capdeteriorate_time.GetFloat()) * (gpGlobals->curtime - m_flCapLastThinkTime[i]);
float flDecreaseScale = m_bCPCapRateScalesWithPlayers[i] ? mp_capdeteriorate_time.GetFloat() : flCapLength;
float flDecrease = (flCapLength / flDecreaseScale) * (gpGlobals->curtime - m_flCapLastThinkTime[i]);
if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->InOvertime() )
{
flDecrease *= 6;

View File

@ -163,6 +163,7 @@ public:
}
const char *GetCapLayoutInHUD( void ) { return m_pszCapLayoutInHUD; }
void GetCapLayoutCustomPosition( float& flCustomPositionX, float& flCustomPositionY ) { flCustomPositionX = m_flCustomPositionX; flCustomPositionY = m_flCustomPositionY; }
bool PlayingMiniRounds( void ){ return m_bPlayingMiniRounds; }
bool IsInMiniRound( int index ) { return m_bInMiniRound[index]; }
@ -313,6 +314,7 @@ protected:
int m_iTeamInZone[MAX_CONTROL_POINTS];
bool m_bBlocked[MAX_CONTROL_POINTS];
int m_iOwner[MAX_CONTROL_POINTS];
bool m_bCPCapRateScalesWithPlayers[MAX_CONTROL_POINTS];
// client calculated state
float m_flCapTimeLeft[MAX_CONTROL_POINTS];
@ -321,6 +323,10 @@ protected:
bool m_bWarnedOnFinalCap[MAX_CONTROL_POINTS];
float m_flLastCapWarningTime[MAX_CONTROL_POINTS];
char m_pszCapLayoutInHUD[MAX_CAPLAYOUT_LENGTH];
float m_flOldCustomPositionX;
float m_flOldCustomPositionY;
float m_flCustomPositionX;
float m_flCustomPositionY;
// hill data for multi-escort payload maps
int m_nNumNodeHillData[TEAM_TRAIN_MAX_TEAMS];

View File

@ -104,6 +104,7 @@
#include "replay/vgui/replayperformanceeditor.h"
#endif
#include "vgui/ILocalize.h"
#include "vgui/IVGui.h"
#include "ixboxsystem.h"
#include "ipresence.h"
#include "engine/imatchmaking.h"
@ -982,6 +983,8 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
g_pSourceVR->GetViewportBounds( ISourceVirtualReality::VREye_Left, NULL, NULL, &nViewportWidth, &nViewportHeight );
vgui::surface()->SetFullscreenViewport( 0, 0, nViewportWidth, nViewportHeight );
vgui::ivgui()->SetVRMode( true );
}
if (!Initializer::InitializeAllObjects())

View File

@ -635,34 +635,6 @@ bool CClientVirtualReality::OverrideStereoView( CViewSetup *pViewMiddle, CViewSe
g_pSourceVR->GetEyeProjectionMatrix ( &pViewLeft->m_ViewToProjection, ISourceVirtualReality::VREye_Left, pViewMiddle->zNear, pViewMiddle->zFar, 1.0f/headtrackFovScale );
g_pSourceVR->GetEyeProjectionMatrix ( &pViewRight->m_ViewToProjection, ISourceVirtualReality::VREye_Right, pViewMiddle->zNear, pViewMiddle->zFar, 1.0f/headtrackFovScale );
static ConVarRef vr_distortion_grow_outside( "vr_distortion_grow_outside" );
static ConVarRef vr_distortion_grow_inside( "vr_distortion_grow_inside" );
static ConVarRef vr_distortion_grow_above( "vr_distortion_grow_above" );
static ConVarRef vr_distortion_grow_below( "vr_distortion_grow_below" );
float StereoDistortionGrowOutside = vr_distortion_grow_outside.GetFloat();
float StereoDistortionGrowInside = vr_distortion_grow_inside.GetFloat();
float StereoDistortionGrowAbove = vr_distortion_grow_above.GetFloat();
float StereoDistortionGrowBelow = vr_distortion_grow_below.GetFloat();
if ( ( StereoDistortionGrowOutside != 0.0f ) || (StereoDistortionGrowInside != 0.0f ) )
{
float ScaleX = 2.0f / ( StereoDistortionGrowInside + StereoDistortionGrowOutside + 2.0f );
float OffsetX = 0.5f * ScaleX * ( StereoDistortionGrowInside - StereoDistortionGrowOutside );
pViewLeft ->m_ViewToProjection.m[0][0] *= ScaleX;
pViewLeft ->m_ViewToProjection.m[0][2] = ( pViewLeft ->m_ViewToProjection.m[0][2] * ScaleX ) + OffsetX;
pViewRight->m_ViewToProjection.m[0][0] *= ScaleX;
pViewRight->m_ViewToProjection.m[0][2] = ( pViewRight->m_ViewToProjection.m[0][2] * ScaleX ) - OffsetX;
}
if ( ( StereoDistortionGrowAbove != 0.0f ) || (StereoDistortionGrowBelow != 0.0f ) )
{
float ScaleY = 2.0f / ( StereoDistortionGrowBelow + StereoDistortionGrowAbove + 2.0f );
float OffsetY = -0.5f * ScaleY * ( StereoDistortionGrowBelow - StereoDistortionGrowAbove ); // Why is this -0.5 and not +0.5? I wish I knew.
pViewLeft ->m_ViewToProjection.m[1][1] *= ScaleY;
pViewLeft ->m_ViewToProjection.m[1][2] = ( pViewLeft ->m_ViewToProjection.m[1][2] * ScaleY ) + OffsetY;
pViewRight->m_ViewToProjection.m[1][1] *= ScaleY;
pViewRight->m_ViewToProjection.m[1][2] = ( pViewRight->m_ViewToProjection.m[1][2] * ScaleY ) + OffsetY;
}
// And bodge together some sort of average for our cyclops friends.
pViewMiddle->m_bViewToProjectionOverride = true;
for ( int i = 0; i < 4; i++ )

View File

@ -312,37 +312,20 @@ void CGlowObjectManager::ApplyEntityGlowEffects( const CViewSetup *pSetup, int n
void CGlowObjectManager::GlowObjectDefinition_t::DrawModel()
{
C_BaseEntity *pEntity = m_hEntity.Get();
if ( !pEntity )
return;
if ( pEntity->GetMoveParent() != NULL )
if ( m_hEntity.Get() )
{
C_BaseAnimating *pBaseAnimating = pEntity->GetBaseAnimating();
if ( pBaseAnimating )
{
pBaseAnimating->InvalidateBoneCache();
}
}
m_hEntity->DrawModel( STUDIO_RENDER );
C_BaseEntity *pAttachment = m_hEntity->FirstMoveChild();
pEntity->DrawModel( STUDIO_RENDER );
C_BaseEntity *pAttachment = pEntity->FirstMoveChild();
while ( pAttachment != NULL )
{
if ( !g_GlowObjectManager.HasGlowEffect( pAttachment ) && pAttachment->ShouldDraw() )
while ( pAttachment != NULL )
{
C_BaseAnimating *pBaseAnimating = pAttachment->GetBaseAnimating();
if ( pBaseAnimating )
if ( !g_GlowObjectManager.HasGlowEffect( pAttachment ) && pAttachment->ShouldDraw() )
{
pBaseAnimating->InvalidateBoneCache();
pAttachment->DrawModel( STUDIO_RENDER );
}
pAttachment->DrawModel( STUDIO_RENDER );
pAttachment = pAttachment->NextMovePeer();
}
pAttachment = pAttachment->NextMovePeer();
}
}
#endif // GLOWS_ENABLE
#endif // GLOWS_ENABLE

View File

@ -1107,7 +1107,23 @@ void CHudControlPointIcons::PerformLayout( void )
}
// Setup the main panel
SetBounds( (ScreenWidth() - iWidest) * 0.5, ScreenHeight() - iTall - m_nHeightOffset, iWidest, iTall );
float flPositionX = (ScreenWidth() - iWidest) * 0.5;
float flPositionY = ScreenHeight() - iTall - m_nHeightOffset;
if ( ObjectiveResource() )
{
float flCustomPositionX = -1.f;
float flCustomPositionY = -1.f;
ObjectiveResource()->GetCapLayoutCustomPosition( flCustomPositionX, flCustomPositionY );
if ( flCustomPositionX != -1.f )
{
flPositionX = flCustomPositionX * ScreenWidth();
}
if ( flCustomPositionY != -1.f )
{
flPositionY = flCustomPositionY * ScreenHeight();
}
}
SetBounds( flPositionX, flPositionY, iWidest, iTall );
// Now that we know how wide we are, and how many icons are in each line,
// we can lay the icons out, centered in the lines.

View File

@ -10,9 +10,6 @@
#define _WIN32_WINNT 0x0502
#include <windows.h>
#endif
#ifdef OSX
#include <Carbon/Carbon.h>
#endif
#include "cbase.h"
#include "hud.h"
#include "cdll_int.h"
@ -105,12 +102,7 @@ static ConVar m_mousespeed( "m_mousespeed", "1", FCVAR_ARCHIVE, "Windows mouse a
static ConVar m_mouseaccel1( "m_mouseaccel1", "0", FCVAR_ARCHIVE, "Windows mouse acceleration initial threshold (2x movement).", true, 0, false, 0.0f );
static ConVar m_mouseaccel2( "m_mouseaccel2", "0", FCVAR_ARCHIVE, "Windows mouse acceleration secondary threshold (4x movement).", true, 0, false, 0.0f );
#if defined( OSX )
// On OSX, this needs to stick at 0.
static ConVar m_rawinput( "m_rawinput", "0", FCVAR_ARCHIVE, "Raw Mouse input is unavailable on OSX", true, 0.0, true, 0.0);
#else
static ConVar m_rawinput( "m_rawinput", "0", FCVAR_ARCHIVE, "Use Raw Input for mouse input.");
#endif
#if DEBUG
ConVar cl_mouselook( "cl_mouselook", "1", FCVAR_ARCHIVE, "Set to 1 to use mouse for look, 0 for keyboard look." );
@ -604,7 +596,7 @@ void CInput::AccumulateMouse( void )
m_flAccumulatedMouseXMovement += current_posx - x;
m_flAccumulatedMouseYMovement += current_posy - y;
#elif defined( USE_SDL ) || defined( OSX )
#elif defined( USE_SDL )
int dx, dy;
engine->GetMouseDelta( dx, dy );
m_flAccumulatedMouseXMovement += dx;

View File

@ -18,7 +18,7 @@
#include "ehandle.h"
#include "inputsystem/AnalogCode.h"
typedef unsigned long CRC32_t;
typedef unsigned int CRC32_t;
//-----------------------------------------------------------------------------
// Purpose:

View File

@ -2147,4 +2147,10 @@ void CAI_BaseNPC::InitDefaultActivitySR(void)
ADD_ACTIVITY_TO_SR( ACT_MP_RELOAD_CROUCH_PRIMARY3_END );
ADD_ACTIVITY_TO_SR( ACT_MP_RELOAD_AIRWALK_PRIMARY3_END );
ADD_ACTIVITY_TO_SR( ACT_MP_RELOAD_SWIM_PRIMARY3 );
ADD_ACTIVITY_TO_SR( ACT_MP_THROW );
ADD_ACTIVITY_TO_SR( ACT_THROWABLE_VM_DRAW );
ADD_ACTIVITY_TO_SR( ACT_THROWABLE_VM_IDLE );
ADD_ACTIVITY_TO_SR( ACT_THROWABLE_VM_FIRE );
}

View File

@ -2633,7 +2633,7 @@ void CAI_NetworkBuilder::InitVisibility(CAI_Network *pNetwork, CAI_Node *pNode)
if ( DebuggingConnect( pNode->m_iID, testnode ) )
{
DevMsg( "" ); // break here..
DevMsg( " " ); // break here..
}
// We know we can view ourself
@ -2814,7 +2814,7 @@ void CAI_NetworkBuilder::InitNeighbors(CAI_Network *pNetwork, CAI_Node *pNode)
{
if ( DebuggingConnect( pNode->m_iID, checknode ) )
{
DevMsg( "" ); // break here..
DevMsg( " " ); // break here..
}
// I'm not a neighbor of myself
@ -3204,7 +3204,7 @@ void CAI_NetworkBuilder::InitLinks(CAI_Network *pNetwork, CAI_Node *pNode)
if ( DebuggingConnect( pNode->m_iID, i ) )
{
DevMsg( "" ); // break here..
DevMsg( " " ); // break here..
}
if ( !(pNode->m_eNodeInfo & bits_NODE_FALLEN) && !(pDestNode->m_eNodeInfo & bits_NODE_FALLEN) )

View File

@ -3522,6 +3522,10 @@ void CBaseCombatCharacter::ChangeTeam( int iTeamNum )
// old team member no longer in the nav mesh
ClearLastKnownArea();
#ifdef GLOWS_ENABLE
RemoveGlowEffect();
#endif // GLOWS_ENABLE
BaseClass::ChangeTeam( iTeamNum );
}

View File

@ -948,6 +948,7 @@ public:
bool IsBSPModel() const;
bool IsCombatCharacter() { return MyCombatCharacterPointer() == NULL ? false : true; }
bool IsInWorld( void ) const;
virtual bool IsCombatItem( void ) const { return false; }
virtual bool IsBaseCombatWeapon( void ) const { return false; }
virtual bool IsWearable( void ) const { return false; }

View File

@ -278,14 +278,32 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa
if ( ev->m_flDelay )
{
char szBuffer[256];
Q_snprintf( szBuffer, sizeof(szBuffer), "(%0.2f) output: (%s,%s) -> (%s,%s,%.1f)(%s)\n", gpGlobals->curtime, pCaller ? STRING(pCaller->m_iClassname) : "NULL", pCaller ? STRING(pCaller->GetEntityName()) : "NULL", STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), ev->m_flDelay, STRING(ev->m_iParameter) );
Q_snprintf( szBuffer,
sizeof(szBuffer),
"(%0.2f) output: (%s,%s) -> (%s,%s,%.1f)(%s)\n",
engine->GetServerTime(),
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
pCaller ? STRING(pCaller->GetEntityName()) : "NULL",
STRING(ev->m_iTarget),
STRING(ev->m_iTargetInput),
ev->m_flDelay,
STRING(ev->m_iParameter) );
DevMsg( 2, "%s", szBuffer );
ADD_DEBUG_HISTORY( HISTORY_ENTITY_IO, szBuffer );
}
else
{
char szBuffer[256];
Q_snprintf( szBuffer, sizeof(szBuffer), "(%0.2f) output: (%s,%s) -> (%s,%s)(%s)\n", gpGlobals->curtime, pCaller ? STRING(pCaller->m_iClassname) : "NULL", pCaller ? STRING(pCaller->GetEntityName()) : "NULL", STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), STRING(ev->m_iParameter) );
Q_snprintf( szBuffer,
sizeof(szBuffer),
"(%0.2f) output: (%s,%s) -> (%s,%s)(%s)\n",
engine->GetServerTime(),
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
pCaller ? STRING(pCaller->GetEntityName()) : "NULL", STRING(ev->m_iTarget),
STRING(ev->m_iTargetInput),
STRING(ev->m_iParameter) );
DevMsg( 2, "%s", szBuffer );
ADD_DEBUG_HISTORY( HISTORY_ENTITY_IO, szBuffer );
}
@ -749,7 +767,7 @@ void CEventQueue::Dump( void )
{
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
Msg("Dumping event queue. Current time is: %.2f\n", gpGlobals->curtime );
Msg( "Dumping event queue. Current time is: %.2f\n", engine->GetServerTime() );
while ( pe != NULL )
{
@ -777,7 +795,7 @@ void CEventQueue::AddEvent( const char *target, const char *targetInput, variant
{
// build the new event
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // priority key in the priority queue
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // priority key in the priority queue
newEvent->m_iTarget = MAKE_STRING( target );
newEvent->m_pEntTarget = NULL;
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
@ -796,7 +814,7 @@ void CEventQueue::AddEvent( CBaseEntity *target, const char *targetInput, varian
{
// build the new event
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // primary priority key in the priority queue
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // primary priority key in the priority queue
newEvent->m_iTarget = NULL_STRING;
newEvent->m_pEntTarget = target;
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
@ -867,7 +885,7 @@ void CEventQueue::ServiceEvents( void )
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
while ( pe != NULL && pe->m_flFireTime <= gpGlobals->curtime )
while ( pe != NULL && pe->m_flFireTime <= engine->GetServerTime() )
{
MDLCACHE_CRITICAL_SECTION();
@ -1150,11 +1168,23 @@ int CEventQueue::Restore( IRestore &restore )
// add the restored event into the list
if ( tmpEvent.m_pEntTarget )
{
AddEvent( tmpEvent.m_pEntTarget, STRING(tmpEvent.m_iTargetInput), tmpEvent.m_VariantValue, tmpEvent.m_flFireTime - gpGlobals->curtime, tmpEvent.m_pActivator, tmpEvent.m_pCaller, tmpEvent.m_iOutputID );
AddEvent( tmpEvent.m_pEntTarget,
STRING(tmpEvent.m_iTargetInput),
tmpEvent.m_VariantValue,
tmpEvent.m_flFireTime - engine->GetServerTime(),
tmpEvent.m_pActivator,
tmpEvent.m_pCaller,
tmpEvent.m_iOutputID );
}
else
{
AddEvent( STRING(tmpEvent.m_iTarget), STRING(tmpEvent.m_iTargetInput), tmpEvent.m_VariantValue, tmpEvent.m_flFireTime - gpGlobals->curtime, tmpEvent.m_pActivator, tmpEvent.m_pCaller, tmpEvent.m_iOutputID );
AddEvent( STRING(tmpEvent.m_iTarget),
STRING(tmpEvent.m_iTargetInput),
tmpEvent.m_VariantValue,
tmpEvent.m_flFireTime - engine->GetServerTime(),
tmpEvent.m_pActivator,
tmpEvent.m_pCaller,
tmpEvent.m_iOutputID );
}
}

View File

@ -21,6 +21,10 @@
#include "KeyValues.h"
#endif
#ifdef TF_DLL
#include "tf_gamerules.h"
#endif // TF_DLL
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@ -332,6 +336,17 @@ void CBaseDoor::Spawn()
}
CreateVPhysics();
#ifdef TF_DLL
if ( TFGameRules() && TFGameRules()->IsMultiplayer() )
{
if ( !m_flBlockDamage )
{
// Never block doors in TF2 - to prevent various exploits.
m_flBlockDamage = 10.f;
}
}
#endif // TF_DLL
}
void CBaseDoor::MovingSoundThink( void )

View File

@ -5,8 +5,10 @@
#ifndef _FUNCTOR_UTILS_H_
#define _FUNCTOR_UTILS_H_
#ifdef NEXT_BOT
#include "NextBotInterface.h"
#include "NextBotManager.h"
#endif // NEXT_BOT
//--------------------------------------------------------------------------------------------------------
/**
@ -321,12 +323,14 @@ inline bool ForEachActor( Functor &func )
if ( !player->IsConnected() )
continue;
#ifdef NEXT_BOT
// skip bots - ForEachCombatCharacter will catch them
INextBot *bot = player->MyNextBotPointer();
if ( bot )
{
continue;
}
#endif // NEXT_BOT
if ( func( player ) == false )
{
@ -334,8 +338,12 @@ inline bool ForEachActor( Functor &func )
}
}
#ifdef NEXT_BOT
// iterate all NextBots
return TheNextBots().ForEachCombatCharacter( func );
#else
return true;
#endif // NEXT_BOT
}
@ -385,12 +393,14 @@ inline bool ForEachActor( IActorFunctor &func )
if ( !player->IsConnected() )
continue;
#ifdef NEXT_BOT
// skip bots - ForEachCombatCharacter will catch them
INextBot *bot = dynamic_cast< INextBot * >( player );
if ( bot )
{
continue;
}
#endif // NEXT_BOT
if ( func( player ) == false )
{
@ -399,11 +409,13 @@ inline bool ForEachActor( IActorFunctor &func )
}
}
#ifdef NEXT_BOT
if ( !isComplete )
{
// iterate all NextBots
isComplete = TheNextBots().ForEachCombatCharacter( func );
}
#endif // NEXT_BOT
func.OnEndIteration( isComplete );

View File

@ -98,14 +98,17 @@
#include "tf/tf_gc_server.h"
#include "tf_gamerules.h"
#include "tf_lobby.h"
#include "player_vs_environment/tf_populator.h"
#include "player_vs_environment/tf_population_manager.h"
extern ConVar tf_mm_trusted;
extern ConVar tf_mm_servermode;
#endif
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
#include "nav_mesh.h"
#endif
#ifdef NEXT_BOT
#include "NextBotManager.h"
#endif
@ -730,7 +733,7 @@ bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
debugoverlay = (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL );
#ifndef _XBOX
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
// create the Navigation Mesh interface
TheNavMesh = NavMeshFactory();
#endif
@ -776,7 +779,7 @@ void CServerGameDLL::DLLShutdown( void )
#endif
#ifndef _XBOX
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
// destroy the Navigation Mesh interface
if ( TheNavMesh )
{
@ -1125,7 +1128,7 @@ void CServerGameDLL::ServerActivate( edict_t *pEdictList, int edictCount, int cl
}
#ifndef _XBOX
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
// load the Navigation Mesh for this map
TheNavMesh->Load();
TheNavMesh->OnServerActivate();
@ -1220,9 +1223,11 @@ void CServerGameDLL::GameFrame( bool simulating )
GameStartFrame();
#ifndef _XBOX
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
TheNavMesh->Update();
#endif
#ifdef NEXT_BOT
TheNextBots().Update();
#endif
@ -1388,7 +1393,7 @@ void CServerGameDLL::LevelShutdown( void )
g_nCurrentChapterIndex = -1;
#ifndef _XBOX
#ifdef NEXT_BOT
#ifdef USE_NAV_MESH
// reset the Navigation Mesh
if ( TheNavMesh )
{

View File

@ -244,7 +244,7 @@ int CBounceBomb::DrawDebugTextOverlays(void)
if (m_debugOverlays & OVERLAY_TEXT_BIT)
{
char tempstr[512];
Q_snprintf(tempstr,sizeof(tempstr), pszMineStateNames[m_iMineState] );
Q_snprintf(tempstr,sizeof(tempstr), "%s", pszMineStateNames[m_iMineState] );
EntityText(text_offset,tempstr,0);
text_offset++;
}

View File

@ -313,10 +313,12 @@ public:
bool HasAvoidanceObstacle( float maxObstructionHeight = StepHeight ) const; // is there a large, immobile object obstructing this area
float GetAvoidanceObstacleHeight( void ) const; // returns the maximum height of the obstruction above the ground
#ifdef NEXT_BOT
bool HasPrerequisite( CBaseCombatCharacter *actor = NULL ) const; // return true if this area has a prerequisite that applies to the given actor
const CUtlVector< CHandle< CFuncNavPrerequisite > > &GetPrerequisiteVector( void ) const; // return vector of prerequisites that must be met before this area can be traversed
void RemoveAllPrerequisites( void );
void AddPrerequisite( CFuncNavPrerequisite *prereq );
#endif
void ClearAllNavCostEntities( void ); // clear set of func_nav_cost entities that affect this area
void AddFuncNavCostEntity( CFuncNavCost *cost ); // add the given func_nav_cost entity to the cost of this area
@ -722,7 +724,9 @@ private:
void CalcDebugID();
#ifdef NEXT_BOT
CUtlVector< CHandle< CFuncNavPrerequisite > > m_prerequisiteVector; // list of prerequisites that must be met before this area can be traversed
#endif
CNavArea *m_prevHash, *m_nextHash; // for hash table in CNavMesh
@ -764,6 +768,8 @@ extern NavAreaVector TheNavAreas;
// Inlines
//
#ifdef NEXT_BOT
//--------------------------------------------------------------------------------------------------------------
inline bool CNavArea::HasPrerequisite( CBaseCombatCharacter *actor ) const
{
@ -790,6 +796,7 @@ inline void CNavArea::AddPrerequisite( CFuncNavPrerequisite *prereq )
m_prerequisiteVector.AddToTail( prereq );
}
}
#endif
//--------------------------------------------------------------------------------------------------------------
inline float CNavArea::GetDangerDecayRate( void ) const

View File

@ -79,8 +79,8 @@ void NavDrawLine( const Vector& from, const Vector& to, NavEditColor navColor )
const Vector offset( 0, 0, 1 );
Color color = NavColors[navColor];
NDebugOverlay::Line( from + offset, to + offset, color[0]/2, color[1]/2, color[2]/2, true, 0.1f );
NDebugOverlay::Line( from + offset, to + offset, color[0], color[1], color[2], false, 0.15f );
NDebugOverlay::Line( from + offset, to + offset, color[0], color[1], color[2], false, NDEBUG_PERSIST_TILL_NEXT_SERVER );
NDebugOverlay::Line( from + offset, to + offset, color[0]/2, color[1]/2, color[2]/2, true, NDEBUG_PERSIST_TILL_NEXT_SERVER );
}
@ -113,8 +113,8 @@ void NavDrawHorizontalArrow( const Vector& from, const Vector& to, float width,
const Vector offset( 0, 0, 1 );
Color color = NavColors[navColor];
NDebugOverlay::HorzArrow( from + offset, to + offset, width, color[0]/2, color[1]/2, color[2]/2, 255, true, NDEBUG_PERSIST_TILL_NEXT_SERVER );
NDebugOverlay::HorzArrow( from + offset, to + offset, width, color[0], color[1], color[2], 255, false, NDEBUG_PERSIST_TILL_NEXT_SERVER );
NDebugOverlay::HorzArrow( from + offset, to + offset, width, color[0]/2, color[1]/2, color[2]/2, 255, true, NDEBUG_PERSIST_TILL_NEXT_SERVER );
}
@ -142,8 +142,8 @@ void NavDrawDashedLine( const Vector& from, const Vector& to, NavEditColor navCo
distance += solidLen + gapLen;
NDebugOverlay::Line( start + offset, end + offset, color[0]/2, color[1]/2, color[2]/2, true, NDEBUG_PERSIST_TILL_NEXT_SERVER );
NDebugOverlay::Line( start + offset, end + offset, color[0], color[1], color[2], false, NDEBUG_PERSIST_TILL_NEXT_SERVER );
NDebugOverlay::Line( start + offset, end + offset, color[0]/2, color[1]/2, color[2]/2, true, NDEBUG_PERSIST_TILL_NEXT_SERVER );
}
}

View File

@ -732,9 +732,6 @@ void CNavMesh::DrawEditMode( void )
static ConVarRef host_thread_mode( "host_thread_mode" );
host_thread_mode.SetValue( 0 );
static ConVarRef sb_perf_collect( "sb_perf_collect" );
sb_perf_collect.SetValue( 0 );
const float maxRange = 1000.0f; // 500
#if DEBUG_NAV_NODES
@ -908,7 +905,7 @@ void CNavMesh::DrawEditMode( void )
{
V_snprintf( buffer, sizeof( buffer ), "Ladder #%d\n", m_selectedLadder->GetID() );
}
NDebugOverlay::ScreenText( 0.5, 0.53, buffer, 255, 255, 0, 128, nav_show_area_info.GetBool() ? 0.1 : 0.5 );
NDebugOverlay::ScreenText( 0.5, 0.53, buffer, 255, 255, 0, 128, NDEBUG_PERSIST_TILL_NEXT_SERVER );
}
// draw the ladder we are pointing at and all connected areas

View File

@ -96,7 +96,7 @@ void CFuncNavCost::Spawn( void )
for( char *token = strtok( buffer, " " ); token; token = strtok( NULL, " " ) )
{
m_tags.AddToTail( token );
m_tags.AddToTail( CFmtStr( "%s", token ) );
}
delete [] buffer;
@ -189,6 +189,19 @@ bool CFuncNavCost::IsApplicableTo( CBaseCombatCharacter *who ) const
return true;
}
// check custom bomb_carrier tags for this bot
for( int i=0; i<m_tags.Count(); ++i )
{
const char* pszTag = m_tags[i];
if ( V_stristr( pszTag, "bomb_carrier" ) )
{
if ( bot->HasTag( pszTag ) )
{
return true;
}
}
}
// the bomb carrier only pays attention to bomb_carrier costs
return false;
}
@ -217,6 +230,11 @@ bool CFuncNavCost::IsApplicableTo( CBaseCombatCharacter *who ) const
}
}
if ( bot->HasMission( CTFBot::MISSION_REPROGRAMMED ) )
{
return false;
}
if ( !bot->IsOnAnyMission() )
{
if ( HasTag( "common" ) )

View File

@ -21,13 +21,15 @@
#endif
#include "functorutils.h"
#ifdef NEXT_BOT
#include "NextBot/NavMeshEntities/func_nav_prerequisite.h"
#endif
// NOTE: This has to be the last file included!
#include "tier0/memdbgon.h"
#define DrawLine( from, to, duration, red, green, blue ) NDebugOverlay::Line( from, to, red, green, blue, true, 0.1f )
#define DrawLine( from, to, duration, red, green, blue ) NDebugOverlay::Line( from, to, red, green, blue, true, NDEBUG_PERSIST_TILL_NEXT_SERVER )
/**
@ -42,6 +44,7 @@ ConVar nav_show_danger( "nav_show_danger", "0", FCVAR_GAMEDLL | FCVAR_CHEAT, "Sh
ConVar nav_show_player_counts( "nav_show_player_counts", "0", FCVAR_GAMEDLL | FCVAR_CHEAT, "Show current player counts in each area." );
ConVar nav_show_func_nav_avoid( "nav_show_func_nav_avoid", "0", FCVAR_GAMEDLL | FCVAR_CHEAT, "Show areas of designer-placed bot avoidance due to func_nav_avoid entities" );
ConVar nav_show_func_nav_prefer( "nav_show_func_nav_prefer", "0", FCVAR_GAMEDLL | FCVAR_CHEAT, "Show areas of designer-placed bot preference due to func_nav_prefer entities" );
ConVar nav_show_func_nav_prerequisite( "nav_show_func_nav_prerequisite", "0", FCVAR_GAMEDLL | FCVAR_CHEAT, "Show areas of designer-placed bot preference due to func_nav_prerequisite entities" );
ConVar nav_max_vis_delta_list_length( "nav_max_vis_delta_list_length", "64", FCVAR_CHEAT );
extern ConVar nav_show_potentially_visible;
@ -302,6 +305,13 @@ void CNavMesh::Update( void )
DrawFuncNavPrefer();
}
#ifdef NEXT_BOT
if ( nav_show_func_nav_prerequisite.GetBool() )
{
DrawFuncNavPrerequisite();
}
#endif
if ( nav_show_potentially_visible.GetBool() )
{
CBasePlayer *player = UTIL_GetListenServerHost();
@ -569,6 +579,7 @@ void CNavMesh::OnServerActivate( void )
}
}
#ifdef NEXT_BOT
//--------------------------------------------------------------------------------------------------------------
class CRegisterPrerequisite
@ -588,6 +599,8 @@ public:
CFuncNavPrerequisite *m_prereq;
};
#endif
//--------------------------------------------------------------------------------------------------------------
/**
* Test all areas for blocked status
@ -609,6 +622,7 @@ void CNavMesh::OnRoundRestart( void )
{
m_updateBlockedAreasTimer.Start( 1.0f );
#ifdef NEXT_BOT
FOR_EACH_VEC( TheNavAreas, pit )
{
CNavArea *area = TheNavAreas[ pit ];
@ -626,6 +640,7 @@ void CNavMesh::OnRoundRestart( void )
ForAllAreasOverlappingExtent( apply, prereqExtent );
}
#endif
}
@ -1420,7 +1435,7 @@ void CNavMesh::DrawPlayerCounts( void ) const
if (area->GetPlayerCount() > 0)
{
NDebugOverlay::Text( area->GetCenter(), msg.sprintf( "%d (%d/%d)", area->GetPlayerCount(), area->GetPlayerCount(1), area->GetPlayerCount(2) ), false, 0.1f );
NDebugOverlay::Text( area->GetCenter(), msg.sprintf( "%d (%d/%d)", area->GetPlayerCount(), area->GetPlayerCount(1), area->GetPlayerCount(2) ), false, NDEBUG_PERSIST_TILL_NEXT_SERVER );
}
}
}
@ -1462,6 +1477,26 @@ void CNavMesh::DrawFuncNavPrefer( void ) const
}
#ifdef NEXT_BOT
//--------------------------------------------------------------------------------------------------------------
/**
* Draw bot preference areas from func_nav_prerequisite entities
*/
void CNavMesh::DrawFuncNavPrerequisite( void ) const
{
FOR_EACH_VEC( TheNavAreas, it )
{
CNavArea *area = TheNavAreas[ it ];
if ( area->HasPrerequisite() )
{
area->DrawFilled( 0, 0, 255, 255 );
}
}
}
#endif
//--------------------------------------------------------------------------------------------------------------
/**
* Increase the danger of nav areas containing and near the given position

View File

@ -340,7 +340,9 @@ public:
void DrawPlayerCounts( void ) const; // draw the current player counts for each area
void DrawFuncNavAvoid( void ) const; // draw bot avoidance areas from func_nav_avoid entities
void DrawFuncNavPrefer( void ) const; // draw bot preference areas from func_nav_prefer entities
#ifdef NEXT_BOT
void DrawFuncNavPrerequisite( void ) const; // draw bot prerequisite areas from func_nav_prerequisite entities
#endif
//-------------------------------------------------------------------------------------
// Auto-generation
//

View File

@ -0,0 +1,43 @@
//-----------------------------------------------------------------------------
// NAV_MESH.VPC
//
// Project script for navigation mesh files (no NextBot files)
//-----------------------------------------------------------------------------
$Configuration
{
$Compiler
{
$PreprocessorDefinitions "$BASE;USE_NAV_MESH"
}
}
$Project
{
$Folder "Source Files"
{
$Folder "Navigation Mesh"
{
$File "nav.h"
$File "nav_area.cpp"
$File "nav_area.h"
$File "nav_colors.cpp"
$File "nav_colors.h"
$File "nav_edit.cpp"
$File "nav_entities.cpp"
$File "nav_entities.h"
$File "nav_file.cpp"
$File "nav_generate.cpp"
$File "nav_ladder.cpp"
$File "nav_ladder.h"
$File "nav_merge.cpp"
$File "nav_mesh.cpp"
$File "nav_mesh.h"
$File "nav_mesh_factory.cpp"
$File "nav_node.cpp"
$File "nav_node.h"
$File "nav_pathfind.h"
$File "nav_simplify.cpp"
}
}
}

View File

@ -9,6 +9,7 @@ $Macro GAMENAME "hl2mp" [!$SOURCESDK]
$Macro GAMENAME "mod_hl2mp" [$SOURCESDK]
$Include "$SRCDIR\game\server\server_base.vpc"
$Include "$SRCDIR\game\server\nav_mesh.vpc" [$SOURCESDK]
$Configuration
{

View File

@ -24,6 +24,9 @@ BEGIN_DATADESC( CTeamControlPointMaster )
DEFINE_KEYFIELD( m_flPartialCapturePointsRate, FIELD_FLOAT, "partial_cap_points_rate" ),
DEFINE_KEYFIELD( m_flCustomPositionX, FIELD_FLOAT, "custom_position_x" ),
DEFINE_KEYFIELD( m_flCustomPositionY, FIELD_FLOAT, "custom_position_y" ),
// DEFINE_FIELD( m_ControlPoints, CUtlMap < int , CTeamControlPoint * > ),
// DEFINE_FIELD( m_bFoundPoints, FIELD_BOOLEAN ),
// DEFINE_FIELD( m_ControlPointRounds, CUtlVector < CTeamControlPointRound * > ),
@ -40,6 +43,8 @@ BEGIN_DATADESC( CTeamControlPointMaster )
DEFINE_INPUTFUNC( FIELD_VOID, "RoundSpawn", InputRoundSpawn ),
DEFINE_INPUTFUNC( FIELD_VOID, "RoundActivate", InputRoundActivate ),
DEFINE_INPUTFUNC( FIELD_STRING, "SetCapLayout", InputSetCapLayout ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetCapLayoutCustomPositionX", InputSetCapLayoutCustomPositionX ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetCapLayoutCustomPositionY", InputSetCapLayoutCustomPositionY ),
DEFINE_FUNCTION( CPMThink ),
@ -70,6 +75,8 @@ int ControlPointRoundSort( CTeamControlPointRound* const *p1, CTeamControlPointR
CTeamControlPointMaster::CTeamControlPointMaster()
{
m_flPartialCapturePointsRate = 0.0f;
m_flCustomPositionX = -1.f;
m_flCustomPositionY = -1.f;
}
//-----------------------------------------------------------------------------
@ -329,6 +336,7 @@ bool CTeamControlPointMaster::FindControlPointRounds( void )
{
g_pObjectiveResource->SetPlayingMiniRounds( bFoundRounds );
g_pObjectiveResource->SetCapLayoutInHUD( STRING(m_iszCapLayoutInHUD) );
g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
}
return bFoundRounds;
@ -837,15 +845,11 @@ void CTeamControlPointMaster::InputRoundSpawn( inputdata_t &input )
// init the ClientAreas
int index = 0;
CBaseEntity *pEnt = gEntList.FindEntityByClassname( NULL, GetTriggerAreaCaptureName() );
while( pEnt )
for ( int i=0; i<ITriggerAreaCaptureAutoList::AutoList().Count(); ++i )
{
CTriggerAreaCapture *pArea = (CTriggerAreaCapture *)pEnt;
Assert( pArea );
CTriggerAreaCapture *pArea = static_cast< CTriggerAreaCapture * >( ITriggerAreaCaptureAutoList::AutoList()[i] );
pArea->SetAreaIndex( index );
index++;
pEnt = gEntList.FindEntityByClassname( pEnt, GetTriggerAreaCaptureName() );
}
ObjectiveResource()->ResetControlPoints();
@ -889,6 +893,24 @@ void CTeamControlPointMaster::InputSetCapLayout( inputdata_t &inputdata )
g_pObjectiveResource->SetCapLayoutInHUD( STRING(m_iszCapLayoutInHUD) );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTeamControlPointMaster::InputSetCapLayoutCustomPositionX( inputdata_t &inputdata )
{
m_flCustomPositionX = inputdata.value.Float();
g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTeamControlPointMaster::InputSetCapLayoutCustomPositionY( inputdata_t &inputdata )
{
m_flCustomPositionY = inputdata.value.Float();
g_pObjectiveResource->SetCapLayoutCustomPosition( m_flCustomPositionX, m_flCustomPositionY );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------

View File

@ -36,7 +36,6 @@ public:
CTeamControlPointMaster();
// Used to find game specific entities
virtual const char *GetTriggerAreaCaptureName( void ) { return "trigger_capture_area"; }
virtual const char *GetControlPointName( void ) { return "team_control_point"; }
virtual const char *GetControlPointRoundName( void ) { return "team_control_point_round"; }
@ -182,6 +181,8 @@ private:
void InputSetWinner( inputdata_t &inputdata );
void InputSetWinnerAndForceCaps( inputdata_t &inputdata );
void InputSetCapLayout( inputdata_t &inputdata );
void InputSetCapLayoutCustomPositionX( inputdata_t &inputdata );
void InputSetCapLayoutCustomPositionY( inputdata_t &inputdata );
void InternalSetWinner( int iTeam );
@ -191,6 +192,9 @@ private:
int m_iTeamBaseIcons[MAX_TEAMS];
string_t m_iszCapLayoutInHUD;
float m_flCustomPositionX;
float m_flCustomPositionY;
int m_iInvalidCapWinner;
bool m_bSwitchTeamsOnWin;
bool m_bScorePerCapture;

View File

@ -365,33 +365,27 @@ bool CTeamControlPointRound::MakePlayable( void )
if ( !IsPlayable() )
{
// we need to try switching the owners of the teams to make this round playable
for ( int i = FIRST_GAME_TEAM ; i < GetNumberOfTeams() ; i++ )
for ( int iTeam = FIRST_GAME_TEAM ; iTeam < GetNumberOfTeams() ; iTeam++ )
{
for ( int j = 0 ; j < m_ControlPoints.Count() ; j++ )
for ( int iControlPoint = 0 ; iControlPoint < m_ControlPoints.Count() ; iControlPoint++ )
{
if ( ( !pMaster->IsBaseControlPoint( m_ControlPoints[j]->GetPointIndex() ) ) && // this is NOT the base point for one of the teams (we don't want to assign the base to the wrong team)
( !WouldNewCPOwnerWinGame( m_ControlPoints[j], i ) ) ) // making this change would make this round playable
if ( ( !pMaster->IsBaseControlPoint( m_ControlPoints[iControlPoint]->GetPointIndex() ) ) && // this is NOT the base point for one of the teams (we don't want to assign the base to the wrong team)
( !WouldNewCPOwnerWinGame( m_ControlPoints[iControlPoint], iTeam ) ) ) // making this change would make this round playable
{
// need to find the trigger area associated with this point
CBaseEntity *pEnt = gEntList.FindEntityByClassname( NULL, pMaster->GetTriggerAreaCaptureName() );
while( pEnt )
for ( int iObj=0; iObj<ITriggerAreaCaptureAutoList::AutoList().Count(); ++iObj )
{
CTriggerAreaCapture *pArea = assert_cast<CTriggerAreaCapture*>( pEnt );
if ( pArea )
{
if ( pArea->TeamCanCap( i ) )
CTriggerAreaCapture *pArea = static_cast< CTriggerAreaCapture * >( ITriggerAreaCaptureAutoList::AutoList()[iObj] );
if ( pArea->TeamCanCap( iTeam ) )
{
CHandle<CTeamControlPoint> hPoint = pArea->GetControlPoint();
if ( hPoint == m_ControlPoints[iControlPoint] )
{
CHandle<CTeamControlPoint> hPoint = pArea->GetControlPoint();
if ( hPoint == m_ControlPoints[j] )
{
// found!
pArea->ForceOwner( i ); // this updates the trigger_area *and* the control_point
return true;
}
// found!
pArea->ForceOwner( iTeam ); // this updates the trigger_area *and* the control_point
return true;
}
}
pEnt = gEntList.FindEntityByClassname( pEnt, pMaster->GetTriggerAreaCaptureName() );
}
}
}

View File

@ -61,7 +61,10 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE(CBaseTeamObjectiveResource, DT_BaseTeamObjective
SendPropArray3( SENDINFO_ARRAY3(m_iTeamInZone), SendPropInt( SENDINFO_ARRAY(m_iTeamInZone), 4, SPROP_UNSIGNED ) ),
SendPropArray3( SENDINFO_ARRAY3(m_bBlocked), SendPropInt( SENDINFO_ARRAY(m_bBlocked), 1, SPROP_UNSIGNED ) ),
SendPropArray3( SENDINFO_ARRAY3(m_iOwner), SendPropInt( SENDINFO_ARRAY(m_iOwner), 4, SPROP_UNSIGNED ) ),
SendPropArray3( SENDINFO_ARRAY3(m_bCPCapRateScalesWithPlayers), SendPropBool( SENDINFO_ARRAY(m_bCPCapRateScalesWithPlayers) ) ),
SendPropString( SENDINFO(m_pszCapLayoutInHUD) ),
SendPropFloat( SENDINFO( m_flCustomPositionX ) ),
SendPropFloat( SENDINFO( m_flCustomPositionY ) ),
END_SEND_TABLE()
@ -72,6 +75,8 @@ BEGIN_DATADESC( CBaseTeamObjectiveResource )
DEFINE_FIELD( m_bPlayingMiniRounds, FIELD_BOOLEAN ),
DEFINE_FIELD( m_bControlPointsReset, FIELD_BOOLEAN ),
DEFINE_FIELD( m_iUpdateCapHudParity, FIELD_INTEGER ),
DEFINE_FIELD( m_flCustomPositionX, FIELD_FLOAT ),
DEFINE_FIELD( m_flCustomPositionY, FIELD_FLOAT ),
DEFINE_ARRAY( m_vCPPositions, FIELD_VECTOR, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_bCPIsVisible, FIELD_INTEGER, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_flLazyCapPerc, FIELD_FLOAT, MAX_CONTROL_POINTS ),
@ -91,6 +96,7 @@ BEGIN_DATADESC( CBaseTeamObjectiveResource )
DEFINE_ARRAY( m_iTeamInZone, FIELD_INTEGER, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_bBlocked, FIELD_BOOLEAN, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_iOwner, FIELD_INTEGER, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_bCPCapRateScalesWithPlayers, FIELD_BOOLEAN, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_pszCapLayoutInHUD, FIELD_CHARACTER, MAX_CAPLAYOUT_LENGTH ),
DEFINE_ARRAY( m_flCapPercentages, FIELD_FLOAT, MAX_CONTROL_POINTS ),
DEFINE_ARRAY( m_iCPGroup, FIELD_INTEGER, MAX_CONTROL_POINTS ),
@ -114,6 +120,8 @@ CBaseTeamObjectiveResource::CBaseTeamObjectiveResource()
m_bPlayingMiniRounds = false;
m_iUpdateCapHudParity = 0;
m_bControlPointsReset = false;
m_flCustomPositionX = -1.f;
m_flCustomPositionY = -1.f;
}
//-----------------------------------------------------------------------------
@ -153,6 +161,7 @@ void CBaseTeamObjectiveResource::Spawn( void )
m_bCPLocked.Set( i, false );
m_flUnlockTimes.Set( i, 0.0 );
m_flCPTimerTimes.Set( i, -1.0 );
m_bCPCapRateScalesWithPlayers.Set( i, true );
for ( int team = 0; team < MAX_CONTROL_POINT_TEAMS; team++ )
{
@ -381,6 +390,15 @@ void CBaseTeamObjectiveResource::SetCPTimerTime( int index, float flTime )
m_flCPTimerTimes.Set( index, flTime );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseTeamObjectiveResource::SetCPCapTimeScalesWithPlayers( int index, bool bScales )
{
AssertValidIndex(index);
m_bCPCapRateScalesWithPlayers.Set( index, bScales );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------

View File

@ -58,6 +58,7 @@ public:
int GetPreviousPointForPoint( int index, int team, int iPrevIndex );
bool TeamCanCapPoint( int index, int team );
void SetCapLayoutInHUD( const char *pszLayout ) { Q_strncpy(m_pszCapLayoutInHUD.GetForModify(), pszLayout, MAX_CAPLAYOUT_LENGTH ); }
void SetCapLayoutCustomPosition( float flPositionX, float flPositionY ) { m_flCustomPositionX = flPositionX; m_flCustomPositionY = flPositionY; }
void SetWarnOnCap( int index, int iWarnLevel );
void SetWarnSound( int index, string_t iszSound );
void SetCPGroup( int index, int iCPGroup );
@ -65,6 +66,7 @@ public:
void SetTrackAlarm( int index, bool bAlarm );
void SetCPUnlockTime( int index, float flTime );
void SetCPTimerTime( int index, float flTime );
void SetCPCapTimeScalesWithPlayers( int index, bool bScales );
// State functions, called many times
void SetNumPlayers( int index, int team, int iNumPlayers );
@ -205,10 +207,15 @@ private:
// changes when a point is successfully captured
CNetworkArray( int, m_iOwner, MAX_CONTROL_POINTS );
CNetworkArray( bool, m_bCPCapRateScalesWithPlayers, MAX_CONTROL_POINTS );
// describes how to lay out the cap points in the hud
CNetworkString( m_pszCapLayoutInHUD, MAX_CAPLAYOUT_LENGTH );
// custom screen position for the cap points in the hud
CNetworkVar( float, m_flCustomPositionX );
CNetworkVar( float, m_flCustomPositionY );
// the groups the points belong to
CNetworkArray( int, m_iCPGroup, MAX_CONTROL_POINTS );

View File

@ -819,17 +819,15 @@ void CTeamTrainWatcher::WatcherActivate( void )
{
if ( m_hTrain )
{
CTriggerAreaCapture *pArea = dynamic_cast<CTriggerAreaCapture *>( gEntList.FindEntityByClassname( NULL, "trigger_capture_area" ) );
while( pArea )
for ( int i=0; i<ITriggerAreaCaptureAutoList::AutoList().Count(); ++i )
{
CTriggerAreaCapture *pArea = static_cast< CTriggerAreaCapture * >( ITriggerAreaCaptureAutoList::AutoList()[i] );
if ( pArea->GetParent() == m_hTrain.Get() )
{
// this is the capture area we care about, so let it know that we want updates on the capture numbers
pArea->SetTrainWatcher( this );
break;
}
pArea = dynamic_cast<CTriggerAreaCapture *>( gEntList.FindEntityByClassname( pArea, "trigger_capture_area" ) );
}
}

View File

@ -18,10 +18,12 @@ extern ConVar mp_capstyle;
extern ConVar mp_blockstyle;
extern ConVar mp_capdeteriorate_time;
IMPLEMENT_AUTO_LIST( ITriggerAreaCaptureAutoList );
BEGIN_DATADESC(CTriggerAreaCapture)
// Touch functions
DEFINE_FUNCTION( AreaTouch ),
DEFINE_FUNCTION( CTriggerAreaCaptureShim::Touch ),
// Think functions
DEFINE_THINKFUNC( CaptureThink ),
@ -96,7 +98,7 @@ void CTriggerAreaCapture::Spawn( void )
m_iAreaIndex = -1;
SetTouch ( &CTriggerAreaCapture::AreaTouch );
SetTouch ( &CTriggerAreaCaptureShim::Touch );
SetThink( &CTriggerAreaCapture::CaptureThink );
SetNextThink( gpGlobals->curtime + AREA_THINK_TIME );
@ -250,6 +252,14 @@ void CTriggerAreaCapture::EndTouch(CBaseEntity *pOther)
BaseClass::EndTouch( pOther );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTriggerAreaCapture::CaptureModeScalesWithPlayers() const
{
return mp_capstyle.GetBool();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@ -469,7 +479,7 @@ void CTriggerAreaCapture::CaptureThink( void )
float flTimeDelta = gpGlobals->curtime - m_flLastReductionTime;
float flReduction = flTimeDelta;
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
// Diminishing returns for successive players.
for ( int i = 1; i < m_TeamData[m_nTeamInZone].iNumTouching; i++ )
@ -490,7 +500,7 @@ void CTriggerAreaCapture::CaptureThink( void )
// See if anyone gets credit for the block
float flPercentToGo = m_fTimeRemaining / m_flCapTime;
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
flPercentToGo = m_fTimeRemaining / ((m_flCapTime * 2) * m_TeamData[m_nCapturingTeam].iNumRequiredToCap);
}
@ -561,7 +571,7 @@ void CTriggerAreaCapture::CaptureThink( void )
}
float flTotalTimeToCap = m_flCapTime;
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
flTotalTimeToCap = ((m_flCapTime * 2) * m_TeamData[m_nCapturingTeam].iNumRequiredToCap);
}
@ -580,7 +590,8 @@ void CTriggerAreaCapture::CaptureThink( void )
// Caps deteriorate over time
if ( TeamplayRoundBasedRules() && m_hPoint && TeamplayRoundBasedRules()->TeamMayCapturePoint(m_nCapturingTeam,m_hPoint->GetPointIndex()) )
{
float flDecrease = (flTotalTimeToCap / mp_capdeteriorate_time.GetFloat()) * flTimeDelta;
float flDecreaseScale = CaptureModeScalesWithPlayers() ? mp_capdeteriorate_time.GetFloat() : flTotalTimeToCap;
float flDecrease = (flTotalTimeToCap / flDecreaseScale) * flTimeDelta;
if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->InOvertime() )
{
flDecrease *= 6;
@ -649,7 +660,7 @@ void CTriggerAreaCapture::CaptureThink( void )
if ( m_TeamData[i].iNumTouching < m_TeamData[i].iNumRequiredToStartCap )
continue;
if ( mp_capstyle.GetInt() == 0 && m_TeamData[i].iNumTouching < m_TeamData[i].iNumRequiredToCap )
if ( !CaptureModeScalesWithPlayers() && m_TeamData[i].iNumTouching < m_TeamData[i].iNumRequiredToCap )
continue;
StartCapture( i, CAPTURE_NORMAL );
@ -670,7 +681,7 @@ void CTriggerAreaCapture::SetCapTimeRemaining( float flTime )
if ( m_nCapturingTeam )
{
flCapPercentage = m_fTimeRemaining / m_flCapTime;
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
flCapPercentage = m_fTimeRemaining / ((m_flCapTime * 2) * m_TeamData[m_nCapturingTeam].iNumRequiredToCap);
}
@ -762,7 +773,7 @@ void CTriggerAreaCapture::StartCapture( int team, int capmode )
UpdateNumPlayers();
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
SetCapTimeRemaining( ((m_flCapTime * 2) * m_TeamData[team].iNumRequiredToCap) );
}
@ -1017,7 +1028,7 @@ void CTriggerAreaCapture::InputRoundSpawn( inputdata_t &inputdata )
ObjectiveResource()->SetCPRequiredCappers( m_hPoint->GetPointIndex(), i, m_TeamData[i].iNumRequiredToCap );
ObjectiveResource()->SetTeamCanCap( m_hPoint->GetPointIndex(), i, m_TeamData[i].bCanCap );
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
ObjectiveResource()->SetCPCapTime( m_hPoint->GetPointIndex(), i, (m_flCapTime * 2) * m_TeamData[i].iNumRequiredToCap );
}
@ -1025,6 +1036,8 @@ void CTriggerAreaCapture::InputRoundSpawn( inputdata_t &inputdata )
{
ObjectiveResource()->SetCPCapTime( m_hPoint->GetPointIndex(), i, m_flCapTime );
}
ObjectiveResource()->SetCPCapTimeScalesWithPlayers( m_hPoint->GetPointIndex(), CaptureModeScalesWithPlayers() );
}
}
}
@ -1125,7 +1138,7 @@ bool CTriggerAreaCapture::CheckIfDeathCausesBlock( CBaseMultiplayerPlayer *pVict
// break early incase we kill multiple people in the same frame
bool bBreakCap = false;
if ( mp_capstyle.GetInt() == 1 )
if ( CaptureModeScalesWithPlayers() )
{
bBreakCap = ( m_TeamData[m_nCapturingTeam].iBlockedTouching - 1 ) <= 0;
}

View File

@ -32,9 +32,19 @@ class CTeamTrainWatcher;
// Can either be capped by both teams at once, or just by one
// Time to capture and number of people required to capture are both passed by the mapper
//-----------------------------------------------------------------------------
class CTriggerAreaCapture : public CBaseTrigger
// This class is to get around the fact that DEFINE_FUNCTION doesn't like multiple inheritance
class CTriggerAreaCaptureShim : public CBaseTrigger
{
DECLARE_CLASS( CTriggerAreaCapture, CBaseTrigger );
virtual void AreaTouch( CBaseEntity *pOther ) = 0;
public:
void Touch( CBaseEntity *pOther ) { return AreaTouch( pOther ) ; }
};
DECLARE_AUTO_LIST( ITriggerAreaCaptureAutoList );
class CTriggerAreaCapture : public CTriggerAreaCaptureShim, public ITriggerAreaCaptureAutoList
{
DECLARE_CLASS( CTriggerAreaCapture, CTriggerAreaCaptureShim );
public:
CTriggerAreaCapture();
@ -73,10 +83,17 @@ public:
void SetTrainWatcher( CTeamTrainWatcher *pTrainWatcher ){ m_hTrainWatcher = pTrainWatcher; } // used for train watchers that control train movement
CTeamTrainWatcher *GetTrainWatcher( void ) const { return m_hTrainWatcher; }
virtual void StartTouch(CBaseEntity *pOther) OVERRIDE;
virtual void EndTouch(CBaseEntity *pOther) OVERRIDE;
float GetCapTime() const { return m_flCapTime; }
protected:
virtual bool CaptureModeScalesWithPlayers() const;
private:
void StartTouch(CBaseEntity *pOther);
void EXPORT AreaTouch( CBaseEntity *pOther );
void EndTouch(CBaseEntity *pOther);
virtual void AreaTouch( CBaseEntity *pOther ) OVERRIDE;
void CaptureThink( void );
void StartCapture( int team, int capmode );

View File

@ -346,6 +346,19 @@ bool CVoteController::CreateVote( int iEntIndex, const char *pszTypeString, cons
Assert( nNumVoteOptions >= 2 );
}
// Have the issue start working on it
pCurrentIssue->OnVoteStarted();
// Now the vote handling and UI
m_nPotentialVotes = pCurrentIssue->CountPotentialVoters();
m_acceptingVotesTimer.Start( sv_vote_timer_duration.GetFloat() );
// Force the vote holder to agree with a Yes/No vote
if ( m_bIsYesNoVote && !bDedicatedServer )
{
TryCastVote( iEntIndex, "Option1" );
}
// Get the data out to the client
CBroadcastRecipientFilter filter;
filter.MakeReliable();
@ -357,16 +370,6 @@ bool CVoteController::CreateVote( int iEntIndex, const char *pszTypeString, cons
WRITE_BOOL( m_bIsYesNoVote );
MessageEnd();
// Force the vote holder to agree with a Yes/No vote
if ( m_bIsYesNoVote && !bDedicatedServer )
{
TryCastVote( iEntIndex, "Option1" );
}
m_nPotentialVotes = pCurrentIssue->CountPotentialVoters();
m_acceptingVotesTimer.Start( sv_vote_timer_duration.GetFloat() );
pCurrentIssue->OnVoteStarted();
if ( !bDedicatedServer )
{
TrackVoteCaller( pVoteCaller );

View File

@ -2265,6 +2265,11 @@ void ActivityList_RegisterSharedActivities( void )
REGISTER_SHARED_ACTIVITY( ACT_MP_RELOAD_AIRWALK_PRIMARY3_END );
REGISTER_SHARED_ACTIVITY( ACT_MP_RELOAD_SWIM_PRIMARY3 );
REGISTER_SHARED_ACTIVITY( ACT_MP_THROW );
REGISTER_SHARED_ACTIVITY( ACT_THROWABLE_VM_DRAW );
REGISTER_SHARED_ACTIVITY( ACT_THROWABLE_VM_IDLE );
REGISTER_SHARED_ACTIVITY( ACT_THROWABLE_VM_FIRE );
AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" );
}

View File

@ -2095,6 +2095,13 @@ typedef enum
ACT_MP_RELOAD_AIRWALK_PRIMARY3_END,
ACT_MP_RELOAD_SWIM_PRIMARY3,
// Throwable Animations
ACT_MP_THROW,
ACT_THROWABLE_VM_DRAW,
ACT_THROWABLE_VM_IDLE,
ACT_THROWABLE_VM_FIRE,
// this is the end of the global activities, private per-monster activities start here.
LAST_SHARED_ACTIVITY,
} Activity;

View File

@ -48,6 +48,11 @@ ConVar hl2_episodic( "hl2_episodic", "0", FCVAR_REPLICATED );
#include "prop_portal_shared.h"
#endif
#ifdef TF_DLL
#include "tf_gamerules.h"
#include "tf_weaponbase.h"
#endif // TF_DLL
#include "rumble_shared.h"
// memdbgon must be the last include file in a .cpp file!!!
@ -1746,6 +1751,17 @@ void CBaseEntity::FireBullets( const FireBulletsInfo_t &info )
{
pShootThroughPortal = NULL;
}
#elif TF_DLL
CTraceFilterIgnoreFriendlyCombatItems traceFilterCombatItem( this, COLLISION_GROUP_NONE, GetTeamNumber() );
if ( TFGameRules() && TFGameRules()->GameModeUsesUpgrades() )
{
CTraceFilterChain traceFilterChain( &traceFilter, &traceFilterCombatItem );
AI_TraceLine(info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilterChain, &tr);
}
else
{
AI_TraceLine(info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilter, &tr);
}
#else
AI_TraceLine(info.m_vecSrc, vecEnd, MASK_SHOT, &traceFilter, &tr);
#endif //#ifdef PORTAL

View File

@ -1223,7 +1223,7 @@ ConVarRef suitcharger( "sk_suitcharger" );
{
if ( bForceSpew || V_stricmp( szLastResult, pszResult) )
{
Msg( "Using map cycle file %s.\n", pszResult );
Msg( "Using map cycle file '%s'.\n", pszResult );
V_strcpy_safe( szLastResult, pszResult );
}
return;

View File

@ -26,6 +26,12 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#ifdef STAGING_ONLY
#ifdef TF_CLIENT_DLL
extern ConVar tf_unusual_effect_offset;
#endif
#endif
//-----------------------------------------------------------------------------
// Save/load
//-----------------------------------------------------------------------------

View File

@ -77,10 +77,10 @@ struct fogplayerparams_t
{
m_hCtrl.Set( NULL );
m_flTransitionTime = -1.0f;
m_OldColor.r = m_OldColor.g = m_OldColor.b = m_OldColor.a = 0;
m_OldColor.r = m_OldColor.g = m_OldColor.g = m_OldColor.a = 0.0f;
m_flOldStart = 0.0f;
m_flOldEnd = 0.0f;
m_NewColor.r = m_NewColor.g = m_NewColor.b = m_NewColor.a = 0;
m_NewColor.r = m_NewColor.g = m_NewColor.g = m_NewColor.a = 0.0f;
m_flNewStart = 0.0f;
m_flNewEnd = 0.0f;
}

View File

@ -79,6 +79,7 @@ public:
void SetStopWatch( bool bState ) { m_bStopWatchTimer = bState; }
bool IsStopWatchTimer( void ) { return m_bStopWatchTimer; }
float GetStopWatchTotalTime( void ) { return m_flTotalTime; }
bool IsRoundMaxTimerSet( void ) { return m_nTimerMaxLength > 0; }
private:

View File

@ -38,7 +38,7 @@
#if defined(TF_CLIENT_DLL) || defined(TF_DLL)
#include "tf_lobby.h"
#ifdef GAME_DLL
#include "player_vs_environment/tf_populator.h"
#include "player_vs_environment/tf_population_manager.h"
#include "../server/tf/tf_gc_server.h"
#include "../server/tf/tf_objective_resource.h"
#else

View File

@ -425,7 +425,7 @@ void CVoiceStatus::UpdateServerState(bool bForce)
void CVoiceStatus::HandleVoiceMaskMsg(bf_read &msg)
{
unsigned long dw;
unsigned int dw;
for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++)
{
m_AudiblePlayers.SetDWord(dw, (unsigned long)msg.ReadLong());
@ -434,8 +434,8 @@ void CVoiceStatus::HandleVoiceMaskMsg(bf_read &msg)
if( voice_clientdebug.GetInt())
{
Msg("CVoiceStatus::HandleVoiceMaskMsg\n");
Msg(" - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw));
Msg(" - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw));
Msg(" - m_AudiblePlayers[%d] = %u\n", dw, m_AudiblePlayers.GetDWord(dw));
Msg(" - m_ServerBannedPlayers[%d] = %u\n", dw, m_ServerBannedPlayers.GetDWord(dw));
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
libSDL2-2.0.so.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More