From 8fb9ae08c1a8647d0ccfb00ead89edc6c9670103 Mon Sep 17 00:00:00 2001 From: TheApadayo Date: Thu, 29 Dec 2016 19:30:07 -0500 Subject: [PATCH] [GfxWorld] Make sure runtime data gets allocated if applicable --- .../Modules/AssetInterfaces/IGfxWorld.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp index a8d6b6fe..08d19f4a 100644 --- a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp +++ b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp @@ -317,6 +317,24 @@ namespace Assets 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) { asset->shadowGeom = reader.readArray(asset->primaryLightCount);