Skip to content

Commit

Permalink
Update CKSceneGraphNode::NoTestsTraversal()
Browse files Browse the repository at this point in the history
  • Loading branch information
doyaGu committed Jul 21, 2024
1 parent 7a850c3 commit 3c4580d
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/RenderHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,9 @@ void CKSceneGraphNode::NoTestsTraversal(CKRenderContext *Dev, CK_RENDER_FLAGS Fl
SetAsPotentiallyVisible();
SetAsInsideFrustum();

if ((m_Flags & 0x10) != 0)
if ((m_Flags & 0x10) != 0) {
SortNodes();
}

if (m_Entity->GetClassID() == CKCID_PLACE) {
auto *place = (CKPlace *) m_Entity;
Expand All @@ -660,18 +661,21 @@ void CKSceneGraphNode::NoTestsTraversal(CKRenderContext *Dev, CK_RENDER_FLAGS Fl
}
}

if (m_Entity->GetClassID() == CKCID_CHARACTER)
m_Entity->ModifyMoveableFlags(VX_MOVEABLE_CHARACTERRENDERED, 0);
if (m_Entity) {
if (m_Entity->GetClassID() == CKCID_CHARACTER) {
m_Entity->ModifyMoveableFlags(VX_MOVEABLE_CHARACTERRENDERED, 0);
}

if ((dev->m_Mask & m_RenderContextMask) != 0 && m_Entity->IsToBeRendered()) {
m_Entity->ModifyMoveableFlags(0, VX_MOVEABLE_EXTENTSUPTODATE);
if (m_Entity->IsToBeRenderedLast()) {
m_TimeFpsCalc = dev->m_TimeFpsCalc;
rm->m_SceneGraphRootNode.AddTransparentObject(this);
} else {
dev->m_Stats.SceneTraversalTime += dev->m_SceneTraversalTimeProfiler.Current();
m_Entity->Render(dev, Flags);
dev->m_SceneTraversalTimeProfiler.Reset();
if ((dev->m_Mask & m_RenderContextMask) != 0 && m_Entity->IsToBeRendered()) {
m_Entity->ModifyMoveableFlags(0, VX_MOVEABLE_EXTENTSUPTODATE);
if (!m_Entity->IsToBeRenderedLast()) {
dev->m_Stats.SceneTraversalTime += dev->m_SceneTraversalTimeProfiler.Current();
m_Entity->Render(dev, Flags);
dev->m_SceneTraversalTimeProfiler.Reset();
} else {
m_TimeFpsCalc = dev->m_TimeFpsCalc;
rm->m_SceneGraphRootNode.AddTransparentObject(this);
}
}
}

Expand Down

0 comments on commit 3c4580d

Please sign in to comment.