Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:MK_MOVE")
This commit is contained in:
parent
b32f8b5025
commit
10e4eb4634
2 changed files with 8 additions and 1 deletions
|
@ -294,7 +294,9 @@ void CUserControls::update()
|
|||
// update camera collision once per frame
|
||||
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 //
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
// Std.
|
||||
#include <string>
|
||||
|
||||
namespace NLMISC {
|
||||
class CCDBNodeLeaf;
|
||||
}
|
||||
|
||||
///////////
|
||||
// CLASS //
|
||||
|
@ -305,6 +308,8 @@ private:
|
|||
|
||||
/// when true the next forward action will cancel any moveto
|
||||
bool _NextForwardCancelMoveTo;
|
||||
|
||||
NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _UiVarMkMoveDB;
|
||||
};
|
||||
|
||||
/// User Controls (mouse, keyboard, interfaces, ...)
|
||||
|
|
Loading…
Reference in a new issue