* -maxmapdrawsurfs <N>: Sets max amount of mapDrawSurfs, used during .map compilation (-bsp, -convert), default = 131072
This commit is contained in:
parent
2721cca15b
commit
20a9afcd1d
|
|
@ -114,6 +114,7 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
|
|||
<li><strong><code>-fs_homepath</code> path:</strong> Sets the given path as the game home directory name (fs_home + fs_homebase)</li>
|
||||
<li><strong><code>-fs_pakpath</code> path:</strong> Specify a package directory (can be used more than once to look in multiple paths)</li>
|
||||
<li><strong><code>-game</code> gamename:</strong> Load settings for the given game (default: quake3), -help -game lists available games</li>
|
||||
<li><strong><code>-maxmapdrawsurfs</code> N:</strong> Sets max amount of mapDrawSurfs, used during .map compilation (-bsp, -convert), default = 131072</li>
|
||||
<li><strong><code>-subdivisions</code> F:</strong> multiplier for patch subdivisions quality</li>
|
||||
<li><strong><code>-threads</code> N:</strong> number of threads to use</li>
|
||||
<li><strong><code>-v</code>:</strong> Verbose mode</li>
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ int BSPMain( Args& args ){
|
|||
Sys_Printf( "--- BSP ---\n" );
|
||||
|
||||
doingBSP = true;
|
||||
mapDrawSurfs = safe_calloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
|
||||
mapDrawSurfs = safe_calloc( sizeof( mapDrawSurface_t ) * max_map_draw_surfs );
|
||||
numMapDrawSurfs = 0;
|
||||
|
||||
strClear( tempSource );
|
||||
|
|
|
|||
|
|
@ -952,7 +952,7 @@ static void PseudoCompileBSP( bool need_tree ){
|
|||
facelist_t faces;
|
||||
tree_t tree{};
|
||||
|
||||
mapDrawSurfs = safe_calloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
|
||||
mapDrawSurfs = safe_calloc( sizeof( mapDrawSurface_t ) * max_map_draw_surfs );
|
||||
numMapDrawSurfs = 0;
|
||||
|
||||
BeginBSPFile();
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ static void HelpCommon()
|
|||
{"-fs_homepath <path>", "Sets the given path as the game home directory name (fs_home + fs_homebase)"},
|
||||
{"-fs_pakpath <path>", "Specify a package directory (can be used more than once to look in multiple paths)"},
|
||||
{"-game <gamename>", "Load settings for the given game (default: quake3), -help -game lists available games"},
|
||||
{"-maxmapdrawsurfs <N>", "Sets max amount of mapDrawSurfs, used during .map compilation (-bsp, -convert), default = 131072"},
|
||||
{"-subdivisions <F>", "multiplier for patch subdivisions quality"},
|
||||
{"-threads <N>", "number of threads to use"},
|
||||
{"-v", "Verbose mode"}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,13 @@ int main( int argc, char **argv ){
|
|||
while ( args.takeArg( "-threads" ) ) {
|
||||
numthreads = atoi( args.takeNext() );
|
||||
}
|
||||
|
||||
/* max_map_draw_surfs */
|
||||
while ( args.takeArg( "-maxmapdrawsurfs" ) ) {
|
||||
max_map_draw_surfs = abs( atoi( args.takeNext() ) );
|
||||
Sys_Printf( "max_map_draw_surfs = %d, mapDrawSurfs size = %.2f MBytes \n",
|
||||
max_map_draw_surfs, sizeof( mapDrawSurface_t ) * max_map_draw_surfs / ( 1024.f * 1024.f ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* init model library */
|
||||
|
|
|
|||
|
|
@ -203,8 +203,6 @@ inline bool style_is_valid( int style ){ return LS_NORMAL <= style && style < LS
|
|||
#define MAX_MAP_VISCLUSTERS 0x4000 // <= MAX_MAP_LEAFS
|
||||
#define MAX_MAP_VISIBILITY ( VIS_HEADER_SIZE + MAX_MAP_VISCLUSTERS * ( ( ( MAX_MAP_VISCLUSTERS + 63 ) & ~63 ) >> 3 ) )
|
||||
|
||||
#define MAX_MAP_DRAW_SURFS 0x20000
|
||||
|
||||
/* the editor uses these predefined yaw angles to orient entities up or down */
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
|
@ -1827,6 +1825,7 @@ inline EBrushType g_brushType = EBrushType::Undefined;
|
|||
/* surface stuff */
|
||||
inline mapDrawSurface_t *mapDrawSurfs;
|
||||
inline int numMapDrawSurfs;
|
||||
inline int max_map_draw_surfs = 0x20000;
|
||||
|
||||
inline int numSurfacesByType[ static_cast<std::size_t>( ESurfaceType::Shader ) + 1 ];
|
||||
inline int numStripSurfaces;
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
|
||||
mapDrawSurface_t *AllocDrawSurface( ESurfaceType type ){
|
||||
/* bounds check */
|
||||
if ( numMapDrawSurfs >= MAX_MAP_DRAW_SURFS ) {
|
||||
Error( "MAX_MAP_DRAW_SURFS (%d) exceeded", MAX_MAP_DRAW_SURFS );
|
||||
if ( numMapDrawSurfs >= max_map_draw_surfs ) {
|
||||
Error( "max_map_draw_surfs (%d) exceeded, consider -maxmapdrawsurfs to increase", max_map_draw_surfs );
|
||||
}
|
||||
mapDrawSurface_t *ds = &mapDrawSurfs[ numMapDrawSurfs ];
|
||||
numMapDrawSurfs++;
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ void LoadSurfaceExtraFile( const char *path ){
|
|||
else
|
||||
{
|
||||
const int surfaceNum = atoi( token );
|
||||
if ( surfaceNum < 0 || surfaceNum > MAX_MAP_DRAW_SURFS ) {
|
||||
if ( surfaceNum < 0 ) {
|
||||
Error( "ReadSurfaceExtraFile(): %s, line %d: bogus surface num %d", srfPath.c_str(), scriptline, surfaceNum );
|
||||
}
|
||||
while ( surfaceNum >= numSurfaceExtras )
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user