Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false)
This commit is contained in:
parent
82f3defdbc
commit
4fca01efac
2 changed files with 9 additions and 2 deletions
|
@ -941,6 +941,8 @@ void CSPhraseManager::reset()
|
||||||
CSkillManager *pSM= CSkillManager::getInstance();
|
CSkillManager *pSM= CSkillManager::getInstance();
|
||||||
pBM->removeBrickLearnedCallback(&_ProgressionUpdate);
|
pBM->removeBrickLearnedCallback(&_ProgressionUpdate);
|
||||||
pSM->removeSkillChangeCallback(&_ProgressionUpdate);
|
pSM->removeSkillChangeCallback(&_ProgressionUpdate);
|
||||||
|
|
||||||
|
_TotalMalusEquipLeaf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
@ -1122,7 +1124,9 @@ void CSPhraseManager::buildPhraseDesc(ucstring &text, const CSPhraseCom &phrase,
|
||||||
// **** Compute Phrase Elements from phrase
|
// **** Compute Phrase Elements from phrase
|
||||||
// get the current action malus (0-100)
|
// get the current action malus (0-100)
|
||||||
uint32 totalActionMalus= 0;
|
uint32 totalActionMalus= 0;
|
||||||
CCDBNodeLeaf *actMalus= NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false);
|
CCDBNodeLeaf *actMalus = (CCDBNodeLeaf *)_TotalMalusEquipLeaf ? &*_TotalMalusEquipLeaf
|
||||||
|
: (_TotalMalusEquipLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false));
|
||||||
|
|
||||||
// root brick must not be Power or aura, because Action malus don't apply to them
|
// root brick must not be Power or aura, because Action malus don't apply to them
|
||||||
// (ie leave 0 ActionMalus for Aura or Powers
|
// (ie leave 0 ActionMalus for Aura or Powers
|
||||||
if(actMalus && !rootBrick->isSpecialPower())
|
if(actMalus && !rootBrick->isSpecialPower())
|
||||||
|
@ -4501,7 +4505,8 @@ uint32 CSPhraseManager::getTotalActionMalus(const CSPhraseCom &phrase) const
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||||
CSBrickManager *pBM= CSBrickManager::getInstance();
|
CSBrickManager *pBM= CSBrickManager::getInstance();
|
||||||
uint32 totalActionMalus= 0;
|
uint32 totalActionMalus= 0;
|
||||||
CCDBNodeLeaf *actMalus= NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false);
|
CCDBNodeLeaf *actMalus = (CCDBNodeLeaf *)_TotalMalusEquipLeaf ? &*_TotalMalusEquipLeaf
|
||||||
|
: (_TotalMalusEquipLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false));
|
||||||
// root brick must not be Power or aura, because Action malus don't apply to them
|
// root brick must not be Power or aura, because Action malus don't apply to them
|
||||||
// (ie leave 0 ActionMalus for Aura or Powers
|
// (ie leave 0 ActionMalus for Aura or Powers
|
||||||
if (!phrase.Bricks.empty())
|
if (!phrase.Bricks.empty())
|
||||||
|
|
|
@ -651,6 +651,8 @@ private:
|
||||||
void computePhraseProgression();
|
void computePhraseProgression();
|
||||||
void insertProgressionSkillRecurs(SKILLS::ESkills skill, uint32 value, sint *skillReqLevel, std::vector<SKILLS::ESkills> &skillsToInsert);
|
void insertProgressionSkillRecurs(SKILLS::ESkills skill, uint32 value, sint *skillReqLevel, std::vector<SKILLS::ESkills> &skillsToInsert);
|
||||||
|
|
||||||
|
mutable NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _TotalMalusEquipLeaf;
|
||||||
|
|
||||||
// @}
|
// @}
|
||||||
|
|
||||||
/// return the skill of the root
|
/// return the skill of the root
|
||||||
|
|
Loading…
Reference in a new issue