Remove unused globals and duplicate global variable forward declarations

#89
This commit is contained in:
Sam V 2021-11-28 20:40:56 +01:00
parent f5fc7fb5ad
commit 9ca8e6a47a
51 changed files with 122 additions and 330 deletions

View file

@ -30,14 +30,6 @@ This file contains "stubs" of class member implementations so that we can predic
#include "soundent.h"
#include "skill.h"
// Globals used by game logic
int gmsgWeapPickup = 0;
enginefuncs_t g_engfuncs;
globalvars_t* gpGlobals;
ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS];
AmmoInfo CBasePlayerItem::AmmoInfoArray[MAX_AMMO_SLOTS];
void EMIT_SOUND_DYN(edict_t* entity, int channel, const char* sample, float volume, float attenuation, int flags, int pitch) {}
// CBaseEntity Stubs
@ -98,7 +90,6 @@ CGrenade* CGrenade::ShootContact(entvars_t* pevOwner, Vector vecStart, Vector ve
void CGrenade::DetonateUse(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value) {}
void UTIL_Remove(CBaseEntity* pEntity) {}
struct skilldata_t gSkillData;
void UTIL_SetSize(entvars_t* pev, const Vector& vecMin, const Vector& vecMax) {}
CBaseEntity* UTIL_FindEntityInSphere(CBaseEntity* pStartEntity, const Vector& vecCenter, float flRadius) { return 0; }

View file

@ -30,7 +30,6 @@
#include "../com_weapons.h"
#include "../demo.h"
extern globalvars_t* gpGlobals;
extern int g_iUser1;
// Pool of client side entities/entvars_t

View file

@ -19,44 +19,6 @@
#include "shake.h"
#include "UserMessages.h"
int gmsgShake = 0;
int gmsgFade = 0;
int gmsgFlashlight = 0;
int gmsgFlashBattery = 0;
int gmsgResetHUD = 0;
int gmsgInitHUD = 0;
int gmsgShowGameTitle = 0;
int gmsgCurWeapon = 0;
int gmsgHealth = 0;
int gmsgDamage = 0;
int gmsgBattery = 0;
int gmsgTrain = 0;
int gmsgLogo = 0;
int gmsgWeaponList = 0;
int gmsgAmmoX = 0;
int gmsgHudText = 0;
int gmsgDeathMsg = 0;
int gmsgScoreInfo = 0;
int gmsgTeamInfo = 0;
int gmsgTeamScore = 0;
int gmsgGameMode = 0;
int gmsgMOTD = 0;
int gmsgServerName = 0;
int gmsgAmmoPickup = 0;
int gmsgWeapPickup = 0;
int gmsgItemPickup = 0;
int gmsgHideWeapon = 0;
int gmsgSetCurWeap = 0;
int gmsgSayText = 0;
int gmsgTextMsg = 0;
int gmsgSetFOV = 0;
int gmsgShowMenu = 0;
int gmsgGeigerRange = 0;
int gmsgTeamNames = 0;
int gmsgStatusText = 0;
int gmsgStatusValue = 0;
void LinkUserMessages()
{
// Already taken care of?

View file

@ -15,42 +15,42 @@
#pragma once
extern int gmsgShake;
extern int gmsgFade;
extern int gmsgFlashlight;
extern int gmsgFlashBattery;
extern int gmsgResetHUD;
extern int gmsgInitHUD;
extern int gmsgShowGameTitle;
extern int gmsgCurWeapon;
extern int gmsgHealth;
extern int gmsgDamage;
extern int gmsgBattery;
extern int gmsgTrain;
extern int gmsgLogo;
extern int gmsgWeaponList;
extern int gmsgAmmoX;
extern int gmsgHudText;
extern int gmsgDeathMsg;
extern int gmsgScoreInfo;
extern int gmsgTeamInfo;
extern int gmsgTeamScore;
extern int gmsgGameMode;
extern int gmsgMOTD;
extern int gmsgServerName;
extern int gmsgAmmoPickup;
extern int gmsgWeapPickup;
extern int gmsgItemPickup;
extern int gmsgHideWeapon;
extern int gmsgSetCurWeap;
extern int gmsgSayText;
extern int gmsgTextMsg;
extern int gmsgSetFOV;
extern int gmsgShowMenu;
extern int gmsgGeigerRange;
extern int gmsgTeamNames;
inline int gmsgShake = 0;
inline int gmsgFade = 0;
inline int gmsgFlashlight = 0;
inline int gmsgFlashBattery = 0;
inline int gmsgResetHUD = 0;
inline int gmsgInitHUD = 0;
inline int gmsgShowGameTitle = 0;
inline int gmsgCurWeapon = 0;
inline int gmsgHealth = 0;
inline int gmsgDamage = 0;
inline int gmsgBattery = 0;
inline int gmsgTrain = 0;
inline int gmsgLogo = 0;
inline int gmsgWeaponList = 0;
inline int gmsgAmmoX = 0;
inline int gmsgHudText = 0;
inline int gmsgDeathMsg = 0;
inline int gmsgScoreInfo = 0;
inline int gmsgTeamInfo = 0;
inline int gmsgTeamScore = 0;
inline int gmsgGameMode = 0;
inline int gmsgMOTD = 0;
inline int gmsgServerName = 0;
inline int gmsgAmmoPickup = 0;
inline int gmsgWeapPickup = 0;
inline int gmsgItemPickup = 0;
inline int gmsgHideWeapon = 0;
inline int gmsgSetCurWeap = 0;
inline int gmsgSayText = 0;
inline int gmsgTextMsg = 0;
inline int gmsgSetFOV = 0;
inline int gmsgShowMenu = 0;
inline int gmsgGeigerRange = 0;
inline int gmsgTeamNames = 0;
extern int gmsgStatusText;
extern int gmsgStatusValue;
inline int gmsgStatusText = 0;
inline int gmsgStatusValue = 0;
void LinkUserMessages();

View file

@ -22,8 +22,6 @@
#include "animation.h"
#include "scriptevent.h"
extern globalvars_t* gpGlobals;
#pragma warning(disable : 4244)

View file

@ -20,8 +20,6 @@
#include "weapons.h"
#include "effects.h"
extern DLL_GLOBAL int g_iSkillLevel;
#define SF_WAITFORTRIGGER (0x04 | 0x40) // UNDONE: Fix!
#define SF_NOWRECKAGE 0x08

View file

@ -25,8 +25,6 @@
#include "cbase.h"
#include "doors.h"
extern DLL_GLOBAL Vector g_vecAttackDir;
#define SF_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled
#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed
#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid.

View file

@ -15,6 +15,7 @@
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "saverestore.h"
#include "client.h"
#include "decals.h"
@ -30,8 +31,6 @@ char PM_FindTextureType(char* name);
void OnFreeEntPrivateData(edict_s* pEdict);
extern Vector VecBModelOrigin(entvars_t* pevBModel);
extern DLL_GLOBAL Vector g_vecAttackDir;
extern DLL_GLOBAL int g_iSkillLevel;
static DLL_FUNCTIONS gFunctionTable =
{
@ -217,10 +216,6 @@ void DispatchKeyValue(edict_t* pentKeyvalue, KeyValueData* pkvd)
pkvd->fHandled = static_cast<int32>(pEntity->KeyValue(pkvd));
}
// HACKHACK -- this is a hack to keep the node graph entity from "touching" things (like triggers)
// while it builds the graph
bool gTouchDisabled = false;
void DispatchTouch(edict_t* pentTouched, edict_t* pentOther)
{
if (gTouchDisabled)

View file

@ -58,6 +58,12 @@ extern "C" DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS* pFunctionTable, int interfa
extern "C" DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion);
extern "C" DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion);
/**
* @brief HACKHACK -- this is a hack to keep the node graph entity from "touching" things (like triggers)
* while it builds the graph
*/
inline bool gTouchDisabled = false;
extern int DispatchSpawn(edict_t* pent);
extern void DispatchKeyValue(edict_t* pentKeyvalue, KeyValueData* pkvd);
extern void DispatchTouch(edict_t* pentTouched, edict_t* pentOther);
@ -749,3 +755,5 @@ public:
void Precache() override;
bool KeyValue(KeyValueData* pkvd) override;
};
inline DLL_GLOBAL edict_t* g_pBodyQueueHead = nullptr;

