2023-09-30 14:49:35 +02:00
|
|
|
|
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
2010-07-22 01:46:14 -05:00
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
// $NoKeywords: $
|
|
|
|
|
//
|
|
|
|
|
//=============================================================================//
|
|
|
|
|
#ifndef CONST_H
|
|
|
|
|
#define CONST_H
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// the command line param that tells the engine to use steam
|
|
|
|
|
#define STEAM_PARM "-steam"
|
|
|
|
|
// the command line param to tell dedicated server to restart
|
|
|
|
|
// if they are out of date
|
|
|
|
|
#define AUTO_RESTART "-autoupdate"
|
|
|
|
|
|
|
|
|
|
// the message a server sends when a clients steam login is expired
|
|
|
|
|
#define INVALID_STEAM_TICKET "Invalid STEAM UserID Ticket\n"
|
|
|
|
|
#define INVALID_STEAM_LOGON "No Steam logon\n"
|
|
|
|
|
#define INVALID_STEAM_VACBANSTATE "VAC banned from secure server\n"
|
|
|
|
|
#define INVALID_STEAM_LOGGED_IN_ELSEWHERE "This Steam account is being used in another location\n"
|
|
|
|
|
|
|
|
|
|
// This is the default, see shareddefs.h for mod-specific value, which can override this
|
|
|
|
|
#define DEFAULT_TICK_INTERVAL (1.0f / 60.0f) // 16.666667 msec is the default
|
|
|
|
|
#define MINIMUM_TICK_INTERVAL (0.001)
|
|
|
|
|
#define MAXIMUM_TICK_INTERVAL (0.1)
|
|
|
|
|
|
|
|
|
|
// This is the max # of players the engine can handle
|
|
|
|
|
// Note, must be power of 2
|
|
|
|
|
#define ABSOLUTE_PLAYER_LIMIT 64
|
|
|
|
|
#define ABSOLUTE_PLAYER_LIMIT_DW ( (ABSOLUTE_PLAYER_LIMIT/32) + 1 )
|
|
|
|
|
|
|
|
|
|
#if ABSOLUTE_PLAYER_LIMIT > 32
|
|
|
|
|
#define CPlayerBitVec CBitVec<ABSOLUTE_PLAYER_LIMIT>
|
|
|
|
|
#else
|
|
|
|
|
#define CPlayerBitVec CDWordBitVec
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// a player name may have 31 chars + 0 on the PC.
|
|
|
|
|
// the 360 only allows 15 char + 0, but stick with the larger PC size for cross-platform communication
|
|
|
|
|
#define MAX_PLAYER_NAME_LENGTH 32
|
|
|
|
|
|
|
|
|
|
#ifdef _X360
|
|
|
|
|
#define MAX_PLAYERS_PER_CLIENT XUSER_MAX_COUNT // Xbox 360 supports 4 players per console
|
|
|
|
|
#else
|
|
|
|
|
#define MAX_PLAYERS_PER_CLIENT 1 // One player per PC
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define MAX_MAP_NAME 32
|
|
|
|
|
#define MAX_NETWORKID_LENGTH 64 // num chars for a network (i.e steam) ID
|
|
|
|
|
|
|
|
|
|
// BUGBUG: Reconcile with or derive this from the engine's internal definition!
|
|
|
|
|
// FIXME: I added an extra bit because I needed to make it signed
|
|
|
|
|
#define SP_MODEL_INDEX_BITS 11
|
|
|
|
|
|
|
|
|
|
// How many bits to use to encode an edict.
|
2023-10-16 22:01:20 +03:00
|
|
|
|
#define MAX_EDICT_BITS 14 // # of bits needed to represent max edicts
|
2010-07-22 01:46:14 -05:00
|
|
|
|
// Max # of edicts in a level
|
|
|
|
|
#define MAX_EDICTS (1<<MAX_EDICT_BITS)
|
|
|
|
|
|
|
|
|
|
// How many bits to use to encode an server class index
|
|
|
|
|
#define MAX_SERVER_CLASS_BITS 9
|
|
|
|
|
// Max # of networkable server classes
|
|
|
|
|
#define MAX_SERVER_CLASSES (1<<MAX_SERVER_CLASS_BITS)
|
|
|
|
|
|
|
|
|
|
#define SIGNED_GUID_LEN 32 // Hashed CD Key (32 hex alphabetic chars + 0 terminator )
|
|
|
|
|
|
|
|
|
|
// Used for networking ehandles.
|
|
|
|
|
#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 2)
|
|
|
|
|
#define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS)
|
|
|
|
|
#define INVALID_EHANDLE_INDEX 0xFFFFFFFF
|
|
|
|
|
|
2023-09-30 14:49:35 +02:00
|
|
|
|
#define NUM_SERIAL_NUM_BITS 17 // (32 - NUM_ENT_ENTRY_BITS)
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS)
|
|
|
|
|
#define ENT_ENTRY_MASK (( 1 << NUM_SERIAL_NUM_BITS) - 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Networked ehandles use less bits to encode the serial number.
|
|
|
|
|
#define NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS 10
|
|
|
|
|
#define NUM_NETWORKED_EHANDLE_BITS (MAX_EDICT_BITS + NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS)
|
|
|
|
|
#define INVALID_NETWORKED_EHANDLE_VALUE ((1 << NUM_NETWORKED_EHANDLE_BITS) - 1)
|
|
|
|
|
|
|
|
|
|
// This is the maximum amount of data a PackedEntity can have. Having a limit allows us
|
|
|
|
|
// to use static arrays sometimes instead of allocating memory all over the place.
|
|
|
|
|
#define MAX_PACKEDENTITY_DATA (16384)
|
|
|
|
|
|
|
|
|
|
// This is the maximum number of properties that can be delta'd. Must be evenly divisible by 8.
|
|
|
|
|
#define MAX_PACKEDENTITY_PROPS (4096)
|
|
|
|
|
|
|
|
|
|
// a client can have up to 4 customization files (logo, sounds, models, txt).
|
|
|
|
|
#define MAX_CUSTOM_FILES 4 // max 4 files
|
|
|
|
|
#define MAX_CUSTOM_FILE_SIZE 131072
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Constants shared by the engine and dlls
|
|
|
|
|
// This header file included by engine files and DLL files.
|
|
|
|
|
// Most came from server.h
|
|
|
|
|
|
|
|
|
|
// CBaseEntity::m_fFlags
|
|
|
|
|
// PLAYER SPECIFIC FLAGS FIRST BECAUSE WE USE ONLY A FEW BITS OF NETWORK PRECISION
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_ONGROUND (1<<0) // At rest / on the ground
|
|
|
|
|
#define FL_DUCKING (1<<1) // Player flag -- Player is fully crouched
|
|
|
|
|
#define FL_WATERJUMP (1<<2) // player jumping out of water
|
|
|
|
|
#define FL_NOCLIP (1<<3) // Forces MOVETYPE_NOCLIP on the entity
|
|
|
|
|
#define FL_PAWN_FAKECLIENT (1<<4) // Fake client controlled pawn entity, mostly referenced in movement related code
|
|
|
|
|
#define FL_FROZEN (1<<5) // Player is frozen for 3rd person camera
|
|
|
|
|
#define FL_ATCONTROLS (1<<6) // Player can't move, but keeps key inputs for controlling another entity
|
|
|
|
|
#define FL_CLIENT (1<<7) // Is a player
|
|
|
|
|
#define FL_CONTROLLER_FAKECLIENT (1<<8) // Fake client, simulated server side. Mainly set on controllers
|
|
|
|
|
#define FL_INWATER (1<<9) // In water. Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
// NOTE if you move things up, make sure to change this value
|
|
|
|
|
#define PLAYER_FLAG_BITS 10
|
|
|
|
|
|
|
|
|
|
// NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though
|
|
|
|
|
#define FL_FLY (1<<10) // Changes the SV_Movestep() behavior to not need to be on ground
|
|
|
|
|
#define FL_SWIM (1<<11) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_CONVEYOR (1<<12) // Potentially obsolete in s2
|
|
|
|
|
#define FL_NPC (1<<13) // Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_GODMODE (1<<14)
|
|
|
|
|
#define FL_NOTARGET (1<<15)
|
|
|
|
|
#define FL_AIMTARGET (1<<16) // set if the crosshair needs to aim onto the entity
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_PARTIALGROUND (1<<17) // not all corners are valid. Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_STATICPROP (1<<18) // Eetsa static prop!
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_GRAPHED (1<<19) // worldgraph has this ent listed as something that blocks a connection. Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_GRENADE (1<<20)
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_STEPMOVEMENT (1<<21) // Changes the SV_Movestep() behavior to not do any processing. Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_DONTTOUCH (1<<22) // Doesn't generate touch functions, generates Untouch() for anything it was touching when this flag was set
|
|
|
|
|
#define FL_BASEVELOCITY (1<<23) // Base velocity has been applied this frame (used to convert base velocity into momentum)
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_CONVEYOR_NEW (1<<24)
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_OBJECT (1<<25) // Terrible name. This is an object that NPCs should see. Missiles, for example.
|
2024-02-28 08:33:07 +03:00
|
|
|
|
#define FL_KILLME (1<<26) // This entity is marked for death -- will be freed by game DLL. Potentially obsolete in s2
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#define FL_ONFIRE (1<<27) // You know...
|
|
|
|
|
#define FL_DISSOLVING (1<<28) // We're dissolving!
|
|
|
|
|
#define FL_TRANSRAGDOLL (1<<29) // In the process of turning into a client side ragdoll.
|
|
|
|
|
#define FL_UNBLOCKABLE_BY_PLAYER (1<<30) // pusher that can't be blocked by the player
|
|
|
|
|
#define FL_FREEZING (1<<31) // We're becoming frozen!
|
|
|
|
|
|
|
|
|
|
// edict->movetype values
|
2023-09-16 22:59:52 +03:00
|
|
|
|
enum MoveType_t : unsigned char
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
MOVETYPE_NONE = 0, // never moves
|
2023-09-16 22:13:16 +03:00
|
|
|
|
MOVETYPE_OBSOLETE, // Previously isometric movetype
|
2010-07-22 01:46:14 -05:00
|
|
|
|
MOVETYPE_WALK, // Player only - moving on the ground
|
|
|
|
|
MOVETYPE_FLY, // No gravity, but still collides with stuff
|
|
|
|
|
MOVETYPE_FLYGRAVITY, // flies through the air + is affected by gravity
|
|
|
|
|
MOVETYPE_VPHYSICS, // uses VPHYSICS for simulation
|
|
|
|
|
MOVETYPE_PUSH, // no clip to world, push and crush
|
|
|
|
|
MOVETYPE_NOCLIP, // No gravity, no collisions, still do velocity/avelocity
|
|
|
|
|
MOVETYPE_OBSERVER, // Observer movement, depends on player's observer mode
|
2023-09-16 22:13:16 +03:00
|
|
|
|
MOVETYPE_LADDER, // Used by players only when going onto a ladder
|
2010-07-22 01:46:14 -05:00
|
|
|
|
MOVETYPE_CUSTOM, // Allows the entity to describe its own physics
|
|
|
|
|
|
|
|
|
|
// should always be defined as the last item in the list
|
|
|
|
|
MOVETYPE_LAST = MOVETYPE_CUSTOM,
|
|
|
|
|
|
2023-09-16 22:13:16 +03:00
|
|
|
|
MOVETYPE_MAX_BITS = 5
|
2010-07-22 01:46:14 -05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// edict->movecollide values
|
2023-09-16 22:59:52 +03:00
|
|
|
|
enum MoveCollide_t : unsigned char
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
MOVECOLLIDE_DEFAULT = 0,
|
|
|
|
|
|
|
|
|
|
// These ones only work for MOVETYPE_FLY + MOVETYPE_FLYGRAVITY
|
|
|
|
|
MOVECOLLIDE_FLY_BOUNCE, // bounces, reflects, based on elasticity of surface and object - applies friction (adjust velocity)
|
|
|
|
|
MOVECOLLIDE_FLY_CUSTOM, // Touch() will modify the velocity however it likes
|
|
|
|
|
MOVECOLLIDE_FLY_SLIDE, // slides along surfaces (no bounce) - applies friciton (adjusts velocity)
|
|
|
|
|
|
|
|
|
|
MOVECOLLIDE_COUNT, // Number of different movecollides
|
|
|
|
|
|
|
|
|
|
// When adding new movecollide types, make sure this is correct
|
|
|
|
|
MOVECOLLIDE_MAX_BITS = 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// edict->solid values
|
|
|
|
|
// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves
|
|
|
|
|
// SOLID only effects OTHER entities colliding with this one when they move - UGH!
|
|
|
|
|
|
|
|
|
|
// Solid type basically describes how the bounding volume of the object is represented
|
|
|
|
|
// NOTE: SOLID_BBOX MUST BE 2, and SOLID_VPHYSICS MUST BE 6
|
|
|
|
|
// NOTE: These numerical values are used in the FGD by the prop code (see prop_dynamic)
|
2023-09-16 22:59:52 +03:00
|
|
|
|
enum SolidType_t : unsigned char
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
SOLID_NONE = 0, // no solid model
|
|
|
|
|
SOLID_BSP = 1, // a BSP tree
|
|
|
|
|
SOLID_BBOX = 2, // an AABB
|
|
|
|
|
SOLID_OBB = 3, // an OBB (not implemented yet)
|
2023-09-16 22:13:16 +03:00
|
|
|
|
SOLID_SPHERE = 4,
|
|
|
|
|
SOLID_POINT = 5,
|
2010-07-22 01:46:14 -05:00
|
|
|
|
SOLID_VPHYSICS = 6, // solid vphysics object, get vcollide from the model and collide with that
|
2023-09-16 22:13:16 +03:00
|
|
|
|
SOLID_CAPSULE = 7,
|
2010-07-22 01:46:14 -05:00
|
|
|
|
SOLID_LAST,
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-16 22:13:16 +03:00
|
|
|
|
// GAMMACASE: Potentially obsolete
|
2010-07-22 01:46:14 -05:00
|
|
|
|
enum SolidFlags_t
|
|
|
|
|
{
|
|
|
|
|
FSOLID_CUSTOMRAYTEST = 0x0001, // Ignore solid type + always call into the entity for ray tests
|
|
|
|
|
FSOLID_CUSTOMBOXTEST = 0x0002, // Ignore solid type + always call into the entity for swept box tests
|
|
|
|
|
FSOLID_NOT_SOLID = 0x0004, // Are we currently not solid?
|
|
|
|
|
FSOLID_TRIGGER = 0x0008, // This is something may be collideable but fires touch functions
|
|
|
|
|
// even when it's not collideable (when the FSOLID_NOT_SOLID flag is set)
|
|
|
|
|
FSOLID_NOT_STANDABLE = 0x0010, // You can't stand on this
|
|
|
|
|
FSOLID_VOLUME_CONTENTS = 0x0020, // Contains volumetric contents (like water)
|
|
|
|
|
FSOLID_FORCE_WORLD_ALIGNED = 0x0040, // Forces the collision rep to be world-aligned even if it's SOLID_BSP or SOLID_VPHYSICS
|
|
|
|
|
FSOLID_USE_TRIGGER_BOUNDS = 0x0080, // Uses a special trigger bounds separate from the normal OBB
|
|
|
|
|
FSOLID_ROOT_PARENT_ALIGNED = 0x0100, // Collisions are defined in root parent's local coordinate space
|
|
|
|
|
FSOLID_TRIGGER_TOUCH_DEBRIS = 0x0200, // This trigger will touch debris objects
|
|
|
|
|
FSOLID_TRIGGER_TOUCH_PLAYER = 0x0400, // This trigger will touch only players
|
|
|
|
|
FSOLID_NOT_MOVEABLE = 0x0800, // Assume this object will not move
|
|
|
|
|
|
|
|
|
|
FSOLID_MAX_BITS = 12
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// A couple of inline helper methods
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
inline bool IsSolid( SolidType_t solidType, int nSolidFlags )
|
|
|
|
|
{
|
|
|
|
|
return (solidType != SOLID_NONE) && ((nSolidFlags & FSOLID_NOT_SOLID) == 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// m_lifeState values
|
2023-09-16 22:13:16 +03:00
|
|
|
|
enum LifeState_t
|
|
|
|
|
{
|
|
|
|
|
LIFE_ALIVE = 0x0, // alive
|
|
|
|
|
LIFE_DYING = 0x1, // playing death animation or still falling off of a ledge waiting to hit ground
|
|
|
|
|
LIFE_DEAD = 0x2, // dead. lying still.
|
|
|
|
|
LIFE_RESPAWNABLE = 0x3,
|
|
|
|
|
LIFE_RESPAWNING = 0x4
|
|
|
|
|
};
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-09-16 22:13:16 +03:00
|
|
|
|
// GAMMACASE: Potentially obsolete
|
2010-07-22 01:46:14 -05:00
|
|
|
|
// entity effects
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
EF_BONEMERGE = 0x001, // Performs bone merge on client side
|
|
|
|
|
EF_BRIGHTLIGHT = 0x002, // DLIGHT centered at entity origin
|
|
|
|
|
EF_DIMLIGHT = 0x004, // player flashlight
|
|
|
|
|
EF_NOINTERP = 0x008, // don't interpolate the next frame
|
|
|
|
|
EF_NOSHADOW = 0x010, // Don't cast no shadow
|
|
|
|
|
EF_NODRAW = 0x020, // don't draw entity
|
|
|
|
|
EF_NORECEIVESHADOW = 0x040, // Don't receive no shadow
|
|
|
|
|
EF_BONEMERGE_FASTCULL = 0x080, // For use with EF_BONEMERGE. If this is set, then it places this ent's origin at its
|
|
|
|
|
// parent and uses the parent's bbox + the max extents of the aiment.
|
|
|
|
|
// Otherwise, it sets up the parent's bones every frame to figure out where to place
|
|
|
|
|
// the aiment, which is inefficient because it'll setup the parent's bones even if
|
|
|
|
|
// the parent is not in the PVS.
|
|
|
|
|
EF_ITEM_BLINK = 0x100, // blink an item so that the user notices it.
|
|
|
|
|
EF_PARENT_ANIMATES = 0x200, // always assume that the parent entity is animating
|
|
|
|
|
EF_MAX_BITS = 10
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define EF_PARITY_BITS 3
|
|
|
|
|
#define EF_PARITY_MASK ((1<<EF_PARITY_BITS)-1)
|
|
|
|
|
|
|
|
|
|
// How many bits does the muzzle flash parity thing get?
|
|
|
|
|
#define EF_MUZZLEFLASH_BITS 2
|
|
|
|
|
|
|
|
|
|
// plats
|
|
|
|
|
#define PLAT_LOW_TRIGGER 1
|
|
|
|
|
|
|
|
|
|
// Trains
|
|
|
|
|
#define SF_TRAIN_WAIT_RETRIGGER 1
|
|
|
|
|
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
|
|
|
|
|
|
|
|
|
|
// view angle update types for CPlayerState::fixangle
|
|
|
|
|
#define FIXANGLE_NONE 0
|
|
|
|
|
#define FIXANGLE_ABSOLUTE 1
|
|
|
|
|
#define FIXANGLE_RELATIVE 2
|
|
|
|
|
|
|
|
|
|
// Break Model Defines
|
|
|
|
|
|
|
|
|
|
#define BREAK_GLASS 0x01
|
|
|
|
|
#define BREAK_METAL 0x02
|
|
|
|
|
#define BREAK_FLESH 0x04
|
|
|
|
|
#define BREAK_WOOD 0x08
|
|
|
|
|
|
|
|
|
|
#define BREAK_SMOKE 0x10
|
|
|
|
|
#define BREAK_TRANS 0x20
|
|
|
|
|
#define BREAK_CONCRETE 0x40
|
|
|
|
|
|
|
|
|
|
// If this is set, then we share a lighting origin with the last non-slave breakable sent down to the client
|
|
|
|
|
#define BREAK_SLAVE 0x80
|
|
|
|
|
|
|
|
|
|
// Colliding temp entity sounds
|
|
|
|
|
|
|
|
|
|
#define BOUNCE_GLASS BREAK_GLASS
|
|
|
|
|
#define BOUNCE_METAL BREAK_METAL
|
|
|
|
|
#define BOUNCE_FLESH BREAK_FLESH
|
|
|
|
|
#define BOUNCE_WOOD BREAK_WOOD
|
|
|
|
|
#define BOUNCE_SHRAP 0x10
|
|
|
|
|
#define BOUNCE_SHELL 0x20
|
|
|
|
|
#define BOUNCE_CONCRETE BREAK_CONCRETE
|
|
|
|
|
#define BOUNCE_SHOTSHELL 0x80
|
|
|
|
|
|
|
|
|
|
// Temp entity bounce sound types
|
|
|
|
|
#define TE_BOUNCE_NULL 0
|
|
|
|
|
#define TE_BOUNCE_SHELL 1
|
|
|
|
|
#define TE_BOUNCE_SHOTSHELL 2
|
|
|
|
|
|
|
|
|
|
// Rendering constants
|
|
|
|
|
// if this is changed, update common/MaterialSystem/Sprite.cpp
|
2023-09-16 22:59:52 +03:00
|
|
|
|
enum RenderMode_t : unsigned char
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
kRenderNormal = 0, // src
|
|
|
|
|
kRenderTransColor, // c*a+dest*(1-a)
|
|
|
|
|
kRenderTransTexture, // src*a+dest*(1-a)
|
|
|
|
|
kRenderGlow, // src*a+dest -- No Z buffer checks -- Fixed size in screen space
|
|
|
|
|
kRenderTransAlpha, // src*srca+dest*(1-srca)
|
|
|
|
|
kRenderTransAdd, // src*a+dest
|
|
|
|
|
kRenderEnvironmental, // not drawn, used for environmental effects
|
|
|
|
|
kRenderTransAddFrameBlend, // use a fractional frame value to blend between animation frames
|
|
|
|
|
kRenderTransAlphaAdd, // src + dest*(1-a)
|
|
|
|
|
kRenderWorldGlow, // Same as kRenderGlow but not fixed size in screen space
|
|
|
|
|
kRenderNone, // Don't render.
|
2023-09-16 22:13:16 +03:00
|
|
|
|
kRenderDevVisualizer,
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
kRenderModeCount, // must be last
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-16 22:59:52 +03:00
|
|
|
|
enum RenderFx_t : unsigned char
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
kRenderFxNone = 0,
|
|
|
|
|
kRenderFxPulseSlow,
|
|
|
|
|
kRenderFxPulseFast,
|
|
|
|
|
kRenderFxPulseSlowWide,
|
|
|
|
|
kRenderFxPulseFastWide,
|
|
|
|
|
|
|
|
|
|
kRenderFxFadeSlow,
|
|
|
|
|
kRenderFxFadeFast,
|
|
|
|
|
kRenderFxSolidSlow,
|
|
|
|
|
kRenderFxSolidFast,
|
|
|
|
|
kRenderFxStrobeSlow,
|
|
|
|
|
|
|
|
|
|
kRenderFxStrobeFast,
|
|
|
|
|
kRenderFxStrobeFaster,
|
|
|
|
|
kRenderFxFlickerSlow,
|
|
|
|
|
kRenderFxFlickerFast,
|
|
|
|
|
kRenderFxNoDissipation,
|
|
|
|
|
|
|
|
|
|
kRenderFxFadeOut,
|
|
|
|
|
kRenderFxFadeIn,
|
|
|
|
|
kRenderFxPulseFastWider,
|
|
|
|
|
kRenderFxGlowShell, // Glowing Shell
|
|
|
|
|
|
|
|
|
|
kRenderFxMax
|
|
|
|
|
};
|
|
|
|
|
|
2024-06-07 14:29:04 +03:00
|
|
|
|
enum BuiltInInteractionLayer_t
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
2024-06-07 14:29:04 +03:00
|
|
|
|
LAYER_INDEX_CONTENTS_SOLID = 0,
|
|
|
|
|
LAYER_INDEX_CONTENTS_HITBOX,
|
|
|
|
|
LAYER_INDEX_CONTENTS_TRIGGER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_SKY,
|
|
|
|
|
LAYER_INDEX_FIRST_USER,
|
|
|
|
|
LAYER_INDEX_NOT_FOUND = -1,
|
|
|
|
|
LAYER_INDEX_MAX_ALLOWED = 64,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum StandardInteractionLayers_t
|
|
|
|
|
{
|
|
|
|
|
LAYER_INDEX_CONTENTS_PLAYER_CLIP = LAYER_INDEX_FIRST_USER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_NPC_CLIP,
|
|
|
|
|
LAYER_INDEX_CONTENTS_BLOCK_LOS,
|
|
|
|
|
LAYER_INDEX_CONTENTS_BLOCK_LIGHT,
|
|
|
|
|
LAYER_INDEX_CONTENTS_LADDER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_PICKUP,
|
|
|
|
|
LAYER_INDEX_CONTENTS_BLOCK_SOUND,
|
|
|
|
|
LAYER_INDEX_CONTENTS_NODRAW,
|
|
|
|
|
LAYER_INDEX_CONTENTS_WINDOW,
|
|
|
|
|
LAYER_INDEX_CONTENTS_PASS_BULLETS,
|
|
|
|
|
LAYER_INDEX_CONTENTS_WORLD_GEOMETRY,
|
|
|
|
|
LAYER_INDEX_CONTENTS_WATER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_SLIME,
|
|
|
|
|
LAYER_INDEX_CONTENTS_TOUCH_ALL,
|
|
|
|
|
LAYER_INDEX_CONTENTS_PLAYER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_NPC,
|
|
|
|
|
LAYER_INDEX_CONTENTS_DEBRIS,
|
|
|
|
|
LAYER_INDEX_CONTENTS_PHYSICS_PROP,
|
|
|
|
|
LAYER_INDEX_CONTENTS_NAV_IGNORE,
|
|
|
|
|
LAYER_INDEX_CONTENTS_NAV_LOCAL_IGNORE,
|
|
|
|
|
LAYER_INDEX_CONTENTS_POST_PROCESSING_VOLUME,
|
|
|
|
|
LAYER_INDEX_CONTENTS_UNUSED_LAYER3,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CARRIED_OBJECT,
|
|
|
|
|
LAYER_INDEX_CONTENTS_PUSHAWAY,
|
|
|
|
|
LAYER_INDEX_CONTENTS_SERVER_ENTITY_ON_CLIENT,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CARRIED_WEAPON,
|
|
|
|
|
LAYER_INDEX_CONTENTS_STATIC_LEVEL,
|
|
|
|
|
LAYER_INDEX_FIRST_MOD_SPECIFIC,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum ModSpecificInteractionLayers_t
|
|
|
|
|
{
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_TEAM1 = LAYER_INDEX_FIRST_MOD_SPECIFIC,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_TEAM2,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_GRENADE_CLIP,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_DRONE_CLIP,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_MOVEABLE,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_OPAQUE,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_MONSTER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_UNUSED_LAYER,
|
|
|
|
|
LAYER_INDEX_CONTENTS_CSGO_THROWN_GRENADE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum BuiltInCollisionGroup_t
|
|
|
|
|
{
|
|
|
|
|
// Default layer, always collides with everything.
|
|
|
|
|
COLLISION_GROUP_ALWAYS = 0, // "always"
|
|
|
|
|
// This is how you turn off all collisions for an object - move it to this group
|
|
|
|
|
COLLISION_GROUP_NONPHYSICAL, // "never"
|
|
|
|
|
// Trigger layer, never collides with anything, only triggers/interacts. Use when querying for interaction layers.
|
|
|
|
|
COLLISION_GROUP_TRIGGER, // "trigger"
|
|
|
|
|
// Conditionally solid means that the collision response will be zero or as defined in the table when there are matching interactions
|
|
|
|
|
COLLISION_GROUP_CONDITIONALLY_SOLID, // needs interactions
|
|
|
|
|
// First unreserved collision layer index.
|
|
|
|
|
COLLISION_GROUP_FIRST_USER,
|
|
|
|
|
// Hard limit of 254 due to memory layout, and these are never visible to scene queries.
|
|
|
|
|
COLLISION_GROUPS_MAX_ALLOWED = 64,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum StandardCollisionGroups_t
|
|
|
|
|
{
|
|
|
|
|
COLLISION_GROUP_DEFAULT = COLLISION_GROUP_FIRST_USER,
|
2023-10-08 15:22:49 +02:00
|
|
|
|
COLLISION_GROUP_DEBRIS, // Collides with nothing but world, static stuff and triggers
|
2010-07-22 01:46:14 -05:00
|
|
|
|
COLLISION_GROUP_INTERACTIVE_DEBRIS, // Collides with everything except other interactive debris or debris
|
|
|
|
|
COLLISION_GROUP_INTERACTIVE, // Collides with everything except interactive debris or debris
|
|
|
|
|
COLLISION_GROUP_PLAYER,
|
|
|
|
|
COLLISION_GROUP_BREAKABLE_GLASS,
|
|
|
|
|
COLLISION_GROUP_VEHICLE,
|
|
|
|
|
COLLISION_GROUP_PLAYER_MOVEMENT, // For HL2, same as Collision_Group_Player, for
|
|
|
|
|
// TF2, this filters out other players and CBaseObjects
|
|
|
|
|
COLLISION_GROUP_NPC, // Generic NPC group
|
|
|
|
|
COLLISION_GROUP_IN_VEHICLE, // for any entity inside a vehicle
|
|
|
|
|
COLLISION_GROUP_WEAPON, // for any weapons that need collision detection
|
|
|
|
|
COLLISION_GROUP_VEHICLE_CLIP, // vehicle clip brush to restrict vehicle movement
|
|
|
|
|
COLLISION_GROUP_PROJECTILE, // Projectiles!
|
|
|
|
|
COLLISION_GROUP_DOOR_BLOCKER, // Blocks entities not permitted to get near moving doors
|
|
|
|
|
COLLISION_GROUP_PASSABLE_DOOR, // Doors that the player shouldn't collide with
|
|
|
|
|
COLLISION_GROUP_DISSOLVING, // Things that are dissolving are in this group
|
|
|
|
|
COLLISION_GROUP_PUSHAWAY, // Nonsolid on client and server, pushaway in player code
|
|
|
|
|
|
|
|
|
|
COLLISION_GROUP_NPC_ACTOR, // Used so NPCs in scripts ignore the player.
|
2024-06-07 14:29:04 +03:00
|
|
|
|
COLLISION_GROUP_NPC_SCRIPTED, // Used for NPCs in scripts that should not collide with each other
|
2010-07-22 01:46:14 -05:00
|
|
|
|
COLLISION_GROUP_PZ_CLIP,
|
2023-10-08 15:22:49 +02:00
|
|
|
|
COLLISION_GROUP_PROPS,
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2024-06-07 14:29:04 +03:00
|
|
|
|
LAST_SHARED_COLLISION_GROUP,
|
2010-07-22 01:46:14 -05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#include "basetypes.h"
|
|
|
|
|
|
|
|
|
|
#define SOUND_NORMAL_CLIP_DIST 1000.0f
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Base light indices to avoid index collision
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
LIGHT_INDEX_TE_DYNAMIC = 0x10000000,
|
|
|
|
|
LIGHT_INDEX_PLAYER_BRIGHT = 0x20000000,
|
|
|
|
|
LIGHT_INDEX_MUZZLEFLASH = 0x40000000,
|
|
|
|
|
LIGHT_INDEX_LOW_PRIORITY = 0x64000000,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// How many networked area portals do we allow?
|
|
|
|
|
#define MAX_AREA_STATE_BYTES 32
|
|
|
|
|
#define MAX_AREA_PORTAL_STATE_BYTES 24
|
|
|
|
|
|
|
|
|
|
// user message max payload size (note, this value is used by the engine, so MODs cannot change it)
|
|
|
|
|
#define MAX_USER_MSG_BITS 12
|
|
|
|
|
#define MAX_USER_MSG_DATA ( ( 1 << ( MAX_USER_MSG_BITS - 3 ) ) - 1 )
|
|
|
|
|
#define MAX_ENTITY_MSG_DATA 255
|
|
|
|
|
|
|
|
|
|
#define SOURCE_MT
|
|
|
|
|
#ifdef SOURCE_MT
|
|
|
|
|
class CThreadMutex;
|
|
|
|
|
typedef CThreadMutex CSourceMutex;
|
|
|
|
|
#else
|
|
|
|
|
class CThreadNullMutex;
|
|
|
|
|
typedef CThreadNullMutex CSourceMutex;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined( CLIENT_DLL )
|
|
|
|
|
#define IsServerDll() false
|
|
|
|
|
#define IsClientDll() true
|
|
|
|
|
#elif defined( GAME_DLL )
|
|
|
|
|
#define IsServerDll() true
|
|
|
|
|
#define IsClientDll() false
|
|
|
|
|
#else
|
|
|
|
|
#define IsServerDll() false
|
|
|
|
|
#define IsClientDll() false
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|