27 #include "../renderer/r_entity.h"
40 #define IS_MODE_FIRE_RIGHT(x) ((x) == M_FIRE_R || (x) == M_PEND_FIRE_R)
41 #define IS_MODE_FIRE_LEFT(x) ((x) == M_FIRE_L || (x) == M_PEND_FIRE_L)
42 #define IS_MODE_FIRE_HEADGEAR(x) ((x) == M_FIRE_HEADGEAR)
43 #define IS_MODE_FIRE_PENDING(x) ((x) == M_PEND_FIRE_L || (x) == M_PEND_FIRE_R)
48 #define LE_CHECK_LEVELFLAGS 0x0001
49 #define LE_ALWAYS_VISIBLE 0x0002
50 #define LE_LOCKED 0x0004
52 #define LE_REMOVE_NEXT_FRAME 0x0008
53 #define LE_INVISIBLE 0x0010
54 #define LE_SELECTED 0x0020
56 typedef struct leStep_s {
140 return pathLength > 0;
203 #define MAX_LOCALMODELS 1024
249 const char*
LE_GetAnim(
const char* anim,
int right,
int left,
int state);
255 #define LE_IsStunned(le) (((le)->state & STATE_STUN) & ~STATE_DEAD)
257 #define LE_IsDead(le) ((le)->state & STATE_DEAD)
258 #define LE_IsPanicked(le) ((le)->state & STATE_PANIC)
259 #define LE_IsRaged(le) ((le)->state & STATE_RAGE)
260 #define LE_IsInsane(le) ((le)->state & STATE_INSANE)
261 #define LE_IsShaken(le) ((le)->state & STATE_SHAKEN)
262 #define LE_IsCrouched(le) ((le)->state & STATE_CROUCHED)
263 #define LE_IsDazed(le) ((le)->state & STATE_DAZED)
265 #define LE_IsInvisible(le) ((le)->flags & LE_INVISIBLE)
266 #define LE_IsSelected(le) ((le)->flags & LE_SELECTED)
268 #define LE_SetInvisible(le) do { if (cl_leshowinvis->integer) le->flags &= ~LE_INVISIBLE; else le->flags |= LE_INVISIBLE; } while (0)
270 #define LE_IsItem(le) ((le)->type == ET_ITEM)
271 #define LE_IsCamera(le) ((le)->type == ET_CAMERA)
272 #define LE_IsCivilian(le) ((le)->team == TEAM_CIVILIAN)
273 #define LE_IsAlien(le) ((le)->team == TEAM_ALIEN)
274 #define LE_IsPhalanx(le) ((le)->team == TEAM_PHALANX)
275 #define LE_IsRotating(le) ((le)->type == ET_ROTATING)
276 #define LE_IsDoor(le) ((le)->type == ET_DOOR || (le)->type == ET_DOOR_SLIDING)
277 #define LE_IsBreakable(le) ((le)->type == ET_BREAKABLE)
278 #define LE_IsBrushModel(le) (LE_IsBreakable(le) || LE_IsDoor(le) || LE_IsRotating(le))
279 #define LE_IsNotSolid(le) ((le)->type == ET_TRIGGER_RESCUE || (le)->type == ET_TRIGGER_NEXTMAP)
282 #define LE_GetAnimationIndexForDeath(le) ((le)->state & MAX_DEATH)
285 void LE_List_f(
void);
286 void LM_List_f(
void);
322 #define LE_NotFoundError(entnum) _LE_NotFoundError(entnum, -1, __FILE__, __LINE__)
323 #define LE_NotFoundWithTypeError(entnum, type) _LE_NotFoundError(entnum, type, __FILE__, __LINE__)
void LET_StartPathMove(le_t *le)
Change the actors animation to walking.
#define VectorCopy(src, dest)
void LE_Think(void)
Calls the le think function and updates the animation. The animation updated even if the particular l...
void LMT_Init(localModel_t *localModel)
Item * getLeftHandItem() const
QGL_EXTERN GLint GLenum type
void _LE_NotFoundError(int entnum, int type, const char *file, const int line) __attribute__((noreturn))
this is a fire definition for our weapons/ammo
void setFloorContainer(Item *il)
static const vec3_t scale
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
bool LE_IsActor(const le_t *le)
Checks whether the given le is a living actor.
void LET_Appear(le_t *le)
void LE_AddAmbientSound(const char *sound, const vec3_t origin, int levelflags, float volume, float attenuation)
Adds ambient sounds from misc_sound entities.
void LET_BrushModel(le_t *le)
bool LE_BrushModelAction(le_t *le, entity_t *ent)
Add function for brush models.
Item * getLeftHandContainer() const
bool LE_IsLivingActor(const le_t *le)
Checks whether the given le is a living actor (but might be hidden)
struct le_s * clientAction
struct le_s le_t
a local entity
localModel_t * LM_GetByID(const char *id)
struct localModel_s localModel_t
local models
struct localModel_s * parent
void LM_AddToScene(void)
Add the local models to the scene.
Item * getFloorContainer() const
lighting structure which contains static and dynamic lighting info for entities
le_t * LE_FindRadius(le_t *from, const vec3_t org, float rad, entity_type_t type)
Returns entities that have origins within a spherical area.
void setScale(const vec3_t scale_)
void LET_RotateDoor(le_t *le, int speed)
Rotates a door in the given speed.
void CL_CompleteRecalcRouting(void)
void LET_StartIdle(le_t *le)
Change the animation of an actor to the idle animation (which can be panic, dead or stand) ...
actorModes_t
Actor actions.
actorSizeEnum_t fieldSize
Item * getRightHandItem() const
item instance data, with linked list capability
le_t * LE_Find(entity_type_t type, const pos3_t pos)
Searches a local entity on a given grid field.
inventory definition with all its containers
void LET_HiddenMove(le_t *le)
Handle move for invisible actors.
le_t * LE_GetFromPos(const pos3_t pos)
Searches a local entity on a given grid field.
void LE_ExecuteThink(le_t *le)
Call think function for the given local entity if its still in use.
Item * getRightHandContainer() const
void(* localEntityThinkFunc_t)(struct le_s *le)
void LET_SlideDoor(le_t *le, int speed)
Slides a door.
static const vec3_t player_dead_maxs
void LE_PlaceItem(le_t *le)
localEntitiyAddFunc_t addFunc
int LE_ActorGetStepTime(const le_t *le, const pos3_t pos, const pos3_t oldPos, const int dir, const int sped)
Item * getFloorContainer() const
const cBspModel_t * LE_GetClipModel(const le_t *le)
bool(* localEntitiyAddFunc_t)(struct le_s *le, entity_t *ent)
static const vec3_t player_mins
bool LE_IsLivingAndVisibleActor(const le_t *le)
Checks whether the given le is a living and visible actor.
void LE_Cleanup(void)
Cleanup unused LE inventories that the server sent to the client also free some unused LE memory...
const GLuint *typedef void(APIENTRY *GenRenderbuffersEXT_t)(GLsizei
cvar_t * cl_map_draw_rescue_zone
void LE_Lock(le_t *le)
Markes a le_t struct as locked. Should be called at the beginning of an event handler on this le_t...
void LE_Unlock(le_t *le)
Unlocks a previously locked le_t struct.
int pathContents[MAX_ROUTE]
Item * getHandItem(actorHands_t hand) const
localEntityThinkFunc_t think
void LM_Register(void)
Register misc_models.
byte actorMoveLength
The TUs that the current selected actor needs to walk to the current grid position marked by the mous...
void setFloorContainer(Item *cont)
void LE_DoEndPathMove(le_t *le)
Ends the move of an actor.
void CL_RecalcRouting(const le_t *le)
void LE_LinkFloorContainer(le_t *le)
link any floor container into the actor temp floor container
void LM_Perish(dbuffer *msg)
void(* think)(struct localModel_s *localModel)
le_t * LE_GetNextInUse(le_t *lastLE)
Iterate through the entities that are in use.
void LE_AddProjectile(const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t impact, int normal, le_t *leVictim)
short dvec_t
The direction vector tells us where the actor came from (in his previous step). The pathing table hol...
model_t * LE_GetDrawModel(unsigned int modelIndex)
le_t * LE_Get(int entnum)
Searches all local entities for the one with the searched entnum.
void LE_AddGrenade(const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t v0, int dt, le_t *leVictim)
void LE_CenterView(const le_t *le)
Center the camera on the local entity's origin.
void setFloor(le_s *other)
fireDefIndex_t currentSelectedFiremode
localModel_t * LM_AddModel(const char *model, const vec3_t origin, const vec3_t angles, int entnum, int levelflags, int flags, const vec3_t scale)
Prepares local (not known or handled by the server) models to the map, which will be added later in L...
bool LE_IsLocked(int entnum)
Checks if a given le_t structure is locked, i.e., used by another event at this time.
le_t * LE_Add(int entnum)
Add a new local entity to the scene.
const char * LE_GetAnim(const char *anim, int right, int left, int state)
Get the correct animation for the given actor state and weapons.
static const vec3_t player_maxs
trace_t CL_Trace(const Line &traceLine, const AABB &box, const le_t *passle, le_t *passle2, int contentmask, int worldLevel)
Moves the given mins/maxs volume through the world from start to end.
void LE_SetThink(le_t *le, localEntityThinkFunc_t think)
le_t * LE_GetNext(le_t *lastLE)
Iterate through the list of entities.