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

This commit is contained in:
kaetemi 2013-07-28 00:29:25 +02:00
parent 38c4b66cce
commit beff07c398
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.