aboutsummaryrefslogtreecommitdiff
path: root/mp/src/utils/vvis
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/utils/vvis')
-rw-r--r--mp/src/utils/vvis/vvis.cpp45
-rw-r--r--mp/src/utils/vvis/vvis_dll.vpc1
2 files changed, 27 insertions, 19 deletions
diff --git a/mp/src/utils/vvis/vvis.cpp b/mp/src/utils/vvis/vvis.cpp
index 0fb61388..42edd0bf 100644
--- a/mp/src/utils/vvis/vvis.cpp
+++ b/mp/src/utils/vvis/vvis.cpp
@@ -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 );
diff --git a/mp/src/utils/vvis/vvis_dll.vpc b/mp/src/utils/vvis/vvis_dll.vpc
index 43001443..211719ff 100644
--- a/mp/src/utils/vvis/vvis_dll.vpc
+++ b/mp/src/utils/vvis/vvis_dll.vpc
@@ -97,5 +97,6 @@ $Project "Vvis_dll"
$Lib mathlib
$Lib tier2
$Lib vmpi
+ $Lib "$LIBCOMMON/lzma"
}
}