View file

@ -41,17 +41,9 @@
#include "pm_shared.h"
#include "UserMessages.h"
extern DLL_GLOBAL unsigned int g_ulModelIndexPlayer;
extern DLL_GLOBAL bool g_fGameOver;
extern DLL_GLOBAL int g_iSkillLevel;
extern DLL_GLOBAL unsigned int g_ulFrameCount;
DLL_GLOBAL unsigned int g_ulFrameCount;
extern void CopyToBodyQue(entvars_t* pev);
extern bool giPrecacheGrunt;
extern cvar_t allow_spectators;
extern bool g_teamplay;
void LinkUserMessages();

View file

@ -30,11 +30,7 @@
#include "weapons.h"
#include "func_break.h"
extern DLL_GLOBAL Vector g_vecAttackDir;
extern DLL_GLOBAL int g_iSkillLevel;
extern Vector VecBModelOrigin(entvars_t* pevBModel);
extern entvars_t* g_pevLastInflictor;
#define GERMAN_GIB_COUNT 4
#define HUMAN_GIB_COUNT 6

View file

@ -18,7 +18,8 @@
#include "event_flags.h"
// Must be provided by user of this code
extern enginefuncs_t g_engfuncs;
// Holds engine functionality callbacks
inline enginefuncs_t g_engfuncs;
// The actual engine callbacks
#define GETPLAYERUSERID (*g_engfuncs.pfnGetPlayerUserId)

