Continuing working on dumping the world

This commit is contained in:
Godzil
2020-02-28 09:29:09 +00:00
parent 8ceb68fdff
commit b4ae737b40
19 changed files with 164 additions and 22 deletions

View File

@@ -165,4 +165,34 @@ void Group::updateTransform()
* bounding box
*/
this->updateBoundingBox();
}
void Group::dumpMe(FILE *fp)
{
int i;
fprintf(fp, "\"Type\": \"Group\",\n");
if (this->objectCount > 0)
{
fprintf(fp, "\"Objects\": {\n");
for(i = 0; i < this->objectCount; i++)
{
fprintf(fp, "\"%d\": {\n", i);
this->objectList[i]->dumpMe(fp);
fprintf(fp, "},\n");
}
fprintf(fp, "},\n");
}
if (this->unboxableObjectCount > 0)
{
fprintf(fp, "\"UnboxableObjects\": {\n");
for(i = 0; i < this->objectCount; i++)
{
fprintf(fp, "\"%d\": {\n", i);
this->objectList[i]->dumpMe(fp);
fprintf(fp, "},\n");
}
fprintf(fp, "},\n");
}
Shape::dumpMe(fp);
}