std::vector<int> bspLeafSurfaces

This commit is contained in:
Garux
2021-09-24 16:16:02 +03:00
parent b1f32e6faa
commit 6066fe2cc2
7 changed files with 15 additions and 22 deletions

View File

@@ -221,7 +221,7 @@ static void write_json( const char *directory ){
}
{
doc.RemoveAllMembers();
for_indexed( auto&& ls : Span( bspLeafSurfaces, numBSPLeafSurfaces ) ){
for_indexed( const auto& ls : bspLeafSurfaces ){
rapidjson::Value value( rapidjson::kObjectType );
value.AddMember( "Num", ls, all );
doc.AddMember( rapidjson::Value( StringOutputStream( 16 )( "LeafSurface#", i ).c_str(), all ), value, all );
@@ -434,13 +434,10 @@ static void read_json( const char *directory ){
}
{
const auto doc = load_json( StringOutputStream( 256 )( directory, "LeafSurfaces.json" ) );
static std::vector<int> items;
for( auto&& obj : doc.GetObj() ){
auto&& item = items.emplace_back();
auto&& item = bspLeafSurfaces.emplace_back();
item = obj.value["Num"].GetInt();
}
bspLeafSurfaces = items.data();
numBSPLeafSurfaces = items.size();
}
{
const auto doc = load_json( StringOutputStream( 256 )( directory, "LeafBrushes.json" ) );