View file

@ -24,6 +24,7 @@
#include "cbase.h"
#include "decals.h"
#include "explode.h"
#include "weapons.h"
// Spark Shower
class CShower : public CBaseEntity

View file

@ -22,8 +22,4 @@
#define SF_ENVEXPLOSION_NODECAL (1 << 4) // don't make a scorch mark
#define SF_ENVEXPLOSION_NOSPARKS (1 << 5) // don't make a scorch mark
extern DLL_GLOBAL short g_sModelIndexFireball;
extern DLL_GLOBAL short g_sModelIndexSmoke;
extern void ExplosionCreate(const Vector& center, const Vector& angles, edict_t* pOwner, int magnitude, bool doDamage);

View file

@ -22,9 +22,6 @@
#define FLYING_AE_FLAP (8)
#define FLYING_AE_FLAPSOUND (9)
extern DLL_GLOBAL edict_t* g_pBodyQueueHead;
int CFlyingMonster ::CheckLocalMove(const Vector& vecStart, const Vector& vecEnd, CBaseEntity* pTarget, float* pflDist)
{
// UNDONE: need to check more than the endpoint

View file

@ -22,13 +22,12 @@
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "saverestore.h"
#include "func_break.h"
#include "decals.h"
#include "explode.h"
extern DLL_GLOBAL Vector g_vecAttackDir;
// =================== FUNC_Breakable ==============================================
// Just add more items to the bottom of this array and they will automagically be supported

View file

@ -44,12 +44,6 @@ cvar_t allow_spectators = {"allow_spectators", "0.0", FCVAR_SERVER}; // 0 preven
cvar_t mp_chattime = {"mp_chattime", "10", FCVAR_SERVER};
// Engine Cvars
cvar_t* g_psv_gravity = NULL;
cvar_t* g_psv_aim = NULL;
cvar_t* g_footsteps = NULL;
cvar_t* g_psv_cheats = nullptr;
//CVARS FOR SKILL LEVEL SETTINGS
// Agrunt
cvar_t sk_agrunt_health1 = {"sk_agrunt_health1", "0"};

View file

@ -22,23 +22,27 @@ void GameDLLShutdown();
extern cvar_t displaysoundlist;
// multiplayer server rules
extern cvar_t teamplay;
extern cvar_t fraglimit;
extern cvar_t timelimit;
extern cvar_t friendlyfire;
extern cvar_t falldamage;
extern cvar_t weaponstay;
extern cvar_t forcerespawn;
extern cvar_t flashlight;
extern cvar_t aimcrosshair;
extern cvar_t decalfrequency;
extern cvar_t teamlist;
extern cvar_t teamoverride;
extern cvar_t defaultteam;
extern cvar_t allowmonsters;
extern cvar_t fragsleft;
extern cvar_t timeleft;
extern cvar_t teamplay;
extern cvar_t fraglimit;
extern cvar_t timelimit;
extern cvar_t friendlyfire;
extern cvar_t falldamage;
extern cvar_t weaponstay;
extern cvar_t forcerespawn;
extern cvar_t flashlight;
extern cvar_t aimcrosshair;
extern cvar_t decalfrequency;
extern cvar_t teamlist;
extern cvar_t teamoverride;
extern cvar_t defaultteam;
extern cvar_t allowmonsters;
extern cvar_t allow_spectators;
extern cvar_t mp_chattime;
// Engine Cvars
extern cvar_t *g_psv_gravity;
extern cvar_t *g_psv_aim;
extern cvar_t *g_footsteps;
extern cvar_t* g_psv_cheats;
inline cvar_t* g_psv_gravity;
inline cvar_t* g_psv_aim;
inline cvar_t* g_footsteps;
inline cvar_t* g_psv_cheats;

View file

@ -29,11 +29,6 @@
extern edict_t* EntSelectSpawnPoint(CBaseEntity* pPlayer);
DLL_GLOBAL CGameRules* g_pGameRules = NULL;
extern DLL_GLOBAL bool g_fGameOver;
bool g_teamplay = false;
//=========================================================
//=========================================================
bool CGameRules::CanHaveAmmo(CBasePlayer* pPlayer, const char* pszAmmoName, int iMaxCarry)

View file

@ -355,9 +355,12 @@ public:
protected:
virtual void ChangeLevel();
virtual void GoToIntermission();
float m_flIntermissionEndTime;
float m_flIntermissionStartTime = 0;
float m_flIntermissionEndTime = 0;
bool m_iEndIntermissionButtonHit;
void SendMOTDToClient(edict_t* client);
};
extern DLL_GLOBAL CGameRules* g_pGameRules;
inline DLL_GLOBAL CGameRules* g_pGameRules = nullptr;
inline DLL_GLOBAL bool g_fGameOver;
inline bool g_teamplay = false;

