fix flipped SceneEntity creation condition, non-editor mode should no longer be missing objects

This commit is contained in:
Adam Jensen 2023-06-20 16:23:17 +01:00
parent be11579fdf
commit 9e03ab108d
4 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@
namespace cdc {
SceneEntity::SceneEntity(Scene *scene) : scene(scene) {
// called from SceneLayer::AddInstance
scene->AddEntity(this);
}

View File

@ -38,7 +38,7 @@ public:
dtp::Model **modelsOverride = nullptr; // 5C
uint32_t numOverrideModels = 0; // 60
cdc::SceneEntity *sceneEntity; // 64
cdc::SceneEntity *sceneEntity = nullptr; // 64
cdc::Object *derivedObject; // 6C
// the matrices buffer is allocated by MeshComponent::SetModel

View File

@ -173,6 +173,10 @@ void InstanceDrawable::RemoveFromDirtyList() { // 2052
m_pNextDirty->m_pPrevDirty = m_pPrevDirty;
else
s_pLastDirty = m_pPrevDirty;
// HACK
m_pNextDirty = nullptr;
m_pPrevDirty = nullptr;
}
}

View File

@ -72,7 +72,7 @@ static void UpdateInstances() { // 2052
while (auto *id = InstanceDrawable::s_pFirstDirty) {
Instance *i = id->m_instance;
// TODO
if (i->sceneEntity)
if (!i->sceneEntity)
SceneLayer::AddInstance(i);
// TODO