diff options
-rw-r--r-- | saga/actor.cpp | 12 | ||||
-rw-r--r-- | saga/animation.cpp | 12 | ||||
-rw-r--r-- | saga/events.cpp | 160 | ||||
-rw-r--r-- | saga/events.h | 122 | ||||
-rw-r--r-- | saga/ihnm_introproc.cpp | 134 | ||||
-rw-r--r-- | saga/interface.cpp | 6 | ||||
-rw-r--r-- | saga/ite_introproc.cpp | 206 | ||||
-rw-r--r-- | saga/palanim.cpp | 12 | ||||
-rw-r--r-- | saga/scene.cpp | 100 | ||||
-rw-r--r-- | saga/script.cpp | 6 | ||||
-rw-r--r-- | saga/sfuncs.cpp | 90 |
11 files changed, 430 insertions, 430 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index 8ed4cf9463..e305b997dd 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -620,9 +620,9 @@ void Actor::stepZoneAction(ActorData *actor, const HitZone *hitZone, bool exit, if (hitZone->getFlags() & kHitZoneExit) { takeExit(actor->_id, hitZone); } else if (hitZone->getScriptNumber() > 0) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = _vm->_scene->getScriptModuleNumber(); // module number event.param2 = hitZone->getScriptNumber(); // script entry point number @@ -2099,9 +2099,9 @@ void Actor::moveDragon(ActorData *actor) { moveType = kDragonMoveInvalid; if (actor->_location.distance(_protagonist->_location) < 24) { if (_dragonHunt && (_protagonist->_currentAction != kActionFall)) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = _vm->_scene->getScriptModuleNumber(); // module number event.param2 = ACTOR_EXP_KNOCK_RIF; // script entry point number diff --git a/saga/animation.cpp b/saga/animation.cpp index 3c43aacdbf..885fcb4385 100644 --- a/saga/animation.cpp +++ b/saga/animation.cpp @@ -183,9 +183,9 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { if (anim->flags & ANIM_ENDSCENE) { // This animation ends the scene - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = anim->frameTime + vectorTime; _vm->_events->queue(&event); } @@ -207,9 +207,9 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { frameTime = anim->frameTime + vectorTime; } - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_FRAME; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventFrame; event.param = animId; event.time = frameTime; diff --git a/saga/events.cpp b/saga/events.cpp index e3dfc5f23d..a2cca6ce0b 100644 --- a/saga/events.cpp +++ b/saga/events.cpp @@ -71,31 +71,31 @@ int Events::handleEvents(long msec) { // Call the appropriate event handler for the specific event type switch (event_p->type) { - case ONESHOT_EVENT: + case kEvTOneshot: result = handleOneShot(event_p); break; - case CONTINUOUS_EVENT: + case kEvTContinuous: result = handleContinuous(event_p); break; - case INTERVAL_EVENT: + case kEvTInterval: result = handleInterval(event_p); break; - case IMMEDIATE_EVENT: + case kEvTImmediate: result = handleImmediate(event_p); break; default: - result = EVENT_INVALIDCODE; + result = kEvStInvalidCode; warning("Invalid event code encountered"); break; } // Process the event appropriately based on result code from // handler - if ((result == EVENT_DELETE) || (result == EVENT_INVALIDCODE)) { + if ((result == kEvStDelete) || (result == kEvStInvalidCode)) { // If there is no event chain, delete the base event. if (event_p->chain == NULL) { eventi = _eventList.eraseAndPrev(eventi); @@ -111,7 +111,7 @@ int Events::handleEvents(long msec) { event_p->time += delta_time; --eventi; } - } else if (result == EVENT_BREAK) { + } else if (result == kEvStBreak) { break; } } @@ -140,30 +140,30 @@ int Events::handleContinuous(Event *event) { if (event_pc < 0.0) { // Event not signaled, skip it - return EVENT_CONTINUE; - } else if (!(event->code & SIGNALED)) { + return kEvStContinue; + } else if (!(event->code & kEvFSignaled)) { // Signal event - event->code |= SIGNALED; + event->code |= kEvFSignaled; event_pc = 0.0; } switch (event->code & EVENT_MASK) { - case PAL_EVENT: + case kPalEvent: switch (event->op) { - case EVENT_BLACKTOPAL: + case kEventBlackToPal: _vm->_gfx->blackToPal((PalEntry *)event->data, event_pc); break; - case EVENT_PALTOBLACK: + case kEventPalToBlack: _vm->_gfx->palToBlack((PalEntry *)event->data, event_pc); break; default: break; } break; - case TRANSITION_EVENT: + case kTransitionEvent: switch (event->op) { - case EVENT_DISSOLVE: + case kEventDissolve: backGroundSurface = _vm->_render->getBackGroundSurface(); _vm->_scene->getBGInfo(bgInfo); rect.left = rect.top = 0; @@ -171,7 +171,7 @@ int Events::handleContinuous(Event *event) { rect.bottom = bgInfo.bounds.height(); backGroundSurface->transitionDissolve(bgInfo.buffer, rect, 0, event_pc); break; - case EVENT_DISSOLVE_BGMASK: + case kEventDissolveBGMask: // we dissolve it centered. // set flag of Dissolve to 1. It is a hack to simulate zero masking. int w, h; @@ -197,10 +197,10 @@ int Events::handleContinuous(Event *event) { } if (event_done) { - return EVENT_DELETE; + return kEvStDelete; } - return EVENT_CONTINUE; + return kEvStContinue; } int Events::handleImmediate(Event *event) { @@ -223,30 +223,30 @@ int Events::handleImmediate(Event *event) { if (event_pc < 0.0) { // Event not signaled, skip it - return EVENT_BREAK; - } else if (!(event->code & SIGNALED)) { + return kEvStBreak; + } else if (!(event->code & kEvFSignaled)) { // Signal event - event->code |= SIGNALED; + event->code |= kEvFSignaled; event_pc = 0.0; } switch (event->code & EVENT_MASK) { - case PAL_EVENT: + case kPalEvent: switch (event->op) { - case EVENT_BLACKTOPAL: + case kEventBlackToPal: _vm->_gfx->blackToPal((PalEntry *)event->data, event_pc); break; - case EVENT_PALTOBLACK: + case kEventPalToBlack: _vm->_gfx->palToBlack((PalEntry *)event->data, event_pc); break; default: break; } break; - case SCRIPT_EVENT: - case BG_EVENT: - case INTERFACE_EVENT: + case kScriptEvent: + case kBgEvent: + case kInterfaceEvent: handleOneShot(event); event_done = true; break; @@ -256,10 +256,10 @@ int Events::handleImmediate(Event *event) { } if (event_done) { - return EVENT_DELETE; + return kEvStDelete; } - return EVENT_BREAK; + return kEvStBreak; } int Events::handleOneShot(Event *event) { @@ -269,18 +269,18 @@ int Events::handleOneShot(Event *event) { if (event->time > 0) { - return EVENT_CONTINUE; + return kEvStContinue; } // Event has been signaled switch (event->code & EVENT_MASK) { - case TEXT_EVENT: + case kTextEvent: switch (event->op) { - case EVENT_DISPLAY: + case kEventDisplay: ((TextListEntry *)event->data)->display = true; break; - case EVENT_REMOVE: + case kEventRemove: _vm->_scene->_textList.remove((TextListEntry *)event->data); break; default: @@ -288,20 +288,20 @@ int Events::handleOneShot(Event *event) { } break; - case SOUND_EVENT: + case kSoundEvent: _vm->_sound->stopSound(); - if (event->op == EVENT_PLAY) + if (event->op == kEventPlay) _vm->_sndRes->playSound(event->param, event->param2, event->param3 != 0); break; - case VOICE_EVENT: + case kVoiceEvent: _vm->_sndRes->playVoice(event->param); break; - case MUSIC_EVENT: + case kMusicEvent: _vm->_music->stop(); - if (event->op == EVENT_PLAY) + if (event->op == kEventPlay) _vm->_music->play(event->param, (MusicFlags)event->param2); break; - case BG_EVENT: + case kBgEvent: { Surface *backGroundSurface; BGInfo bgInfo; @@ -331,7 +331,7 @@ int Events::handleOneShot(Event *event) { backGroundSurface->drawRect(rect4, kITEColorBlack); } - if (event->param == SET_PALETTE) { + if (event->param == kEvPSetPalette) { PalEntry *palPointer; _vm->_scene->getBGPal(palPointer); _vm->_gfx->setPalette(palPointer); @@ -339,76 +339,76 @@ int Events::handleOneShot(Event *event) { } } break; - case ANIM_EVENT: + case kAnimEvent: switch (event->op) { - case EVENT_PLAY: + case kEventPlay: _vm->_anim->play(event->param, event->time, true); break; - case EVENT_STOP: + case kEventStop: _vm->_anim->stop(event->param); break; - case EVENT_FRAME: + case kEventFrame: _vm->_anim->play(event->param, event->time, false); break; - case EVENT_SETFLAG: + case kEventSetFlag: _vm->_anim->setFlag(event->param, event->param2); break; - case EVENT_CLEARFLAG: + case kEventClearFlag: _vm->_anim->clearFlag(event->param, event->param2); break; default: break; } break; - case SCENE_EVENT: + case kSceneEvent: switch (event->op) { - case EVENT_END: + case kEventEnd: _vm->_scene->nextScene(); - return EVENT_BREAK; + return kEvStBreak; break; default: break; } break; - case PALANIM_EVENT: + case kPalAnimEvent: switch (event->op) { - case EVENT_CYCLESTART: + case kEventCycleStart: _vm->_palanim->cycleStart(); break; - case EVENT_CYCLESTEP: + case kEventCycleStep: _vm->_palanim->cycleStep(event->time); break; default: break; } break; - case INTERFACE_EVENT: + case kInterfaceEvent: switch (event->op) { - case EVENT_ACTIVATE: + case kEventActivate: _vm->_interface->activate(); break; - case EVENT_DEACTIVATE: + case kEventDeactivate: _vm->_interface->deactivate(); break; - case EVENT_SET_STATUS: + case kEventSetStatus: _vm->_interface->setStatusText((const char*)event->data); _vm->_interface->drawStatusBar(); break; - case EVENT_CLEAR_STATUS: + case kEventClearStatus: _vm->_interface->setStatusText(""); _vm->_interface->drawStatusBar(); break; - case EVENT_SET_FADE_MODE: + case kEventSetFadeMode: _vm->_interface->setFadeMode(event->param); break; default: break; } break; - case SCRIPT_EVENT: + case kScriptEvent: switch (event->op) { - case EVENT_EXEC_BLOCKING: - case EVENT_EXEC_NONBLOCKING: + case kEventExecBlocking: + case kEventExecNonBlocking: debug(6, "Exec module number %d script entry number %d", event->param, event->param2); sthread = _vm->_script->createThread(event->param, event->param2); @@ -422,40 +422,40 @@ int Events::handleOneShot(Event *event) { sthread->_threadVars[kThreadVarWithObject] = event->param5; sthread->_threadVars[kThreadVarActor] = event->param6; - if (event->op == EVENT_EXEC_BLOCKING) + if (event->op == kEventExecBlocking) _vm->_script->completeThread(); break; - case EVENT_THREAD_WAKE: + case kEventThreadWake: _vm->_script->wakeUpThreads(event->param); break; } break; - case CURSOR_EVENT: + case kCursorEvent: switch (event->op) { - case EVENT_SHOW: + case kEventShow: _vm->_gfx->showCursor(true); break; - case EVENT_HIDE: + case kEventHide: _vm->_gfx->showCursor(false); break; default: break; } break; - case GRAPHICS_EVENT: + case kGraphicsEvent: switch (event->op) { - case EVENT_FILL_RECT: + case kEventFillRect: rect.top = event->param2; rect.bottom = event->param3; rect.left = event->param4; rect.right = event->param5; ((Surface *)event->data)->drawRect(rect, event->param); break; - case EVENT_SETFLAG: + case kEventSetFlag: _vm->_render->setFlag(event->param); break; - case EVENT_CLEARFLAG: + case kEventClearFlag: _vm->_render->clearFlag(event->param); break; default: @@ -465,11 +465,11 @@ int Events::handleOneShot(Event *event) { break; } - return EVENT_DELETE; + return kEvStDelete; } int Events::handleInterval(Event *event) { - return EVENT_DELETE; + return kEvStDelete; } // Schedules an event in the event list; returns a pointer to the scheduled @@ -505,13 +505,13 @@ Event *Events::chain(Event *headEvent, Event *addEvent) { int Events::initializeEvent(Event *event) { event->chain = NULL; switch (event->type) { - case ONESHOT_EVENT: + case kEvTOneshot: break; - case CONTINUOUS_EVENT: - case IMMEDIATE_EVENT: + case kEvTContinuous: + case kEvTImmediate: event->time += event->duration; break; - case INTERVAL_EVENT: + case kEvTInterval: break; default: return FAILURE; @@ -530,8 +530,8 @@ int Events::clearList() { for (EventList::iterator eventi = _eventList.begin(); eventi != _eventList.end(); ++eventi) { event_p = (Event *)eventi.operator->(); - // Only remove events not marked NODESTROY (engine events) - if (!(event_p->code & NODESTROY)) { + // Only remove events not marked kEvFNoDestory (engine events) + if (!(event_p->code & kEvFNoDestory)) { // Remove any events chained off this one */ for (chain_walk = event_p->chain; chain_walk != NULL; chain_walk = next_chain) { next_chain = chain_walk->chain; @@ -544,7 +544,7 @@ int Events::clearList() { return SUCCESS; } -// Removes all events from the list (even NODESTROY) +// Removes all events from the list (even kEvFNoDestory) int Events::freeList() { Event *chain_walk; Event *next_chain; @@ -577,7 +577,7 @@ int Events::processEventTime(long msec) { event_p->time -= msec; event_count++; - if (event_p->type == IMMEDIATE_EVENT) + if (event_p->type == kEvTImmediate) break; if (event_count > EVENT_WARNINGCOUNT) { diff --git a/saga/events.h b/saga/events.h index 65787fabdf..ce1f86d1ba 100644 --- a/saga/events.h +++ b/saga/events.h @@ -31,88 +31,88 @@ namespace Saga { enum EventTypes { - ONESHOT_EVENT, // Event takes no time - CONTINUOUS_EVENT, // Event takes time; next event starts immediately - INTERVAL_EVENT, // Not yet implemented - IMMEDIATE_EVENT // Event takes time; next event starts when event is done + kEvTOneshot, // Event takes no time + kEvTContinuous, // Event takes time; next event starts immediately + kEvTInterval, // Not yet implemented + kEvTImmediate // Event takes time; next event starts when event is done }; -enum EVENT_FLAGS { - SIGNALED = 0x8000, - NODESTROY = 0x4000 +enum EventFlags { + kEvFSignaled = 0x8000, + kEvFNoDestory = 0x4000 }; enum EventCodes { - BG_EVENT = 1, - ANIM_EVENT, - MUSIC_EVENT, - VOICE_EVENT, - SOUND_EVENT, - SCENE_EVENT, - TEXT_EVENT, - PAL_EVENT, - PALANIM_EVENT, - TRANSITION_EVENT, - INTERFACE_EVENT, - ACTOR_EVENT, - SCRIPT_EVENT, - CURSOR_EVENT, - GRAPHICS_EVENT + kBgEvent = 1, + kAnimEvent, + kMusicEvent, + kVoiceEvent, + kSoundEvent, + kSceneEvent, + kTextEvent, + kPalEvent, + kPalAnimEvent, + kTransitionEvent, + kInterfaceEvent, + kActorEvent, + kScriptEvent, + kCursorEvent, + kGraphicsEvent }; -enum EVENT_OPS { +enum EventOps { // INSTANTANEOUS events // BG events - EVENT_DISPLAY = 1, + kEventDisplay = 1, // ANIM events - // EVENT_PLAY = 1, // reused - // EVENT_STOP = 2, // reused - EVENT_FRAME = 3, - EVENT_SETFLAG = 4, - EVENT_CLEARFLAG = 5, + // kEventPlay = 1, // reused + // kEventStop = 2, // reused + kEventFrame = 3, + kEventSetFlag = 4, + kEventClearFlag = 5, // MUISC & SOUND events - EVENT_PLAY = 1, - EVENT_STOP = 2, + kEventPlay = 1, + kEventStop = 2, // SCENE events - EVENT_END = 2, + kEventEnd = 2, // TEXT events - EVENT_HIDE = 2, - EVENT_REMOVE = 3, + kEventHide = 2, + kEventRemove = 3, // PALANIM events - EVENT_CYCLESTART = 1, - EVENT_CYCLESTEP = 2, + kEventCycleStart = 1, + kEventCycleStep = 2, // INTERFACE events - EVENT_ACTIVATE = 1, - EVENT_DEACTIVATE = 2, - EVENT_SET_STATUS = 3, - EVENT_CLEAR_STATUS = 4, - EVENT_SET_FADE_MODE = 5, + kEventActivate = 1, + kEventDeactivate = 2, + kEventSetStatus = 3, + kEventClearStatus = 4, + kEventSetFadeMode = 5, // ACTOR events - EVENT_MOVE = 1, + kEventMove = 1, // SCRIPT events - EVENT_EXEC_BLOCKING = 1, - EVENT_EXEC_NONBLOCKING = 2, - EVENT_THREAD_WAKE = 3, + kEventExecBlocking = 1, + kEventExecNonBlocking = 2, + kEventThreadWake = 3, // CURSOR events - EVENT_SHOW = 1, - // EVENT_HIDE = 2, // reused + kEventShow = 1, + // kEventHide = 2, // reused // GRAPHICS events - EVENT_FILL_RECT = 1, - // EVENT_SETFLAG = 4, // reused - // EVENT_CLEARFLAG = 5, // reused + kEventFillRect = 1, + // kEventSetFlag = 4, // reused + // kEventClearFlag = 5, // reused // CONTINUOUS events // PALETTE events - EVENT_PALTOBLACK = 1, - EVENT_BLACKTOPAL = 2, + kEventPalToBlack = 1, + kEventBlackToPal = 2, // TRANSITION events - EVENT_DISSOLVE = 1, - EVENT_DISSOLVE_BGMASK = 2 + kEventDissolve = 1, + kEventDissolveBGMask = 2 }; -enum EVENT_PARAMS { - NO_SET_PALETTE, - SET_PALETTE +enum EventParams { + kEvPNoSetPalette, + kEvPSetPalette }; struct Event { @@ -142,10 +142,10 @@ typedef SortedList<Event> EventList; #define EVENT_MASK 0x00FF enum EventStatusCode { - EVENT_INVALIDCODE = 0, - EVENT_DELETE, - EVENT_CONTINUE, - EVENT_BREAK + kEvStInvalidCode = 0, + kEvStDelete, + kEvStContinue, + kEvStBreak }; class Events { diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp index 81ae4fde6d..ab6b93af29 100644 --- a/saga/ihnm_introproc.cpp +++ b/saga/ihnm_introproc.cpp @@ -124,10 +124,10 @@ int Scene::IHNMIntroMovieProc1(int param) { case SCENE_BEGIN: // Background for intro scene is the first frame of the // intro animation; display it and set the palette - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPSetPalette; event.time = 0; q_event = _vm->_events->queue(&event); @@ -135,9 +135,9 @@ int Scene::IHNMIntroMovieProc1(int param) { _vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME); _vm->_anim->setFlag(0, ANIM_ENDSCENE); - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -166,9 +166,9 @@ int Scene::IHNMIntroMovieProc2(int param) { // Fade to black out of the intro CyberDreams logo anim _vm->_gfx->getCurrentPal(current_pal); - event.type = CONTINUOUS_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTContinuous; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = 0; event.duration = IHNM_PALFADE_TIME; event.data = current_pal; @@ -177,10 +177,10 @@ int Scene::IHNMIntroMovieProc2(int param) { // Background for intro scene is the first frame of the // intro animation; display it but don't set palette - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = NO_SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPNoSetPalette; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -191,9 +191,9 @@ int Scene::IHNMIntroMovieProc2(int param) { // palette fades. We don't have to, but I think it looks better // that way. - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -202,9 +202,9 @@ int Scene::IHNMIntroMovieProc2(int param) { // Fade in from black to the scene background palette _vm->_scene->getBGPal(pal); - event.type = CONTINUOUS_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_BLACKTOPAL; + event.type = kEvTContinuous; + event.code = kPalEvent; + event.op = kEventBlackToPal; event.time = 0; event.duration = IHNM_PALFADE_TIME; event.data = pal; @@ -212,9 +212,9 @@ int Scene::IHNMIntroMovieProc2(int param) { q_event = _vm->_events->chain(q_event, &event); // Fade to black after looping animation for a while - event.type = CONTINUOUS_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTContinuous; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = IHNM_DGLOGO_TIME; event.duration = IHNM_PALFADE_TIME; event.data = pal; @@ -222,9 +222,9 @@ int Scene::IHNMIntroMovieProc2(int param) { q_event = _vm->_events->chain(q_event, &event); // Queue end of scene - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -251,9 +251,9 @@ int Scene::IHNMIntroMovieProc3(int param) { // Fade to black out of the intro DG logo anim _vm->_gfx->getCurrentPal(current_pal); - event.type = CONTINUOUS_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTContinuous; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = 0; event.duration = IHNM_PALFADE_TIME; event.data = current_pal; @@ -265,21 +265,21 @@ int Scene::IHNMIntroMovieProc3(int param) { // In the GM file, this music also appears as tracks 7, 13, 19, // 25 and 31, but only track 1 sounds right with the FM music. - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; + event.type = kEvTOneshot; + event.code = kMusicEvent; event.param = 1; event.param2 = MUSIC_NORMAL; - event.op = EVENT_PLAY; + event.op = kEventPlay; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Background for intro scene is the first frame of the intro // animation; display it but don't set palette - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = NO_SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPNoSetPalette; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -287,18 +287,18 @@ int Scene::IHNMIntroMovieProc3(int param) { // Fade in from black to the scene background palette _vm->_scene->getBGPal(pal); - event.type = CONTINUOUS_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_BLACKTOPAL; + event.type = kEvTContinuous; + event.code = kPalEvent; + event.op = kEventBlackToPal; event.time = 0; event.duration = IHNM_PALFADE_TIME; event.data = pal; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -308,9 +308,9 @@ int Scene::IHNMIntroMovieProc3(int param) { // TODO: I've increased the delay so the speech won't start // until the music has ended. Could someone verify if that's // the correct behaviour? - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = _vm->_music->hasAdlib() ? IHNM_TITLE_TIME_FM : IHNM_TITLE_TIME_GM; q_event = _vm->_events->chain(q_event, &event); @@ -335,47 +335,47 @@ int Scene::IHNMHateProc(int param) { _vm->_anim->setCycles(0, -1); // Start "hate" animation - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; q_event = _vm->_events->queue(&event); // More music - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; + event.type = kEvTOneshot; + event.code = kMusicEvent; event.param = 32; event.param2 = MUSIC_LOOP; - event.op = EVENT_PLAY; + event.op = kEventPlay; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Background for intro scene is the first frame of the // intro animation; display it and set the palette - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPSetPalette; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Play voice - event.type = ONESHOT_EVENT; - event.code = VOICE_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kVoiceEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Background sound - event.type = ONESHOT_EVENT; - event.code = SOUND_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kSoundEvent; + event.op = kEventPlay; event.param = 260; event.param2 = 255; // FIXME: Verify volume event.param3 = SOUND_LOOP; @@ -384,17 +384,17 @@ int Scene::IHNMHateProc(int param) { q_event = _vm->_events->chain(q_event, &event); // End background sound after the voice has finished - event.type = ONESHOT_EVENT; - event.code = SOUND_EVENT; - event.op = EVENT_STOP; + event.type = kEvTOneshot; + event.code = kSoundEvent; + event.op = kEventStop; event.time = _vm->_sndRes->getVoiceLength(0); q_event = _vm->_events->chain(q_event, &event); // End scene after the voice has finished - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 0; q_event = _vm->_events->chain(q_event, &event); diff --git a/saga/interface.cpp b/saga/interface.cpp index 4b33cc3d05..282da2c65d 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -1207,9 +1207,9 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) { } if (script > 0) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = _vm->_scene->getScriptModuleNumber(); event.param2 = script; diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp index 33fe3e1001..54d25c4918 100644 --- a/saga/ite_introproc.cpp +++ b/saga/ite_introproc.cpp @@ -109,18 +109,18 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo entry = _vm->_scene->_textList.addEntry(textEntry); // Display text - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_DISPLAY; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventDisplay; event.data = entry; event.time = (i == 0) ? 0 : VOICE_PAD; q_event = _vm->_events->chain(q_event, &event); // Play voice - event.type = ONESHOT_EVENT; - event.code = VOICE_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kVoiceEvent; + event.op = kEventPlay; event.param = dialogue[i].i_voice_rn; event.time = 0; @@ -132,9 +132,9 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo } // Remove text - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_REMOVE; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventRemove; event.data = entry; event.time = voice_len; @@ -263,18 +263,18 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const entry = _vm->_scene->_textList.addEntry(textEntry); // Display text - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_DISPLAY; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventDisplay; event.data = entry; event.time = delta_time; q_event = _vm->_events->queue(&event); // Remove text - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_REMOVE; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventRemove; event.data = entry; event.time = duration; @@ -299,10 +299,10 @@ int Scene::ITEIntroAnimProc(int param) { case SCENE_BEGIN:{ // Background for intro scene is the first frame of the // intro animation; display it and set the palette - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPSetPalette; event.time = 0; q_event = _vm->_events->queue(&event); @@ -338,20 +338,20 @@ int Scene::ITEIntroAnimProc(int param) { debug(3, "Beginning animation playback."); // Begin the animation - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Queue intro music playback - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; + event.type = kEvTOneshot; + event.code = kMusicEvent; event.param = MUSIC_1; event.param2 = MUSIC_LOOP; - event.op = EVENT_PLAY; + event.op = kEventPlay; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -426,9 +426,9 @@ int Scene::ITEIntroCave1Proc(int param) { switch (param) { case SCENE_BEGIN: // Begin palette cycling animation for candles - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTART; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; event.time = 0; q_event = _vm->_events->queue(&event); @@ -437,9 +437,9 @@ int Scene::ITEIntroCave1Proc(int param) { q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); // End scene after last dialogue over - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = VOICE_PAD; q_event = _vm->_events->chain(q_event, &event); @@ -502,18 +502,18 @@ int Scene::ITEIntroCave2Proc(int param) { switch (param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTART; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -522,9 +522,9 @@ int Scene::ITEIntroCave2Proc(int param) { q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); // End scene after last dialogue over - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = VOICE_PAD; q_event = _vm->_events->chain(q_event, &event); @@ -586,18 +586,18 @@ int Scene::ITEIntroCave3Proc(int param) { switch (param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTART; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -606,9 +606,9 @@ int Scene::ITEIntroCave3Proc(int param) { q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); // End scene after last dialogue over - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = VOICE_PAD; q_event = _vm->_events->chain(q_event, &event); @@ -679,18 +679,18 @@ int Scene::ITEIntroCave4Proc(int param) { switch (param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTART; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; event.time = 0; q_event = _vm->_events->chain(q_event, &event); @@ -699,9 +699,9 @@ int Scene::ITEIntroCave4Proc(int param) { q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); // End scene after last dialogue over - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = VOICE_PAD; q_event = _vm->_events->chain(q_event, &event); @@ -745,9 +745,9 @@ int Scene::ITEIntroValleyProc(int param) { // Begin title screen background animation _vm->_anim->setCycles(0, -1); - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -756,46 +756,46 @@ int Scene::ITEIntroValleyProc(int param) { // Begin ITE title theme music _vm->_music->stop(); - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; + event.type = kEvTOneshot; + event.code = kMusicEvent; event.param = MUSIC_2; event.param2 = MUSIC_NORMAL; - event.op = EVENT_PLAY; + event.op = kEventPlay; event.time = 0; q_event = _vm->_events->chain(q_event, &event); // Pause animation before logo - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_STOP; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventStop; event.param = 0; event.time = 3000; q_event = _vm->_events->chain(q_event, &event); // Display logo - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE_BGMASK; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolveBGMask; event.time = 0; event.duration = LOGO_DISSOLVE_DURATION; q_event = _vm->_events->chain(q_event, &event); // Remove logo - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 3000; event.duration = LOGO_DISSOLVE_DURATION; q_event = _vm->_events->chain(q_event, &event); // Unpause animation before logo - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.time = 0; event.param = 0; @@ -805,9 +805,9 @@ int Scene::ITEIntroValleyProc(int param) { q_event = ITEQueueCredits(9000, CREDIT_DURATION1, n_credits, credits); // End scene after credit display - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 1000; q_event = _vm->_events->chain(q_event, &event); @@ -868,9 +868,9 @@ int Scene::ITEIntroTreeHouseProc(int param) { switch (param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; @@ -880,9 +880,9 @@ int Scene::ITEIntroTreeHouseProc(int param) { // Begin title screen background animation _vm->_anim->setFrameTime(0, 100); - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -894,9 +894,9 @@ int Scene::ITEIntroTreeHouseProc(int param) { q_event = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); // End scene after credit display - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 1000; q_event = _vm->_events->chain(q_event, &event); @@ -948,9 +948,9 @@ int Scene::ITEIntroFairePathProc(int param) { switch (param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; @@ -959,9 +959,9 @@ int Scene::ITEIntroFairePathProc(int param) { // Begin title screen background animation _vm->_anim->setCycles(0, -1); - event.type = ONESHOT_EVENT; - event.code = ANIM_EVENT; - event.op = EVENT_PLAY; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventPlay; event.param = 0; event.time = 0; @@ -972,9 +972,9 @@ int Scene::ITEIntroFairePathProc(int param) { q_event = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); // End scene after credit display - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 1000; q_event = _vm->_events->chain(q_event, &event); @@ -1003,18 +1003,18 @@ int Scene::ITEIntroFaireTentProc(int param) { case SCENE_BEGIN: // Start 'dissolve' transition to new scene background - event.type = CONTINUOUS_EVENT; - event.code = TRANSITION_EVENT; - event.op = EVENT_DISSOLVE; + event.type = kEvTContinuous; + event.code = kTransitionEvent; + event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; q_event_start = _vm->_events->queue(&event); // End scene after momentary pause - event.type = ONESHOT_EVENT; - event.code = SCENE_EVENT; - event.op = EVENT_END; + event.type = kEvTOneshot; + event.code = kSceneEvent; + event.op = kEventEnd; event.time = 5000; q_event = _vm->_events->chain(q_event_start, &event); break; diff --git a/saga/palanim.cpp b/saga/palanim.cpp index 5aa941b7b3..01788a867e 100644 --- a/saga/palanim.cpp +++ b/saga/palanim.cpp @@ -125,9 +125,9 @@ int PalAnim::cycleStart() { return FAILURE; } - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTEP; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStep; event.time = PALANIM_CYCLETIME; _vm->_events->queue(&event); @@ -172,9 +172,9 @@ int PalAnim::cycleStep(int vectortime) { _vm->_gfx->setPalette(pal); - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTEP; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStep; event.time = vectortime + PALANIM_CYCLETIME; _vm->_events->queue(&event); diff --git a/saga/scene.cpp b/saga/scene.cpp index 27ecb1d9fb..6369aa988c 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -262,9 +262,9 @@ void Scene::startScene() { } // Hide cursor during intro - event.type = ONESHOT_EVENT; - event.code = CURSOR_EVENT; - event.op = EVENT_HIDE; + event.type = kEvTOneshot; + event.code = kCursorEvent; + event.op = kEventHide; _vm->_events->queue(&event); switch (_vm->getGameType()) { @@ -717,9 +717,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { //fix placard bug //i guess we should remove RF_PLACARD flag - and use _interface->getMode() - event.type = ONESHOT_EVENT; - event.code = GRAPHICS_EVENT; - event.op = EVENT_CLEARFLAG; + event.type = kEvTOneshot; + event.code = kGraphicsEvent; + event.op = kEventClearFlag; event.param = RF_PLACARD; q_event = _vm->_events->chain(q_event, &event); @@ -730,28 +730,28 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { // Fade to black out _vm->_gfx->getCurrentPal(current_pal); - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = current_pal; q_event = _vm->_events->queue(&event); // set fade mode - event.type = IMMEDIATE_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_SET_FADE_MODE; + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; event.param = kNoFade; event.time = 0; event.duration = 0; q_event = _vm->_events->chain(q_event, &event); // Display scene background, but stay with black palette - event.type = IMMEDIATE_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = NO_SET_PALETTE; + event.type = kEvTImmediate; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPNoSetPalette; event.time = 0; event.duration = 0; q_event = _vm->_events->chain(q_event, &event); @@ -760,9 +760,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { // Start the scene pre script, but stay with black palette if (_sceneDescription.startScriptEntrypointNumber > 0) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_BLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecBlocking; event.time = 0; event.param = _sceneDescription.scriptModuleNumber; event.param2 = _sceneDescription.startScriptEntrypointNumber; @@ -777,18 +777,18 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { if (loadSceneParams->transitionType == kTransitionFade) { // set fade mode - event.type = IMMEDIATE_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_SET_FADE_MODE; + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; event.param = kFadeIn; event.time = 0; event.duration = 0; q_event = _vm->_events->chain(q_event, &event); // Fade in from black to the scene background palette - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_BLACKTOPAL; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventBlackToPal; event.time = 0; event.duration = kNormalFadeDuration; event.data = _bg.pal; @@ -796,9 +796,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { q_event = _vm->_events->chain(q_event, &event); // set fade mode - event.type = IMMEDIATE_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_SET_FADE_MODE; + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; event.param = kNoFade; event.time = 0; event.duration = 0; @@ -816,61 +816,61 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { _vm->_sound->stopSound(); if (_sceneDescription.musicResourceId >= 0) { - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; + event.type = kEvTOneshot; + event.code = kMusicEvent; event.param = _sceneDescription.musicResourceId; event.param2 = MUSIC_DEFAULT; - event.op = EVENT_PLAY; + event.op = kEventPlay; event.time = 0; _vm->_events->queue(&event); } else { - event.type = ONESHOT_EVENT; - event.code = MUSIC_EVENT; - event.op = EVENT_STOP; + event.type = kEvTOneshot; + event.code = kMusicEvent; + event.op = kEventStop; event.time = 0; _vm->_events->queue(&event); } // Set scene background - event.type = ONESHOT_EVENT; - event.code = BG_EVENT; - event.op = EVENT_DISPLAY; - event.param = SET_PALETTE; + event.type = kEvTOneshot; + event.code = kBgEvent; + event.op = kEventDisplay; + event.param = kEvPSetPalette; event.time = 0; _vm->_events->queue(&event); if (getFlags() & kSceneFlagShowCursor) { // Activate user interface - event.type = ONESHOT_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_ACTIVATE; + event.type = kEvTOneshot; + event.code = kInterfaceEvent; + event.op = kEventActivate; event.time = 0; _vm->_events->queue(&event); } // Begin palette cycle animation if present - event.type = ONESHOT_EVENT; - event.code = PALANIM_EVENT; - event.op = EVENT_CYCLESTART; + event.type = kEvTOneshot; + event.code = kPalAnimEvent; + event.op = kEventCycleStart; event.time = 0; q_event = _vm->_events->queue(&event); // Show cursor - event.type = ONESHOT_EVENT; - event.code = CURSOR_EVENT; - event.op = EVENT_SHOW; + event.type = kEvTOneshot; + event.code = kCursorEvent; + event.op = kEventShow; _vm->_events->chain(q_event, &event); // Start the scene main script if (_sceneDescription.sceneScriptEntrypointNumber > 0) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = _sceneDescription.scriptModuleNumber; event.param2 = _sceneDescription.sceneScriptEntrypointNumber; diff --git a/saga/script.cpp b/saga/script.cpp index 6b962e63ec..ed70a4b7a7 100644 --- a/saga/script.cpp +++ b/saga/script.cpp @@ -416,9 +416,9 @@ void Script::doVerb() { if (scriptEntrypointNumber > 0) { - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = scriptModuleNumber; event.param2 = scriptEntrypointNumber; diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index bf64bbb1cd..fb4cde839d 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -396,9 +396,9 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { error("Script::sfScriptDoAction wrong object type"); } - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_EXEC_NONBLOCKING; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; event.time = 0; event.param = moduleNumber; event.param2 = scriptEntryPointNumber; @@ -1249,39 +1249,39 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { stringId = thread->pop(); - event.type = ONESHOT_EVENT; - event.code = CURSOR_EVENT; - event.op = EVENT_HIDE; + event.type = kEvTOneshot; + event.code = kCursorEvent; + event.op = kEventHide; q_event = _vm->_events->queue(&event); _vm->_gfx->getCurrentPal(cur_pal); - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = INTERFACE_EVENT; - event.op = EVENT_CLEAR_STATUS; + event.type = kEvTOneshot; + event.code = kInterfaceEvent; + event.op = kEventClearStatus; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = GRAPHICS_EVENT; - event.op = EVENT_SETFLAG; + event.type = kEvTOneshot; + event.code = kGraphicsEvent; + event.op = kEventSetFlag; event.param = RF_PLACARD; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = GRAPHICS_EVENT; - event.op = EVENT_FILL_RECT; + event.type = kEvTOneshot; + event.code = kGraphicsEvent; + event.op = kEventFillRect; event.data = backBuffer; event.param = 138; event.param2 = 0; @@ -1309,27 +1309,27 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { _placardTextEntry = _vm->_scene->_textList.addEntry(textEntry); - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_DISPLAY; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventDisplay; event.data = _placardTextEntry; q_event = _vm->_events->chain(q_event, &event); _vm->_scene->getBGPal(pal); - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_BLACKTOPAL; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventBlackToPal; event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_THREAD_WAKE; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventThreadWake; event.param = kWaitTypePlacard; q_event = _vm->_events->chain(q_event, &event); @@ -1349,49 +1349,49 @@ void Script::sfPlacardOff(SCRIPTFUNC_PARAMS) { _vm->_gfx->getCurrentPal(cur_pal); - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_PALTOBLACK; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; q_event = _vm->_events->queue(&event); - event.type = ONESHOT_EVENT; - event.code = GRAPHICS_EVENT; - event.op = EVENT_CLEARFLAG; + event.type = kEvTOneshot; + event.code = kGraphicsEvent; + event.op = kEventClearFlag; event.param = RF_PLACARD; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = TEXT_EVENT; - event.op = EVENT_REMOVE; + event.type = kEvTOneshot; + event.code = kTextEvent; + event.op = kEventRemove; event.data = _placardTextEntry; q_event = _vm->_events->chain(q_event, &event); _vm->_scene->getBGPal(pal); - event.type = IMMEDIATE_EVENT; - event.code = PAL_EVENT; - event.op = EVENT_BLACKTOPAL; + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventBlackToPal; event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = CURSOR_EVENT; - event.op = EVENT_SHOW; + event.type = kEvTOneshot; + event.code = kCursorEvent; + event.op = kEventShow; q_event = _vm->_events->chain(q_event, &event); - event.type = ONESHOT_EVENT; - event.code = SCRIPT_EVENT; - event.op = EVENT_THREAD_WAKE; + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventThreadWake; event.param = kWaitTypePlacard; q_event = _vm->_events->chain(q_event, &event); |