Fixed up DynOS collision files

This commit is contained in:
MysterD 2022-04-01 17:59:40 -07:00
parent 710bd87fb6
commit 7e677d4596
4 changed files with 9 additions and 1 deletions

View File

@ -26,7 +26,10 @@ DataNode<Collision>* DynOS_Col_LoadFromBinary(const SysPath &aPackFolder, const
SysPath _Filename = fstring("%s/%s.col", aPackFolder.begin(), aCollisionName);
FILE *_File = fopen(_Filename.c_str(), "rb");
if (_File) {
collisionNode = LoadCollisionData(_File);
u8 type = ReadBytes<u8>(_File);
if (type == DATA_TYPE_COLLISION) {
collisionNode = LoadCollisionData(_File);
}
fclose(_File);
}

View File

@ -8,6 +8,7 @@ static void WriteCollisionData(FILE* aFile, GfxData* aGfxData, DataNode<Collisio
if (!aNode->mData) return;
// Name
WriteBytes<u8>(aFile, DATA_TYPE_COLLISION);
aNode->mName.Write(aFile);
// Data

View File

@ -313,6 +313,10 @@ void DynOS_Gfx_Free(GfxData* aGfxData) {
Delete(_Node->mData);
Delete(_Node);
}
for (auto& _Node : aGfxData->mCollisions) {
Delete(_Node->mData);
Delete(_Node);
}
Delete(aGfxData);
}
}