View file

@ -1,38 +0,0 @@
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
/*
===== globals.cpp ========================================================
DLL-wide global variable definitions.
They're all defined here, for convenient centralization.
Source files that need them should "extern ..." declare each
variable, to better document what globals they care about.
*/
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "soundent.h"
DLL_GLOBAL unsigned int g_ulFrameCount;
DLL_GLOBAL unsigned int g_ulModelIndexEyes;
DLL_GLOBAL unsigned int g_ulModelIndexPlayer;
DLL_GLOBAL Vector g_vecAttackDir;
DLL_GLOBAL int g_iSkillLevel;
DLL_GLOBAL bool gDisplayTitle;
DLL_GLOBAL bool g_fGameOver;
DLL_GLOBAL int g_Language;

View file

@ -30,8 +30,6 @@
//float flRandom = RANDOM_FLOAT(0,1);
DLL_GLOBAL bool g_fDrawLines = false;
//=========================================================
//
// AI UTILITY FUNCTIONS

View file

@ -25,10 +25,6 @@
#include "cbase.h"
// Holds engine functionality callbacks
enginefuncs_t g_engfuncs;
globalvars_t* gpGlobals;
#undef DLLEXPORT
#ifdef WIN32
#define DLLEXPORT __stdcall

View file

@ -27,8 +27,6 @@
#include "soundent.h"
#include "game.h"
extern DLL_GLOBAL int g_iSkillLevel;
//=========================================================
// monster-specific schedule types
//=========================================================

View file

@ -44,8 +44,6 @@
int g_fGruntQuestion; // true if an idle grunt asked a question. Cleared when someone answers.
extern DLL_GLOBAL int g_iSkillLevel;
//=========================================================
// monster-specific DEFINE's
//=========================================================

View file

@ -26,8 +26,6 @@
#include "weapons.h"
#include "soundent.h"
extern DLL_GLOBAL int g_iSkillLevel;
//=========================================================
// Monster's Anim Events Go Here
//=========================================================

View file

