UFO: Alien Invasion
Loading...
Searching...
No Matches
e_main.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  eventTiming_t
 CL_ParseEvent timers and vars. More...
struct  eventRegister_t
 Struct that defines one particular event with all its callbacks and data. More...

Functions

const eventRegister_tCL_GetEvent (const event_t eType)
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.
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.

Function Documentation

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