[IclipMap_t] Small fixes

This commit is contained in:
momo5502 2016-12-30 17:26:32 +01:00
parent 6e39c71243
commit 8d7be2a74f
2 changed files with 14 additions and 10 deletions

View File

@ -434,14 +434,14 @@ namespace Assets
Utils::Stream::ClearPointer(&dest->cBrushContents); Utils::Stream::ClearPointer(&dest->cBrushContents);
} }
if (asset->unknown4) if (asset->smodelNodes)
{ {
AssertSize(Game::SModelAabbNode, 28); AssertSize(Game::SModelAabbNode, 28);
SaveLogEnter("SModelAabbNode"); SaveLogEnter("SModelAabbNode");
buffer->align(Utils::Stream::ALIGN_4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveArray(asset->unknown4, asset->unkCount4); buffer->saveArray(asset->smodelNodes, asset->smodelNodeCount);
Utils::Stream::ClearPointer(&dest->unknown4); Utils::Stream::ClearPointer(&dest->smodelNodes);
SaveLogExit(); SaveLogExit();
} }
@ -859,10 +859,14 @@ namespace Assets
clipMap->mapEnts = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_MAP_ENTS, Utils::String::VA("maps/mp/%s.d3dbsp", name.c_str()), builder).mapEnts; clipMap->mapEnts = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_MAP_ENTS, Utils::String::VA("maps/mp/%s.d3dbsp", name.c_str()), builder).mapEnts;
// This mustn't be null and has to have at least 1 'valid' entry. // This mustn't be null and has to have at least 1 'valid' entry.
if (!clipMap->unkCount4 || !clipMap->unknown4) if (!clipMap->smodelNodeCount || !clipMap->smodelNodes)
{ {
clipMap->unkCount4 = 1; clipMap->smodelNodeCount = 1;
clipMap->unknown4 = builder->getAllocator()->allocateArray<Game::SModelAabbNode>(1); clipMap->smodelNodes = builder->getAllocator()->allocateArray<Game::SModelAabbNode>(clipMap->smodelNodeCount);
clipMap->smodelNodes[0].bounds.halfSize[0] = -131072.000f;
clipMap->smodelNodes[0].bounds.halfSize[1] = -131072.000f;
clipMap->smodelNodes[0].bounds.halfSize[2] = -131072.000f;
} }
// These mustn't be null, but they don't need to be valid. // These mustn't be null, but they don't need to be valid.

View File

@ -2500,10 +2500,10 @@ namespace Game
struct CollisionAabbTree struct CollisionAabbTree
{ {
float origin[3]; float midPoint[3];
float halfSize[3];
unsigned __int16 materialIndex; unsigned __int16 materialIndex;
unsigned __int16 childCount; unsigned __int16 childCount;
float halfSize[3];
CollisionAabbTreeIndex u; CollisionAabbTreeIndex u;
}; };
@ -2558,9 +2558,9 @@ namespace Game
Bounds* cBrushBounds; // same count as cBrushes, +148 Bounds* cBrushBounds; // same count as cBrushes, +148
int * cBrushContents; // same count as cBrushes, +152 int * cBrushContents; // same count as cBrushes, +152
MapEnts * mapEnts; // +156 MapEnts * mapEnts; // +156
unsigned short unkCount4; // +160 unsigned __int16 smodelNodeCount;
short pad; // +160 short pad; // +160
SModelAabbNode* unknown4; // +164 SModelAabbNode *smodelNodes;
unsigned __int16 dynEntCount[2]; unsigned __int16 dynEntCount[2];
DynEntityDef *dynEntDefList[2]; DynEntityDef *dynEntDefList[2];
DynEntityPose *dynEntPoseList[2]; DynEntityPose *dynEntPoseList[2];