testqbsp: write out .bsp.json files for testmaps

This commit is contained in:
Eric Wasylishen 2022-05-14 15:08:49 -06:00
parent ba37ae3a54
commit 863a3de04f
1 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,8 @@ static mapentity_t LoadMap(const char *map)
return worldspawn;
}
#include <common/bspinfo.hh>
static mbsp_t LoadTestmap(const std::filesystem::path &name, std::vector<std::string> extra_args = {})
{
auto map_path = std::filesystem::path(testmaps_dir) / name;
@ -91,6 +93,9 @@ static mbsp_t LoadTestmap(const std::filesystem::path &name, std::vector<std::st
ConvertBSPFormat(&bspdata, &bspver_generic);
// write to .json for inspection
serialize_bsp(bspdata, std::get<mbsp_t>(bspdata.bsp), fs::path(options.bsp_path).replace_extension(".bsp.json"));
return std::get<mbsp_t>(bspdata.bsp);
}