UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"

Go to the source code of this file.

Macros

#define E(x)   x, STRINGIFY(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. More...
 
 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. More...
 
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. More...
 

Variables

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

Macro Definition Documentation

#define E (   x)    x, STRINGIFY(x)

Function Documentation

CASSERT ( lengthof(events = =EV_NUM_EVENTS)
static 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().

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().

int CL_GetNextTime ( const eventRegister_t event,
eventTiming_t eventTiming,
int  nextTime 
)
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_s::entnum, i, leStep_s::lastMoveDuration, leStep_s::lastMoveTime, leStep_s::next, eventTiming_s::nextTime, le_s::stepIndex, le_s::stepList, leStep_s::steps, and leStep_s::stepTimes.

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

Variable Documentation

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 CL_ParseCampaignEvents(), CP_CheckCampaignEvents(), CP_GetEventsByID(), and TEST_F().