Avoid redundant per-frame calls to getDbProp("UI:SAVE:SHOW_RETICLE")

--HG--
branch : kaetemi-optimize
This commit is contained in:
kaetemi 2013-07-28 00:29:25 +02:00
parent 55a00fd518
commit 0897092fe3
2 changed files with 5 additions and 1 deletions

View file

@ -3041,7 +3041,9 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */,
bool bShowReticle = true;
CCDBNodeLeaf* node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:SHOW_RETICLE");
CCDBNodeLeaf *node = (CCDBNodeLeaf *)_ShowReticleLeaf ? &*_ShowReticleLeaf
: (_ShowReticleLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:SHOW_RETICLE", false));
if (node)
{
bShowReticle = node->getValueBool();

View file

@ -1113,6 +1113,8 @@ protected:
static NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _OpacityMinNodeLeaf;
NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _ShowReticleLeaf;
protected:
/**
* Change the box position.