MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SendEventToEffect

Function SendEventToEffect

Descent3/TelComEffects.cpp:610–627  ·  view source on GitHub ↗

Sends an event to an effect

Source from the content-addressed store, hash-verified

608
609// Sends an event to an effect
610void SendEventToEffect(int effect, int event, int parm1, int parm2) {
611 ASSERT(effect >= 0 && effect < MAX_TCEFFECTS);
612 ASSERT(event >= 0);
613
614 tceffect *tce = &TCEffects[effect];
615
616 for (int j = 0; j < MAX_EFFECT_EVENTS; j++) {
617 if (tce->event_queue[j].id == -1) {
618 tce->event_queue[j].id = event;
619 tce->event_queue[j].parms[0] = parm1;
620 tce->event_queue[j].parms[1] = parm2;
621 return;
622 }
623 }
624
625 // if we got here than the event queue is filled up
626 mprintf(0, "Warning: Event queue filled up for effect %d\n", effect);
627}
628
629// Pops off an event for processesing, returns -1 if no event available
630bool PopEvent(tceffect *tce, tTCEvent *evt) {

Callers 4

TelComSetFocusOnEffectFunction · 0.85
TelComHandleAllEventsFunction · 0.85
TelComHandleKeyPressFunction · 0.85
RenderButtonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected