1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +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

@ -176,15 +176,6 @@ void CBattleHero::show(SDL_Surface * to)
}
}
void CBattleHero::activate()
{
activateLClick();
}
void CBattleHero::deactivate()
{
deactivateLClick();
}
void CBattleHero::setPhase(int newPhase)
{
if(phase != 4)
@ -242,6 +233,7 @@ CBattleHero::CBattleHero(const std::string & defName, int phaseG, int imageG, bo
CSDL_Ext::alphaTransform(flag->ourImages[i].bitmap);
graphics->blueToPlayersAdv(flag->ourImages[i].bitmap, player);
}
addUsedEvents(LCLICK);
}
CBattleHero::~CBattleHero()
@ -543,21 +535,6 @@ Point CClickableHex::getXYUnitAnim(const int & hexNum, const bool & attacker, co
//returning
return ret +CPlayerInterface::battleInt->pos;
}
void CClickableHex::activate()
{
activateHover();
activateMouseMove();
activateLClick();
activateRClick();
}
void CClickableHex::deactivate()
{
deactivateHover();
deactivateMouseMove();
deactivateLClick();
deactivateRClick();
}
void CClickableHex::hover(bool on)
{
@ -572,6 +549,7 @@ void CClickableHex::hover(bool on)
CClickableHex::CClickableHex() : setAlterText(false), myNumber(-1), accessible(true), hovered(false), strictHovered(false), myInterface(NULL)
{
addUsedEvents(LCLICK | RCLICK | HOVER | MOVE);
}
void CClickableHex::mouseMoved(const SDL_MouseMotionEvent &sEvent)