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
56typedef struct leStep_s {
111 char inlineModelName[8];
140 return pathLength > 0;
203#define MAX_LOCALMODELS 1024
206typedef struct localModel_s {
231 void (*think) (
struct localModel_s* localModel);
249const 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)
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.
void(* localEntityThinkFunc_t)(struct le_s *le)
bool(* localEntitiyAddFunc_t)(struct le_s *le, entity_t *ent)
le_t * LE_GetNextInUse(le_t *lastLE)
Iterate through the entities that are in use.
void LE_Cleanup(void)
Cleanup unused LE inventories that the server sent to the client also free some unused LE memory.
void LE_CenterView(const le_t *le)
Center the camera on the local entity's origin.
void LET_RotateDoor(le_t *le, int speed)
Rotates a door in the given speed.
void LE_AddAmbientSound(const char *sound, const vec3_t origin, int levelflags, float volume, float attenuation)
Adds ambient sounds from misc_sound entities.
le_t * LE_GetNext(le_t *lastLE)
Iterate through the list of entities.
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_AddGrenade(const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t v0, int dt, le_t *leVictim)
void LM_Perish(dbuffer *msg)
void LM_AddToScene(void)
Add the local models to the scene.
void CL_RecalcRouting(const le_t *le)
void LM_Register(void)
Register misc_models.
static const vec3_t player_mins
localModel_t * LM_GetByID(const char *id)
void LMT_Init(localModel_t *localModel)
int LE_ActorGetStepTime(const le_t *le, const pos3_t pos, const pos3_t oldPos, const int dir, const int sped)
void _LE_NotFoundError(int entnum, int type, const char *file, const int line) __attribute__((noreturn))
void LE_Unlock(le_t *le)
Unlocks a previously locked le_t struct.
bool LE_IsLivingAndVisibleActor(const le_t *le)
Checks whether the given le is a living and visible actor.
bool LE_BrushModelAction(le_t *le, entity_t *ent)
Add function for brush models.
void CL_CompleteRecalcRouting(void)
void LET_HiddenMove(le_t *le)
Handle move for invisible actors.
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.
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_IsLivingActor(const le_t *le)
Checks whether the given le is a living actor (but might be hidden)
void LET_BrushModel(le_t *le)
le_t * LE_GetFromPos(const pos3_t pos)
Searches a local entity on a given grid field.
const cBspModel_t * LE_GetClipModel(const le_t *le)
void LE_DoEndPathMove(le_t *le)
Ends the move of an actor.
cvar_t * cl_map_draw_rescue_zone
le_t * LE_Add(int entnum)
Add a new local entity to the scene.
static const vec3_t player_maxs
void LE_SetThink(le_t *le, localEntityThinkFunc_t think)
actorModes_t
Actor actions.
void LET_SlideDoor(le_t *le, int speed)
Slides a door.
void LET_Appear(le_t *le)
void LE_LinkFloorContainer(le_t *le)
link any floor container into the actor temp floor container
void LE_PlaceItem(le_t *le)
void LET_StartIdle(le_t *le)
Change the animation of an actor to the idle animation (which can be panic, dead or stand)
static const vec3_t player_dead_maxs
void LE_AddProjectile(const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t impact, int normal, le_t *leVictim)
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,...
model_t * LE_GetDrawModel(unsigned int modelIndex)
le_t * LE_Find(entity_type_t type, 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.
bool LE_IsLocked(int entnum)
Checks if a given le_t structure is locked, i.e., used by another event at this time.
void LE_Think(void)
Calls the le think function and updates the animation. The animation updated even if the particular l...
le_t * LE_Get(int entnum)
Searches all local entities for the one with the searched entnum.
bool LE_IsActor(const le_t *le)
Checks whether the given le is a living actor.
const char * LE_GetAnim(const char *anim, int right, int left, int state)
Get the correct animation for the given actor state and weapons.
inventory definition with all its containers
Item * getLeftHandContainer() const
Item * getFloorContainer() const
Item * getRightHandContainer() const
void setFloorContainer(Item *cont)
item instance data, with linked list capability
short dvec_t
The direction vector tells us where the actor came from (in his previous step). The pathing table hol...
QGL_EXTERN void(APIENTRY *qglActiveTexture)(GLenum texture)
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
this is a fire definition for our weapons/ammo
Item * getLeftHandItem() const
fireDefIndex_t currentSelectedFiremode
actorSizeEnum_t fieldSize
Item * getRightHandItem() const
localEntitiyAddFunc_t addFunc
localEntityThinkFunc_t think
void setFloorContainer(Item *il)
byte actorMoveLength
The TUs that the current selected actor needs to walk to the current grid position marked by the mous...
struct le_s * clientAction
void setFloor(le_s *other)
Item * getFloorContainer() const
Item * getHandItem(actorHands_t hand) const
lighting structure which contains static and dynamic lighting info for entities
void setScale(const vec3_t scale_)
struct localModel_s * parent
static const vec3_t scale
#define VectorCopy(src, dest)