@ -102,8 +102,6 @@ void CItem::Spawn()
}
}
extern bool gEvilImpulse101;
void CItem::ItemTouch(CBaseEntity* pOther)
{
// if it's not a player, ignore

View file

@ -39,10 +39,6 @@
Vector VecBModelOrigin(entvars_t* pevBModel);
extern DLL_GLOBAL bool g_fDrawLines;
extern DLL_GLOBAL short g_sModelIndexLaser; // holds the index for the laser beam
extern DLL_GLOBAL short g_sModelIndexLaserDot; // holds the index for the laser beam dot
// Global Savedata for monster
// UNDONE: Save schedule data? Can this be done? We may
// lose our enemy pointer or other data (goal ent, target, etc)

View file

@ -70,15 +70,20 @@
#define MOVE_NORMAL 0 // normal move in the direction monster is facing
#define MOVE_STRAFE 1 // moves in direction specified, no matter which way monster is facing
inline DLL_GLOBAL Vector g_vecAttackDir;
/**
* @brief Set in combat.cpp. Used to pass the damage inflictor for death messages.
* Better solution: Add as parameter to all Killed() functions.
*/
inline entvars_t* g_pevLastInflictor = nullptr;
inline DLL_GLOBAL bool g_fDrawLines = false;
// spawn flags 256 and above are already taken by the engine
extern void UTIL_MoveToOrigin(edict_t* pent, const Vector& vecGoal, float flDist, int iMoveType);
Vector VecCheckToss(entvars_t* pev, const Vector& vecSpot1, Vector vecSpot2, float flGravityAdj = 1.0);
Vector VecCheckThrow(entvars_t* pev, const Vector& vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj = 1.0);
extern DLL_GLOBAL Vector g_vecAttackDir;
extern DLL_GLOBAL CONSTANT float g_flMeleeRange;
extern DLL_GLOBAL CONSTANT float g_flMediumRange;
extern DLL_GLOBAL CONSTANT float g_flLongRange;
extern void EjectBrass(const Vector& vecOrigin, const Vector& vecVelocity, float rotation, int model, int soundtype);
extern void ExplodeModel(const Vector& vecOrigin, float speed, int model, int count);

View file

@ -29,17 +29,10 @@
#include "hltv.h"
#include "UserMessages.h"
extern DLL_GLOBAL CGameRules* g_pGameRules;
extern DLL_GLOBAL bool g_fGameOver;
extern bool g_teamplay;
#define ITEM_RESPAWN_TIME 30
#define WEAPON_RESPAWN_TIME 20
#define AMMO_RESPAWN_TIME 20
float g_flIntermissionStartTime = 0;
CVoiceGameMgr g_VoiceGameMgr;
class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper
@ -69,8 +62,6 @@ CHalfLifeMultiplay ::CHalfLifeMultiplay()
g_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
RefreshSkillData();
m_flIntermissionEndTime = 0;
g_flIntermissionStartTime = 0;
// 11/8/98
// Modified by YWB: Server .cfg file is now a cvar, so that
@ -170,10 +161,6 @@ void CHalfLifeMultiplay::RefreshSkillData()
// longest the intermission can last, in seconds
#define MAX_INTERMISSION_TIME 120
extern cvar_t timeleft, fragsleft;
extern cvar_t mp_chattime;
//=========================================================
//=========================================================
void CHalfLifeMultiplay ::Think()
@ -196,13 +183,13 @@ void CHalfLifeMultiplay ::Think()
else if (time > MAX_INTERMISSION_TIME)
CVAR_SET_STRING("mp_chattime", UTIL_dtos1(MAX_INTERMISSION_TIME));
m_flIntermissionEndTime = g_flIntermissionStartTime + mp_chattime.value;
m_flIntermissionEndTime = m_flIntermissionStartTime + mp_chattime.value;
// check to see if we should change levels now
if (m_flIntermissionEndTime < gpGlobals->time)
{
if (m_iEndIntermissionButtonHit // check that someone has pressed a key, or the max intermission time is over
|| ((g_flIntermissionStartTime + MAX_INTERMISSION_TIME) < gpGlobals->time))
|| ((m_flIntermissionStartTime + MAX_INTERMISSION_TIME) < gpGlobals->time))
ChangeLevel(); // intermission is over
}
@ -1158,7 +1145,7 @@ void CHalfLifeMultiplay ::GoToIntermission()
CVAR_SET_STRING("mp_chattime", UTIL_dtos1(MAX_INTERMISSION_TIME));
m_flIntermissionEndTime = gpGlobals->time + ((int)mp_chattime.value);
g_flIntermissionStartTime = gpGlobals->time;
m_flIntermissionStartTime = gpGlobals->time;
g_fGameOver = true;
m_iEndIntermissionButtonHit = false;

View file

