mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 03:56:10 +08:00
Sync with upstream (Issue #30).
Recompiled tier1 and mathlib for all platforms will come in next commit.
This commit is contained in:
@ -1072,6 +1072,7 @@ int RunVVis( int argc, char **argv )
|
||||
{
|
||||
char portalfile[1024];
|
||||
char source[1024];
|
||||
char mapFile[1024];
|
||||
double start, end;
|
||||
|
||||
|
||||
@ -1079,17 +1080,25 @@ int RunVVis( int argc, char **argv )
|
||||
|
||||
verbose = false;
|
||||
|
||||
Q_StripExtension( argv[ argc - 1 ], source, sizeof( source ) );
|
||||
CmdLib_InitFileSystem( argv[ argc - 1 ] );
|
||||
|
||||
Q_FileBase( source, source, sizeof( source ) );
|
||||
|
||||
LoadCmdLineFromFile( argc, argv, source, "vvis" );
|
||||
int i = ParseCommandLine( argc, argv );
|
||||
|
||||
// This part is just for VMPI. VMPI's file system needs the basedir in front of all filenames,
|
||||
CmdLib_InitFileSystem( argv[ argc - 1 ] );
|
||||
|
||||
// The ExpandPath is just for VMPI. VMPI's file system needs the basedir in front of all filenames,
|
||||
// so we prepend qdir here.
|
||||
strcpy( source, ExpandPath( source ) );
|
||||
|
||||
// XXX(johns): Somewhat preserving legacy behavior here to avoid changing tool behavior, there's no specific rhyme
|
||||
// or reason to this. We get just the base name we were passed, discarding any directory or extension
|
||||
// information. We then ExpandPath() it (see VMPI comment above), and tack on .bsp for the file access
|
||||
// parts.
|
||||
V_FileBase( argv[ argc - 1 ], mapFile, sizeof( mapFile ) );
|
||||
V_strncpy( mapFile, ExpandPath( mapFile ), sizeof( mapFile ) );
|
||||
V_strncat( mapFile, ".bsp", sizeof( mapFile ) );
|
||||
|
||||
// Source is just the mapfile without an extension at this point...
|
||||
V_strncpy( source, mapFile, sizeof( mapFile ) );
|
||||
V_StripExtension( source, source, sizeof( source ) );
|
||||
|
||||
if (i != argc - 1)
|
||||
{
|
||||
@ -1114,13 +1123,11 @@ int RunVVis( int argc, char **argv )
|
||||
{
|
||||
SetLowPriority();
|
||||
}
|
||||
|
||||
|
||||
ThreadSetDefault ();
|
||||
|
||||
char targetPath[1024];
|
||||
GetPlatformMapPath( source, targetPath, 0, 1024 );
|
||||
Msg ("reading %s\n", targetPath);
|
||||
LoadBSPFile (targetPath);
|
||||
Msg ("reading %s\n", mapFile);
|
||||
LoadBSPFile (mapFile);
|
||||
if (numnodes == 0 || numfaces == 0)
|
||||
Error ("Empty map");
|
||||
ParseEntities ();
|
||||
@ -1151,7 +1158,7 @@ int RunVVis( int argc, char **argv )
|
||||
Q_StripExtension( portalfile, portalfile, sizeof( portalfile ) );
|
||||
}
|
||||
strcat (portalfile, ".prt");
|
||||
|
||||
|
||||
Msg ("reading %s\n", portalfile);
|
||||
LoadPortals (portalfile);
|
||||
|
||||
@ -1162,17 +1169,17 @@ int RunVVis( int argc, char **argv )
|
||||
CalcPAS ();
|
||||
|
||||
// We need a mapping from cluster to leaves, since the PVS
|
||||
// deals with clusters for both CalcVisibleFogVolumes and
|
||||
// deals with clusters for both CalcVisibleFogVolumes and
|
||||
BuildClusterTable();
|
||||
|
||||
CalcVisibleFogVolumes();
|
||||
CalcDistanceFromLeavesToWater();
|
||||
|
||||
visdatasize = vismap_p - dvisdata;
|
||||
visdatasize = vismap_p - dvisdata;
|
||||
Msg ("visdatasize:%i compressed from %i\n", visdatasize, originalvismapsize*2);
|
||||
|
||||
Msg ("writing %s\n", targetPath);
|
||||
WriteBSPFile (targetPath);
|
||||
Msg ("writing %s\n", mapFile);
|
||||
WriteBSPFile (mapFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1187,9 +1194,9 @@ int RunVVis( int argc, char **argv )
|
||||
CalcVisTrace ();
|
||||
WritePortalTrace(source);
|
||||
}
|
||||
|
||||
|
||||
end = Plat_FloatTime();
|
||||
|
||||
|
||||
char str[512];
|
||||
GetHourMinuteSecondsString( (int)( end - start ), str, sizeof( str ) );
|
||||
Msg( "%s elapsed\n", str );
|
||||
|
@ -97,5 +97,6 @@ $Project "Vvis_dll"
|
||||
$Lib mathlib
|
||||
$Lib tier2
|
||||
$Lib vmpi
|
||||
$Lib "$LIBCOMMON/lzma"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user