Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
static void | PF_configstring (int index, const char *val) |
|
static int | PF_FindIndex (const char *name, int start, int max) |
|
static int | PF_ModelIndex (const char *name) |
|
static int | PF_SoundIndex (const char *name) |
|
static int | PF_ImageIndex (const char *name) |
|
static void | PF_Unicast (edict_t *ent, qboolean reliable) |
|
static void | PF_bprintf (int level, const char *fmt,...) |
|
static void | PF_dprintf (const char *fmt,...) |
|
static void | PF_cprintf (edict_t *ent, int level, const char *fmt,...) |
|
static void | PF_centerprintf (edict_t *ent, const char *fmt,...) |
|
static q_noreturn void | PF_error (const char *fmt,...) |
|
static void | PF_setmodel (edict_t *ent, const char *name) |
|
static void | PF_WriteFloat (float f) |
|
static qboolean | PF_inVIS (vec3_t p1, vec3_t p2, int vis) |
|
static qboolean | PF_inPVS (vec3_t p1, vec3_t p2) |
|
static qboolean | PF_inPHS (vec3_t p1, vec3_t p2) |
|
static void | PF_StartSound (edict_t *edict, int channel, int soundindex, float volume, float attenuation, float timeofs) |
|
static void | PF_PositionedSound (vec3_t origin, edict_t *entity, int channel, int soundindex, float volume, float attenuation, float timeofs) |
|
void | PF_Pmove (pmove_t *pm) |
|
static cvar_t * | PF_cvar (const char *name, const char *value, int flags) |
|
static void | PF_AddCommandString (const char *string) |
|
static void | PF_SetAreaPortalState (int portalnum, qboolean open) |
|
static qboolean | PF_AreasConnected (int area1, int area2) |
|
static void * | PF_TagMalloc (size_t size, unsigned tag) |
|
static void | PF_FreeTags (unsigned tag) |
|
static void | PF_DebugGraph (float value, int color) |
|
void | SV_ShutdownGameProgs (void) |
|
static void * | _SV_LoadGameLibrary (const char *path) |
|
static void * | SV_LoadGameLibrary (const char *game, const char *prefix) |
|
void | SV_InitGameProgs (void) |
|
◆ CHECK_PARAMS
Value: if (volume < 0 || volume > 1.0) \
Com_Error(ERR_DROP, "%s: volume = %f", __func__, volume); \
if (attenuation < 0 || attenuation > 4) \
Com_Error(ERR_DROP, "%s: attenuation = %f", __func__, attenuation); \
if (timeofs < 0 || timeofs > 0.255) \
Com_Error(ERR_DROP, "%s: timeofs = %f", __func__, timeofs); \
if (soundindex < 0 || soundindex >= MAX_SOUNDS) \
Com_Error(ERR_DROP, "%s: soundindex = %d", __func__, soundindex);
Definition at line 501 of file game.c.
◆ _SV_LoadGameLibrary()
static void* _SV_LoadGameLibrary |
( |
const char * |
path | ) |
|
|
static |
◆ PF_AddCommandString()
static void PF_AddCommandString |
( |
const char * |
string | ) |
|
|
static |
◆ PF_AreasConnected()
static qboolean PF_AreasConnected |
( |
int |
area1, |
|
|
int |
area2 |
|
) |
| |
|
static |
◆ PF_bprintf()
static void PF_bprintf |
( |
int |
level, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
Definition at line 140 of file game.c.
143 char string[MAX_STRING_CHARS];
148 va_start(argptr, fmt);
149 len =
Q_vsnprintf(
string,
sizeof(
string), fmt, argptr);
152 if (len >=
sizeof(
string)) {
153 Com_WPrintf(
"%s: overflow\n", __func__);
161 MSG_WriteData(
string, len + 1);
166 for (i = 0; i < len; i++)
168 Com_Printf(
"%s",
string);
Referenced by SV_InitGameProgs().
◆ PF_centerprintf()
static void PF_centerprintf |
( |
edict_t * |
ent, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
Definition at line 266 of file game.c.
268 char msg[MAX_STRING_CHARS];
279 Com_WPrintf(
"%s to a non-client %d\n", __func__, n - 1);
283 va_start(argptr, fmt);
287 if (len >=
sizeof(
msg)) {
288 Com_WPrintf(
"%s: overflow\n", __func__);
293 MSG_WriteData(
msg, len + 1);
Referenced by SV_InitGameProgs().
◆ PF_configstring()
static void PF_configstring |
( |
int |
index, |
|
|
const char * |
val |
|
) |
| |
|
static |
Definition at line 356 of file game.c.
362 if (index < 0 || index >= MAX_CONFIGSTRINGS)
363 Com_Error(ERR_DROP,
"%s: bad index: %d", __func__, index);
366 Com_WPrintf(
"%s: not yet initialized\n", __func__);
375 maxlen = (MAX_CONFIGSTRINGS - index) * MAX_QPATH;
378 "%s: index %d overflowed: %"PRIz
" > %"PRIz,
379 __func__, index, len, maxlen - 1);
383 maxlen = CS_SIZE(index);
386 "%s: index %d overflowed: %"PRIz
" > %"PRIz
"\n",
387 __func__, index, len, maxlen - 1);
392 if (!strncmp(dst, val, len)) {
397 memcpy(dst, val, len);
409 MSG_WriteData(val, len);
Referenced by PF_FindIndex(), and SV_InitGameProgs().
◆ PF_cprintf()
static void PF_cprintf |
( |
edict_t * |
ent, |
|
|
int |
level, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
Definition at line 211 of file game.c.
213 char msg[MAX_STRING_CHARS];
219 va_start(argptr, fmt);
223 if (len >=
sizeof(
msg)) {
224 Com_WPrintf(
"%s: overflow\n", __func__);
235 Com_Error(ERR_DROP,
"%s to a non-client %d", __func__, clientNum);
240 Com_WPrintf(
"%s to a free/zombie client %d\n", __func__, clientNum);
246 MSG_WriteData(
msg, len + 1);
Referenced by SV_InitGameProgs().
◆ PF_cvar()
static cvar_t* PF_cvar |
( |
const char * |
name, |
|
|
const char * |
value, |
|
|
int |
flags |
|
) |
| |
|
static |
Definition at line 717 of file game.c.
719 if (flags & CVAR_EXTENDED_MASK) {
720 Com_WPrintf(
"Game attemped to set extended flags on '%s', masked out.\n", name);
721 flags &= ~CVAR_EXTENDED_MASK;
724 return Cvar_Get(name, value, flags | CVAR_GAME);
Referenced by SV_InitGameProgs().
◆ PF_DebugGraph()
static void PF_DebugGraph |
( |
float |
value, |
|
|
int |
color |
|
) |
| |
|
static |
◆ PF_dprintf()
static void PF_dprintf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
◆ PF_error()
static q_noreturn void PF_error |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
◆ PF_FindIndex()
static int PF_FindIndex |
( |
const char * |
name, |
|
|
int |
start, |
|
|
int |
max |
|
) |
| |
|
static |
◆ PF_FreeTags()
static void PF_FreeTags |
( |
unsigned |
tag | ) |
|
|
static |
◆ PF_ImageIndex()
static int PF_ImageIndex |
( |
const char * |
name | ) |
|
|
static |
◆ PF_inPHS()
static qboolean PF_inPHS |
( |
vec3_t |
p1, |
|
|
vec3_t |
p2 |
|
) |
| |
|
static |
◆ PF_inPVS()
static qboolean PF_inPVS |
( |
vec3_t |
p1, |
|
|
vec3_t |
p2 |
|
) |
| |
|
static |
◆ PF_inVIS()
static qboolean PF_inVIS |
( |
vec3_t |
p1, |
|
|
vec3_t |
p2, |
|
|
int |
vis |
|
) |
| |
|
static |
Definition at line 427 of file game.c.
429 mleaf_t *leaf1, *leaf2;
430 byte mask[VIS_MAX_BYTES];
431 bsp_t *bsp =
sv.
cm.cache;
434 Com_Error(ERR_DROP,
"%s: no map loaded", __func__);
441 if (leaf2->cluster == -1)
443 if (!Q_IsBitSet(mask, leaf2->cluster))
Referenced by PF_inPHS(), and PF_inPVS().
◆ PF_ModelIndex()
static int PF_ModelIndex |
( |
const char * |
name | ) |
|
|
static |
◆ PF_Pmove()
void PF_Pmove |
( |
pmove_t * |
pm | ) |
|
◆ PF_PositionedSound()
static void PF_PositionedSound |
( |
vec3_t |
origin, |
|
|
edict_t * |
entity, |
|
|
int |
channel, |
|
|
int |
soundindex, |
|
|
float |
volume, |
|
|
float |
attenuation, |
|
|
float |
timeofs |
|
) |
| |
|
static |
Definition at line 651 of file game.c.
660 Com_Error(ERR_DROP,
"%s: NULL origin", __func__);
665 sendchan = (ent << 3) | (channel & 7);
668 flags = SND_ENT | SND_POS;
669 if (volume != DEFAULT_SOUND_PACKET_VOLUME)
671 if (attenuation != DEFAULT_SOUND_PACKET_ATTENUATION)
672 flags |= SND_ATTENUATION;
680 if (flags & SND_VOLUME)
682 if (flags & SND_ATTENUATION)
684 if (flags & SND_OFFSET)
692 if (attenuation == ATTN_NONE || (channel & CHAN_NO_PHS_ADD)) {
693 if (channel & CHAN_RELIABLE) {
699 if (channel & CHAN_RELIABLE) {
Referenced by SV_InitGameProgs().
◆ PF_SetAreaPortalState()
static void PF_SetAreaPortalState |
( |
int |
portalnum, |
|
|
qboolean |
open |
|
) |
| |
|
static |
◆ PF_setmodel()
static void PF_setmodel |
( |
edict_t * |
ent, |
|
|
const char * |
name |
|
) |
| |
|
static |
Definition at line 326 of file game.c.
332 Com_Error(ERR_DROP,
"PF_setmodel: NULL");
336 ent->s.modelindex = i;
339 if (name[0] ==
'*') {
340 mod = CM_InlineModel(&
sv.
cm, name);
341 VectorCopy(mod->mins, ent->mins);
342 VectorCopy(mod->maxs, ent->maxs);
Referenced by SV_InitGameProgs().
◆ PF_SoundIndex()
static int PF_SoundIndex |
( |
const char * |
name | ) |
|
|
static |
◆ PF_StartSound()
static void PF_StartSound |
( |
edict_t * |
edict, |
|
|
int |
channel, |
|
|
int |
soundindex, |
|
|
float |
volume, |
|
|
float |
attenuation, |
|
|
float |
timeofs |
|
) |
| |
|
static |
Definition at line 511 of file game.c.
520 byte mask[VIS_MAX_BYTES];
534 if ((
g_features->integer & GMF_PROPERINUSE) && !edict->inuse) {
535 Com_DPrintf(
"%s: entnum not in use: %d\n", __func__, ent);
539 sendchan = (ent << 3) | (channel & 7);
543 if (volume != DEFAULT_SOUND_PACKET_VOLUME)
545 if (attenuation != DEFAULT_SOUND_PACKET_ATTENUATION)
546 flags |= SND_ATTENUATION;
552 if (attenuation == ATTN_NONE) {
553 channel |= CHAN_NO_PHS_ADD;
563 if (!(channel & CHAN_NO_PHS_ADD)) {
565 ps = &client->
edict->client->ps;
566 VectorMA(ps->viewoffset, 0.125f, ps->pmove.origin,
origin);
568 area = CM_LeafArea(leaf);
583 if (edict->solid == SOLID_BSP) {
584 VectorAvg(edict->mins, edict->maxs,
origin);
587 VectorCopy(edict->s.origin,
origin);
592 if (channel & CHAN_RELIABLE) {
597 if (flags & SND_VOLUME)
599 if (flags & SND_ATTENUATION)
601 if (flags & SND_OFFSET)
612 Com_WPrintf(
"%s: %s: out of message slots\n",
613 __func__, client->
name);
618 if (edict->svflags & SVF_NOCLIENT) {
623 if (edict->solid == SOLID_BSP && client->
protocol == PROTOCOL_VERSION_DEFAULT) {
631 msg->index = soundindex;
632 msg->volume = volume * 255;
633 msg->attenuation = attenuation * 64;
634 msg->timeofs = timeofs * 1000;
635 msg->sendchan = sendchan;
636 for (i = 0; i < 3; i++) {
640 List_Remove(&
msg->entry);
648 volume * 255, attenuation * 64, timeofs * 1000);
Referenced by SV_InitGameProgs().
◆ PF_TagMalloc()
static void* PF_TagMalloc |
( |
size_t |
size, |
|
|
unsigned |
tag |
|
) |
| |
|
static |
◆ PF_Unicast()
static void PF_Unicast |
( |
edict_t * |
ent, |
|
|
qboolean |
reliable |
|
) |
| |
|
static |
Definition at line 81 of file game.c.
84 int cmd, flags, clientNum;
92 Com_WPrintf(
"%s to a non-client %d\n", __func__, clientNum);
98 Com_WPrintf(
"%s to a free/zombie client %d\n", __func__, clientNum);
103 Com_DPrintf(
"%s with empty data\n", __func__);
121 if (cmd == svc_disconnect) {
Referenced by PF_centerprintf(), and SV_InitGameProgs().
◆ PF_WriteFloat()
static void PF_WriteFloat |
( |
float |
f | ) |
|
|
static |
◆ SV_InitGameProgs()
Definition at line 841 of file game.c.
843 game_import_t
import;
844 game_export_t *(*entry)(game_import_t *) = NULL;
854 if (!entry &&
fs_game->string[0]) {
869 Com_Error(ERR_DROP,
"Failed to load game library");
928 Com_Error(ERR_DROP,
"Game DLL returned NULL exports");
931 if (
ge->apiversion != GAME_API_VERSION) {
932 Com_Error(ERR_DROP,
"Game DLL is version %d, expected %d",
933 ge->apiversion, GAME_API_VERSION);
940 if (
ge->edict_size <
sizeof(edict_t) ||
ge->edict_size > SIZE_MAX / MAX_EDICTS) {
941 Com_Error(ERR_DROP,
"Game DLL returned bad size of edict_t");
946 Com_Error(ERR_DROP,
"Game DLL returned bad number of max_edicts");
Referenced by SV_InitGame().
◆ SV_LoadGameLibrary()
static void* SV_LoadGameLibrary |
( |
const char * |
game, |
|
|
const char * |
prefix |
|
) |
| |
|
static |
Definition at line 812 of file game.c.
814 char path[MAX_OSPATH];
818 PATH_SEP_STRING,
game, PATH_SEP_STRING,
819 prefix,
"game" CPUSTRING LIBSUFFIX, NULL);
820 if (len >=
sizeof(path)) {
821 Com_EPrintf(
"Game library path length exceeded\n");
825 if (os_access(path, F_OK)) {
827 Com_Printf(
"Can't access %s: %s\n", path, strerror(errno));
Referenced by SV_InitGameProgs().
◆ SV_ShutdownGameProgs()
◆ game_library
◆ ge
Definition at line 22 of file game.c.
Referenced by build_gamestate(), dummy_command(), dummy_create(), dummy_run(), dummy_spawn(), emit_frame(), PF_LinkEdict(), read_level_file(), read_server_file(), SV_Begin_f(), SV_CheckForSavegame(), SV_ClearWorld(), SV_ClientThink(), SV_DropClient(), SV_ExecuteUserCommand(), SV_InitGame(), SV_InitGameProgs(), SV_PrepWorldFrame(), SV_RunGameFrame(), SV_ServerCommand_f(), SV_Shutdown(), SV_ShutdownGameProgs(), SV_SpawnServer(), SV_Trace(), SV_UserinfoChanged(), SVC_DirectConnect(), write_level_file(), and write_server_file().
static qboolean PF_inPVS(vec3_t p1, vec3_t p2)
cvar_t * Cvar_Set(const char *var_name, const char *value)
void SV_MvdStartSound(int entnum, int channel, int flags, int soundindex, int volume, int attenuation, int timeofs)
static qboolean PF_inVIS(vec3_t p1, vec3_t p2, int vis)
static void PF_AddCommandString(const char *string)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
byte * BSP_ClusterVis(bsp_t *bsp, byte *mask, int cluster, int vis)
static void PF_bprintf(int level, const char *fmt,...)
static cvar_t * PF_cvar(const char *name, const char *value, int flags)
static void * _SV_LoadGameLibrary(const char *path)
void SV_MvdUnicast(edict_t *ent, int clientNum, qboolean reliable)
static void PF_PositionedSound(vec3_t origin, edict_t *entity, int channel, int soundindex, float volume, float attenuation, float timeofs)
size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr)
static int PF_ImageIndex(const char *name)
void MSG_WriteByte(int c)
void SCR_DebugGraph(float value, int color)
void SV_Multicast(vec3_t origin, multicast_t to)
static void PF_setmodel(edict_t *ent, const char *name)
mleaf_t * BSP_PointLeaf(mnode_t *node, vec3_t p)
void PF_LinkEdict(edict_t *ent)
void SV_ClientAddMessage(client_t *client, int flags)
#define FOR_EACH_CLIENT(client)
int SV_AreaEdicts(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount, int areatype)
qboolean CM_AreasConnected(cm_t *cm, int area1, int area2)
static void PF_SetAreaPortalState(int portalnum, qboolean open)
void MSG_WritePos(const vec3_t pos)
void * Z_TagMalloc(size_t size, memtag_t tag)
void Com_Error(error_type_t type, const char *fmt,...)
static q_noreturn void PF_error(const char *fmt,...)
void PF_Pmove(pmove_t *pm)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
void Pmove(pmove_t *pmove, pmoveParams_t *params)
void PF_UnlinkEdict(edict_t *ent)
static int PF_ModelIndex(const char *name)
static void PF_centerprintf(edict_t *ent, const char *fmt,...)
static void PF_DebugGraph(float value, int color)
void Com_LPrintf(print_type_t type, const char *fmt,...)
char * Com_GetLastError(void)
void MSG_WriteShort(int c)
cvar_t * Cvar_UserSet(const char *var_name, const char *value)
static void PF_dprintf(const char *fmt,...)
static void PF_WriteFloat(float f)
void * Sys_LoadLibrary(const char *path, const char *sym, void **handle)
void MSG_WriteString(const char *string)
void MSG_WriteLong(int c)
static qboolean PF_inPHS(vec3_t p1, vec3_t p2)
cvar_t * sys_forcegamelib
mleaf_t * CM_PointLeaf(cm_t *cm, vec3_t p)
int SV_PointContents(vec3_t p)
static int PF_SoundIndex(const char *name)
static int PF_FindIndex(const char *name, int start, int max)
void SV_ShutdownGameProgs(void)
static void PF_Unicast(edict_t *ent, qboolean reliable)
void Z_FreeTags(memtag_t tag)
void MSG_WriteChar(int c)
size_t msg_unreliable_bytes
list_t msg_unreliable_list
void SV_MvdConfigstring(int index, const char *string, size_t len)
static void * PF_TagMalloc(size_t size, unsigned tag)
size_t Q_concat(char *dest, size_t size,...)
static void * SV_LoadGameLibrary(const char *game, const char *prefix)
void Sys_FreeLibrary(void *handle)
static void PF_cprintf(edict_t *ent, int level, const char *fmt,...)
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
qboolean SV_EdictIsVisible(cm_t *cm, edict_t *ent, byte *mask)
trace_t q_gameabi SV_Trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passedict, int contentmask)
static void PF_StartSound(edict_t *edict, int channel, int soundindex, float volume, float attenuation, float timeofs)
void MSG_WriteDir(const vec3_t dir)
void MSG_WriteAngle(float f)
void CM_SetAreaPortalState(cm_t *cm, int portalnum, qboolean open)
static void PF_configstring(int index, const char *val)
void SZ_Clear(sizebuf_t *buf)
static qboolean PF_AreasConnected(int area1, int area2)
static void * game_library
static void PF_FreeTags(unsigned tag)
void SV_MvdBroadcastPrint(int level, const char *string)
char name[MAX_CLIENT_NAME]