}
size = (int)( (size_t)( (fixedWinding_t *)0 )->points[points] );
- w = safe_malloc( size );
- memset( w, 0, size );
+ w = safe_malloc0( size );
return w;
}
portallongs = portalbytes / sizeof( long );
// each file portal is split into two memory portals
- portals = safe_malloc( 2 * numportals * sizeof( vportal_t ) );
- memset( portals, 0, 2 * numportals * sizeof( vportal_t ) );
+ portals = safe_malloc0( 2 * numportals * sizeof( vportal_t ) );
- leafs = safe_malloc( portalclusters * sizeof( leaf_t ) );
- memset( leafs, 0, portalclusters * sizeof( leaf_t ) );
+ leafs = safe_malloc0( portalclusters * sizeof( leaf_t ) );
for ( i = 0; i < portalclusters; i++ )
leafs[i].merged = -1;
}
- faces = safe_malloc( 2 * numfaces * sizeof( vportal_t ) );
- memset( faces, 0, 2 * numfaces * sizeof( vportal_t ) );
+ faces = safe_malloc0( 2 * numfaces * sizeof( vportal_t ) );
- faceleafs = safe_malloc( portalclusters * sizeof( leaf_t ) );
- memset( faceleafs, 0, portalclusters * sizeof( leaf_t ) );
+ faceleafs = safe_malloc0( portalclusters * sizeof( leaf_t ) );
for ( i = 0, p = faces; i < numfaces; i++ )
{
}
else if ( !strcmp( argv[ i ], "-v" ) ) {
debugCluster = qtrue;
- Sys_Printf( "Extra verbous mode enabled\n" );
+ Sys_Printf( "Extra verbose mode enabled\n" );
}
else if ( !strcmp( argv[i],"-tmpin" ) ) {
strcpy( inbase, "/tmp" );
else if ( !strcmp( argv[ i ], "-prtfile" ) )
{
strcpy( portalFilePath, argv[i + 1] );
+ argv[ i ] = NULL;
i++;
+ argv[ i ] = NULL;
Sys_Printf( "Use %s as portal file\n", portalFilePath );
}
Sys_Printf( "Loading %s\n", source );
LoadBSPFile( source );
+ if ( game->texFile )
+ {
+ // smokinguns-like tex file
+ StripExtension( source );
+ strcat( source, ".tex" );
+ LoadSurfaceFlags( source );
+ StripExtension( source );
+ strcat( source, ".bsp" );
+ }
+
/* load the portal file */
if (!portalFilePath[0]) {
sprintf( portalFilePath, "%s%s", inbase, ExpandArg( argv[ i ] ) );
remove( portalFilePath );
}
+ if ( game->texFile )
+ {
+ // smokinguns-like tex file
+ StripExtension( source );
+ WriteTexFile( source );
+ DefaultExtension( source, ".bsp" );
+ }
+
/* write the bsp file */
Sys_Printf( "Writing %s\n", source );
WriteBSPFile( source );