Skip to content

Commit

Permalink
xbsp: support for extended map limits similar to BSP2. Add -xbsp to 4…
Browse files Browse the repository at this point in the history
…bsp command line. Other tools will detect automatically.
  • Loading branch information
qbism committed Aug 15, 2021
1 parent 18c19b8 commit 5144e01
Show file tree
Hide file tree
Showing 22 changed files with 5,657 additions and 4,243 deletions.
50 changes: 31 additions & 19 deletions 4bsp/4bsp.c
Expand Up @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

extern float subdivide_size;
extern float sublight_size;
extern qboolean use_xbsp;

char source[1024];
char name[1024];
Expand Down Expand Up @@ -130,12 +131,12 @@ void ProcessBlock_Thread (int blocknum)

qprintf ("############### block %2i,%2i ###############\n", xblock, yblock);

mins[0] = xblock*block_size;
mins[1] = yblock*block_size;
mins[2] = -max_bounds; // was -4096
maxs[0] = (xblock+1)*block_size;
maxs[1] = (yblock+1)*block_size;
maxs[2] = max_bounds; // was 4096
mins[0] = xblock*block_size;
mins[1] = yblock*block_size;
mins[2] = -max_bounds; // was -4096
maxs[0] = (xblock+1)*block_size;
maxs[1] = (yblock+1)*block_size;
maxs[2] = max_bounds; // was 4096

// the makelist and chopbrushes could be cached between the passes...
brushes = MakeBspBrushList (brush_start, brush_end, mins, maxs);
Expand Down Expand Up @@ -377,6 +378,7 @@ int main (int argc, char **argv)
" -noorigfix: Disable texture fix for origin offsets.\n"
" -largebounds: Increase max map size for supporting engines.\n"
" -moreents: Increase max number of entities for supporting engines.\n"
" -xbsp: Greatly expanded map and entity limits for supporting engines.\n"
" -v: Display more verbose output.\n"
"<<<<<<<<<<<<<<<<<<<<< 4bsp HELP >>>>>>>>>>>>>>>>>>>>>\n\n");

Expand Down Expand Up @@ -448,19 +450,25 @@ int main (int argc, char **argv)
printf ("leaktest = true\n");
leaktest = true;
}
else if (!strcmp(argv[i], "-xbsp"))
{
printf ("use_xbsp = true\n");
use_xbsp = true;
max_entities = MAX_MAP_ENTITIES_XBSP;
}
//qb: from kmqbsp3- Knightmare added
else if (!strcmp(argv[i], "-largebounds") || !strcmp(argv[i], "-lb"))
{
max_bounds = MAX_HALF_SIZE;
block_size = MAX_BLOCK_SIZE;
printf ("using max bound size of %i\n", MAX_HALF_SIZE);
}
else if (!strcmp(argv[i], "-moreents"))
{
max_entities = MAX_MAP_ENTITIES;
printf ("using entity limit of %i\n", MAX_MAP_ENTITIES);
}
// end Knightmare
else if (!strcmp(argv[i], "-largebounds") || !strcmp(argv[i], "-lb"))
{
max_bounds = MAX_HALF_SIZE;
block_size = MAX_BLOCK_SIZE;
printf ("using max bound size of %i\n", MAX_HALF_SIZE);
}
else if (!strcmp(argv[i], "-moreents"))
{
max_entities = MAX_MAP_ENTITIES;
printf ("using entity limit of %i\n", MAX_MAP_ENTITIES);
}
// end Knightmare

else if ((!strcmp(argv[i], "-chop")) || (!strcmp(argv[i], "-subdiv")))
{
Expand Down Expand Up @@ -526,7 +534,7 @@ int main (int argc, char **argv)
" -leaktest -nodetail -onlyents\n"
" -fulldetail -noshare -noprune\n"
" -noorigfix -largebounds -moreents\n"
" -v (verbose)\n\n");
" -xbsp -v (verbose)\n\n");

exit(1);
}
Expand Down Expand Up @@ -557,6 +565,9 @@ int main (int argc, char **argv)

sprintf (out, "%s.bsp", source);
LoadBSPFile (out);
if(use_xbsp)
printf ("use_xbsp = true\n");

num_entities = 0;

LoadMapFile (name);
Expand All @@ -579,6 +590,7 @@ int main (int argc, char **argv)
ProcessModels ();
}

PrintBSPFileSizes();
printf( "<<<<<<<<<<<<<<<<<< END 4bsp >>>>>>>>>>>>>>>>>>\n\n" );

return 0;
Expand Down

2 comments on commit 5144e01

@Paril
Copy link
Contributor

@Paril Paril commented on 5144e01 Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a huge deal, but, there is already a "BSPX" format - this might cause confusion with the name. QBSP would work for qbism BSP perhaps?

@qbism
Copy link
Owner Author

@qbism qbism commented on 5144e01 Aug 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I should have guessed someone else had already been just as lazy with names in the past.

Please sign in to comment.