Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:MK_MOVE")

This commit is contained in:
kaetemi 2013-07-28 08:19:54 +02:00
parent b32f8b5025
commit 10e4eb4634
2 changed files with 8 additions and 1 deletions

View file

@ -294,7 +294,9 @@ void CUserControls::update()
// update camera collision once per frame // update camera collision once per frame
View.updateCameraCollision(); View.updateCameraCollision();
NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:MK_MOVE")->setValue32(autowalkState()); NLMISC::CCDBNodeLeaf *node = _UiVarMkMoveDB ? &*_UiVarMkMoveDB
: (_UiVarMkMoveDB = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:MK_MOVE"));
node->setValue32(autowalkState());
}// update // }// update //

View file

@ -31,6 +31,9 @@
// Std. // Std.
#include <string> #include <string>
namespace NLMISC {
class CCDBNodeLeaf;
}
/////////// ///////////
// CLASS // // CLASS //
@ -305,6 +308,8 @@ private:
/// when true the next forward action will cancel any moveto /// when true the next forward action will cancel any moveto
bool _NextForwardCancelMoveTo; bool _NextForwardCancelMoveTo;
NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _UiVarMkMoveDB;
}; };
/// User Controls (mouse, keyboard, interfaces, ...) /// User Controls (mouse, keyboard, interfaces, ...)