UFO: Alien Invasion
Loading...
Searching...
No Matches
e_main.cpp File Reference
#include "../../client.h"
#include "../cl_localentity.h"
#include "e_main.h"
#include "event/actor/e_event_actorappear.h"
#include "event/actor/e_event_actoradd.h"
#include "event/actor/e_event_actormove.h"
#include "event/actor/e_event_actorturn.h"
#include "event/actor/e_event_actorstartshoot.h"
#include "event/actor/e_event_actorshoot.h"
#include "event/actor/e_event_actorshoothidden.h"
#include "event/actor/e_event_actorthrow.h"
#include "event/actor/e_event_actorendshot.h"
#include "event/actor/e_event_actordie.h"
#include "event/actor/e_event_actorstats.h"
#include "event/actor/e_event_actorstatechange.h"
#include "event/actor/e_event_actorclientaction.h"
#include "event/actor/e_event_actorreactionfirechange.h"
#include "event/actor/e_event_actorreactionfireaddtarget.h"
#include "event/actor/e_event_actorreactionfireremovetarget.h"
#include "event/actor/e_event_actorreactionfiretargetupdate.h"
#include "event/actor/e_event_actorreactionfireabortshot.h"
#include "event/actor/e_event_actorresetclientaction.h"
#include "event/actor/e_event_actorreservationchange.h"
#include "event/actor/e_event_actorrevitalised.h"
#include "event/actor/e_event_actorwound.h"
#include "event/inventory/e_event_invadd.h"
#include "event/inventory/e_event_invdel.h"
#include "event/inventory/e_event_invammo.h"
#include "event/inventory/e_event_invreload.h"
#include "event/player/e_event_reset.h"
#include "event/player/e_event_startgame.h"
#include "event/player/e_event_doendround.h"
#include "event/player/e_event_endroundannounce.h"
#include "event/player/e_event_results.h"
#include "event/player/e_event_centerview.h"
#include "event/world/e_event_cameraappear.h"
#include "event/world/e_event_entappear.h"
#include "event/world/e_event_entperish.h"
#include "event/world/e_event_entdestroy.h"
#include "event/world/e_event_addbrushmodel.h"
#include "event/world/e_event_addedict.h"
#include "event/world/e_event_explode.h"
#include "event/world/e_event_particleappear.h"
#include "event/world/e_event_particlespawn.h"
#include "event/world/e_event_dooropen.h"
#include "event/world/e_event_doorclose.h"
#include "event/world/e_event_sound.h"
Include dependency graph for e_main.cpp:

Go to the source code of this file.

Macros

#define E(x)

Functions

static bool CL_CheckDefault (const eventRegister_t *self, const dbuffer *msg)
 A default check function that assumes the entnum is the first short in msg.
 CASSERT (lengthof(events)==EV_NUM_EVENTS)
const eventRegister_tCL_GetEvent (const event_t eType)
int CL_GetStepTime (const eventTiming_t *eventTiming, const le_t *le, int step)
 Calculates the time when the given step was executed in the event chain.
int CL_GetNextTime (const eventRegister_t *event, eventTiming_t *eventTiming, int nextTime)
const char * CL_ConvertSoundFromEvent (char *sound, size_t size)
 Some sound strings may end on a '+' to indicate to use a random sound which can be identified by replacing the '+' by a number.

Variables

const eventRegister_t events []
 List of functions to register nodes.

Macro Definition Documentation

◆ E

#define E ( x)
Value:
x, STRINGIFY(x)
#define STRINGIFY(x)
Definition shared.h:89

Referenced by Com_SHA1ProcessMessageBlock(), and Com_SHA2Process().

Function Documentation

◆ CASSERT()

CASSERT ( lengthof(events) = =EV_NUM_EVENTS)

References EV_NUM_EVENTS, and events.

◆ CL_CheckDefault()

bool CL_CheckDefault ( const eventRegister_t * self,
const dbuffer * msg )
static

A default check function that assumes the entnum is the first short in msg.

Parameters
selfThe event we're checking.
msgThe buffer containing event information. It is not changed during the call, so it doesn't need to be copied before, and can be used as new afterwards.

Definition at line 79 of file e_main.cpp.

References Com_DPrintf(), DEBUG_EVENTSYS, LE_IsLocked(), and NET_PeekShort().

◆ CL_ConvertSoundFromEvent()

const char * CL_ConvertSoundFromEvent ( char * sound,
size_t size )

Some sound strings may end on a '+' to indicate to use a random sound which can be identified by replacing the '+' by a number.

Parameters
[in,out]soundThe sound string that we might need to convert
[in]sizeThe size of the sound buffer
Returns
Pointer to the sound buffer

Definition at line 219 of file e_main.cpp.

References FS_CheckFile(), i, length, and Q_strcat().

Referenced by CL_Explode(), and CL_SoundEvent().

◆ CL_GetEvent()

◆ CL_GetNextTime()

int CL_GetNextTime ( const eventRegister_t * event,
eventTiming_t * eventTiming,
int nextTime )

◆ CL_GetStepTime()

int CL_GetStepTime ( const eventTiming_t * eventTiming,
const le_t * le,
int step )

Calculates the time when the given step was executed in the event chain.

Note
There is only one movement event which takes some time and delays other events in the queue. If you want to execute any other event during this movement event, use this function to get the proper eventTime for doing so.
Parameters
[in]eventTimingThe structure to get the needed data from
[in]leThe moving actor
[in]stepThe step we want to calculate the time for
Returns
-1 on error (invalid input data), otherwise the timestamp the move event was executed for that step

Definition at line 177 of file e_main.cpp.

References Com_Printf(), le_t::entnum, i, leStep_t::lastMoveDuration, leStep_t::lastMoveTime, leStep_t::next, eventTiming_t::nextTime, le_t::stepIndex, le_t::stepList, leStep_t::steps, and leStep_t::stepTimes.

Referenced by CL_ActorReactionFireAbortShotTime(), CL_ActorReactionFireAddTargetTime(), CL_ActorReactionFireRemoveTargetTime(), CL_ActorReactionFireTargetUpdateTime(), and CL_SoundEventTime().

Variable Documentation

◆ events

const eventRegister_t events[]

List of functions to register nodes.

Note
Functions must be sorted by node name

Definition at line 92 of file e_main.cpp.

Referenced by CASSERT(), CL_GetEvent(), CL_ParseCampaignEvents(), CP_CheckCampaignEvents(), CP_GetEventsByID(), and TEST_F().