Skip to content

New reading scheme for vbsp, vvis, vrad #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5b5332b
New scheme for vbsp,vvis,vrad
Unusuario2 Jan 12, 2025
fcc3137
New scheme for vbsp,vvis,vrad
Unusuario2 Jan 12, 2025
52ac069
mini fix
Unusuario2 Jan 13, 2025
899035b
mini fix2
Unusuario2 Jan 13, 2025
3e304e3
cleanup
Unusuario2 Jan 13, 2025
c13706a
Small fixes.
Unusuario2 Jan 13, 2025
2654067
gitignore fix
Unusuario2 Jan 14, 2025
4fe0f8b
vpc fix
Unusuario2 Jan 14, 2025
d3c8543
Merge branch 'mapbase-source:master' into master
Unusuario2 Jan 17, 2025
cd82dfc
Merge branch 'develop' into master
Blixibon Feb 8, 2025
6b386e8
resolve gitignore conflict.
Unusuario2 Feb 9, 2025
186e88f
cleanup
Unusuario2 Feb 10, 2025
3f1bb61
documented some vrad_dll options
Unusuario2 Feb 10, 2025
d34f7ac
undo wrong commit
Unusuario2 Feb 10, 2025
b4e1f51
Revert "undo wrong commit"
Unusuario2 Feb 10, 2025
f655798
Reapply "undo wrong commit"
Unusuario2 Feb 10, 2025
5248568
cleanup
Unusuario2 Feb 10, 2025
ea9f163
cleanup
Unusuario2 Feb 10, 2025
2a1229a
update the vbsp,vvis,vrad to use specific features
Unusuario2 Mar 1, 2025
f365483
cleanup & bug fixes.
Unusuario2 Mar 1, 2025
4060ad6
added support for "-NoColorHighLighting"
Unusuario2 Mar 1, 2025
f9786b7
Bug fixes & extend new VBSP, VVIS, VRAD format to other strings.
Unusuario2 Mar 2, 2025
bcf6682
Extend new VBSP, VVIS, VRAD format to other strings.
Unusuario2 Mar 2, 2025
362a28a
Merge branch 'develop' into master
Unusuario2 Mar 2, 2025
3e782bb
Small scheme fix.
Unusuario2 Mar 2, 2025
5a41075
New color scheme, extended formatting.
Unusuario2 Mar 4, 2025
5e4f8c9
more non-saturated scheme changes.
Unusuario2 Mar 4, 2025
c392344
.
Unusuario2 Mar 4, 2025
791dd6b
Now most "done(%i)" funtions have a timer.
Unusuario2 Mar 4, 2025
2954f3b
.
Unusuario2 Mar 4, 2025
1c70cf4
more scheme verbose (vrad)
Unusuario2 Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sp/src/fgdlib/gamedata.cpp
Original file line number Diff line number Diff line change
@@ -755,7 +755,7 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
if (value == -1)
break;

//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), value, value + m_InstanceStartAINodes );
//Warning(" %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), value, value + m_InstanceStartAINodes );

value += m_InstanceStartAINodes;

