[GfxWorld] Make sure runtime data gets allocated if applicable

This commit is contained in:
TheApadayo 2016-12-29 19:30:07 -05:00
parent 392d7fa5a6
commit 8fb9ae08c1

View File

@ -317,6 +317,24 @@ namespace Assets
asset->outdoorImage = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_IMAGE, reader.readString().data(), builder).image; asset->outdoorImage = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_IMAGE, reader.readString().data(), builder).image;
} }
if (asset->primaryLightCount > 0)
{
Utils::Stream::ClearPointer(&asset->primaryLightEntityShadowVis);
}
if (asset->dpvsDyn.dynEntClientCount[0] > 0)
{
Utils::Stream::ClearPointer(&asset->sceneDynModel);
Utils::Stream::ClearPointer(&asset->primaryLightDynEntShadowVis[0]);
Utils::Stream::ClearPointer(&asset->nonSunPrimaryLightForModelDynEnt);
}
if (asset->dpvsDyn.dynEntClientCount[1] > 0)
{
Utils::Stream::ClearPointer(&asset->sceneDynBrush);
Utils::Stream::ClearPointer(&asset->primaryLightDynEntShadowVis[1]);
}
if (asset->shadowGeom) if (asset->shadowGeom)
{ {
asset->shadowGeom = reader.readArray<Game::GfxShadowGeometry>(asset->primaryLightCount); asset->shadowGeom = reader.readArray<Game::GfxShadowGeometry>(asset->primaryLightCount);