From b0779b4b658e0443c6491d6819a240b718fe5ad4 Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 21 Jul 2005 18:44:27 +0000 Subject: (svn r2663) Include variables.h only in these files which need it, not globally via openttd.h --- ai_new.h | 1 + ai_old.c | 1 + ai_pathfinder.c | 1 + airport.h | 1 + clear_cmd.c | 1 + depot.h | 1 + extmidi.c | 1 + fileio.c | 1 + gfx.c | 1 + network.c | 1 + network.h | 2 ++ network_data.c | 1 + network_udp.c | 1 + openttd.h | 3 ++- pathfind.c | 1 + settings.c | 1 + signs.c | 1 + sprite.c | 1 + texteff.c | 1 + tree_cmd.c | 1 + variables.h | 3 --- vehicle.h | 1 + 22 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ai_new.h b/ai_new.h index 66c26b6ad..9023d397a 100644 --- a/ai_new.h +++ b/ai_new.h @@ -2,6 +2,7 @@ #define AI_NEW_H #include "aystar.h" +#include "player.h" /* * These defines can be altered to change the behavoir of the AI diff --git a/ai_old.c b/ai_old.c index 70b4103c9..95ac10111 100644 --- a/ai_old.c +++ b/ai_old.c @@ -13,6 +13,7 @@ #include "economy.h" #include "airport.h" #include "depot.h" +#include "variables.h" // remove some day perhaps? static Player *_cur_ai_player; diff --git a/ai_pathfinder.c b/ai_pathfinder.c index f6e2c3f57..cee7a6e6b 100644 --- a/ai_pathfinder.c +++ b/ai_pathfinder.c @@ -6,6 +6,7 @@ #include "command.h" #include "ai_new.h" #include "depot.h" +#include "variables.h" #define TEST_STATION_NO_DIR 0xFF diff --git a/airport.h b/airport.h index 5b0a86907..09c7a4881 100644 --- a/airport.h +++ b/airport.h @@ -2,6 +2,7 @@ #define AIRPORT_H #include "airport_movement.h" +#include "variables.h" enum {MAX_TERMINALS = 6}; enum {MAX_HELIPADS = 2}; diff --git a/clear_cmd.c b/clear_cmd.c index 7d0227f64..b940af4ab 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -5,6 +5,7 @@ #include "tile.h" #include "viewport.h" #include "command.h" +#include "variables.h" typedef struct TerraformerHeightMod { TileIndex tile; diff --git a/depot.h b/depot.h index a08fadb12..614476b12 100644 --- a/depot.h +++ b/depot.h @@ -6,6 +6,7 @@ #include "pool.h" #include "tile.h" +#include "variables.h" struct Depot { TileIndex xy; diff --git a/extmidi.c b/extmidi.c index f4e07eb44..e9fcd59d1 100644 --- a/extmidi.c +++ b/extmidi.c @@ -6,6 +6,7 @@ #include "hal.h" #include "sound.h" #include "string.h" +#include "variables.h" #include #include #include diff --git a/fileio.c b/fileio.c index 4a9cd0284..e3c7d5021 100644 --- a/fileio.c +++ b/fileio.c @@ -1,6 +1,7 @@ #include "stdafx.h" #include "openttd.h" #include "fileio.h" +#include "variables.h" #if defined(UNIX) || defined(__OS2__) #include // required for tolower() #endif diff --git a/gfx.c b/gfx.c index 8462b436c..57e655c8b 100644 --- a/gfx.c +++ b/gfx.c @@ -6,6 +6,7 @@ #include "gfx.h" #include "table/palettes.h" #include "hal.h" +#include "variables.h" Colour _cur_palette[256]; diff --git a/network.c b/network.c index 938a73544..2265795c3 100644 --- a/network.c +++ b/network.c @@ -5,6 +5,7 @@ #include "map.h" #include "network_data.h" #include "command.h" +#include "variables.h" #if defined(WITH_REV) extern const char _openttd_revision[]; diff --git a/network.h b/network.h index 46d4d349d..3139a3e4d 100644 --- a/network.h +++ b/network.h @@ -5,6 +5,8 @@ #ifdef ENABLE_NETWORK +#include "player.h" + // If this line is enable, every frame will have a sync test // this is not needed in normal games. Normal is like 1 sync in 100 // frames. You can enable this if you have a lot of desyncs on a certain diff --git a/network_data.c b/network_data.c index 18b179fd0..02cecfc06 100644 --- a/network_data.c +++ b/network_data.c @@ -10,6 +10,7 @@ #include "network_client.h" #include "command.h" #include "callback_table.h" +#include "variables.h" // This files handles the send/receive of all packets diff --git a/network_udp.c b/network_udp.c index e9cf01425..253247014 100644 --- a/network_udp.c +++ b/network_udp.c @@ -8,6 +8,7 @@ #include "map.h" #include "network_gamelist.h" #include "network_udp.h" +#include "variables.h" extern void UpdateNetworkGameWindow(bool unselect); extern void NetworkPopulateCompanyInfo(void); diff --git a/openttd.h b/openttd.h index 1936a13aa..46d125705 100644 --- a/openttd.h +++ b/openttd.h @@ -72,6 +72,8 @@ typedef uint16 StringID; typedef uint16 SpriteID; typedef uint32 PalSpriteID; typedef uint32 CursorID; +typedef uint16 EngineID; //! All enginenumbers should be of this type +typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be) typedef uint32 WindowNumber; typedef byte WindowClass; @@ -546,6 +548,5 @@ enum { VARDEF byte _no_scroll; #include "functions.h" -#include "variables.h" #endif /* OPENTTD_H */ diff --git a/pathfind.c b/pathfind.c index 715fb95fe..737b6d36d 100644 --- a/pathfind.c +++ b/pathfind.c @@ -5,6 +5,7 @@ #include "pathfind.h" #include "rail.h" #include "debug.h" +#include "variables.h" // remember which tiles we have already visited so we don't visit them again. static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir) diff --git a/settings.c b/settings.c index 44d6287d5..5a9b47178 100644 --- a/settings.c +++ b/settings.c @@ -4,6 +4,7 @@ #include "sound.h" #include "spritecache.h" #include "string.h" +#include "variables.h" #include "table/currency.h" #include "network.h" #include "settings.h" diff --git a/signs.c b/signs.c index eb5c62826..840620ec7 100644 --- a/signs.c +++ b/signs.c @@ -5,6 +5,7 @@ #include "saveload.h" #include "command.h" #include "strings.h" +#include "variables.h" enum { /* Max signs: 64000 (4 * 16000) */ diff --git a/sprite.c b/sprite.c index 617d0705e..54134c002 100644 --- a/sprite.c +++ b/sprite.c @@ -4,6 +4,7 @@ #include "openttd.h" #include "sprite.h" +#include "variables.h" SpriteGroup *EvalDeterministicSpriteGroup(DeterministicSpriteGroup *dsg, int value) diff --git a/texteff.c b/texteff.c index 1ef28762f..e6c030813 100644 --- a/texteff.c +++ b/texteff.c @@ -7,6 +7,7 @@ #include "hal.h" #include "console.h" #include "string.h" +#include "variables.h" #include /* va_list */ typedef struct TextEffect { diff --git a/tree_cmd.c b/tree_cmd.c index 88af5c5e3..8b7e3a50c 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -9,6 +9,7 @@ #include "command.h" #include "town.h" #include "sound.h" +#include "variables.h" static int GetRandomTreeType(TileIndex tile, uint seed) { diff --git a/variables.h b/variables.h index c8d13e3fb..7e116f5b6 100644 --- a/variables.h +++ b/variables.h @@ -8,9 +8,6 @@ # define MAX_PATH 260 #endif -typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be) -typedef uint16 EngineID; //! All enginenumbers should be of this type - // Prices and also the fractional part. VARDEF Prices _price; VARDEF uint16 _price_frac[NUM_PRICES]; diff --git a/vehicle.h b/vehicle.h index a68a234bd..5e40d7772 100644 --- a/vehicle.h +++ b/vehicle.h @@ -4,6 +4,7 @@ #include "pool.h" #include "order.h" #include "rail.h" +#include "variables.h" enum { VEH_Train = 0x10, -- cgit v1.2.3-54-g00ecf