[ModelSurfs] Skip releasing if buffer is empty

This commit is contained in:
momo5502 2017-01-18 14:55:18 +01:00
parent 4a4e938b00
commit 3cadc64d13
12 changed files with 755 additions and 752 deletions

View File

@ -189,6 +189,8 @@ namespace Components
{
hasCustomSurface = true;
if (!ModelSurfs::BufferMap.empty())
{
auto buffer = ModelSurfs::BufferMap.find(surface->triIndices);
if (buffer != ModelSurfs::BufferMap.end())
{
@ -204,8 +206,9 @@ namespace Components
}
}
}
}
if (hasCustomSurface)
if (hasCustomSurface && !ModelSurfs::AllocMap.empty())
{
auto allocData = ModelSurfs::AllocMap.find(header.surfaces->name);
if (allocData != ModelSurfs::AllocMap.end())