@@ -774,7 +774,7 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
{
int iSide = atoi( sideList[i] );

//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), iSide, iSide + m_InstanceStartSide );
//Warning(" %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), iSide, iSide + m_InstanceStartSide );

iSide += m_InstanceStartSide;

8 changes: 8 additions & 0 deletions sp/src/mathlib/lightdesc.cpp
Original file line number Diff line number Diff line change
@@ -292,13 +292,21 @@ void LightDesc_t::SetupNewStyleAttenuation( float fFiftyPercentDistance,
if (d0<d50)
{
// !!warning in lib code???!!!
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Warning("\tlight has _fifty_percent_distance of %f but no zero_percent_distance\n",d50);
#else
Warning("light has _fifty_percent_distance of %f but no zero_percent_distance\n",d50);
#endif
d0=2.0*d50;
}
float a=0,b=1,c=0;
if (! SolveInverseQuadraticMonotonic(0,1.0,d50,2.0,d0,256.0,a,b,c))
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Warning("\tcan't solve quadratic for light %f %f\n",d50,d0);
#else
Warning("can't solve quadratic for light %f %f\n",d50,d0);
#endif
}
float v50=c+d50*(b+d50*a);
float scale=2.0/v50;
4 changes: 4 additions & 0 deletions sp/src/mathlib/mathlib_base.cpp
Original file line number Diff line number Diff line change
@@ -737,7 +737,11 @@ void FloorDivMod (double numer, double denom, int *quotient,

#ifdef PARANOID
if (denom <= 0.0)
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Sys_Error ("\tFloorDivMod: bad denominator %d\n", denom);
#else
Sys_Error ("FloorDivMod: bad denominator %d\n", denom);
#endif

// if ((floor(numer) != numer) || (floor(denom) != denom))
// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f\n",
18 changes: 18 additions & 0 deletions sp/src/mathlib/mathlib_sdktools.vpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//-----------------------------------------------------------------------------
// MATHLIB_SDKTOOLS.VPC
//
// We use a modify version of mathlib for the compile tools since we use another printing formating.
//
// Project Script
//-----------------------------------------------------------------------------

$macro SRCDIR ".."
$include "$SRCDIR\mathlib\mathlib.vpc"

$Configuration
{
$Compiler
{
$PreprocessorDefinitions "$SDK_TOOLS"
}
}
6 changes: 5 additions & 1 deletion sp/src/public/bspfile.h
Original file line number Diff line number Diff line change
@@ -112,9 +112,13 @@
#define MAX_MAP_PRIMITIVES 32768
#define MAX_MAP_PRIMVERTS 65536
#define MAX_MAP_PRIMINDICES 65536

#ifdef MAPBASE
#define MAX_MAP_DETAIL_PROPS 65535 // This is a soft limit that can be raised up without any issues.
#else
#define MAX_MAP_DETAIL_PROPS 65535
#endif

#else
// Xbox 360 - Force static arrays to be very small
#define MAX_MAP_MODELS 2
#define MAX_MAP_BRUSHES 2
12 changes: 12 additions & 0 deletions sp/src/public/disp_common.cpp
Original file line number Diff line number Diff line change
@@ -876,7 +876,11 @@ void AddNeighbor( CCoreDispInfo *pMain,
// Make sure this slot isn't used on either displacement.
if ( pSub->IsValid() || pNeighborSub->IsValid() )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
ExecuteOnce( Warning("\tFound a displacement edge abutting multiple other edges.\n" ) );
#else
ExecuteOnce( Warning( "Found a displacement edge abutting multiple other edges.\n" ) );
#endif
return;
}

@@ -1074,7 +1078,11 @@ void VerifyNeighborConnections( CCoreDispInfo **ppListBase, int nDisps )
if ( !VerifyNeighborVertConnection( pHelper, it.GetVertIndex(), it.GetCurrentNeighbor(), it.GetNBVertIndex(), iEdge ) )
{
pDisp->GetEdgeNeighbor( iEdge )->SetInvalid();
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Warning("\tWarning: invalid neighbor connection on displacement near (%.2f %.2f %.2f)\n", VectorExpand( pDisp->GetCornerPoint(0) ) );
#else
Warning( "Warning: invalid neighbor connection on displacement near (%.2f %.2f %.2f)\n", VectorExpand( pDisp->GetCornerPoint(0) ) );
#endif
bHappy = false;
}
}
@@ -1125,7 +1133,11 @@ void FindNeighboringDispSurfs( CCoreDispInfo **ppListBase, int nListSize )

if ( nCornerOverflows )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Warning("\tWarning: overflowed %d displacement corner-neighbor lists.", nCornerOverflows );
#else
Warning( "Warning: overflowed %d displacement corner-neighbor lists.", nCornerOverflows );
#endif
}

