From 7442168061227da947ba095d3477c2350188e30b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 28 Jul 2013 09:06:11 +0200 Subject: [PATCH] Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:DIRECTION"") --- code/ryzom/client/src/main_loop.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 6bf5c03d6..74ac297df 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -383,6 +383,7 @@ NLMISC::CValueSmoother smoothFPS; NLMISC::CValueSmoother moreSmoothFPS(64); static CRefPtr s_FpsLeaf; +static CRefPtr s_UiDirectionLeaf; // Profile @@ -2804,8 +2805,10 @@ bool mainLoop() 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. // UPDATE COMPASS + NLMISC::CCDBNodeLeaf *node = s_UiDirectionLeaf ? (&*s_UiDirectionLeaf) + : (s_UiDirectionLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:DIRECTION")); CInterfaceProperty prop; - prop.readDouble("UI:VARIABLES:DIRECTION"," "); + prop.setNodePtr(node); if(CompassMode == 1) { double camDir = atan2(View.view().y, View.view().x);