This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/common/progdefs.h

208 lines
5.5 KiB
C
Raw Normal View History

2008-12-15 22:00:00 +01:00
//=======================================================================
2010-08-15 22:00:00 +02:00
// Copyright XashXT Group 2010 <20>
// progdefs.h - global and entity variables
2008-12-15 22:00:00 +01:00
//=======================================================================
2010-08-15 22:00:00 +02:00
#ifndef PROGDEFS_H
#define PROGDEFS_H
typedef struct globalvars_s
{
float time;
float frametime;
int force_retouch;
string_t mapname;
string_t startspot;
float deathmatch;
float coop;
float teamplay;
int serverflags;
int found_secrets;
vec3_t v_forward;
vec3_t v_up;
vec3_t v_right;
int trace_allsolid;
int trace_startsolid;
float trace_fraction;
vec3_t trace_endpos;
vec3_t trace_plane_normal;
float trace_plane_dist;
edict_t *trace_ent;
int trace_inopen;
int trace_inwater;
int trace_hitgroup;
int trace_flags;
int changelevel; // transition in progress when true (was msg_entity)
int cdAudioTrack;
int maxClients;
int maxEntities;
const char *pStringBase; // set to NULL during initialize if you want use StringTable system
void *pSaveData; // (SAVERESTOREDATA *) pointer
vec3_t vecLandmarkOffset;
} globalvars_t;
2008-12-15 22:00:00 +01:00
typedef struct entvars_s
{
2010-06-23 22:00:00 +02:00
string_t classname;
2009-01-06 22:00:00 +01:00
string_t globalname; // global entity name transmitted across levels
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
vec3_t origin;
vec3_t oldorigin;
2009-01-06 22:00:00 +01:00
vec3_t velocity;
2009-11-02 22:00:00 +01:00
vec3_t basevelocity;
2010-06-23 22:00:00 +02:00
vec3_t clbasevelocity; // Base velocity that was passed in to server physics so
// client can predict conveyors correctly.
// Server zeroes it, so we need to store here, too.
2009-01-06 22:00:00 +01:00
vec3_t movedir;
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
vec3_t angles;
2008-12-21 22:00:00 +01:00
vec3_t avelocity; // angular velocity (degrees per second)
2010-06-23 22:00:00 +02:00
vec3_t punchangle; // auto-decaying view angle adjustment
vec3_t v_angle; // Viewing angle (player only)
2008-12-15 22:00:00 +01:00
2010-08-06 22:00:00 +02:00
// For parametric entities
vec3_t endpos;
vec3_t startpos;
float impacttime;
float starttime;
2009-01-06 22:00:00 +01:00
int fixangle; // 0 - nothing, 1 - force view angles, 2 - add avelocity
2010-06-23 22:00:00 +02:00
float idealpitch;
2009-01-06 22:00:00 +01:00
float pitch_speed;
float ideal_yaw;
float yaw_speed;
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
int modelindex;
2008-12-15 22:00:00 +01:00
2009-01-06 22:00:00 +01:00
string_t model; // model name
2010-08-15 22:00:00 +02:00
int viewmodel; // player's viewmodel
int weaponmodel; // what other players see
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
vec3_t absmin; // BB max translated to world coord
vec3_t absmax; // BB max translated to world coord
vec3_t mins; // local BB min
vec3_t maxs; // local BB max
vec3_t size; // maxs - mins
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
float ltime;
2009-01-06 22:00:00 +01:00
float nextthink; // time to next call of think function
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
int movetype;
int solid;
2009-01-06 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
int skin;
int body; // sub-model selection for studiomodels
int effects;
2009-01-06 22:00:00 +01:00
float gravity; // % of "normal" gravity
float friction; // inverse elasticity of MOVETYPE_BOUNCE
2009-11-15 22:00:00 +01:00
int light_level; // entity current lightlevel
2008-12-15 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
int sequence; // animation sequence
int gaitsequence; // movement animation sequence for player (0 for none)
float frame; // % playback position in animation sequences (0..255)
float animtime; // world time when frame was set
float framerate; // animation playback rate (-8x to 8x)
2010-08-06 22:00:00 +02:00
byte controller[4]; // bone controller setting (0..255)
byte blending[2]; // blending amount between sub-sequences (0..255)
2010-06-23 22:00:00 +02:00
float scale; // sprites and models rendering scale (0..255)
int rendermode;
float renderamt;
vec3_t rendercolor;
int renderfx;
float health;
2008-12-15 22:00:00 +01:00
float frags;
2010-06-23 22:00:00 +02:00
int weapons; // bit mask for available weapons
2008-12-15 22:00:00 +01:00
float takedamage;
int deadflag;
2010-06-23 22:00:00 +02:00
vec3_t view_ofs; // eye position
2008-12-15 22:00:00 +01:00
int button;
int impulse;
2010-06-23 22:00:00 +02:00
edict_t *chain; // linked list for EntitiesInPVS\PHS
2008-12-15 22:00:00 +01:00
edict_t *dmg_inflictor;
edict_t *enemy;
2010-06-23 22:00:00 +02:00
edict_t *aiment; // entity pointer when MOVETYPE_FOLLOW
edict_t *owner;
edict_t *groundentity; // only if FL_ONGROUND is set
2008-12-15 22:00:00 +01:00
int spawnflags; // spwanflags are used only during level loading
2009-02-01 22:00:00 +01:00
int flags; // generic flags that can be send to client
2009-01-06 22:00:00 +01:00
2008-12-15 22:00:00 +01:00
short colormap; // lowbyte topcolor, highbyte bottomcolor
2010-06-23 22:00:00 +02:00
int team; // for teamplay
2008-12-15 22:00:00 +01:00
float max_health;
2010-06-23 22:00:00 +02:00
float teleport_time; // engine will be reset this value on next frame
2008-12-15 22:00:00 +01:00
int armortype;
float armorvalue;
2010-06-23 22:00:00 +02:00
int waterlevel;
int watertype;
2008-12-15 22:00:00 +01:00
2009-01-06 22:00:00 +01:00
string_t target; // various server strings
2008-12-15 22:00:00 +01:00
string_t targetname;
string_t netname;
string_t message;
2009-01-06 22:00:00 +01:00
float dmg_take;
float dmg_save;
float dmg;
float dmgtime;
2010-06-23 22:00:00 +02:00
string_t noise;
string_t noise1;
string_t noise2;
string_t noise3;
float speed;
float air_finished;
float pain_finished;
float radsuit_finished;
2009-11-10 22:00:00 +01:00
2010-06-23 22:00:00 +02:00
edict_t *pContainingEntity; // filled by engine, don't save, don't modifiy
int playerclass;
float maxspeed; // uses to limit speed for current client
float fov; // client fov, used instead m_iFov
int weaponanim; // FIXME: shorten these ?
2010-10-20 22:00:00 +02:00
int pushmsec; // g-cont. used to store last network frame to prevent add entities
// twice through portals (in HL does nothing)
2010-08-15 22:00:00 +02:00
2009-11-10 22:00:00 +01:00
int bInDuck;
int flTimeStepSound; // Next time we can play a step sound
int flSwimTime; // In process of ducking or ducked already?
int flDuckTime; // Time we started duck
int iStepLeft; // 0 - 4
float flFallVelocity; // falling velocity z
2010-06-23 22:00:00 +02:00
int gamestate;
2009-11-10 22:00:00 +01:00
int oldbuttons; // buttons last usercmd
2009-11-15 22:00:00 +01:00
int groupinfo; // entities culling (on server)
2010-06-23 22:00:00 +02:00
// for mods
int iuser1;
int iuser2;
int iuser3;
int iuser4;
float fuser1;
float fuser2;
float fuser3;
float fuser4;
vec3_t vuser1;
vec3_t vuser2;
vec3_t vuser3;
vec3_t vuser4;
edict_t *euser1;
edict_t *euser2;
edict_t *euser3;
edict_t *euser4;
2008-12-15 22:00:00 +01:00
} entvars_t;
2010-08-15 22:00:00 +02:00
#endif//PROGDEFS_H