limit levelmesh models to StaticMapModel class

This commit is contained in:
Ricardo Luís Vaz Silva 2025-06-10 22:53:54 -03:00 committed by Magnus Norddahl
commit d42ebe9760
2 changed files with 12 additions and 6 deletions

View file

@ -283,16 +283,20 @@ DoomLevelMesh::DoomLevelMesh(FLevelLocals& doomMap)
// Collect all the models we want to bake into the level mesh
if (lm_models)
{
PClass * cls = PClass::FindClass("StaticMapModel");
auto it = doomMap.GetThinkerIterator<AActor>();
AActor* thing;
while ((thing = it.Next()) != nullptr)
{
bool isPicnumOverride = thing->picnum.isValid();
int spritenum = thing->sprite;
FSpriteModelFrame* modelframe = isPicnumOverride ? nullptr : FindModelFrame(thing, spritenum, thing->frame, !!(thing->flags & MF_DROPPED));
if (modelframe && modelframe->modelIDs.size() != 0)
if(thing->GetClass()->IsDescendantOf(cls))
{
CreateModelSurfaces(thing, modelframe);
bool isPicnumOverride = thing->picnum.isValid();
int spritenum = thing->sprite;
FSpriteModelFrame* modelframe = isPicnumOverride ? nullptr : FindModelFrame(thing, spritenum, thing->frame, !!(thing->flags & MF_DROPPED));
if (modelframe && modelframe->modelIDs.size() != 0)
{
CreateModelSurfaces(thing, modelframe);
}
}
}
}

View file

@ -983,4 +983,6 @@ struct Lightmap
// Multiplier for the sun's intensity (or brightness)
// Calling this does NOT recalculate the lightmap.
native static void SetSunIntensity(double intensity);
};
};
class StaticMapModel : Actor {}