UFO: Alien Invasion
Loading...
Searching...
No Matches
e_main.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27class dbuffer;
28
30typedef struct eventTiming_s {
38
42typedef struct eventRegister_s {
50 const char* name;
54 const char* formatString;
60 void (*eventCallback)(const struct eventRegister_s* self, dbuffer* msg);
67 int (*timeCallback)(const struct eventRegister_s* self, dbuffer* msg, eventTiming_t* eventTiming);
68
74 bool (*eventCheck)(const struct eventRegister_s* self, const dbuffer* msg);
76
77const eventRegister_t* CL_GetEvent(const event_t eType);
78int CL_GetNextTime(const eventRegister_t* event, eventTiming_t* eventTiming, int nextTime);
79int CL_GetStepTime(const eventTiming_t* eventTiming, const le_t* le, int step);
80const char* CL_ConvertSoundFromEvent(char* sound, size_t size);
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 repl...
Definition e_main.cpp:219
const eventRegister_t * CL_GetEvent(const event_t eType)
Definition e_main.cpp:157
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.
Definition e_main.cpp:177
int CL_GetNextTime(const eventRegister_t *event, eventTiming_t *eventTiming, int nextTime)
Definition e_main.cpp:203
voidpf void uLong size
Definition ioapi.h:42
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
event_t
Possible event values.
Definition q_shared.h:79
QGL_EXTERN void(APIENTRY *qglActiveTexture)(GLenum texture)
Struct that defines one particular event with all its callbacks and data.
Definition e_main.h:42
void(* eventCallback)(const struct eventRegister_s *self, dbuffer *msg)
Callback that is executing the event.
Definition e_main.h:60
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...
Definition e_main.h:74
const char * name
the name of this event (e.g. for logs)
Definition e_main.h:50
const char * formatString
The format string that is used to write and parse this event.
Definition e_main.h:54
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.
Definition e_main.h:67
const event_t type
The type of this event.
Definition e_main.h:46
CL_ParseEvent timers and vars.
Definition e_main.h:30
int shootTime
Definition e_main.h:32
int nextTime
Definition e_main.h:31
int impactTime
Definition e_main.h:33
bool parsedDeath
Definition e_main.h:35
bool parsedShot
Definition e_main.h:36
a local entity