mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Converted timer event into tick event that is called every frame
This commit is contained in:
@ -29,7 +29,6 @@ CIntObject::CIntObject(int used_, Point pos_):
|
||||
active(active_m)
|
||||
{
|
||||
hovered = captureAllKeys = strongInterest = false;
|
||||
toNextTick = timerDelay = 0;
|
||||
used = used_;
|
||||
|
||||
recActions = defActions = GH.defActionsDef;
|
||||
@ -60,24 +59,6 @@ CIntObject::~CIntObject()
|
||||
parent_m->removeChild(this);
|
||||
}
|
||||
|
||||
void CIntObject::setTimer(int msToTrigger)
|
||||
{
|
||||
if (!(active & TIME))
|
||||
activate(TIME);
|
||||
toNextTick = timerDelay = msToTrigger;
|
||||
used |= TIME;
|
||||
}
|
||||
|
||||
void CIntObject::onTimer(int timePassed)
|
||||
{
|
||||
toNextTick -= timePassed;
|
||||
if (toNextTick < 0)
|
||||
{
|
||||
toNextTick += timerDelay;
|
||||
tick();
|
||||
}
|
||||
}
|
||||
|
||||
void CIntObject::show(SDL_Surface * to)
|
||||
{
|
||||
if(defActions & UPDATE)
|
||||
|
Reference in New Issue
Block a user