UFO: Alien Invasion
|
#include "../../client.h"
#include "e_parse.h"
#include "e_main.h"
#include "../cl_localentity.h"
#include "../../cgame/cl_game.h"
Go to the source code of this file.
Data Structures | |
struct | evTimes_s |
Typedefs | |
typedef struct evTimes_s | evTimes_t |
Functions | |
static void | CL_LogEvent (const eventRegister_t *eventData) |
void | CL_BlockBattlescapeEvents (bool block) |
Adds the ability to block battlescape event execution until something other is finished. E.g. camera movement. More... | |
static bool | CL_AreBattlescapeEventsBlocked (void) |
static bool | CL_CheckBattlescapeEvent (int now, void *data) |
Checks if a given battlescape event is ok to run now. Uses the check_func pointer in the event struct. More... | |
static void | CL_NotifyBattlescapeEventDelay (int now, void *data, int delay) |
If we delayed the battlescape events due to event locking (e.g. le is locked or camera is locked), we have to advance the time for new events, too. Otherwise they might be scheduled before the just delayed events. More... | |
static bool | CL_DelayBattlescapeEvent (int now, void *data) |
Checks if a given battlescape event should get delayed. More... | |
static void | CL_ExecuteBattlescapeEvent (int now, void *data) |
static void | CL_FreeBattlescapeEvent (void *data) |
static bool | CL_FilterBattlescapeEvents (int when, event_func *func, event_check_func *check, void *data) |
int | CL_ClearBattlescapeEvents (void) |
static int | CL_GetEventTime (const event_t eType, dbuffer *msg, eventTiming_t *eventTiming) |
Calculates the time the event should get executed. If two events return the same time, they are going to be executed in the order the were parsed. More... | |
event_t | CL_ParseEvent (dbuffer *msg) |
Called in case a svc_event was send via the network buffer. More... | |
Variables | |
cvar_t * | cl_log_battlescape_events |
c | char | 1 b | byte | 1 s | short | 2 l | long | 4 p | pos | 6 (map boundaries - (-MAX_WORLD_WIDTH) - (MAX_WORLD_WIDTH)) g | gpos | 3 d | dir | 1 a | angle | 1 & | string | x ! | do not read the next id | 1
Definition in file e_parse.cpp.
|
static |
true
Definition at line 95 of file e_parse.cpp.
References cl, and clientBattleScape_s::eventsBlocked.
Referenced by CL_CheckBattlescapeEvent(), and CL_DelayBattlescapeEvent().
void CL_BlockBattlescapeEvents | ( | bool | block | ) |
Adds the ability to block battlescape event execution until something other is finished. E.g. camera movement.
block | true to block the execution of other events until you unblock the event execution again, false to unblock the event execution. |
Definition at line 83 of file e_parse.cpp.
References cl, Com_DPrintf(), DEBUG_EVENTSYS, and clientBattleScape_s::eventsBlocked.
Referenced by CL_CameraMove(), CL_CameraRoute(), and CL_ClearBattlescapeEvents().
Checks if a given battlescape event is ok to run now. Uses the check_func pointer in the event struct.
now | The current time. |
data | The event to check. |
Definition at line 107 of file e_parse.cpp.
References CL_AreBattlescapeEventsBlocked(), CL_GetEvent(), and eventRegister_s::eventCheck.
Referenced by CL_ParseEvent().
Definition at line 215 of file e_parse.cpp.
References CL_BlockBattlescapeEvents(), CL_FilterBattlescapeEvents(), and CL_FilterEventQueue().
Referenced by CL_Disconnect(), and TEST_F().
Checks if a given battlescape event should get delayed.
now | The current time. |
data | Event structure pointer |
Definition at line 156 of file e_parse.cpp.
References CL_AreBattlescapeEventsBlocked(), CL_GetEvent(), Com_DPrintf(), DEBUG_EVENTSYS, and eventRegister_s::name.
Referenced by CL_ParseEvent().
Definition at line 171 of file e_parse.cpp.
References ca_active, CL_GetEvent(), CL_LogEvent(), cls, Com_DPrintf(), Com_Error(), DEBUG_EVENTSYS, ERR_DROP, EV_START, eventRegister_s::eventCallback, GAME_NotifyEvent(), Mem_Free, eventRegister_s::name, and client_static_s::state.
Referenced by CL_FilterBattlescapeEvents(), and CL_ParseEvent().
|
static |
true
to keep the event, false
to remove it from the queue Definition at line 204 of file e_parse.cpp.
References CL_ExecuteBattlescapeEvent(), CL_GetEvent(), Com_Printf(), and eventRegister_s::name.
Referenced by CL_ClearBattlescapeEvents().
Definition at line 194 of file e_parse.cpp.
References Mem_Free, and evTimes_s::msg.
Referenced by CL_ParseEvent().
|
static |
Calculates the time the event should get executed. If two events return the same time, they are going to be executed in the order the were parsed.
[in] | eType | The event type |
[in,out] | msg | The message buffer that can be modified to get the event time |
[in,out] | eventTiming | The delay data for the events |
impactTime
is used to delay some events in case the projectile needs some time to reach its target. Definition at line 234 of file e_parse.cpp.
References cl, CL_GetEvent(), Com_DPrintf(), DEBUG_EVENTSYS, eventTiming_s::impactTime, eventRegister_s::name, eventTiming_s::nextTime, eventTiming_s::shootTime, clientBattleScape_s::time, and eventRegister_s::timeCallback.
Referenced by CL_ParseEvent().
|
static |
Definition at line 61 of file e_parse.cpp.
References cl, CL_GetConfigString(), Com_MakeTimestamp(), CS_MAPTITLE, f, FILE_APPEND, FS_OpenFile(), FS_Printf(), cvar_s::integer, eventRegister_s::name, and clientBattleScape_s::time.
Referenced by CL_ExecuteBattlescapeEvent(), and CL_ParseEvent().
If we delayed the battlescape events due to event locking (e.g. le is locked or camera is locked), we have to advance the time for new events, too. Otherwise they might be scheduled before the just delayed events.
[in] | now | |
[in] | data | The userdata that is passed to the function callback. In our case this is the eventTiming_t data |
[in] | delay | The milliseconds that the battlescape events were delayed and that we have to use to advance the eventTiming_t values. |
Definition at line 131 of file e_parse.cpp.
References i, eventTiming_s::impactTime, leStep_s::lastMoveTime, LE_GetNextInUse(), LE_IsLivingActor(), leStep_s::next, eventTiming_s::nextTime, eventTiming_s::shootTime, le_s::stepIndex, and le_s::stepList.
Referenced by CL_ParseEvent().
Called in case a svc_event was send via the network buffer.
[in] | msg | The client stream message buffer to read from |
Definition at line 261 of file e_parse.cpp.
References cl, CL_CheckBattlescapeEvent(), CL_DelayBattlescapeEvent(), CL_ExecuteBattlescapeEvent(), CL_FreeBattlescapeEvent(), cl_genericPool, CL_GetEvent(), CL_GetEventTime(), CL_LogEvent(), CL_NotifyBattlescapeEventDelay(), Com_DPrintf(), Com_Error(), DEBUG_EVENTSYS, ERR_DROP, evTimes_s::eType, EV_NULL, EV_NUM_EVENTS, EV_RESET, EVENT_INSTANTLY, eventRegister_s::eventCallback, GAME_NotifyEvent(), Mem_PoolAllocType, evTimes_s::msg, eventRegister_s::name, NET_ReadByte(), OBJZERO, Schedule_Event(), and clientBattleScape_s::time.
Referenced by CL_ParseServerMessage(), and TEST_F().
cvar_t* cl_log_battlescape_events |
Definition at line 47 of file e_parse.cpp.
Referenced by CL_InitLocal().