From beff07c3981ef82edb15dec889130564c498a685 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 28 Jul 2013 00:29:25 +0200 Subject: [PATCH] Avoid redundant per-frame calls to getDbProp("UI:SAVE:SHOW_RETICLE") --- code/ryzom/client/src/entity_cl.cpp | 4 +++- code/ryzom/client/src/entity_cl.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 9aef8b1c8..8ec667548 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -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(); diff --git a/code/ryzom/client/src/entity_cl.h b/code/ryzom/client/src/entity_cl.h index 696efc61d..18feac179 100644 --- a/code/ryzom/client/src/entity_cl.h +++ b/code/ryzom/client/src/entity_cl.h @@ -1113,6 +1113,8 @@ protected: static NLMISC::CRefPtr _OpacityMinNodeLeaf; + NLMISC::CRefPtr _ShowReticleLeaf; + protected: /** * Change the box position.