diff options
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/actor.cpp | 2 | ||||
-rw-r--r-- | engines/saga/actor_walk.cpp | 2 | ||||
-rw-r--r-- | engines/saga/animation.cpp | 40 | ||||
-rw-r--r-- | engines/saga/events.cpp | 103 | ||||
-rw-r--r-- | engines/saga/events.h | 19 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 2 | ||||
-rw-r--r-- | engines/saga/introproc_ite.cpp | 115 | ||||
-rw-r--r-- | engines/saga/palanim.cpp | 4 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 80 | ||||
-rw-r--r-- | engines/saga/scene.h | 7 | ||||
-rw-r--r-- | engines/saga/script.cpp | 2 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 20 | ||||
-rw-r--r-- | engines/saga/sfuncs_ihnm.cpp | 6 |
13 files changed, 181 insertions, 221 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index f743fc4324..6d2fded39c 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -659,7 +659,7 @@ void Actor::stepZoneAction(ActorData *actor, const HitZone *hitZone, bool exit, event.param5 = ID_NOTHING; // With Object event.param6 = ID_PROTAG; // Actor - _vm->_events->queue(&event); + _vm->_events->queue(event); } } diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 620b8ee2b6..b6e74fa2bf 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -1153,7 +1153,7 @@ void Actor::moveDragon(ActorData *actor) { event.param4 = -1; // Object event.param5 = -1; // With Object event.param6 = -1; // Actor - _vm->_events->queue(&event); + _vm->_events->queue(event); _dragonHunt = false; } diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index abefba92c6..56201f62fc 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -78,7 +78,7 @@ int Anim::playCutaway(int cut, bool fade) { debug(0, "playCutaway(%d, %d)", cut, fade); Event event; - Event *q_event = NULL; + EventColumns *eventColumns = NULL; bool startImmediately = false; byte *resourceData; size_t resourceDataLength; @@ -102,7 +102,7 @@ int Anim::playCutaway(int cut, bool fade) { event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // set fade mode event.type = kEvTImmediate; @@ -111,7 +111,7 @@ int Anim::playCutaway(int cut, bool fade) { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } // Prepare cutaway @@ -139,7 +139,7 @@ int Anim::playCutaway(int cut, bool fade) { event.time = 0; event.duration = 0; event.param = _cutawayList[cut].backgroundResourceId; - q_event = _vm->_events->chain(q_event, &event); + eventColumns = _vm->_events->chain(eventColumns, event); } else { showCutawayBg(_cutawayList[cut].backgroundResourceId); } @@ -189,9 +189,9 @@ int Anim::playCutaway(int cut, bool fade) { event.time = (40 / 3) * 1000 / _cutawayList[cut].frameRate; if (fade) - q_event = _vm->_events->chain(q_event, &event); + eventColumns = _vm->_events->chain(eventColumns, event); else - _vm->_events->queue(&event); + _vm->_events->queue(event); } return MAX_ANIMATIONS + cutawaySlot; @@ -213,7 +213,7 @@ void Anim::returnFromCutaway() { if (_cutawayActive) { Event event; - Event *q_event = NULL; + EventColumns *eventColumns = NULL; if (_cutAwayFade) { static PalEntry cur_pal[PAL_ENTRIES]; @@ -228,7 +228,7 @@ void Anim::returnFromCutaway() { event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // set fade mode event.type = kEvTImmediate; @@ -237,7 +237,7 @@ void Anim::returnFromCutaway() { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } // Clear the cutaway. Note that this sets _cutawayActive to false @@ -248,9 +248,9 @@ void Anim::returnFromCutaway() { event.duration = 0; if (_cutAwayFade) - q_event = _vm->_events->chain(q_event, &event); // chain with the other events + eventColumns = _vm->_events->chain(eventColumns, event); // chain with the other events else - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); _vm->_scene->restoreScene(); @@ -270,7 +270,7 @@ void Anim::returnFromCutaway() { event.op = kEventResumeAll; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); // chain with the other events + _vm->_events->chain(eventColumns, event); // chain with the other events // Draw the scene event.type = kEvTImmediate; @@ -278,7 +278,7 @@ void Anim::returnFromCutaway() { event.op = kEventDraw; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); // chain with the other events + _vm->_events->chain(eventColumns, event); // chain with the other events // Handle fade up, if we previously faded down if (_cutAwayFade) { @@ -288,14 +288,14 @@ void Anim::returnFromCutaway() { event.time = 0; event.duration = kNormalFadeDuration; event.data = saved_pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypeWakeUp; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } } @@ -355,7 +355,7 @@ void Anim::showCutawayBg(int bg) { event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - _vm->_events->queue(&event); + _vm->_events->queue(event); } else { _vm->_gfx->setPalette(pal); } @@ -500,7 +500,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { event.op = kEventFrame; event.param = animId; event.time = 10; - _vm->_events->queue(&event); + _vm->_events->queue(event); // Nothing to render here (apart from the background, which is already rendered), // so return @@ -530,7 +530,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { event.op = kEventFrame; event.param = animId; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); return; } @@ -571,7 +571,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { event.code = kSceneEvent; event.op = kEventEnd; event.time = anim->frameTime + vectorTime; - _vm->_events->queue(&event); + _vm->_events->queue(event); } return; } else { @@ -597,7 +597,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { event.op = kEventFrame; event.param = animId; event.time = frameTime; - _vm->_events->queue(&event); + _vm->_events->queue(event); } void Anim::stop(uint16 animId) { diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 057c602608..193d20289d 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -55,7 +55,7 @@ Events::~Events() { // Function to process event list once per frame. // First advances event times, then processes each event with the appropriate // handler depending on the type of event. -int Events::handleEvents(long msec) { +void Events::handleEvents(long msec) { long delta_time; int result; @@ -64,7 +64,7 @@ int Events::handleEvents(long msec) { // Process each event in list for (EventList::iterator eventi = _eventList.begin(); eventi != _eventList.end(); ++eventi) { - Event *event_p = &*eventi; + Event *event_p = &eventi->front(); // Call the appropriate event handler for the specific event type switch (event_p->type) { @@ -95,17 +95,15 @@ int Events::handleEvents(long msec) { // handler if ((result == kEvStDelete) || (result == kEvStInvalidCode)) { // If there is no event chain, delete the base event. - if (event_p->chain == NULL) { + if (eventi->size() < 2) { eventi = _eventList.reverse_erase(eventi); } else { // If there is an event chain present, move the next event // in the chain up, adjust it by the previous delta time, // and reprocess the event delta_time = event_p->time; - Event *from_chain = event_p->chain; - memcpy(event_p, from_chain, sizeof(*event_p)); - free(from_chain); - + eventi->pop_front(); + event_p = &eventi->front(); event_p->time += delta_time; --eventi; } @@ -113,8 +111,6 @@ int Events::handleEvents(long msec) { break; } } - - return SUCCESS; } int Events::handleContinuous(Event *event) { @@ -569,120 +565,85 @@ int Events::handleInterval(Event *event) { // Schedules an event in the event list; returns a pointer to the scheduled // event suitable for chaining if desired. -Event *Events::queue(Event *event) { - Event *queuedEvent; +EventColumns *Events::queue(const Event &event) { + EventColumns tmp; + + _eventList.push_back(tmp); + EventColumns *res; + res = &_eventList.back(); + res->push_back(event); - _eventList.push_back(*event); - queuedEvent = &*--_eventList.end(); - initializeEvent(queuedEvent); + initializeEvent(res->back()); - return queuedEvent; + return res; } // Places a 'add_event' on the end of an event chain given by 'head_event' // (head_event may be in any position in the event chain) -Event *Events::chain(Event *headEvent, Event *addEvent) { - if (headEvent == NULL) { +EventColumns *Events::chain(EventColumns *eventColumns, const Event &addEvent) { + if (eventColumns == NULL) { return queue(addEvent); } - Event *walkEvent; - for (walkEvent = headEvent; walkEvent->chain != NULL; walkEvent = walkEvent->chain) { - continue; - } - - walkEvent->chain = (Event *)malloc(sizeof(*walkEvent->chain)); - *walkEvent->chain = *addEvent; - initializeEvent(walkEvent->chain); + eventColumns->push_back(addEvent); + initializeEvent(eventColumns->back()); - return walkEvent->chain; + return eventColumns; } -int Events::initializeEvent(Event *event) { - event->chain = NULL; - switch (event->type) { +void Events::initializeEvent(Event &event) { + switch (event.type) { case kEvTOneshot: break; case kEvTContinuous: case kEvTImmediate: - event->time += event->duration; + event.time += event.duration; break; case kEvTInterval: break; - default: - return FAILURE; } - - return SUCCESS; } -int Events::clearList(bool playQueuedMusic) { - Event *chain_walk; - Event *next_chain; - +void Events::clearList(bool playQueuedMusic) { // Walk down event list for (EventList::iterator eventi = _eventList.begin(); eventi != _eventList.end(); ++eventi) { // Only remove events not marked kEvFNoDestory (engine events) - if (!(eventi->code & kEvFNoDestory)) { + if (!(eventi->front().code & kEvFNoDestory)) { // Handle queued music change events before deleting them // This can happen in IHNM by music events set by sfQueueMusic() // Fixes bug #2057987 - "IHNM: Music stops in Ellen's chapter" - if (playQueuedMusic && ((eventi->code & EVENT_MASK) == kMusicEvent)) { + if (playQueuedMusic && ((eventi->front().code & EVENT_MASK) == kMusicEvent)) { _vm->_music->stop(); - if (eventi->op == kEventPlay) - _vm->_music->play(eventi->param, (MusicFlags)eventi->param2); + if (eventi->front().op == kEventPlay) + _vm->_music->play(eventi->front().param, (MusicFlags)eventi->front().param2); } - // Remove any events chained off this one - for (chain_walk = eventi->chain; chain_walk != NULL; chain_walk = next_chain) { - next_chain = chain_walk->chain; - free(chain_walk); - } eventi = _eventList.reverse_erase(eventi); } } - - return SUCCESS; } // Removes all events from the list (even kEvFNoDestory) -int Events::freeList() { - Event *chain_walk; - Event *next_chain; - - // Walk down event list - EventList::iterator eventi = _eventList.begin(); - while (eventi != _eventList.end()) { - - // Remove any events chained off this one */ - for (chain_walk = eventi->chain; chain_walk != NULL; chain_walk = next_chain) { - next_chain = chain_walk->chain; - free(chain_walk); - } - eventi = _eventList.erase(eventi); - } - - return SUCCESS; +void Events::freeList() { + _eventList.clear(); } // Walks down the event list, updating event times by 'msec'. -int Events::processEventTime(long msec) { +void Events::processEventTime(long msec) { uint16 event_count = 0; for (EventList::iterator eventi = _eventList.begin(); eventi != _eventList.end(); ++eventi) { - eventi->time -= msec; + eventi->front().time -= msec; event_count++; - if (eventi->type == kEvTImmediate) + if (eventi->front().type == kEvTImmediate) break; if (event_count > EVENT_WARNINGCOUNT) { warning("Event list exceeds %u", EVENT_WARNINGCOUNT); } } - - return SUCCESS; } } // End of namespace Saga diff --git a/engines/saga/events.h b/engines/saga/events.h index d1530787c2..a6e42513ad 100644 --- a/engines/saga/events.h +++ b/engines/saga/events.h @@ -142,13 +142,14 @@ struct Event { long duration; // Duration of event long d_reserved; - Event *chain; // Event chain (For consecutive events) Event() { memset(this, 0, sizeof(*this)); } }; -typedef Common::List<Event> EventList; +typedef Common::List<Event> EventColumns; + +typedef Common::List<EventColumns> EventList; #define EVENT_WARNINGCOUNT 1000 #define EVENT_MASK 0x00FF @@ -164,19 +165,19 @@ class Events { public: Events(SagaEngine *vm); ~Events(); - int handleEvents(long msec); - int clearList(bool playQueuedMusic = true); - int freeList(); - Event *queue(Event *event); - Event *chain(Event *headEvent, Event *addEvent); + void handleEvents(long msec); + void clearList(bool playQueuedMusic = true); + void freeList(); + EventColumns *queue(const Event &event); + EventColumns *chain(EventColumns *eventColumns, const Event &addEvent); private: int handleContinuous(Event *event); int handleOneShot(Event *event); int handleInterval(Event *event); int handleImmediate(Event *event); - int processEventTime(long msec); - int initializeEvent(Event *event); + void processEventTime(long msec); + void initializeEvent(Event &event); private: SagaEngine *_vm; diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 7916693100..21e4f1227e 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1563,7 +1563,7 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) { event.param4 = obj; // Object event.param5 = 0; // With Object event.param6 = obj; // Actor - _vm->_events->queue(&event); + _vm->_events->queue(event); } } } diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp index 83fdadf59e..73b7e353d5 100644 --- a/engines/saga/introproc_ite.cpp +++ b/engines/saga/introproc_ite.cpp @@ -102,7 +102,7 @@ int Scene::ITEStartProc() { return SUCCESS; } -Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialogue dialogue[]) { +EventColumns *Scene::ITEQueueDialogue(EventColumns *eventColumns, int n_dialogues, const IntroDialogue dialogue[]) { TextListEntry textEntry; TextListEntry *entry; Event event; @@ -136,7 +136,7 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventDisplay; event.data = entry; event.time = (i == 0) ? 0 : VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + eventColumns = _vm->_events->chain(eventColumns, event); // Play voice event.type = kEvTOneshot; @@ -144,7 +144,7 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventPlay; event.param = dialogue[i].i_voice_rn; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); voice_len = _vm->_sndRes->getVoiceLength(dialogue[i].i_voice_rn); if (voice_len < 0) { @@ -157,10 +157,10 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventRemove; event.data = entry; event.time = voice_len; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } - return q_event; + return eventColumns; } enum { @@ -180,7 +180,7 @@ enum { // Queue a page of credits text. The original interpreter did word-wrapping // automatically. We currently don't. -Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]) { +EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]) { int game; Common::Language lang; @@ -241,7 +241,7 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const TextListEntry textEntry; TextListEntry *entry; Event event; - Event *q_event = NULL; + EventColumns *eventColumns = NULL; textEntry.knownColor = kKnownColorSubtitleTextColor; textEntry.effectKnownColor = kKnownColorTransparent; @@ -283,7 +283,7 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const event.op = kEventDisplay; event.data = entry; event.time = delta_time; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Remove text event.type = kEvTOneshot; @@ -291,12 +291,12 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const event.op = kEventRemove; event.data = entry; event.time = duration; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); y += (_vm->_font->getHeight(font) + line_spacing); } - return q_event; + return eventColumns; } int Scene::SC_ITEIntroAnimProc(int param, void *refCon) { @@ -306,7 +306,7 @@ int Scene::SC_ITEIntroAnimProc(int param, void *refCon) { // Handles the introductory Dreamer's Guild / NWC logo animation scene. int Scene::ITEIntroAnimProc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; switch (param) { case SCENE_BEGIN:{ @@ -317,7 +317,7 @@ int Scene::ITEIntroAnimProc(int param) { event.op = kEventDisplay; event.param = kEvPSetPalette; event.time = 0; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); debug(3, "Intro animation procedure started."); debug(3, "Linking animation resources..."); @@ -355,7 +355,7 @@ int Scene::ITEIntroAnimProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue intro music playback event.type = kEvTOneshot; @@ -364,7 +364,7 @@ int Scene::ITEIntroAnimProc(int param) { event.param2 = MUSIC_LOOP; event.op = kEventPlay; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } break; case SCENE_END: @@ -384,7 +384,7 @@ int Scene::SC_ITEIntroCave1Proc(int param, void *refCon) { // Handles first introductory cave painting scene int Scene::ITEIntroCave1Proc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; int lang = 0; if (_vm->getLanguage() == Common::DE_DEU) @@ -468,17 +468,17 @@ int Scene::ITEIntroCave1Proc(int param) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Queue narrator dialogue list - q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); + ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]); // End scene after last dialogue over event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -499,7 +499,7 @@ int Scene::SC_ITEIntroCave2Proc(int param, void *refCon) { // Handles second introductory cave painting scene int Scene::ITEIntroCave2Proc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; int lang = 0; if (_vm->getLanguage() == Common::DE_DEU) @@ -566,24 +566,24 @@ int Scene::ITEIntroCave2Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Begin palette cycling animation for candles event.type = kEvTOneshot; event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue narrator dialogue list - q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); + ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]); // End scene after last dialogue over event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -603,7 +603,7 @@ int Scene::SC_ITEIntroCave3Proc(int param, void *refCon) { // Handles third introductory cave painting scene int Scene::ITEIntroCave3Proc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; int lang = 0; if (_vm->getLanguage() == Common::DE_DEU) @@ -671,24 +671,24 @@ int Scene::ITEIntroCave3Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Begin palette cycling animation for candles event.type = kEvTOneshot; event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue narrator dialogue list - q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); + ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]); // End scene after last dialogue over event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -708,7 +708,7 @@ int Scene::SC_ITEIntroCave4Proc(int param, void *refCon) { // Handles fourth introductory cave painting scene int Scene::ITEIntroCave4Proc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; int lang = 0; if (_vm->getLanguage() == Common::DE_DEU) @@ -789,24 +789,24 @@ int Scene::ITEIntroCave4Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Begin palette cycling animation for candles event.type = kEvTOneshot; event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue narrator dialogue list - q_event = ITEQueueDialogue(q_event, n_dialogues, dialogue[lang]); + ITEQueueDialogue(eventColumns, n_dialogues, dialogue[lang]); // End scene after last dialogue over event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -826,7 +826,7 @@ int Scene::SC_ITEIntroValleyProc(int param, void *refCon) { // Handles intro title scene (valley overlook) int Scene::ITEIntroValleyProc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; static const IntroCredit credits[] = { {EN_ANY, kITEAny, kCHeader, "Producer"}, @@ -856,7 +856,7 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Begin ITE title theme music _vm->_music->stop(); @@ -867,7 +867,7 @@ int Scene::ITEIntroValleyProc(int param) { event.param2 = MUSIC_NORMAL; event.op = kEventPlay; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Pause animation before logo event.type = kEvTOneshot; @@ -875,7 +875,7 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventStop; event.param = 0; event.time = 3000; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Display logo event.type = kEvTContinuous; @@ -883,7 +883,7 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventDissolveBGMask; event.time = 0; event.duration = LOGO_DISSOLVE_DURATION; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Remove logo event.type = kEvTContinuous; @@ -891,7 +891,7 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventDissolve; event.time = 3000; event.duration = LOGO_DISSOLVE_DURATION; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Unpause animation before logo event.type = kEvTOneshot; @@ -899,17 +899,17 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventPlay; event.time = 0; event.param = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue game credits list - q_event = ITEQueueCredits(9000, CREDIT_DURATION1, n_credits, credits); + eventColumns = ITEQueueCredits(9000, CREDIT_DURATION1, n_credits, credits); // End scene after credit display event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -929,7 +929,7 @@ int Scene::SC_ITEIntroTreeHouseProc(int param, void *refCon) { // Handles second intro credit screen (treehouse view) int Scene::ITEIntroTreeHouseProc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; static const IntroCredit credits1[] = { {EN_ANY, kITEAny, kCHeader, "Game Design"}, @@ -981,7 +981,7 @@ int Scene::ITEIntroTreeHouseProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); if (_vm->_anim->hasAnimation(0)) { // Begin title screen background animation @@ -992,19 +992,19 @@ int Scene::ITEIntroTreeHouseProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } // Queue game credits list - q_event = ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); - q_event = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); + eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); + eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); // End scene after credit display event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -1024,7 +1024,7 @@ int Scene::SC_ITEIntroFairePathProc(int param, void *refCon) { // Handles third intro credit screen (path to puzzle tent) int Scene::ITEIntroFairePathProc(int param) { Event event; - Event *q_event; + EventColumns *eventColumns; static const IntroCredit credits1[] = { {EN_ANY, kITEAny, kCHeader, "Programming"}, @@ -1063,7 +1063,7 @@ int Scene::ITEIntroFairePathProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // Begin title screen background animation _vm->_anim->setCycles(0, -1); @@ -1073,18 +1073,18 @@ int Scene::ITEIntroFairePathProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Queue game credits list - q_event = ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); - q_event = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); + eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); + eventColumns = ITEQueueCredits(DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); // End scene after credit display event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: @@ -1104,8 +1104,7 @@ int Scene::SC_ITEIntroFaireTentProc(int param, void *refCon) { // Handles fourth intro credit screen (treehouse view) int Scene::ITEIntroFaireTentProc(int param) { Event event; - Event *q_event; - Event *q_event_start; + EventColumns *eventColumns; switch (param) { case SCENE_BEGIN: @@ -1116,14 +1115,14 @@ int Scene::ITEIntroFaireTentProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event_start = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // End scene after momentary pause event.type = kEvTOneshot; event.code = kSceneEvent; event.op = kEventEnd; event.time = 5000; - q_event = _vm->_events->chain(q_event_start, &event); + _vm->_events->chain(eventColumns, event); break; case SCENE_END: diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index 48eb0f5ec9..bb27af75ff 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -89,7 +89,7 @@ void PalAnim::cycleStart() { event.code = kPalAnimEvent; event.op = kEventCycleStep; event.time = PALANIM_CYCLETIME; - _vm->_events->queue(&event); + _vm->_events->queue(event); } void PalAnim::cycleStep(int vectortime) { @@ -136,7 +136,7 @@ void PalAnim::cycleStep(int vectortime) { event.code = kPalAnimEvent; event.op = kEventCycleStep; event.time = vectortime + PALANIM_CYCLETIME; - _vm->_events->queue(&event); + _vm->_events->queue(event); } diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 0438b5d6c0..03b4899105 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -274,7 +274,7 @@ void Scene::startScene() { event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventHide; - _vm->_events->queue(&event); + _vm->_events->queue(event); switch (_vm->getGameId()) { case GID_ITE: @@ -590,7 +590,7 @@ void Scene::initDoorsState() { void Scene::loadScene(LoadSceneParams &loadSceneParams) { size_t i; Event event; - Event *q_event; + EventColumns *eventColumns; static PalEntry current_pal[PAL_ENTRIES]; if (loadSceneParams.transitionType == kTransitionFade) @@ -601,7 +601,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.code = kCursorEvent; event.op = kEventSetBusyCursor; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); _chapterPointsChanged = false; @@ -739,7 +739,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { _sceneLoaded = true; - q_event = NULL; + eventColumns = NULL; if (loadSceneParams.transitionType == kTransitionFade) { @@ -753,7 +753,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.time = 0; event.duration = kNormalFadeDuration; event.data = current_pal; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // set fade mode event.type = kEvTImmediate; @@ -762,7 +762,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Display scene background, but stay with black palette event.type = kEvTImmediate; @@ -771,7 +771,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param = kEvPNoSetPalette; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } @@ -787,7 +787,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param4 = _sceneNumber; // Object event.param5 = loadSceneParams.actorsEntrance; // With Object event.param6 = 0; // Actor - q_event = _vm->_events->chain(q_event, &event); + eventColumns = _vm->_events->chain(eventColumns, event); } if (loadSceneParams.transitionType == kTransitionFade) { @@ -799,7 +799,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param = kFadeIn; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + eventColumns = _vm->_events->chain(eventColumns, event); // Fade in from black to the scene background palette event.type = kEvTImmediate; @@ -808,7 +808,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.time = 0; event.duration = kNormalFadeDuration; event.data = _bg.pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // set fade mode event.type = kEvTImmediate; @@ -817,7 +817,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } if (loadSceneParams.sceneProc == NULL) { @@ -836,13 +836,13 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param2 = MUSIC_DEFAULT; event.op = kEventPlay; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); } else { event.type = kEvTOneshot; event.code = kMusicEvent; event.op = kEventStop; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); } } @@ -852,14 +852,14 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.op = kEventDisplay; event.param = kEvPSetPalette; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); // Begin palette cycle animation if present event.type = kEvTOneshot; event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->queue(&event); + _vm->_events->queue(event); // Start the scene main script if (_sceneDescription.sceneScriptEntrypointNumber > 0) { @@ -873,7 +873,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.param4 = _sceneNumber; // Object event.param5 = loadSceneParams.actorsEntrance; // With Object event.param6 = 0; // Actor - _vm->_events->queue(&event); + _vm->_events->queue(event); } debug(3, "Scene started"); @@ -896,7 +896,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.code = kInterfaceEvent; event.op = kEventActivate; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); } // Change the cursor back to a crosshair in IHNM @@ -904,7 +904,7 @@ void Scene::loadScene(LoadSceneParams &loadSceneParams) { event.code = kCursorEvent; event.op = kEventSetNormalCursor; event.time = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); } void Scene::loadSceneDescriptor(uint32 resourceId) { @@ -1264,7 +1264,7 @@ void Scene::restoreScene() { event.param = kEvPNoSetPalette; event.time = 0; event.duration = 0; - _vm->_events->queue(&event); + _vm->_events->queue(event); _vm->_gfx->showCursor(true); } @@ -1314,7 +1314,7 @@ void Scene::loadSceneEntryList(const byte* resourcePointer, size_t resourceLengt void Scene::clearPlacard() { static PalEntry cur_pal[PAL_ENTRIES]; Event event; - Event *q_event; + EventColumns *eventColumns; _vm->_interface->setFadeMode(kFadeOut); @@ -1326,7 +1326,7 @@ void Scene::clearPlacard() { event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); // set fade mode event.type = kEvTImmediate; @@ -1335,14 +1335,14 @@ void Scene::clearPlacard() { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); if (_vm->getGameId() == GID_ITE) { event.type = kEvTOneshot; event.code = kTextEvent; event.op = kEventRemove; event.data = _vm->_script->getPlacardTextEntry(); - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } else { _vm->_scene->_textList.clear(); } @@ -1352,7 +1352,7 @@ void Scene::clearPlacard() { event.op = kEventRestoreMode; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); #ifdef ENABLE_IHNM if (_vm->getGameId() == GID_IHNM) { @@ -1363,7 +1363,7 @@ void Scene::clearPlacard() { event.param = kPanelMain; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } #endif @@ -1374,7 +1374,7 @@ void Scene::clearPlacard() { event.param = kEvPNoSetPalette; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // set fade mode event.type = kEvTImmediate; @@ -1383,7 +1383,7 @@ void Scene::clearPlacard() { event.param = kFadeIn; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Fade in from black to the scene background palette event.type = kEvTImmediate; @@ -1392,7 +1392,7 @@ void Scene::clearPlacard() { event.time = 0; event.duration = kNormalFadeDuration; event.data = _bg.pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // set fade mode event.type = kEvTImmediate; @@ -1401,18 +1401,18 @@ void Scene::clearPlacard() { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventShow; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } #ifdef ENABLE_IHNM @@ -1423,7 +1423,7 @@ void Scene::showPsychicProfile(const char *text) { PalEntry *pal; TextListEntry textEntry; Event event; - Event *q_event; + EventColumns *eventColumns; if (_vm->_interface->getMode() == kPanelPlacard) return; @@ -1437,7 +1437,7 @@ void Scene::showPsychicProfile(const char *text) { event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventHide; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); _vm->_interface->setFadeMode(kFadeOut); @@ -1449,7 +1449,7 @@ void Scene::showPsychicProfile(const char *text) { event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // set fade mode event.type = kEvTImmediate; @@ -1458,17 +1458,17 @@ void Scene::showPsychicProfile(const char *text) { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kInterfaceEvent; event.op = kEventClearStatus; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Set the background and palette for the psychic profile event.type = kEvTOneshot; event.code = kPsychicProfileBgEvent; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); _vm->_scene->_textList.clear(); @@ -1491,7 +1491,7 @@ void Scene::showPsychicProfile(const char *text) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _psychicProfileTextEntry; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } _vm->_scene->getBGPal(pal); @@ -1502,13 +1502,13 @@ void Scene::showPsychicProfile(const char *text) { event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } void Scene::clearPsychicProfile() { diff --git a/engines/saga/scene.h b/engines/saga/scene.h index fdb9919064..8b9b4493f0 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -32,6 +32,7 @@ #include "saga/actor.h" #include "saga/interface.h" #include "saga/puzzle.h" +#include "saga/events.h" namespace Saga { @@ -55,8 +56,6 @@ namespace Saga { class ObjectMap; -struct Event; - enum SceneFlags { kSceneFlagISO = 1, kSceneFlagShowCursor = 2 @@ -438,8 +437,8 @@ class Scene { static int SC_ITEIntroFaireTentProc(int param, void *refCon); private: - Event *ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialogue dialogue[]); - Event *ITEQueueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]); + EventColumns *ITEQueueDialogue(EventColumns *eventColumns, int n_dialogues, const IntroDialogue dialogue[]); + EventColumns *ITEQueueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]); int ITEIntroAnimProc(int param); int ITEIntroCave1Proc(int param); int ITEIntroCave2Proc(int param); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index b35e13ed8f..d7ddacabbe 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -1420,7 +1420,7 @@ void Script::doVerb() { event.param4 = _pendingObject[0]; // Object event.param5 = _pendingObject[1]; // With Object event.param6 = (objectType == kGameObjectActor) ? _pendingObject[0] : ID_PROTAG; // Actor - _vm->_events->queue(&event); + _vm->_events->queue(event); } else { // Show excuse text in ITE CD Versions diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 463adc76e8..1e34362dc4 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -327,7 +327,7 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { event.param4 = theObject; // Object event.param5 = withObject; // With Object event.param6 = objectId; - _vm->_events->queue(&event); + _vm->_events->queue(event); } // Script function #8 (0x08) nonblocking @@ -1060,7 +1060,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { static PalEntry cur_pal[PAL_ENTRIES]; PalEntry *pal; Event event; - Event *q_event; + EventColumns *eventColumns; thread->wait(kWaitTypePlacard); @@ -1070,7 +1070,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventHide; - q_event = _vm->_events->queue(&event); + eventColumns = _vm->_events->queue(event); _vm->_interface->setFadeMode(kFadeOut); @@ -1082,7 +1082,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // set fade mode event.type = kEvTImmediate; @@ -1091,12 +1091,12 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.param = kNoFade; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kInterfaceEvent; event.op = kEventClearStatus; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kGraphicsEvent; @@ -1106,7 +1106,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.param3 = _vm->_scene->getHeight(); event.param4 = 0; event.param5 = _vm->getDisplayInfo().width; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); // Put the text in the center of the viewport, assuming it will fit on // one line. If we cannot make that assumption we'll need to extend @@ -1130,7 +1130,7 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _placardTextEntry; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); _vm->_scene->getBGPal(pal); event.type = kEvTImmediate; @@ -1139,13 +1139,13 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); + _vm->_events->chain(eventColumns, event); } diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index 6637c861cb..dd6bbbe6f8 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -247,7 +247,7 @@ void Script::sfScriptFade(SCRIPTFUNC_PARAMS) { event.param2 = endingBrightness; event.param3 = firstPalEntry; event.param4 = lastPalEntry - firstPalEntry + 1; - _vm->_events->queue(&event); + _vm->_events->queue(event); } void Script::sfScriptStartVideo(SCRIPTFUNC_PARAMS) { @@ -294,7 +294,7 @@ void Script::sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _psychicProfileTextEntry; - _vm->_events->queue(&event); + _vm->_events->queue(event); _ihnmDemoCurrentY += _vm->_font->getHeight(kKnownFontVerb, thread->_strings->getString(stringId), 226, kFontCentered); } @@ -424,7 +424,7 @@ void Script::sfQueueMusic(SCRIPTFUNC_PARAMS) { event.op = kEventPlay; event.time = _vm->ticksToMSec(1000); - _vm->_events->queue(&event); + _vm->_events->queue(event); if (!_vm->_scene->haveChapterPointsChanged()) { _vm->_scene->setCurrentMusicTrack(param1); |