aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/schedule_v1d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo/schedule_v1d.cpp')
-rw-r--r--engines/hugo/schedule_v1d.cpp47
1 files changed, 29 insertions, 18 deletions
diff --git a/engines/hugo/schedule_v1d.cpp b/engines/hugo/schedule_v1d.cpp
index 09bfc2294b..4efd371394 100644
--- a/engines/hugo/schedule_v1d.cpp
+++ b/engines/hugo/schedule_v1d.cpp
@@ -56,10 +56,12 @@ const char *Scheduler_v1d::getCypher() {
return "Copyright 1991, Gray Design Associates";
}
-// Delete an event structure (i.e. return it to the free list)
-// Note that event is assumed at head of queue (i.e. earliest). To delete
-// an event from the middle of the queue, merely overwrite its action type
-// to be ANULL
+/**
+* Delete an event structure (i.e. return it to the free list)
+* Note that event is assumed at head of queue (i.e. earliest). To delete
+* an event from the middle of the queue, merely overwrite its action type
+* to be ANULL
+*/
void Scheduler_v1d::delQueue(event_t *curEvent) {
debugC(4, kDebugSchedule, "delQueue()");
@@ -77,8 +79,10 @@ void Scheduler_v1d::delQueue(event_t *curEvent) {
_freeEvent = curEvent;
}
-// Insert the action pointed to by p into the timer event queue
-// The queue goes from head (earliest) to tail (latest) timewise
+/**
+* Insert the action pointed to by p into the timer event queue
+* The queue goes from head (earliest) to tail (latest) timewise
+*/
void Scheduler_v1d::insertAction(act *action) {
debugC(1, kDebugSchedule, "insertAction() - Action type A%d", action->a0.actType);
@@ -121,10 +125,12 @@ void Scheduler_v1d::insertAction(act *action) {
}
}
+/**
+* This function performs the action in the event structure pointed to by p
+* It dequeues the event and returns it to the free list. It returns a ptr
+* to the next action in the list, except special case of NEW_SCREEN
+*/
event_t *Scheduler_v1d::doAction(event_t *curEvent) {
-// This function performs the action in the event structure pointed to by p
-// It dequeues the event and returns it to the free list. It returns a ptr
-// to the next action in the list, except special case of NEW_SCREEN
debugC(1, kDebugSchedule, "doAction - Event action type : %d", curEvent->action->a0.actType);
status_t &gameStatus = _vm->getGameStatus();
@@ -134,7 +140,6 @@ event_t *Scheduler_v1d::doAction(event_t *curEvent) {
object_t *obj2;
int dx, dy;
event_t *wrkEvent; // Save ev_p->next_p for return
-// event_t *saveEvent; // Used in DEL_EVENTS
switch (action->a0.actType) {
case ANULL: // Big NOP from DEL_EVENTS
@@ -321,10 +326,12 @@ event_t *Scheduler_v1d::doAction(event_t *curEvent) {
}
}
-// Write the event queue to the file with handle f
-// Note that we convert all the event structure ptrs to indexes
-// using -1 for NULL. We can't convert the action ptrs to indexes
-// so we save address of first dummy action ptr to compare on restore.
+/**
+* Write the event queue to the file with handle f
+* Note that we convert all the event structure ptrs to indexes
+* using -1 for NULL. We can't convert the action ptrs to indexes
+* so we save address of first dummy action ptr to compare on restore.
+*/
void Scheduler_v1d::saveEvents(Common::WriteStream *f) {
debugC(1, kDebugSchedule, "saveEvents()");
@@ -350,7 +357,9 @@ void Scheduler_v1d::saveEvents(Common::WriteStream *f) {
f->write(saveEventArr, sizeof(saveEventArr));
}
-// Restore the event list from file with handle f
+/**
+* Restore the event list from file with handle f
+*/
void Scheduler_v1d::restoreEvents(Common::SeekableReadStream *f) {
debugC(1, kDebugSchedule, "restoreEvents");
@@ -387,9 +396,11 @@ void Scheduler_v1d::restoreEvents(Common::SeekableReadStream *f) {
}
}
-// This is the scheduler which runs every tick. It examines the event queue
-// for any events whose time has come. It dequeues these events and performs
-// the action associated with the event, returning it to the free queue
+/**
+* This is the scheduler which runs every tick. It examines the event queue
+* for any events whose time has come. It dequeues these events and performs
+* the action associated with the event, returning it to the free queue
+*/
void Scheduler_v1d::runScheduler() {
debugC(6, kDebugSchedule, "runScheduler");