@ -37,8 +37,6 @@
#define MAX_NODE_INITIAL_LINKS 128
#define MAX_NODES 1024
extern DLL_GLOBAL edict_t* g_pBodyQueueHead;
Vector VecBModelOrigin(entvars_t* pevBModel);
CGraph WorldGraph;
@ -1615,7 +1613,6 @@ void CTestHull ::ShowBadNode()
pev->nextthink = gpGlobals->time + 0.1;
}
extern bool gTouchDisabled;
void CTestHull::CallBuildNodeGraph()
{
// TOUCH HACK -- Don't allow this entity to call anyone's "touch" function

View file

@ -43,16 +43,6 @@
// #define DUCKFIX
extern DLL_GLOBAL unsigned int g_ulModelIndexPlayer;
extern DLL_GLOBAL bool g_fGameOver;
extern DLL_GLOBAL bool g_fDrawLines;
bool gEvilImpulse101;
extern DLL_GLOBAL int g_iSkillLevel;
extern DLL_GLOBAL bool gDisplayTitle;
bool gInitHUD = true;
extern void CopyToBodyQue(entvars_t* pev);
extern edict_t* EntSelectSpawnPoint(CBaseEntity* pPlayer);
@ -148,9 +138,6 @@ TYPEDESCRIPTION CBasePlayer::m_playerSaveData[] =
};
bool giPrecacheGrunt = false;
LINK_ENTITY_TO_CLASS(player, CBasePlayer);
@ -767,8 +754,6 @@ void CBasePlayer::RemoveAllItems(bool removeSuit)
*
* ENTITY_METHOD(PlayerDie)
*/
entvars_t* g_pevLastInflictor; // Set in combat.cpp. Used to pass the damage inflictor for death messages.
// Better solution: Add as parameter to all Killed() functions.
void CBasePlayer::Killed(entvars_t* pevAttacker, int iGib)
{
@ -2669,9 +2654,6 @@ bool IsSpawnPointValid(CBaseEntity* pPlayer, CBaseEntity* pSpot)
return true;
}
DLL_GLOBAL CBaseEntity* g_pLastSpawn;
/*
============
EntSelectSpawnPoint
@ -3871,6 +3853,7 @@ void CBasePlayer ::UpdateClientData()
}
// HACKHACK -- send the message to display the game title
//TODO: will not work properly in multiplayer
if (gDisplayTitle)
{
MESSAGE_BEGIN(MSG_ONE, gmsgShowGameTitle, NULL, pev);

View file

@ -335,5 +335,13 @@ public:
#define AUTOAIM_8DEGREES 0.1391731009601
#define AUTOAIM_10DEGREES 0.1736481776669
inline bool gInitHUD = true;
inline bool gEvilImpulse101 = false;
inline bool giPrecacheGrunt = false;
extern bool gInitHUD;
/**
* @brief Display the game title if this key is set
*/
inline DLL_GLOBAL bool gDisplayTitle = false;
inline DLL_GLOBAL unsigned int g_ulModelIndexPlayer = 0;
inline DLL_GLOBAL CBaseEntity* g_pLastSpawn = nullptr;

View file

@ -25,9 +25,6 @@
#include "items.h"
#include "UserMessages.h"
extern DLL_GLOBAL CGameRules* g_pGameRules;
extern DLL_GLOBAL bool g_fGameOver;
//=========================================================
//=========================================================
CHalfLifeRules::CHalfLifeRules()

View file

@ -19,10 +19,6 @@
#include "util.h"
#include "skill.h"
skilldata_t gSkillData;
//=========================================================
// take the name of a cvar, tack a digit for the skill level
// on, and return the value.of that Cvar

View file

@ -139,10 +139,10 @@ struct skilldata_t
float plrArm;
};
extern DLL_GLOBAL skilldata_t gSkillData;
inline DLL_GLOBAL skilldata_t gSkillData;
float GetSkillCvar(const char* pName);
extern DLL_GLOBAL int g_iSkillLevel;
inline DLL_GLOBAL int g_iSkillLevel;
#define SKILL_EASY 1
#define SKILL_MEDIUM 2

View file

@ -21,8 +21,6 @@
LINK_ENTITY_TO_CLASS(soundent, CSoundEnt);
CSoundEnt* pSoundEnt;
//=========================================================
// CSound - Clear - zeros all fields for a sound
//=========================================================

View file

@ -94,3 +94,5 @@ public:
private:
CSound m_SoundPool[MAX_WORLD_SOUNDS];
};
inline CSoundEnt* pSoundEnt;

View file

