UFO: Alien Invasion
Loading...
Searching...
No Matches
g_utils.h
Go to the documentation of this file.
1
5
6/*
7All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9Original file from Quake 2 v3.21: quake2-2.31/game/g_utils.c
10Copyright (C) 1997-2001 Id Software, Inc.
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27*/
28
29#pragma once
30
31#include "g_local.h"
32
33void G_FreeEdict(Edict* e);
35Edict* G_GetEdictFromPosExcluding(const pos3_t pos, const int n, ...);
36bool G_UseEdict(Edict* ent, Edict* activator);
37const char* G_GetWeaponNameForFiredef(const fireDef_t* fd);
38Player* G_GetPlayerForTeam(int team);
39void G_TakeDamage(Edict* ent, int damage);
40bool G_TestLineWithEnts(const vec3_t start, const vec3_t end);
41bool G_TestLine(const vec3_t start, const vec3_t end);
42trace_t G_Trace(const Line& trLine, const Edict* passent, int contentmask);
43const char* G_GetPlayerName(int pnum);
44void G_PrintStats(const char* format, ...) __attribute__((format(__printf__, 1, 2)));
45void G_PrintActorStats(const Edict* victim, const Edict* attacker, const fireDef_t* fd);
46Edict* G_FindRadius(Edict* from, const vec3_t org, float rad, entity_type_t type = ET_NULL);
48void G_GenerateEntList(const char* entList[MAX_EDICTS]);
49void G_RecalcRouting(const char* model, const GridBox& box);
52int G_TouchSolids(Edict* ent, float extend);
53void G_TouchEdicts(Edict* ent, float extend);
54uint32_t G_GetLevelFlagsFromPos(const pos3_t pos);
Definition line.h:31
#define __attribute__(x)
Definition cxx.h:37
#define MAX_EDICTS
Definition defines.h:99
unsigned int playermask_t
Definition g_events.h:34
Local definitions for game module.
void G_GenerateEntList(const char *entList[MAX_EDICTS])
creates an entity list
Definition g_utils.cpp:436
void G_CompleteRecalcRouting(void)
Definition g_utils.cpp:464
void G_RecalcRouting(const char *model, const GridBox &box)
Definition g_utils.cpp:452
playermask_t G_GetClosePlayerMask(const vec3_t origin, float radius)
Assembles a player mask for those players that have a living team member close to the given location.
Definition g_utils.cpp:288
uint32_t G_GetLevelFlagsFromPos(const pos3_t pos)
Calculates the level flags for a given grid position.
Definition g_utils.cpp:650
void G_TouchEdicts(Edict *trigger, float extend)
Call after linking a new trigger in or destroying a bmodel during gameplay to force all entities it c...
Definition g_utils.cpp:625
int G_TouchSolids(Edict *ent, float extend)
Call after making a step to a new grid tile to immediately touch edicts whose bbox intersects with th...
Definition g_utils.cpp:590
int G_TouchTriggers(Edict *ent, const entity_type_t type)
Check the world against triggers for the current entity.
Definition g_utils.cpp:547
void G_PrintActorStats(const Edict *victim, const Edict *attacker, const fireDef_t *fd)
Prints stats about who killed who with what and how.
Definition g_utils.cpp:336
Edict * G_FindRadius(Edict *from, const vec3_t org, float rad, entity_type_t type)
Returns entities that have origins within a spherical area.
Definition g_utils.cpp:408
Edict * G_GetEdictFromPos(const pos3_t pos, const entity_type_t type)
Searches an edict of the given type at the given grid location.
Definition g_utils.cpp:59
bool G_UseEdict(Edict *ent, Edict *activator)
Call the 'use' function for the given edict and all its group members.
Definition g_utils.cpp:117
trace_t G_Trace(const Line &trLine, const Edict *passent, int contentmask)
collision detection - this version is more accurate and includes entity tests
Definition g_utils.cpp:265
const char * G_GetPlayerName(int pnum)
Returns the player name for a give player number.
Definition g_utils.cpp:275
void G_TakeDamage(Edict *ent, int damage)
Applies the given damage value to an edict that is either an actor or has the FL_DESTROYABLE flag set...
Definition g_utils.cpp:215
bool G_TestLine(const vec3_t start, const vec3_t end)
fast version of a line trace but without including entities
Definition g_utils.cpp:253
bool G_TestLineWithEnts(const vec3_t start, const vec3_t end)
fast version of a line trace including entities
Definition g_utils.cpp:237
void G_FreeEdict(Edict *e)
Marks the edict as free.
Definition g_utils.cpp:41
void G_PrintStats(const char *format,...) __attribute__((format(__printf__
const char * G_GetWeaponNameForFiredef(const fireDef_t *fd)
Returns the corresponding weapon name for a given fire definition.
Definition g_utils.cpp:173
Player * G_GetPlayerForTeam(int team)
Gets player for given team.
Definition g_utils.cpp:188
Edict * G_GetEdictFromPosExcluding(const pos3_t pos, const int n,...)
Searches an edict that is not of the given types at the given grid location.
Definition g_utils.cpp:81
voidpf uLong int origin
Definition ioapi.h:45
entity_type_t
Definition q_shared.h:145
@ ET_NULL
Definition q_shared.h:146
void format(__printf__, 1, 2)))
QGL_EXTERN GLint GLenum type
Definition r_gl.h:94
this is a fire definition for our weapons/ammo
Definition inv_shared.h:110
pos_t pos3_t[3]
Definition ufotypes.h:58
vec_t vec3_t[3]
Definition ufotypes.h:39