40 #include "../../client.h"
44 #include "../cl_localentity.h"
45 #include "../../cgame/cl_game.h"
63 if (!cl_log_battlescape_events->
integer)
118 return eventData->
eventCheck(eventData, event->msg);
141 if (stepList ==
nullptr)
144 stepList = stepList->
next;
248 eventTime = eventData->
timeCallback(eventData, msg, eventTiming);
272 eType &= ~EVENT_INSTANTLY;
303 e->delayFollowing = 50;
305 e->notifyDelayUserData = (
void*)&eventTiming;
bool(* eventCheck)(const struct eventRegister_s *self, const dbuffer *msg)
Called to determine if this event is ok to run at this point. Should check any conflicts with other o...
int FS_OpenFile(const char *filename, qFILE *file, filemode_t mode)
Finds and opens the file in the search path.
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
char * CL_GetConfigString(int index)
void event_func(int now, void *data)
void CL_BlockBattlescapeEvents(bool block)
Adds the ability to block battlescape event execution until something other is finished. E.g. camera movement.
static void CL_LogEvent(const eventRegister_t *eventData)
void Com_Printf(const char *const fmt,...)
static bool CL_FilterBattlescapeEvents(int when, event_func *func, event_check_func *check, void *data)
static void CL_FreeBattlescapeEvent(void *data)
void GAME_NotifyEvent(event_t eventType)
memPool_t * cl_genericPool
CL_ParseEvent timers and vars.
void Com_Error(int code, const char *fmt,...)
static void CL_ExecuteBattlescapeEvent(int now, void *data)
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)...
static bool CL_AreBattlescapeEventsBlocked(void)
const eventRegister_t * CL_GetEvent(const event_t eType)
event_t
Possible event values.
int FS_Printf(qFILE *f, const char *msg,...)
Can print chunks for 1024 chars into a file.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
struct evTimes_s evTimes_t
int(* timeCallback)(const struct eventRegister_s *self, dbuffer *msg, eventTiming_t *eventTiming)
Callback that is returning the time that is needed to execute this event.
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...
Struct that defines one particular event with all its callbacks and data.
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.
le_t * LE_GetNextInUse(le_t *lastLE)
Iterate through the entities that are in use.
void Com_MakeTimestamp(char *ts, const size_t tslen)
Creates a timestamp with date and time at the specified location.
const char * name
the name of this event (e.g. for logs)
static bool CL_DelayBattlescapeEvent(int now, void *data)
Checks if a given battlescape event should get delayed.
int CL_FilterEventQueue(event_filter *filter)
Filters every event in the queue using the given function. Keeps all events for which the function re...
event_t CL_ParseEvent(dbuffer *msg)
Called in case a svc_event was send via the network buffer.
int CL_ClearBattlescapeEvents(void)
void(* eventCallback)(const struct eventRegister_s *self, dbuffer *msg)
Callback that is executing the event.
GLsizei const GLvoid * data
cvar_t * cl_log_battlescape_events
ScheduleEventPtr Schedule_Event(int when, event_func *func, event_check_func *check, event_clean_func *clean, void *data)
Schedules an event to run on or after the given time, and when its check function returns true...
#define Mem_PoolAllocType(type, pool)
bool LE_IsLivingActor(const le_t *le)
Checks whether the given le is a living actor (but might be hidden)
bool event_check_func(int now, void *data)
int NET_ReadByte(dbuffer *buf)
Reads a byte from the netchannel.