@ -29,9 +29,6 @@
extern bool FEntIsVisible(entvars_t* pev, entvars_t* pevTarget);
extern DLL_GLOBAL int g_iSkillLevel;
// Landmark class
void CPointEntity ::Spawn()
{

View file

@ -25,12 +25,11 @@
#include "game.h"
#include "UserMessages.h"
//TODO: these should be members of CHalfLifeTeamplay
static char team_names[MAX_TEAMS][MAX_TEAMNAME_LENGTH];
static int team_scores[MAX_TEAMS];
static int num_teams = 0;
extern DLL_GLOBAL bool g_fGameOver;
CHalfLifeTeamplay ::CHalfLifeTeamplay()
{
m_DisableDeathMessages = false;
@ -67,8 +66,6 @@ CHalfLifeTeamplay ::CHalfLifeTeamplay()
RecountTeams();
}
extern cvar_t timeleft, fragsleft;
#include "voice_gamemgr.h"
extern CVoiceGameMgr g_VoiceGameMgr;

View file

@ -35,8 +35,6 @@
#define SF_TRIGGER_HURT_CLIENTONLYFIRE 16 // trigger hurt will only fire its target if it is hurting a client
#define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32 // only clients may touch this trigger.
extern DLL_GLOBAL bool g_fGameOver;
extern void SetMovedir(entvars_t* pev);
extern Vector VecBModelOrigin(entvars_t* pevBModel);

View file

@ -171,9 +171,6 @@ void UTIL_ParametricRocket(entvars_t* pev, Vector vecOrigin, Vector vecAngles, e
pev->impacttime = gpGlobals->time + travelTime;
}
int g_groupmask = 0;
int g_groupop = 0;
// Normal overrides
void UTIL_SetGroupTrace(int groupmask, int op)
{
@ -1507,9 +1504,6 @@ float UTIL_WaterLevel(const Vector& position, float minz, float maxz)
return midUp.z;
}
extern DLL_GLOBAL short g_sModelIndexBubbles; // holds the index for the bubbles model
void UTIL_Bubbles(Vector mins, Vector maxs, int count)
{
Vector mid = (mins + maxs) * 0.5;

View file

@ -25,7 +25,7 @@
inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float* pOrigin, entvars_t* ent); // implementation later in this file
extern globalvars_t* gpGlobals;
inline globalvars_t* gpGlobals = nullptr;
// Use this instead of ALLOC_STRING on constant strings
#define STRING(offset) ((const char*)(gpGlobals->pStringBase + (unsigned int)(offset)))
@ -392,7 +392,7 @@ void DBG_AssertFunction(bool fExpr, const char* szExpr, const char* szFile, int
#define LANGUAGE_FRENCH 2
#define LANGUAGE_BRITISH 3
extern DLL_GLOBAL int g_Language;
inline DLL_GLOBAL int g_Language;
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
@ -534,8 +534,8 @@ void EMIT_GROUPNAME_SUIT(edict_t* entity, const char* groupname);
#define GROUP_OP_AND 0
#define GROUP_OP_NAND 1
extern int g_groupmask;
extern int g_groupop;
inline int g_groupmask = 0;
inline int g_groupop = 0;
class UTIL_GroupTrace
{

View file

@ -31,26 +31,8 @@
#include "gamerules.h"
#include "UserMessages.h"
extern bool gEvilImpulse101;
#define NOT_USED 255
DLL_GLOBAL short g_sModelIndexLaser; // holds the index for the laser beam
DLL_GLOBAL const char* g_pModelNameLaser = "sprites/laserbeam.spr";
DLL_GLOBAL short g_sModelIndexLaserDot; // holds the index for the laser beam dot
DLL_GLOBAL short g_sModelIndexFireball; // holds the index for the fireball
DLL_GLOBAL short g_sModelIndexSmoke; // holds the index for the smoke cloud
DLL_GLOBAL short g_sModelIndexWExplosion; // holds the index for the underwater explosion
DLL_GLOBAL short g_sModelIndexBubbles; // holds the index for the bubbles model
DLL_GLOBAL short g_sModelIndexBloodDrop; // holds the sprite index for the initial blood
DLL_GLOBAL short g_sModelIndexBloodSpray; // holds the sprite index for splattered blood
ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS];
AmmoInfo CBasePlayerItem::AmmoInfoArray[MAX_AMMO_SLOTS];
MULTIDAMAGE gMultiDamage;
#define TRACER_FREQ 4 // Tracers fire every fourth bullet

View file

@ -218,7 +218,7 @@ typedef struct
int iId;
} AmmoInfo;
extern int giAmmoIndex;
inline int giAmmoIndex = 0;
void AddAmmoNameToAmmoRegistry(const char* szAmmoname);
@ -268,8 +268,8 @@ public:
virtual CBasePlayerItem* GetWeaponPtr() { return NULL; }
static ItemInfo ItemInfoArray[MAX_WEAPONS];
static AmmoInfo AmmoInfoArray[MAX_AMMO_SLOTS];
static inline ItemInfo ItemInfoArray[MAX_WEAPONS];
static inline AmmoInfo AmmoInfoArray[MAX_AMMO_SLOTS];
CBasePlayer* m_pPlayer;
CBasePlayerItem* m_pNext;
@ -385,16 +385,16 @@ public:
};
extern DLL_GLOBAL short g_sModelIndexLaser; // holds the index for the laser beam
extern DLL_GLOBAL const char* g_pModelNameLaser;
inline DLL_GLOBAL short g_sModelIndexLaser; // holds the index for the laser beam
constexpr DLL_GLOBAL const char* g_pModelNameLaser = "sprites/laserbeam.spr";
extern DLL_GLOBAL short g_sModelIndexLaserDot; // holds the index for the laser beam dot
extern DLL_GLOBAL short g_sModelIndexFireball; // holds the index for the fireball
extern DLL_GLOBAL short g_sModelIndexSmoke; // holds the index for the smoke cloud
extern DLL_GLOBAL short g_sModelIndexWExplosion; // holds the index for the underwater explosion
extern DLL_GLOBAL short g_sModelIndexBubbles; // holds the index for the bubbles model
extern DLL_GLOBAL short g_sModelIndexBloodDrop; // holds the sprite index for blood drops
extern DLL_GLOBAL short g_sModelIndexBloodSpray; // holds the sprite index for blood spray (bigger)
inline DLL_GLOBAL short g_sModelIndexLaserDot; // holds the index for the laser beam dot
inline DLL_GLOBAL short g_sModelIndexFireball; // holds the index for the fireball
inline DLL_GLOBAL short g_sModelIndexSmoke; // holds the index for the smoke cloud
inline DLL_GLOBAL short g_sModelIndexWExplosion; // holds the index for the underwater explosion
inline DLL_GLOBAL short g_sModelIndexBubbles; // holds the index for the bubbles model
inline DLL_GLOBAL short g_sModelIndexBloodDrop; // holds the sprite index for blood drops
inline DLL_GLOBAL short g_sModelIndexBloodSpray; // holds the sprite index for blood spray (bigger)
extern void ClearMultiDamage();
extern void ApplyMultiDamage(entvars_t* pevInflictor, entvars_t* pevAttacker);
@ -412,7 +412,7 @@ typedef struct
int type;
} MULTIDAMAGE;
extern MULTIDAMAGE gMultiDamage;
inline MULTIDAMAGE gMultiDamage;
#define LOUD_GUN_VOLUME 1000

