TimingEvent: Add Delay method
This commit is contained in:
parent
38288e6b36
commit
db5be6c70c
|
@ -392,6 +392,17 @@ TickCount TimingEvent::GetTicksUntilNextExecution() const
|
|||
return std::max(m_downcount - CPU::GetPendingTicks(), static_cast<TickCount>(0));
|
||||
}
|
||||
|
||||
void TimingEvent::Delay(TickCount ticks)
|
||||
{
|
||||
if (!m_active)
|
||||
{
|
||||
Panic("Trying to delay an inactive event");
|
||||
return;
|
||||
}
|
||||
|
||||
m_downcount += ticks;
|
||||
}
|
||||
|
||||
void TimingEvent::Schedule(TickCount ticks)
|
||||
{
|
||||
const TickCount pending_ticks = CPU::GetPendingTicks();
|
||||
|
|
|
@ -30,6 +30,9 @@ public:
|
|||
TickCount GetTicksSinceLastExecution() const;
|
||||
TickCount GetTicksUntilNextExecution() const;
|
||||
|
||||
// Adds ticks to current execution.
|
||||
void Delay(TickCount ticks);
|
||||
|
||||
void Schedule(TickCount ticks);
|
||||
void SetIntervalAndSchedule(TickCount ticks);
|
||||
void SetPeriodAndSchedule(TickCount ticks);
|
||||
|
|
Loading…
Reference in New Issue