1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

- first part of CIntObject API clean-up.

- - mostly remove usage of (de)activateSomething functions
- - CIntObject's can be safely deleted in active state or without removing from parent first
- - Added CWindowObject to use as base of all windows (will be required for such features as shadows)

Report any crashes or glitches - it should not cause any issues apart from more console output. 

TODO:
- remove redundant (de)activate and show(All) calls
- decrease usage of blitAtLoc\printAtLoc methods
- switch all windows to new base
This commit is contained in:
Ivan Savenko
2012-06-02 15:16:54 +00:00
parent 3df1ddbf86
commit d60f2d57a0
29 changed files with 582 additions and 745 deletions

View File

@ -35,7 +35,7 @@ extern SDL_Surface * screen;
SpellbookInteractiveArea::SpellbookInteractiveArea(const SDL_Rect & myRect, boost::function<void()> funcL,
const std::string & textR, boost::function<void()> funcHon, boost::function<void()> funcHoff, CPlayerInterface * _myInt)
{
used = LCLICK | RCLICK | HOVER;
addUsedEvents(LCLICK | RCLICK | HOVER);
pos = myRect;
onLeft = funcL;
textOnRclick = textR;
@ -216,6 +216,7 @@ CSpellWindow::CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * _myHe
currentPage = battleSpellsOnly ? LOCPLINT->spellbookSettings.spellbookLastPageBattle : LOCPLINT->spellbookSettings.spellbokLastPageAdvmap;
vstd::abetween(currentPage, 0, pagesWithinCurrentTab());
computeSpellsPerArea();
addUsedEvents(KEYBOARD);
}
CSpellWindow::~CSpellWindow()
@ -460,7 +461,7 @@ void CSpellWindow::computeSpellsPerArea()
void CSpellWindow::activate()
{
activateKeys();
CIntObject::activate();
exitBtn->activate();
battleSpells->activate();
adventureSpells->activate();
@ -483,7 +484,7 @@ void CSpellWindow::activate()
void CSpellWindow::deactivate()
{
deactivateKeys();
CIntObject::deactivate();
exitBtn->deactivate();
battleSpells->deactivate();
adventureSpells->deactivate();
@ -586,7 +587,7 @@ CSpellWindow::SpellArea::SpellArea(SDL_Rect pos, CSpellWindow * owner)
{
this->pos = pos;
this->owner = owner;
used = LCLICK | RCLICK | HOVER;
addUsedEvents(LCLICK | RCLICK | HOVER);
spellCost = mySpell = whichSchool = schoolLevel = -1;
}