From 38080b7d73fa1d2bd37e3a6a819e0f2ea654b7dd Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 27 Mar 2017 18:01:23 +0200 Subject: [PATCH] [IGfxWorld] Make sure to allocate the necessary buffers --- src/Components/Modules/AssetInterfaces/IGfxWorld.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp index df752c69..881de499 100644 --- a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp +++ b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp @@ -435,6 +435,15 @@ namespace Assets asset->heroOnlyLights = reader.readArray(asset->heroOnlyLightCount); } + // We need to temporarily allocate a runtime buffer + // It's not accessed during the building process, + // but as we're interacting with the runtime, we have to + // allocate a valid buffer for the time we're using it. + if (asset->dpvs.surfaceMaterials) + { + asset->dpvs.surfaceMaterials = builder->getAllocator()->allocateArray(asset->surfaceCount); + } + Game::SortWorldSurfaces(asset); } }