[IGfxWorld] Map all array entries

This commit is contained in:
momo5502 2017-04-01 10:34:34 +02:00
parent ce457b20c6
commit 0d1267f7d9

View File

@ -250,7 +250,7 @@ namespace Assets
if (aabbTree->smodelIndexes) if (aabbTree->smodelIndexes)
{ {
void* oldPointer = aabbTree->smodelIndexes; unsigned short* oldPointer = aabbTree->smodelIndexes;
if(builder->getAllocator()->isPointerMapped(oldPointer)) if(builder->getAllocator()->isPointerMapped(oldPointer))
{ {
// We still have to read it // We still have to read it
@ -261,7 +261,11 @@ namespace Assets
else else
{ {
aabbTree->smodelIndexes = reader.readArray<unsigned short>(aabbTree->smodelIndexCount); aabbTree->smodelIndexes = reader.readArray<unsigned short>(aabbTree->smodelIndexCount);
builder->getAllocator()->mapPointer(oldPointer, aabbTree->smodelIndexes);
for (unsigned short k = 0; k < aabbTree->smodelIndexCount; ++k)
{
builder->getAllocator()->mapPointer(&oldPointer[k], &aabbTree->smodelIndexes[k]);
}
} }
} }
} }