Skip to content

Commit

Permalink
Fixed some interiors not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomityGuy committed Mar 15, 2024
1 parent e3a0f57 commit 50038a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engine/source/interior/interiorInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,15 @@ bool InteriorInstance::onAdd()
bool foundAllMaterials = true;
for (i = 0; i < mInteriorRes->getNumDetailLevels(); i++) {
Interior* pInterior = mInteriorRes->getDetailLevel(i);
HashTable<U32, bool> materialUsages;
for (int j = 0; j < pInterior->mSurfaces.size(); j++)
{
Interior::Surface& surf = pInterior->mSurfaces[j];
materialUsages.insertUnique(surf.textureIndex, true);
}
for (int j = 0; j < pInterior->mMaterialList->size(); j++)
{
if (materialUsages.find(j) == materialUsages.end()) continue;
Material* mat = pInterior->mMaterialList->getMappedMaterial(j);
if (mat != NULL)
foundAllMaterials = foundAllMaterials && mat->preloadTextures();
Expand Down

0 comments on commit 50038a8

Please sign in to comment.