diff options
author | Treeki <treeki@gmail.com> | 2012-09-16 20:13:29 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-09-16 20:13:29 +0200 |
commit | 7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f (patch) | |
tree | c79a81d147511fcad842e8f1a64d9c0e58828ebb /src/eventlooper.cpp | |
parent | be31f99777d00238151df5851042a9e896d24f74 (diff) | |
parent | eb4b6edcbef13c80b0051abe9dc89c93e7a960d0 (diff) | |
download | kamek-7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f.tar.gz kamek-7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f.zip |
Merge branch 'file-select' into level-select
Diffstat (limited to 'src/eventlooper.cpp')
-rw-r--r-- | src/eventlooper.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/eventlooper.cpp b/src/eventlooper.cpp index 5acb43c..4c0a232 100644 --- a/src/eventlooper.cpp +++ b/src/eventlooper.cpp @@ -18,13 +18,6 @@ struct EventLooper { u8 delayCount; // 0x3D7 }; -struct EventTable_t { - u64 events; - // ... -}; - -extern EventTable_t *EventTable; - void EventLooper_Update(EventLooper *self); @@ -58,10 +51,10 @@ bool EventLooper_Create(EventLooper *self) { } - if (EventTable->events & self->eventActive) + if (dFlagMgr_c::instance->flags & self->eventActive) { u64 evState = (u64)1 << (eventStart - 1); - EventTable->events = EventTable->events | evState; + dFlagMgr_c::instance->flags |= evState; } EventLooper_Update(self); @@ -77,7 +70,7 @@ bool EventLooper_Execute(EventLooper *self) { void EventLooper_Update(EventLooper *self) { - if ((EventTable->events & self->eventActive) == 0) + if ((dFlagMgr_c::instance->flags & self->eventActive) == 0) return; // Waiting for the right moment @@ -92,23 +85,23 @@ void EventLooper_Update(EventLooper *self) { self->delayCount = 0; // Find which event(s) is/are on - u64 evState = EventTable->events & self->eventFlag; + u64 evState = dFlagMgr_c::instance->flags & self->eventFlag; // Turn off the old events - EventTable->events = EventTable->events & (~self->eventFlag); + dFlagMgr_c::instance->flags = dFlagMgr_c::instance->flags & (~self->eventFlag); // Shift them right if they can, if not, reset! evState = evState << 1; if (evState < self->eventFlag) { - EventTable->events = EventTable->events | evState; + dFlagMgr_c::instance->flags = dFlagMgr_c::instance->flags | evState; } else { char eventStart = (self->settings >> 24) & 0xFF; evState = (u64)1 << (eventStart - 1); - EventTable->events = EventTable->events | evState; + dFlagMgr_c::instance->flags = dFlagMgr_c::instance->flags | evState; } |