mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:FPS", false)
This commit is contained in:
parent
2cd88e5d9e
commit
c2b29881bb
1 changed files with 4 additions and 1 deletions
|
@ -382,6 +382,8 @@ CGameContextMenu GameContextMenu;
|
|||
NLMISC::CValueSmoother smoothFPS;
|
||||
NLMISC::CValueSmoother moreSmoothFPS(64);
|
||||
|
||||
static CRefPtr<CCDBNodeLeaf> s_FpsLeaf;
|
||||
|
||||
|
||||
// Profile
|
||||
/*
|
||||
|
@ -2296,7 +2298,8 @@ bool mainLoop()
|
|||
deltaTime = smoothFPS.getSmoothValue ();
|
||||
if (deltaTime > 0.0)
|
||||
{
|
||||
CCDBNodeLeaf*pNL = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:FPS");
|
||||
CCDBNodeLeaf *pNL = (CCDBNodeLeaf *)s_FpsLeaf ? &*s_FpsLeaf
|
||||
: (s_FpsLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:FPS"));
|
||||
pNL->setValue64((sint64)(1.f/deltaTime));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue