summaryrefslogtreecommitdiff
path: root/src/eventlooper.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/eventlooper.cpp21
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;
}