// Debug check.. make sure the neighbor connections are intact (make sure that any
35 changes: 32 additions & 3 deletions sp/src/public/filesystem_init.cpp
Original file line number Diff line number Diff line change
@@ -398,9 +398,11 @@ FSReturnCode_t SetupFileSystemError( bool bRunVConfig, FSReturnCode_t retVal, co
va_start( marker, pMsg );
Q_vsnprintf( g_FileSystemError, sizeof( g_FileSystemError ), pMsg, marker );
va_end( marker );

#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Warning("\t%s\n", g_FileSystemError );
#else
Warning( "%s\n", g_FileSystemError );

#endif
// Run vconfig?
// Don't do it if they specifically asked for it not to, or if they manually specified a vconfig with -game or -vproject.
if ( bRunVConfig && g_FileSystemErrorMode == FS_ERRORMODE_VCONFIG && !CommandLine()->FindParm( CMDLINEOPTION_NOVCONFIG ) && !GetVProjectCmdLineValue() )
@@ -410,7 +412,11 @@ FSReturnCode_t SetupFileSystemError( bool bRunVConfig, FSReturnCode_t retVal, co

if ( g_FileSystemErrorMode == FS_ERRORMODE_AUTO || g_FileSystemErrorMode == FS_ERRORMODE_VCONFIG )
{
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Error("\t%s\n", g_FileSystemError );
#else
Error( "%s\n", g_FileSystemError );
#endif
}

return retVal;
@@ -561,7 +567,11 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
V_MakeAbsolutePath( szAbsSearchPath, sizeof( szAbsSearchPath ), vecPaths[ idxExtraPath ], baseDir );
V_FixSlashes( szAbsSearchPath );
if ( !V_RemoveDotSlashes( szAbsSearchPath ) )
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Error("\tBad -insert_search_path - Can't resolve pathname for '%s'", szAbsSearchPath );
#else
Error( "Bad -insert_search_path - Can't resolve pathname for '%s'", szAbsSearchPath );
#endif
V_StripTrailingSlash( szAbsSearchPath );
FileSystem_AddLoadedSearchPath( initInfo, "GAME", szAbsSearchPath, false );
FileSystem_AddLoadedSearchPath( initInfo, "MOD", szAbsSearchPath, false );
@@ -599,7 +609,11 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
// Now resolve any ./'s.
V_FixSlashes( szAbsSearchPath );
if ( !V_RemoveDotSlashes( szAbsSearchPath ) )
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Error("\tFileSystem_AddLoadedSearchPath - Can't resolve pathname for '%s'", szAbsSearchPath );
#else
Error( "FileSystem_AddLoadedSearchPath - Can't resolve pathname for '%s'", szAbsSearchPath );
#endif
V_StripTrailingSlash( szAbsSearchPath );

// Don't bother doing any wildcard expansion unless it has wildcards. This avoids the weird
@@ -924,8 +938,11 @@ FSReturnCode_t LocateGameInfoFile( const CFSSteamSetupInfo &fsInfo, char *pOutDi

if ( IsPC() )
{
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Warning("\tWarning: falling back to auto detection of vproject directory.\n" );
#else
Warning( "Warning: falling back to auto detection of vproject directory.\n" );
#endif
// Now look for it in the directory they passed in.
if ( fsInfo.m_pDirectoryName )
Q_MakeAbsolutePath( pOutDir, outDirLen, fsInfo.m_pDirectoryName );
@@ -999,7 +1016,11 @@ FSReturnCode_t SetSteamInstallPath( char *steamInstallPath, int steamInstallPath
{
if ( bErrorsAsWarnings )
{
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Warning("\tSetSteamInstallPath: FileSystem_GetExecutableDir failed.\n" );
#else
Warning( "SetSteamInstallPath: FileSystem_GetExecutableDir failed.\n" );
#endif
return FS_INVALID_PARAMETERS;
}
else
@@ -1029,7 +1050,11 @@ FSReturnCode_t SetSteamInstallPath( char *steamInstallPath, int steamInstallPath
{
if ( bErrorsAsWarnings )
{
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Warning("\tCan't find %s relative to executable path: %s.\n", pchSteamDLL, executablePath );
#else
Warning( "Can't find %s relative to executable path: %s.\n", pchSteamDLL, executablePath );
#endif
return FS_MISSING_STEAM_DLL;
}
else
@@ -1105,7 +1130,11 @@ void SetSteamAppUser( KeyValues *pSteamInfo, const char *steamInstallPath, CStea
KeyValues *pSteamAppData = ReadKeyValuesFile( fullFilename );
if ( !pSteamAppData || (pTempAppUser = pSteamAppData->GetString( "AutoLoginUser", NULL )) == NULL )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Error("\tCan't find steam app user info." );
#else
Error( "Can't find steam app user info." );
#endif
}
Q_strncpy( appUser, pTempAppUser, sizeof( appUser ) );

4 changes: 4 additions & 0 deletions sp/src/public/scratchpad3d.cpp
Original file line number Diff line number Diff line change
@@ -239,7 +239,11 @@ bool CScratchPad3D::LoadCommandsFromFile( )

if( !pCmd )
{
#if defined(MAPBASE) && defined (SDK_TOOLS) //for the tooling we use a different printig format
Assert( !"\tLoadCommandsFromFile: invalid file" );
#else
Assert( !"LoadCommandsFromFile: invalid file" );
#endif
m_pFileSystem->Close( fp );
return false;
}
4 changes: 4 additions & 0 deletions sp/src/public/tier0/memoverride.cpp
Original file line number Diff line number Diff line change
@@ -602,7 +602,11 @@ ALLOC_CALL void *__cdecl _aligned_realloc_base( void *ptr, size_t size, size_t a

ALLOC_CALL void *__cdecl _aligned_recalloc_base( void *ptr, size_t size, size_t align )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Error("\tUnsupported function\n" );
#else
Error( "Unsupported function\n" );
#endif
return NULL;
}

4 changes: 4 additions & 0 deletions sp/src/public/tier1/fmtstr.h
Original file line number Diff line number Diff line change
@@ -121,7 +121,11 @@ class CFmtStrN
m_szBuf[SIZE_BUF - 1] = 0;
if ( bTruncated && !m_bQuietTruncation && ( s_nWarned < 5 ) )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Warning("\tCFmtStr truncated to %d without QUIET_TRUNCATION specified!\n", SIZE_BUF );
#else
Warning( "CFmtStr truncated to %d without QUIET_TRUNCATION specified!\n", SIZE_BUF );
#endif
AssertMsg( 0, "CFmtStr truncated without QUIET_TRUNCATION specified!\n" );
s_nWarned++;
}
4 changes: 4 additions & 0 deletions sp/src/public/tier1/utlblockmemory.h
Original file line number Diff line number Diff line change
@@ -270,7 +270,11 @@ void CUtlBlockMemory<T,I>::ChangeSize( int nBlocks )

if ( !m_pMemory )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Error("\tCUtlBlockMemory overflow!\n" );
#else
Error( "CUtlBlockMemory overflow!\n" );
#endif
}

// allocate new blocks if growing
4 changes: 4 additions & 0 deletions sp/src/public/tier1/utlfixedmemory.h
Original file line number Diff line number Diff line change
@@ -294,7 +294,11 @@ void CUtlFixedMemory<T>::Grow( int num )
BlockHeader_t * RESTRICT pBlockHeader = ( BlockHeader_t* )malloc( sizeof( BlockHeader_t ) + nBlockSize * sizeof( T ) );
if ( !pBlockHeader )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Error("\tCUtlFixedMemory overflow!\n" );
#else
Error( "CUtlFixedMemory overflow!\n" );
#endif
}
pBlockHeader->m_pNext = NULL;
pBlockHeader->m_nBlockSize = nBlockSize;
8 changes: 8 additions & 0 deletions sp/src/public/tier1/utllinkedlist.h
Original file line number Diff line number Diff line change
@@ -679,15 +679,23 @@ I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
Assert( m_Memory.IsValidIterator( it ) );
if ( !m_Memory.IsValidIterator( it ) )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
ExecuteNTimes( 10, Warning("\tCUtlLinkedList overflow! (exhausted memory allocator)\n" ) );
#else
ExecuteNTimes( 10, Warning( "CUtlLinkedList overflow! (exhausted memory allocator)\n" ) );
#endif
return InvalidIndex();
}
}

// We can overflow before the utlmemory overflows, since S != I
if ( !IndexInRange( m_Memory.GetIndex( it ) ) )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
ExecuteNTimes( 10, Warning("\tCUtlLinkedList overflow! (exhausted index range)\n" ) );
#else
ExecuteNTimes( 10, Warning( "CUtlLinkedList overflow! (exhausted index range)\n" ) );
#endif
return InvalidIndex();
}

8 changes: 8 additions & 0 deletions sp/src/public/tier1/utlmultilist.h
Original file line number Diff line number Diff line change
@@ -399,7 +399,11 @@ I CUtlMultiList<T,I>::Alloc( )
// We can overflow before the utlmemory overflows, since we have have I != int
if ( !IndexInRange( m_MaxElementIndex ) )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
ExecuteNTimes( 10, Warning( "\tCUtlMultiList overflow! (exhausted index range)\n" ) );
#else
ExecuteNTimes( 10, Warning( "CUtlMultiList overflow! (exhausted index range)\n" ) );
#endif
return InvalidIndex();
}

@@ -413,7 +417,11 @@ I CUtlMultiList<T,I>::Alloc( )

if ( m_MaxElementIndex >= m_Memory.NumAllocated() )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
ExecuteNTimes( 10, Warning( "\tCUtlMultiList overflow! (exhausted memory allocator)\n" ) );
#else
ExecuteNTimes( 10, Warning( "CUtlMultiList overflow! (exhausted memory allocator)\n" ) );
#endif
return InvalidIndex();
}
}
4 changes: 4 additions & 0 deletions sp/src/public/tier1/utlrbtree.h
Original file line number Diff line number Diff line change
@@ -684,7 +684,11 @@ I CUtlRBTree<T, I, L, M>::NewNode()
Assert( m_Elements.IsValidIterator( it ) );
if ( !m_Elements.IsValidIterator( it ) )
{
#if defined(MAPBASE) && defined(SDK_TOOLS) // For the tooling, we use a different printing format
Error("\tCUtlRBTree overflow!\n" );
#else
Error( "CUtlRBTree overflow!\n" );
#endif
}
}
m_LastAlloc = it;
Loading