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

--HG--
branch : kaetemi-optimize
hg/feature/sound
kaetemi 11 years ago
parent 1fc4277cf4
commit ed912ab3ae

@ -318,7 +318,11 @@ void CCDBSynchronised::writeInitInProgressIntoUIDB()
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (pIM)
NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CDB_INIT_IN_PROGRESS")->setValueBool(_InitInProgress);
{
NLMISC::CCDBNodeLeaf *node = m_CDBInitInProgressDB ? (&*m_CDBInitInProgressDB)
: (m_CDBInitInProgressDB = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CDB_INIT_IN_PROGRESS"));
node->setValueBool(_InitInProgress);
}
else
nlwarning("InterfaceManager not created");
}

@ -151,6 +151,8 @@ private:
bool allInitPacketReceived() const { return _InitDeltaReceived == 2; } // Classic database + inventory
void writeInitInProgressIntoUIDB();
NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> m_CDBInitInProgressDB;
};

Loading…
Cancel
Save