Eliminate per-instance hash lookups in M2 render/shadow culling loops

Use cached model flags (isValid, isSmoke, isInvisibleTrap, isGroundDetail,
disableAnimation, boundRadius) on M2Instance instead of models.find() in
the hot culling paths. Also complete cached flag initialization in
createInstanceWithMatrix().
This commit is contained in:
Kelsi 2026-03-04 08:28:21 -08:00
parent 30fa9836d9
commit 2e432fc123
2 changed files with 38 additions and 32 deletions

View file

@ -179,6 +179,9 @@ struct M2Instance {
bool cachedDisableAnimation = false;
bool cachedIsSmoke = false;
bool cachedHasParticleEmitters = false;
bool cachedIsGroundDetail = false;
bool cachedIsInvisibleTrap = false;
bool cachedIsValid = false;
float cachedBoundRadius = 0.0f;
// Frame-skip optimization (update distant animations less frequently)