From 35a96204ec43a25d41fa76735d874d4740382a6e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 10 Aug 2015 15:40:43 +0200 Subject: [PATCH] Don't define variables in header files. --- src/bosses.cpp | 3 +++ src/bosses.h | 3 --- src/cutscene.cpp | 2 ++ src/cutscene.h | 2 -- src/main.cpp | 15 +++++++++++++++ src/main.h | 15 --------------- src/mapEditor.cpp | 15 +++++++++++++++ src/mapEditor.h | 15 --------------- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/bosses.cpp b/src/bosses.cpp index 7c4c26a..385da51 100644 --- a/src/bosses.cpp +++ b/src/bosses.cpp @@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "bosses.h" +// this is used exclusively by the bosses +Boss *self; + void tankBossLevel() { if (player.health < 1) diff --git a/src/bosses.h b/src/bosses.h index 19a488a..248201c 100644 --- a/src/bosses.h +++ b/src/bosses.h @@ -50,6 +50,3 @@ extern Map map; extern Entity player; extern Entity defItem[MAX_ITEMS]; - -// this is used exclusively by the bosses -Boss *self; diff --git a/src/cutscene.cpp b/src/cutscene.cpp index b119f5e..1592add 100644 --- a/src/cutscene.cpp +++ b/src/cutscene.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "cutscene.h" +List sceneList; + void createSceneList() { char sceneLine[1024] = ""; diff --git a/src/cutscene.h b/src/cutscene.h index 2b0775a..87043aa 100644 --- a/src/cutscene.h +++ b/src/cutscene.h @@ -28,5 +28,3 @@ extern GameData gameData; extern Graphics graphics; extern Game game; - -List sceneList; diff --git a/src/main.cpp b/src/main.cpp index 9516517..a92a49b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +Audio audio; +Config config; +Engine engine; +Game game; +GameData gameData; +Graphics graphics; +Map map; +ReplayData replayData; +MedalServer medalServer; + +Entity defEnemy[MAX_ENEMIES]; +Entity defItem[MAX_ITEMS]; +Entity player; +Weapon weapon[MAX_WEAPONS]; + void showVersion() { printf(_( diff --git a/src/main.h b/src/main.h index 2ebcd5a..3c7ad93 100644 --- a/src/main.h +++ b/src/main.h @@ -47,18 +47,3 @@ extern void checkStartCutscene(); extern void easyGameFinished(); extern void presentPlayerMedal(const char *tname); - -Audio audio; -Config config; -Engine engine; -Game game; -GameData gameData; -Graphics graphics; -Map map; -ReplayData replayData; -MedalServer medalServer; - -Entity defEnemy[MAX_ENEMIES]; -Entity defItem[MAX_ITEMS]; -Entity player; -Weapon weapon[MAX_WEAPONS]; diff --git a/src/mapEditor.cpp b/src/mapEditor.cpp index edcf430..97bf2b8 100644 --- a/src/mapEditor.cpp +++ b/src/mapEditor.cpp @@ -21,6 +21,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mapEditor.h" +String *stringHead = new String; +String *stringTail = stringHead; + +Audio audio; +Engine engine; +Game game; +GameData gameData; +Graphics graphics; +Map map; + +Entity defEnemy[MAX_ENEMIES]; +Entity defItem[MAX_ITEMS]; +Entity player; +Weapon weapon[MAX_WEAPONS]; + MedalServer medalServer; Config config; ReplayData replayData; diff --git a/src/mapEditor.h b/src/mapEditor.h index ebaa183..5209a24 100644 --- a/src/mapEditor.h +++ b/src/mapEditor.h @@ -55,18 +55,3 @@ class String { } }; - -String *stringHead = new String; -String *stringTail = stringHead; - -Audio audio; -Engine engine; -Game game; -GameData gameData; -Graphics graphics; -Map map; - -Entity defEnemy[MAX_ENEMIES]; -Entity defItem[MAX_ITEMS]; -Entity player; -Weapon weapon[MAX_WEAPONS]; -- 2.39.2