Drop _IRR_SCENEMANAGER_DEBUG

This commit is contained in:
numzero 2023-02-22 20:13:55 +03:00
parent d8e09f14bd
commit a0e1e39ea7
2 changed files with 2 additions and 47 deletions

View File

@ -34,19 +34,4 @@
#define IRRLICHT_API
#endif
#ifdef _DEBUG
//! A few attributes are written in CSceneManager when _IRR_SCENEMANAGER_DEBUG is enabled
// NOTE: Those attributes were used always until 1.8.0 and became a global define for 1.8.1
// which is only enabled in debug because it had a large (sometimes >5%) impact on speed.
// A better solution in the long run is to break the interface and remove _all_ attribute
// access in functions like CSceneManager::drawAll and instead put that information in some
// own struct/class or in CSceneManager.
// See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=48211 for the discussion.
#define _IRR_SCENEMANAGER_DEBUG
#ifdef NO_IRR_SCENEMANAGER_DEBUG
#undef _IRR_SCENEMANAGER_DEBUG
#endif
#endif
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__

View File

@ -549,17 +549,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
break;
}
#ifdef _IRR_SCENEMANAGER_DEBUG
s32 index = Parameters->findAttribute("calls");
Parameters->setAttribute(index, Parameters->getAttributeAsInt(index)+1);
if (!taken)
{
index = Parameters->findAttribute("culled");
Parameters->setAttribute(index, Parameters->getAttributeAsInt(index)+1);
}
#endif
return taken;
}
@ -580,15 +569,6 @@ void CSceneManager::drawAll()
if (!Driver)
return;
#ifdef _IRR_SCENEMANAGER_DEBUG
// reset attributes
Parameters->setAttribute("culled", 0);
Parameters->setAttribute("calls", 0);
Parameters->setAttribute("drawn_solid", 0);
Parameters->setAttribute("drawn_transparent", 0);
Parameters->setAttribute("drawn_transparent_effect", 0);
#endif
u32 i; // new ISO for scoping problem in some compilers
// reset all transforms
@ -650,9 +630,6 @@ void CSceneManager::drawAll()
for (i=0; i<SolidNodeList.size(); ++i)
SolidNodeList[i].Node->render();
#ifdef _IRR_SCENEMANAGER_DEBUG
Parameters->setAttribute("drawn_solid", (s32) SolidNodeList.size() );
#endif
SolidNodeList.set_used(0);
}
@ -665,9 +642,6 @@ void CSceneManager::drawAll()
for (i=0; i<TransparentNodeList.size(); ++i)
TransparentNodeList[i].Node->render();
#ifdef _IRR_SCENEMANAGER_DEBUG
Parameters->setAttribute ( "drawn_transparent", (s32) TransparentNodeList.size() );
#endif
TransparentNodeList.set_used(0);
}
@ -680,9 +654,7 @@ void CSceneManager::drawAll()
for (i=0; i<TransparentEffectNodeList.size(); ++i)
TransparentEffectNodeList[i].Node->render();
#ifdef _IRR_SCENEMANAGER_DEBUG
Parameters->setAttribute("drawn_transparent_effect", (s32) TransparentEffectNodeList.size());
#endif
TransparentEffectNodeList.set_used(0);
}
@ -693,9 +665,7 @@ void CSceneManager::drawAll()
for (i=0; i<GuiNodeList.size(); ++i)
GuiNodeList[i]->render();
#ifdef _IRR_SCENEMANAGER_DEBUG
Parameters->setAttribute("drawn_gui_nodes", (s32) GuiNodeList.size());
#endif
GuiNodeList.set_used(0);
}
clearDeletionList();