View file

@ -19,8 +19,6 @@
#include "weapons.h"
#include "gamerules.h"
int giAmmoIndex = 0;
// Precaches the ammo and queues the ammo info for sending to clients
void AddAmmoNameToAmmoRegistry(const char* szAmmoname)
{

View file

@ -34,12 +34,7 @@
#include "gamerules.h"
#include "teamplay_gamerules.h"
extern CSoundEnt* pSoundEnt;
extern CBaseEntity* g_pLastSpawn;
DLL_GLOBAL edict_t* g_pBodyQueueHead;
CGlobalState gGlobalState;
extern DLL_GLOBAL bool gDisplayTitle;
extern void W_Precache();
@ -467,8 +462,6 @@ LINK_ENTITY_TO_CLASS(worldspawn, CWorld);
#define SF_WORLD_TITLE 0x0002 // Display game title at startup
#define SF_WORLD_FORCETEAM 0x0004 // Force teams
extern DLL_GLOBAL bool g_fGameOver;
void CWorld ::Spawn()
{
g_fGameOver = false;
@ -651,10 +644,7 @@ void CWorld ::Precache()
else
CVAR_SET_FLOAT("v_dark", 0.0);
if ((pev->spawnflags & SF_WORLD_TITLE) != 0)
gDisplayTitle = true; // display the game title if this key is set
else
gDisplayTitle = false;
gDisplayTitle = (pev->spawnflags & SF_WORLD_TITLE) != 0;
if ((pev->spawnflags & SF_WORLD_FORCETEAM) != 0)
{

View file

@ -141,7 +141,6 @@
<ClCompile Include="..\..\dlls\gauss.cpp" />
<ClCompile Include="..\..\dlls\genericmonster.cpp" />
<ClCompile Include="..\..\dlls\ggrenade.cpp" />
<ClCompile Include="..\..\dlls\globals.cpp" />
<ClCompile Include="..\..\dlls\gman.cpp" />
<ClCompile Include="..\..\dlls\handgrenade.cpp" />
<ClCompile Include="..\..\dlls\hassassin.cpp" />

View file

@ -153,9 +153,6 @@
<ClCompile Include="..\..\dlls\ggrenade.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>
<ClCompile Include="..\..\dlls\globals.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>
<ClCompile Include="..\..\dlls\h_ai.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>

View file

@ -143,7 +143,6 @@
<ClCompile Include="..\..\dlls\gauss.cpp" />
<ClCompile Include="..\..\dlls\genericmonster.cpp" />
<ClCompile Include="..\..\dlls\ggrenade.cpp" />
<ClCompile Include="..\..\dlls\globals.cpp" />
<ClCompile Include="..\..\dlls\gman.cpp" />
<ClCompile Include="..\..\dlls\handgrenade.cpp" />
<ClCompile Include="..\..\dlls\hassassin.cpp" />

View file

@ -153,9 +153,6 @@
<ClCompile Include="..\..\dlls\ggrenade.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>
<ClCompile Include="..\..\dlls\globals.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>
<ClCompile Include="..\..\dlls\h_ai.cpp">
<Filter>Source Files\dlls</Filter>
</ClCompile>