Skip to content
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

New reading scheme for vbsp, vvis, vrad #356

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ipch
*.idb
*.vcxproj
*.sln
*.vcxproj.FileListAbsolute.txt
*.pdb

# OSX/Linux build products
*.mak
Expand Down Expand Up @@ -49,6 +51,8 @@ client.dylib.dSYM/
server.dylib
server.dylib.dSYM/

sp/game/bin

# files generated by running a mod
config.cfg

Expand All @@ -61,6 +65,7 @@ config.cfg
*.filters
*.vpc_crc
*.sentinel
*.recipe

# Backup files
*.bak
Expand Down Expand Up @@ -90,4 +95,4 @@ sp/src/vgui2/*.dll
sp/src/vgui2/*.pdb

# Build support files
sp/src/devtools/gcc9+support.o
sp/src/devtools/gcc9+support.o
6 changes: 3 additions & 3 deletions sp/src/fgdlib/gamedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("\t %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), value, value + m_InstanceStartAINodes );

value += m_InstanceStartAINodes;

Expand All @@ -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("\t %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), iSide, iSide + m_InstanceStartSide );

iSide += m_InstanceStartSide;

Expand All @@ -791,7 +791,7 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
sprintf( pszOutValue, "%s %s", pszOutValue, newSideList[i] );
}

//Warning("Old side list: \"%s\", new side list: \"%s\"\n", pszInValue, pszOutValue);
//Warning("\tOld side list: \"%s\", new side list: \"%s\"\n", pszInValue, pszOutValue);
}
break;
#endif
Expand Down
4 changes: 2 additions & 2 deletions sp/src/mathlib/lightdesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ void LightDesc_t::SetupNewStyleAttenuation( float fFiftyPercentDistance,
if (d0<d50)
{
// !!warning in lib code???!!!
Warning("light has _fifty_percent_distance of %f but no zero_percent_distance\n",d50);
Warning("\tlight has _fifty_percent_distance of %f but no zero_percent_distance\n",d50);
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))
{
Warning("can't solve quadratic for light %f %f\n",d50,d0);
Warning("\tcan't solve quadratic for light %f %f\n",d50,d0);
}
float v50=c+d50*(b+d50*a);
float scale=2.0/v50;
Expand Down
4 changes: 2 additions & 2 deletions sp/src/mathlib/mathlib_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,10 @@ void FloorDivMod (double numer, double denom, int *quotient,

#ifdef PARANOID
if (denom <= 0.0)
Sys_Error ("FloorDivMod: bad denominator %d\n", denom);
Sys_Error ("\tFloorDivMod: bad denominator %d\n", denom);

// if ((floor(numer) != numer) || (floor(denom) != denom))
// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f\n",
// Sys_Error ("\tFloorDivMod: non-integer numer or denom %f %f\n",
// numer, denom);
#endif

Expand Down
6 changes: 5 additions & 1 deletion sp/src/public/bspfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/chunkfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ ChunkFileResult_t CChunkFile::ReadChunk(KeyHandler_t pfnKeyHandler, void *pData)
//
if ((eResult != ChunkFile_Ok) && (eResult != ChunkFile_EOF))
{
//HandleError("chunkname", eResult);
//HandleError("\tchunkname", eResult);
}

return(eResult);
Expand Down
6 changes: 3 additions & 3 deletions sp/src/public/disp_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ void AddNeighbor( CCoreDispInfo *pMain,
// Make sure this slot isn't used on either displacement.
if ( pSub->IsValid() || pNeighborSub->IsValid() )
{
ExecuteOnce( Warning( "Found a displacement edge abutting multiple other edges.\n" ) );
ExecuteOnce( Warning("\tFound a displacement edge abutting multiple other edges.\n" ) );
return;
}

Expand Down Expand Up @@ -1074,7 +1074,7 @@ void VerifyNeighborConnections( CCoreDispInfo **ppListBase, int nDisps )
if ( !VerifyNeighborVertConnection( pHelper, it.GetVertIndex(), it.GetCurrentNeighbor(), it.GetNBVertIndex(), iEdge ) )
{
pDisp->GetEdgeNeighbor( iEdge )->SetInvalid();
Warning( "Warning: invalid neighbor connection on displacement near (%.2f %.2f %.2f)\n", VectorExpand( pDisp->GetCornerPoint(0) ) );
Warning("\tWarning: invalid neighbor connection on displacement near (%.2f %.2f %.2f)\n", VectorExpand( pDisp->GetCornerPoint(0) ) );
bHappy = false;
}
}
Expand Down Expand Up @@ -1125,7 +1125,7 @@ void FindNeighboringDispSurfs( CCoreDispInfo **ppListBase, int nListSize )

if ( nCornerOverflows )
{
Warning( "Warning: overflowed %d displacement corner-neighbor lists.", nCornerOverflows );
Warning("\tWarning: overflowed %d displacement corner-neighbor lists.", nCornerOverflows );
}

// Debug check.. make sure the neighbor connections are intact (make sure that any
Expand Down
16 changes: 8 additions & 8 deletions sp/src/public/filesystem_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ FSReturnCode_t SetupFileSystemError( bool bRunVConfig, FSReturnCode_t retVal, co
Q_vsnprintf( g_FileSystemError, sizeof( g_FileSystemError ), pMsg, marker );
va_end( marker );

Warning( "%s\n", g_FileSystemError );
Warning("\t%s\n", g_FileSystemError );

// 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.
Expand All @@ -410,7 +410,7 @@ FSReturnCode_t SetupFileSystemError( bool bRunVConfig, FSReturnCode_t retVal, co

if ( g_FileSystemErrorMode == FS_ERRORMODE_AUTO || g_FileSystemErrorMode == FS_ERRORMODE_VCONFIG )
{
Error( "%s\n", g_FileSystemError );
Error("\t%s\n", g_FileSystemError );
}

return retVal;
Expand Down Expand Up @@ -561,7 +561,7 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
V_MakeAbsolutePath( szAbsSearchPath, sizeof( szAbsSearchPath ), vecPaths[ idxExtraPath ], baseDir );
V_FixSlashes( szAbsSearchPath );
if ( !V_RemoveDotSlashes( szAbsSearchPath ) )
Error( "Bad -insert_search_path - Can't resolve pathname for '%s'", szAbsSearchPath );
Error("\tBad -insert_search_path - Can't resolve pathname for '%s'", szAbsSearchPath );
V_StripTrailingSlash( szAbsSearchPath );
FileSystem_AddLoadedSearchPath( initInfo, "GAME", szAbsSearchPath, false );
FileSystem_AddLoadedSearchPath( initInfo, "MOD", szAbsSearchPath, false );
Expand Down Expand Up @@ -599,7 +599,7 @@ FSReturnCode_t FileSystem_LoadSearchPaths( CFSSearchPathsInit &initInfo )
// Now resolve any ./'s.
V_FixSlashes( szAbsSearchPath );
if ( !V_RemoveDotSlashes( szAbsSearchPath ) )
Error( "FileSystem_AddLoadedSearchPath - Can't resolve pathname for '%s'", szAbsSearchPath );
Error("\tFileSystem_AddLoadedSearchPath - Can't resolve pathname for '%s'", szAbsSearchPath );
V_StripTrailingSlash( szAbsSearchPath );

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

if ( IsPC() )
{
Warning( "Warning: falling back to auto detection of vproject directory.\n" );
Warning("\tWarning: falling back to auto detection of vproject directory.\n" );

// Now look for it in the directory they passed in.
if ( fsInfo.m_pDirectoryName )
Expand Down Expand Up @@ -999,7 +999,7 @@ FSReturnCode_t SetSteamInstallPath( char *steamInstallPath, int steamInstallPath
{
if ( bErrorsAsWarnings )
{
Warning( "SetSteamInstallPath: FileSystem_GetExecutableDir failed.\n" );
Warning("\tSetSteamInstallPath: FileSystem_GetExecutableDir failed.\n" );
return FS_INVALID_PARAMETERS;
}
else
Expand Down Expand Up @@ -1029,7 +1029,7 @@ FSReturnCode_t SetSteamInstallPath( char *steamInstallPath, int steamInstallPath
{
if ( bErrorsAsWarnings )
{
Warning( "Can't find %s relative to executable path: %s.\n", pchSteamDLL, executablePath );
Warning("\tCan't find %s relative to executable path: %s.\n", pchSteamDLL, executablePath );
return FS_MISSING_STEAM_DLL;
}
else
Expand Down Expand Up @@ -1105,7 +1105,7 @@ void SetSteamAppUser( KeyValues *pSteamInfo, const char *steamInstallPath, CStea
KeyValues *pSteamAppData = ReadKeyValuesFile( fullFilename );
if ( !pSteamAppData || (pTempAppUser = pSteamAppData->GetString( "AutoLoginUser", NULL )) == NULL )
{
Error( "Can't find steam app user info." );
Error("\tCan't find steam app user info." );
}
Q_strncpy( appUser, pTempAppUser, sizeof( appUser ) );

Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/scratchpad3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ bool CScratchPad3D::LoadCommandsFromFile( )

if( !pCmd )
{
Assert( !"LoadCommandsFromFile: invalid file" );
Assert( !"\tLoadCommandsFromFile: invalid file" );
m_pFileSystem->Close( fp );
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions sp/src/public/tier0/dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Color;
//
// To use a warning, use
//
// Warning("Oh I feel so %s all over\n", "yummy");
// Warning("\tOh I feel so %s all over\n", "yummy");
//
// Warning will do its magic in only Debug builds. To perform spew in *all*
// builds, use RelWarning.
Expand All @@ -92,7 +92,7 @@ class Color;
// These error types do *not* need two sets of parenthesis.
//
// Msg( "Isn't this exciting %d?", 5 );
// Error( "I'm just thrilled" );
// Error( "\tI'm just thrilled" );
//
// Dynamic Spew messages
//
Expand All @@ -103,7 +103,7 @@ class Color;
// level specified in the SpewActivate function to be printed. Use DSpew
// to perform the spew:
//
// DWarning( "group", level, "Oh I feel even yummier!\n" );
// DWarning("\tgroup", level, "Oh I feel even yummier!\n" );
//
// Priority level 0 means that the spew will *always* be printed, and group
// '*' is the default spew group. If a DWarning is encountered using a group
Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/tier0/memoverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ 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 )
{
Error( "Unsupported function\n" );
Error("\tUnsupported function\n" );
return NULL;
}

Expand Down
6 changes: 3 additions & 3 deletions sp/src/public/tier1/fmtstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(szBuf)[(nBufSize)-1] = 0; \
if ( bTruncated && !(bQuietTruncation) && scAsserted < 5 ) \
{ \
Warning( "FmtStrVSNPrintf truncated to %d without QUIET_TRUNCATION specified!\n", ( int )( nBufSize ) ); \
Warning("\tFmtStrVSNPrintf truncated to %d without QUIET_TRUNCATION specified!\n", ( int )( nBufSize ) ); \
AssertMsg( 0, "FmtStrVSNPrintf truncated without QUIET_TRUNCATION specified!\n" ); \
scAsserted++; \
} \
Expand All @@ -64,7 +64,7 @@
(szBuf)[(nBufSize)-1] = 0; \
if ( bTruncated && !(bQuietTruncation) && scAsserted < 5 ) \
{ \
Warning( "FmtStrVSNPrintf truncated to %d without QUIET_TRUNCATION specified!\n", ( int )( nBufSize ) ); \
Warning("\tFmtStrVSNPrintf truncated to %d without QUIET_TRUNCATION specified!\n", ( int )( nBufSize ) ); \
AssertMsg( 0, "FmtStrVSNPrintf truncated without QUIET_TRUNCATION specified!\n" ); \
scAsserted++; \
} \
Expand Down Expand Up @@ -121,7 +121,7 @@ class CFmtStrN
m_szBuf[SIZE_BUF - 1] = 0;
if ( bTruncated && !m_bQuietTruncation && ( s_nWarned < 5 ) )
{
Warning( "CFmtStr truncated to %d without QUIET_TRUNCATION specified!\n", SIZE_BUF );
Warning("\tCFmtStr truncated to %d without QUIET_TRUNCATION specified!\n", SIZE_BUF );
AssertMsg( 0, "CFmtStr truncated without QUIET_TRUNCATION specified!\n" );
s_nWarned++;
}
Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/tier1/utlblockmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void CUtlBlockMemory<T,I>::ChangeSize( int nBlocks )

if ( !m_pMemory )
{
Error( "CUtlBlockMemory overflow!\n" );
Error("\tCUtlBlockMemory overflow!\n" );
}

// allocate new blocks if growing
Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/tier1/utlfixedmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void CUtlFixedMemory<T>::Grow( int num )
BlockHeader_t * RESTRICT pBlockHeader = ( BlockHeader_t* )malloc( sizeof( BlockHeader_t ) + nBlockSize * sizeof( T ) );
if ( !pBlockHeader )
{
Error( "CUtlFixedMemory overflow!\n" );
Error("\tCUtlFixedMemory overflow!\n" );
}
pBlockHeader->m_pNext = NULL;
pBlockHeader->m_nBlockSize = nBlockSize;
Expand Down
4 changes: 2 additions & 2 deletions sp/src/public/tier1/utllinkedlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,15 @@ I CUtlLinkedList<T,S,ML,I,M>::AllocInternal( bool multilist )
Assert( m_Memory.IsValidIterator( it ) );
if ( !m_Memory.IsValidIterator( it ) )
{
ExecuteNTimes( 10, Warning( "CUtlLinkedList overflow! (exhausted memory allocator)\n" ) );
ExecuteNTimes( 10, Warning("\tCUtlLinkedList overflow! (exhausted memory allocator)\n" ) );
return InvalidIndex();
}
}

// We can overflow before the utlmemory overflows, since S != I
if ( !IndexInRange( m_Memory.GetIndex( it ) ) )
{
ExecuteNTimes( 10, Warning( "CUtlLinkedList overflow! (exhausted index range)\n" ) );
ExecuteNTimes( 10, Warning("\tCUtlLinkedList overflow! (exhausted index range)\n" ) );
return InvalidIndex();
}

Expand Down
4 changes: 2 additions & 2 deletions sp/src/public/tier1/utlmultilist.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ I CUtlMultiList<T,I>::Alloc( )
// We can overflow before the utlmemory overflows, since we have have I != int
if ( !IndexInRange( m_MaxElementIndex ) )
{
ExecuteNTimes( 10, Warning( "CUtlMultiList overflow! (exhausted index range)\n" ) );
ExecuteNTimes( 10, Warning("\tCUtlMultiList overflow! (exhausted index range)\n" ) );
return InvalidIndex();
}

Expand All @@ -413,7 +413,7 @@ I CUtlMultiList<T,I>::Alloc( )

if ( m_MaxElementIndex >= m_Memory.NumAllocated() )
{
ExecuteNTimes( 10, Warning( "CUtlMultiList overflow! (exhausted memory allocator)\n" ) );
ExecuteNTimes( 10, Warning("\tCUtlMultiList overflow! (exhausted memory allocator)\n" ) );
return InvalidIndex();
}
}
Expand Down
2 changes: 1 addition & 1 deletion sp/src/public/tier1/utlrbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ I CUtlRBTree<T, I, L, M>::NewNode()
Assert( m_Elements.IsValidIterator( it ) );
if ( !m_Elements.IsValidIterator( it ) )
{
Error( "CUtlRBTree overflow!\n" );
Error("\tCUtlRBTree overflow!\n" );
}
}
m_LastAlloc = it;
Expand Down
Loading