From d5ff767196019eeb0001f921365bb1e4060eee5b Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Thu, 23 Dec 2010 01:11:57 +0300 Subject: [PATCH] Move some global vars from Globals.cpp, add decls to headers --- Source/Game.h | 1 + Source/GameDraw.cpp | 3 --- Source/GameInitDispose.cpp | 3 --- Source/GameTick.cpp | 3 --- Source/OpenGL_Windows.cpp | 2 -- Source/Person.cpp | 5 ++--- Source/Person.h | 1 + Source/Sprite.cpp | 3 +-- Source/Weapons.cpp | 3 +-- Source/Weapons.h | 1 + 10 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Source/Game.h b/Source/Game.h index d501b8c..d7714c3 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -319,4 +319,5 @@ extern "C" { void UndefinedSymbolToExposeStubbedCode(void); } #define STUBBED(x) { static bool seen = false; if (!seen) { seen = true; fprintf(stderr, "STUBBED: %s at %s:%d\n", x, __FILE__, __LINE__); } } //#define STUBBED(x) +extern int numplayers; #endif diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 7bc613a..3492656 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -45,8 +45,6 @@ extern int detail; extern float usermousesensitivity; extern bool osx; extern float camerashake; -extern Weapons weapons; -extern Person player[maxplayers]; extern int slomo; extern float slomodelay; extern bool ismotionblur; @@ -54,7 +52,6 @@ extern float woozy; extern float blackout; extern bool damageeffects; extern float volume; -extern int numplayers; extern bool texttoggle; extern float blurness; extern float targetblurness; diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index da5516c..ed1edac 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -51,9 +51,6 @@ extern bool ismotionblur; extern bool trilinear; extern bool osx; extern bool musictoggle; -extern Weapons weapons; -extern Person player[maxplayers]; -extern int numplayers; extern int environment; extern bool ambientsound; extern float multiplier; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index d9f821a..ef75984 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -70,9 +70,6 @@ extern float blackout; extern bool cellophane; extern bool musictoggle; extern int difficulty; -extern Weapons weapons; -extern Person player[maxplayers]; -extern int numplayers; extern int bloodtoggle; extern bool invertmouse; extern float windvar; diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 5dbf5c4..365e48a 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -70,9 +70,7 @@ extern float terraindetail; extern float texdetail; extern bool osx; -extern int numplayers; extern bool freeze; -extern Person player[maxplayers]; extern bool stillloading; extern int mainmenu; /*extern*/ bool gameFocused; diff --git a/Source/Person.cpp b/Source/Person.cpp index 5f2a2d9..05eeb5f 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "openal_wrapper.h" #include "Animation.h" #include "Sounds.h" +#include "Awards.h" +#include "Game.h" extern float multiplier; extern int channels[100]; @@ -51,11 +53,8 @@ extern float terraindetail; extern float viewdistance; extern float blackout; extern int difficulty; -extern Weapons weapons; extern bool decals; extern float fadestart; -extern Person player[maxplayers]; -extern int numplayers; extern bool freeze; extern bool winfreeze; extern float flashamount,flashr,flashg,flashb; diff --git a/Source/Person.h b/Source/Person.h index 27666e4..5c5a969 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -373,4 +373,5 @@ class Person void RagDoll(bool checkcollision); }; +extern Person player[maxplayers]; #endif diff --git a/Source/Sprite.cpp b/Source/Sprite.cpp index f0991af..02eb220 100644 --- a/Source/Sprite.cpp +++ b/Source/Sprite.cpp @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Sprite.h" #include "Person.h" +#include "Game.h" extern XYZ viewer; extern float viewdistance; extern float fadestart; @@ -36,8 +37,6 @@ extern XYZ viewerfacing; extern float terraindetail; extern int bloodtoggle; extern XYZ windvector; -extern int numplayers; -extern Person player[maxplayers]; // init statics GLuint Sprite::cloudtexture = 0; diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index 267bd14..7745b89 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "openal_wrapper.h" #include "Animation.h" #include "Sounds.h" +#include "Game.h" extern float multiplier; extern int channels[100]; @@ -49,8 +50,6 @@ extern float terraindetail; extern float viewdistance; extern float blackout; extern int difficulty; -extern Person player[maxplayers]; -extern int numplayers; extern bool freeze; extern int bonus; extern float bonusvalue; diff --git a/Source/Weapons.h b/Source/Weapons.h index d9fa2f6..bbe1804 100644 --- a/Source/Weapons.h +++ b/Source/Weapons.h @@ -114,4 +114,5 @@ public: ~Weapons(); }; +extern Weapons weapons; #endif -- 2.39.5