From: Guus Sliepen Date: Mon, 10 Aug 2015 13:40:43 +0000 (+0200) Subject: Don't define variables in header files. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=35a96204ec43a25d41fa76735d874d4740382a6e;p=quix0rs-blobwars.git Don't define variables in header files. --- 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];