Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:MK_MOVE")
--HG-- branch : kaetemi-optimize
This commit is contained in:
parent
cc2465199c
commit
1fc4277cf4
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