Implement new visibility system, based on Silverice patch for mangos

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-19 10:12:40 +01:00
parent 7a3e524df2
commit 243f33b5ea
15 changed files with 553 additions and 165 deletions

View File

@@ -95,5 +95,28 @@ struct TimeTrackerSmall
int32 i_expiryTime;
};
struct PeriodicTimer
{
PeriodicTimer(int32 period, int32 start_time) :
i_expireTime(start_time), i_period(period) {}
bool Update(const uint32 &diff)
{
if((i_expireTime -= diff) > 0)
return false;
i_expireTime += i_period > diff ? i_period : diff;
return true;
}
void SetPeriodic(int32 period, int32 start_time)
{
i_expireTime=start_time, i_period=period;
}
int32 i_period;
int32 i_expireTime;
};
#endif