Skip to content

Commit

Permalink
Fix attaching object rendering in LE
Browse files Browse the repository at this point in the history
  • Loading branch information
ForserX committed Dec 12, 2024
1 parent 0857ed2 commit 485efa2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/Editors/LevelEditor/Editor/Entry/Spawn/SpawnPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ bool CSpawnPoint::OnAppendObject(CCustomObject* object)
}
}

sh->SetLoadedState();

return true;
}

Expand Down
16 changes: 9 additions & 7 deletions src/Editors/LevelEditor/Editor/Scene/SceneRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ void EScene::Render( const Fmatrix& camera )
t_it->second->BeforeRender();
// sort tools
ESceneCustomOTool* mt = smart_cast<ESceneCustomOTool*>(t_it->second);
if (mt) object_tools.insert(mt);
if (mt)
object_tools.insert(mt);
scene_tools.insert (t_it->second);
}
}
Expand All @@ -99,12 +100,13 @@ void EScene::Render( const Fmatrix& camera )
for (; t_it!=t_end; t_it++)
{
ObjectList& lst = (*t_it)->GetObjects();
ObjectIt o_it = lst.begin();
ObjectIt o_end = lst.end();
for(;o_it!=o_end;o_it++){
if( (*o_it)->Visible()&& (*o_it)->IsRender() ){
float distSQ = EDevice->vCameraPosition.distance_to_sqr((*o_it)->FPosition);
mapRenderObjects.insertInAnyWay(distSQ,*o_it);

for (CCustomObject* Obj : lst)
{
if (Obj->Visible() && Obj->IsRender())
{
float distSQ = EDevice->vCameraPosition.distance_to_sqr(Obj->FPosition);
mapRenderObjects.insertInAnyWay(distSQ, Obj);
}
}
}
Expand Down

0 comments on commit 485efa2

Please sign in to comment.