mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 13:46:13 +00:00
Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:DIRECTION"")
This commit is contained in:
parent
28fb8d779e
commit
2638ec1c58
1 changed files with 4 additions and 1 deletions
|
@ -383,6 +383,7 @@ NLMISC::CValueSmoother smoothFPS;
|
||||||
NLMISC::CValueSmoother moreSmoothFPS(64);
|
NLMISC::CValueSmoother moreSmoothFPS(64);
|
||||||
|
|
||||||
static CRefPtr<CCDBNodeLeaf> s_FpsLeaf;
|
static CRefPtr<CCDBNodeLeaf> s_FpsLeaf;
|
||||||
|
static CRefPtr<CCDBNodeLeaf> s_UiDirectionLeaf;
|
||||||
|
|
||||||
|
|
||||||
// Profile
|
// Profile
|
||||||
|
@ -2804,8 +2805,10 @@ bool mainLoop()
|
||||||
H_AUTO_USE ( RZ_Client_Main_Loop_Net )
|
H_AUTO_USE ( RZ_Client_Main_Loop_Net )
|
||||||
// Put here things you have to send to the server only once per tick like user position.
|
// Put here things you have to send to the server only once per tick like user position.
|
||||||
// UPDATE COMPASS
|
// UPDATE COMPASS
|
||||||
|
NLMISC::CCDBNodeLeaf *node = s_UiDirectionLeaf ? (&*s_UiDirectionLeaf)
|
||||||
|
: (s_UiDirectionLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DIRECTION"));
|
||||||
CInterfaceProperty prop;
|
CInterfaceProperty prop;
|
||||||
prop.readDouble("UI:VARIABLES:DIRECTION"," ");
|
prop.setNodePtr(node);
|
||||||
if(CompassMode == 1)
|
if(CompassMode == 1)
|
||||||
{
|
{
|
||||||
double camDir = atan2(View.view().y, View.view().x);
|
double camDir = atan2(View.view().y, View.view().x);
|
||||||
|
|
Loading…
Reference in a new issue