From 3ca58dd4ce1bebeea26b89a5a33f0050d81f09b8 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 19 Mar 2017 02:09:05 +0100 Subject: [PATCH] [IGfxWorld] Map smodel index pointers --- .../Modules/AssetInterfaces/IGfxWorld.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp index b7b2b44a..1ae642dd 100644 --- a/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp +++ b/src/Components/Modules/AssetInterfaces/IGfxWorld.cpp @@ -231,7 +231,19 @@ namespace Assets if (aabbTree->smodelIndexes) { - aabbTree->smodelIndexes = reader.readArray(aabbTree->smodelIndexCount); + void* oldPointer = aabbTree->smodelIndexes; + if(builder->getAllocator()->isPointerMapped(oldPointer)) + { + // We still have to read it + reader.readArray(aabbTree->smodelIndexCount); + + aabbTree->smodelIndexes = builder->getAllocator()->getPointer(oldPointer); + } + else + { + aabbTree->smodelIndexes = reader.readArray(aabbTree->smodelIndexCount); + builder->getAllocator()->mapPointer(oldPointer, aabbTree->smodelIndexes); + } } } }