Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/game/client/c_soundscape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ void C_SoundscapeSystem::ProcessPlayRandom( KeyValues *pPlayRandom, const subsou
{
interval_t atten = ReadInterval( pKey->GetString() );
sound.soundlevel.start = ATTN_TO_SNDLVL( atten.start );
sound.soundlevel.range = ATTN_TO_SNDLVL( atten.start + atten.range ) - sound.soundlevel.start;
sound.soundlevel.range = (float)ATTN_TO_SNDLVL( atten.start + atten.range ) - sound.soundlevel.start;
}
else if ( !Q_strcasecmp( pKey->GetName(), "soundlevel" ) )
{
Expand Down
5 changes: 1 addition & 4 deletions src/game/client/c_testtraceline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ C_TestTraceline::~C_TestTraceline()
}


enum
{
CUBE_SIZE = 5
};
#define CUBE_SIZE 5

void C_TestTraceline::DrawCube( Vector& center, unsigned char* pColor )
{
Expand Down
8 changes: 4 additions & 4 deletions src/game/client/cdll_client_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class IAvi;
class IBik;
class IReplayHistoryManager;
class ISoundEmitterSystemBase;
enum CPULevel_t;
enum GPULevel_t;
enum MemLevel_t;
enum GPUMemLevel_t;
enum CPULevel_t : int;
enum GPULevel_t : int;
enum MemLevel_t : int;
enum GPUMemLevel_t : int;

extern IVModelRender *modelrender;
extern IVEngineClient *engine;
Expand Down
3 changes: 2 additions & 1 deletion src/game/client/clientshadowmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,13 +903,14 @@ class CClientShadowMgr : public IClientShadowMgr
virtual void UpdateSplitscreenLocalPlayerShadowSkip();

private:
enum
enum CClientShadowMgrFlags_t
{
SHADOW_FLAGS_TEXTURE_DIRTY = (CLIENT_SHADOW_FLAGS_LAST_FLAG << 1),
SHADOW_FLAGS_BRUSH_MODEL = (CLIENT_SHADOW_FLAGS_LAST_FLAG << 2),
SHADOW_FLAGS_USING_LOD_SHADOW = (CLIENT_SHADOW_FLAGS_LAST_FLAG << 3),
SHADOW_FLAGS_LIGHT_WORLD = (CLIENT_SHADOW_FLAGS_LAST_FLAG << 4),
};
friend constexpr auto operator|(ShadowFlags_t a, CClientShadowMgrFlags_t b) { return a | static_cast<ShadowFlags_t>(b); };

struct ClientShadow_t
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/swarm/vgui/nb_skill_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StatsBar;
// == MANAGED_CLASS_DECLARATIONS_END ==
class CBitmapButton;
class BriefingTooltip;
enum ASW_Skill;
enum ASW_Skill : int;

class CNB_Skill_Panel : public vgui::EditablePanel
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/vgui_fpspanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CFPSPanel : public vgui::Panel
memset( m_pServerTimes, 0, sizeof(m_pServerTimes) );
}

enum { SERVER_TIME_HISTORY = 32 };
static constexpr int SERVER_TIME_HISTORY = 32;

vgui::HFont m_hFont;
float m_AverageFPS;
Expand Down
7 changes: 2 additions & 5 deletions src/game/server/ai_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,8 @@ class CAI_Network : public IPartitionEnumerator

//---------------------------------

enum
{
NEARNODE_CACHE_SIZE = 32,
NEARNODE_CACHE_LIFE = 10,
};
static constexpr int NEARNODE_CACHE_SIZE = 32;
static constexpr int NEARNODE_CACHE_LIFE = 10;

struct NearNodeCache_T
{
Expand Down
4 changes: 4 additions & 0 deletions src/game/server/ai_pathfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,10 @@ bool CAI_Pathfinder::CheckStaleRoute(const Vector &vStart, const Vector &vEnd, i

//-----------------------------------------------------------------------------

#ifdef DEBUG
OVERLOAD_ENUM_COMPARISON(RouteBuildFlags_e, Capability_t);
#endif

#define MAX_NODE_TRIES 4
#define MAX_TRIANGULATIONS 2

Expand Down
7 changes: 2 additions & 5 deletions src/game/server/ai_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,8 @@ class CAI_MoveMonitor
Vector GetMarkPos() { return m_vMark; }

private:
enum
{
NO_MARK = -1
};

static constexpr int NO_MARK = -1;

Vector m_vMark;
float m_flMarkTolerance;

Expand Down
6 changes: 3 additions & 3 deletions src/game/server/baseflex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ void CFlexCycler::Think( void )
for ( LocalFlexController_t i = LocalFlexController_t(0); i < GetNumFlexControllers(); i++ )
{
// Throw a differently offset sine wave on all of the flex controllers
float fFlexTime = i * (1.0f / (float)GetNumFlexControllers()) + gpGlobals->curtime;
float fFlexTime = (float)i * (1.0f / (float)GetNumFlexControllers()) + gpGlobals->curtime;
m_flextarget[i] = sinf( fFlexTime ) * 0.5f + 0.5f;
SetFlexWeight( i, m_flextarget[i] );
}
Expand Down Expand Up @@ -2632,7 +2632,7 @@ void CFlexCycler::Think( void )
{
m_flexnum = LookupFlex( szTemp );

if (m_flexnum != -1 && m_flextarget[m_flexnum] != 1)
if ((int)m_flexnum != -1 && m_flextarget[m_flexnum] != 1)
{
m_flextarget[m_flexnum] = 1.0;
// SetFlexTarget( m_flexnum );
Expand All @@ -2647,7 +2647,7 @@ void CFlexCycler::Think( void )
else if (m_flextime < gpGlobals->curtime)
{
// m_flextime = gpGlobals->curtime + 1.0; // RandomFloat( 0.1, 0.5 );
m_flextime = gpGlobals->curtime + random->RandomFloat( 0.3, 0.5 ) * (30.0 / GetNumFlexControllers());
m_flextime = gpGlobals->curtime + random->RandomFloat( 0.3, 0.5 ) * (30.0 / (int)GetNumFlexControllers());
m_flexnum = (LocalFlexController_t)random->RandomInt( 0, GetNumFlexControllers() - 1 );

// m_flexnum = (pflex->num + 1) % r_psubmodel->numflexes;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/genericactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void CFlextalkActor::ProcessSceneEvents( void )
}
else if (m_flextime < gpGlobals->curtime)
{
m_flextime = gpGlobals->curtime + random->RandomFloat( 0.3, 0.5 ) * (30.0 / GetNumFlexControllers());
m_flextime = gpGlobals->curtime + random->RandomFloat( 0.3, 0.5 ) * (30.0 / (int)GetNumFlexControllers());
m_flexnum = (LocalFlexController_t)random->RandomInt( 0, GetNumFlexControllers() - 1 );

if (m_flextarget[m_flexnum] == 1)
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/hl2/npc_strider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ void CNPC_Strider::RunTask( const Task_t *pTask )
break;

case TASK_PLAY_SEQUENCE:
if( m_bFastCrouch && pTask->flTaskData == ACT_CROUCH )
if( m_bFastCrouch && pTask->flTaskData == static_cast<float>( ACT_CROUCH ) )
{
SetPlaybackRate( 10.0f );
if( IsSequenceFinished() )
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_ai_behavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// Be sure to expose these to vscript in
// void CASW_Alien::LinkEnumsToScope( CScriptScope &hScope )
enum BehaviorEvent_t
enum BehaviorEvent_t : int
{
BEHAVIOR_EVENT_START_HEAL = 0,
BEHAVIOR_EVENT_FINISH_HEAL,
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm/asw_alien.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TakeDamageInfo;
class CASW_Spawner;
class CAI_ASW_FlinchBehavior;
class CAI_ASW_Behavior;
enum BehaviorEvent_t;
enum BehaviorEvent_t : int;

// Keep track of recent damage events for use in asw_ai_behavior_combat_stun.cpp
static const int ASW_NUM_RECENT_DAMAGE = 8;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/swarm/asw_marine_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ IMPLEMENT_SERVERCLASS_ST( CASW_Marine_Resource, DT_ASW_Marine_Resource )
SendPropEHandle( SENDINFO( m_OriginalCommander ) ),
SendPropEHandle( SENDINFO( m_Commander ) ),
SendPropIntWithMinusOneFlag( SENDINFO( m_iCommanderIndex ), NumBitsForCount( ABSOLUTE_PLAYER_LIMIT + 1 ) ),
SendPropArray( SendPropIntWithMinusOneFlag( SENDINFO_ARRAY( m_iWeaponsInSlots ), NumBitsForCount( MAX( ASW_NUM_EQUIP_REGULAR, ASW_NUM_EQUIP_EXTRA ) + 1 ) ), m_iWeaponsInSlots ),
SendPropArray( SendPropIntWithMinusOneFlag( SENDINFO_ARRAY( m_iInitialWeaponsInSlots ), NumBitsForCount( MAX( ASW_NUM_EQUIP_REGULAR, ASW_NUM_EQUIP_EXTRA ) + 1 ) ), m_iInitialWeaponsInSlots ),
SendPropArray( SendPropIntWithMinusOneFlag( SENDINFO_ARRAY( m_iWeaponsInSlots ), NumBitsForCount( MAX( (int)ASW_NUM_EQUIP_REGULAR, (int)ASW_NUM_EQUIP_EXTRA ) + 1 ) ), m_iWeaponsInSlots ),
SendPropArray( SendPropIntWithMinusOneFlag( SENDINFO_ARRAY( m_iInitialWeaponsInSlots ), NumBitsForCount( MAX( (int)ASW_NUM_EQUIP_REGULAR, (int)ASW_NUM_EQUIP_EXTRA ) + 1 ) ), m_iInitialWeaponsInSlots ),
SendPropBool( SENDINFO( m_bInfested ) ),
SendPropBool( SENDINFO( m_bInhabited ) ),
SendPropInt( SENDINFO( m_iServerFiring ), 2, SPROP_UNSIGNED ),
Expand Down
2 changes: 2 additions & 0 deletions src/game/server/swarm/asw_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class CASW_Inhabitable_NPC;
class CASW_Marine;
class CRagdollProp;

enum EInventoryCommand : int;

//=============================================================================
// >> Swarm player
//=============================================================================
Expand Down
13 changes: 5 additions & 8 deletions src/game/server/swarm/asw_sentry_top.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,11 @@ class CASW_Sentry_Top : public CBaseCombatCharacter
CNetworkHandle( CASW_Sentry_Base, m_hSentryBase );

// Constants:
enum
{
ASW_SENTRY_TURNRATE = 150, // angles per second
ASW_SENTRY_ANGLE = 60, // spread on each side
ASW_SENTRY_FIRING_HEIGHT = 50,
ASW_SENTRY_FIRE_ANGLE_THRESHOLD = 3,
ASW_SENTRY_RANGE = 525, // just the default
};
static constexpr int ASW_SENTRY_TURNRATE = 150; // angles per second
static constexpr int ASW_SENTRY_ANGLE = 60; // spread on each side
static constexpr int ASW_SENTRY_FIRING_HEIGHT = 50;
static constexpr int ASW_SENTRY_FIRE_ANGLE_THRESHOLD = 3;
static constexpr int ASW_SENTRY_RANGE = 525; // just the default

protected:
// helper function used by FindEnemy
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/death_pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void GetRagdollCurSequenceWithDeathPose( C_BaseAnimating *entity, matrix3x4a_t *

entity->SetSequence( activity );

entity->SetCycle( (float)frame / MAX_DEATHPOSE_FRAMES );
entity->SetCycle( (float)frame / (float)MAX_DEATHPOSE_FRAMES );

entity->SetAbsOrigin( vAdjustedOrigin );

Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/asw_marine_skills.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
ENUM_ITEM( SPARE, "swarm/SkillButtons/Spare", "#asw_points", "#asw_points_desc", 99 )

// skills
enum ASW_Skill
enum ASW_Skill : int
{
ASW_MARINE_SKILL_INVALID = -1,

Expand Down
16 changes: 14 additions & 2 deletions src/game/shared/swarm/asw_shareddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
#include "const.h"
#include "rd_gamerules_convar.h"

// Use when you extend an enum to allow warning free comparation
#define OVERLOAD_ENUM_COMPARISON(A, B) \
constexpr bool operator==(A a, B b) { return a == static_cast<A>(b); } \
constexpr bool operator==(B b, A a) { return a == b; } \
constexpr bool operator!=(A a, B b) { return a != static_cast<A>(b); } \
constexpr bool operator!=(B b, A a) { return a != b; } \
constexpr bool operator<=(A a, B b) { return a <= static_cast<A>(b); } \
constexpr bool operator<=(B b, A a) { return b <= static_cast<B>(a); } \
// OVERLOAD_ENUM_COMPARISON

enum ASW_Inventory_slot_t
{
ASW_INVENTORY_SLOT_PRIMARY = 0,
Expand Down Expand Up @@ -283,7 +293,7 @@ enum {

#define ASW_NUM_FIRE_EMITTERS 4

enum
enum ASW_Collision_Group_t
{
ASW_COLLISION_GROUP_GRUBS = LAST_SHARED_COLLISION_GROUP,
ASW_COLLISION_GROUP_PARASITE,
Expand Down Expand Up @@ -316,6 +326,7 @@ enum
ASW_COLLISION_GROUP_SHIELD, // collides with projectiles and NPCs
ASW_COLLISION_GROUP_PASSABLE, // asw (stuff you can walk through) NOTE: Has to be LAST!
};
OVERLOAD_ENUM_COMPARISON(Collision_Group_t, ASW_Collision_Group_t);


enum FailAdviceMessage
Expand Down Expand Up @@ -477,7 +488,7 @@ class CASW_AlienVolley
};

// For CLASSIFY
enum
enum ASW_Class_T
{
// Alien Swarm AI
// Be sure to add appropriate checks in IsAlienClass() in asw_shareddefs.cpp
Expand Down Expand Up @@ -656,6 +667,7 @@ enum

LAST_ASW_ENTITY_CLASS,
};
OVERLOAD_ENUM_COMPARISON(Class_T, ASW_Class_T);


// Alien Swarm specific hitgroups
Expand Down
7 changes: 2 additions & 5 deletions src/game/shared/swarm/asw_weapon_flamer_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ class CASW_Weapon_Flamer : public CASW_Weapon
float m_flLastFireTime;
CNetworkVar(bool, m_bIsSecondaryFiring);

enum
{ // namespaced immediate constant:
FLAMER_PROJECTILE_AIR_VELOCITY = 600,
EXTINGUISHER_PROJECTILE_AIR_VELOCITY = 400,
};
static constexpr int FLAMER_PROJECTILE_AIR_VELOCITY = 600;
static constexpr int EXTINGUISHER_PROJECTILE_AIR_VELOCITY = 400;

#ifdef CLIENT_DLL
CUtlReference<CNewParticleEffect> pEffect;
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/rd_crafting_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define RD_MAX_CRAFTING_MATERIAL_SPAWN_LOCATIONS 5

#ifdef RD_7A_DROPS
enum RD_Crafting_Material_t
enum RD_Crafting_Material_t : int
{
RD_CRAFTING_MATERIAL_NONE,

Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/rd_inventory_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "steam/isteaminventory.h"

enum EInventoryCommand
enum EInventoryCommand : int
{
INVCMD_PLAYER_EQUIPS,
INVCMD_MARINE_RESOURCE_EQUIPS,
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/rd_inventory_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern ConVar rd_briefing_item_details_color2;

class CSteamItemIcon;
vgui::IImage *GetSteamItemIcon( const char *szURL, bool bForceLoadRemote = false );
enum RD_Crafting_Material_t;
enum RD_Crafting_Material_t : int;
#endif

class CASW_Player;
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/swarm/rd_missions_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct RD_Campaign_Mission_t;
struct RD_Mission_t;
struct RD_Mission_MinimapSlice_t;
#ifdef RD_7A_DROPS
enum RD_Crafting_Material_t;
enum RD_Crafting_Material_t : int;
#endif

namespace ReactiveDropMissions
Expand Down
4 changes: 2 additions & 2 deletions src/public/bitmap/imageformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ enum NormalDecodeMode_t

// Forward declaration
#ifdef _WIN32
typedef enum _D3DFORMAT D3DFORMAT;
enum DXGI_FORMAT;
typedef enum _D3DFORMAT : int D3DFORMAT;
enum DXGI_FORMAT : int;
#endif

//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/public/fgdlib/gamedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MDkeyvalue;
class GameData;
class KeyValues;

enum TEXTUREFORMAT;
enum TEXTUREFORMAT : int;


typedef void (*GameDataMessageFunc_t)(int level, _Printf_format_string_ const char *fmt, ...);
Expand Down
1 change: 1 addition & 0 deletions src/public/localflexcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "tier0/platform.h"

// TODO: replace this enum with something better and remove all instances of it being casted
enum LocalFlexController_t
{
// this isn't really an enum - its just a typed int. gcc will not accept it as a fwd decl, so we'll define one value
Expand Down
16 changes: 5 additions & 11 deletions src/public/materialsystem/imesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,13 @@ struct ShaderStencilState_t;
//-----------------------------------------------------------------------------
// The Vertex Buffer interface
//-----------------------------------------------------------------------------
enum
{
VERTEX_MAX_TEXTURE_COORDINATES = 8,
BONE_MATRIX_INDEX_INVALID = 255
};
#define VERTEX_MAX_TEXTURE_COORDINATES 8
#define BONE_MATRIX_INDEX_INVALID 255

// Internal maximums for sizes. Don't use directly, use IMaterialSystem::GetMaxToRender()
enum
{
INDEX_BUFFER_SIZE = 32768,
DYNAMIC_VERTEX_BUFFER_MEMORY = ( 1024 + 512 ) * 1024,
DYNAMIC_VERTEX_BUFFER_MEMORY_SMALL = 384 * 1024, // Only allocate this much during map transitions
};
#define INDEX_BUFFER_SIZE 32768
#define DYNAMIC_VERTEX_BUFFER_MEMORY ( ( 1024 + 512 ) * 1024 )
#define DYNAMIC_VERTEX_BUFFER_MEMORY_SMALL ( 384 * 1024 ) // Only allocate this much during map transitions

// Vertex fields must be written in well-defined order to achieve write combining,
// which is a perf booster
Expand Down
Loading