# HG changeset patch # User tron # Date 1121971467 0 # Node ID ecfc674410b42c81dc94ad23b26f73643e2d71a0 # Parent fe994f1275880f5c8704abd91f6a850bc17843d0 (svn r2663) Include variables.h only in these files which need it, not globally via openttd.h diff -r fe994f127588 -r ecfc674410b4 ai_new.h --- a/ai_new.h Thu Jul 21 18:01:43 2005 +0000 +++ b/ai_new.h Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 ai_old.c --- a/ai_old.c Thu Jul 21 18:01:43 2005 +0000 +++ b/ai_old.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 ai_pathfinder.c --- a/ai_pathfinder.c Thu Jul 21 18:01:43 2005 +0000 +++ b/ai_pathfinder.c Thu Jul 21 18:44:27 2005 +0000 @@ -6,6 +6,7 @@ #include "command.h" #include "ai_new.h" #include "depot.h" +#include "variables.h" #define TEST_STATION_NO_DIR 0xFF diff -r fe994f127588 -r ecfc674410b4 airport.h --- a/airport.h Thu Jul 21 18:01:43 2005 +0000 +++ b/airport.h Thu Jul 21 18:44:27 2005 +0000 @@ -2,6 +2,7 @@ #define AIRPORT_H #include "airport_movement.h" +#include "variables.h" enum {MAX_TERMINALS = 6}; enum {MAX_HELIPADS = 2}; diff -r fe994f127588 -r ecfc674410b4 clear_cmd.c --- a/clear_cmd.c Thu Jul 21 18:01:43 2005 +0000 +++ b/clear_cmd.c Thu Jul 21 18:44:27 2005 +0000 @@ -5,6 +5,7 @@ #include "tile.h" #include "viewport.h" #include "command.h" +#include "variables.h" typedef struct TerraformerHeightMod { TileIndex tile; diff -r fe994f127588 -r ecfc674410b4 depot.h --- a/depot.h Thu Jul 21 18:01:43 2005 +0000 +++ b/depot.h Thu Jul 21 18:44:27 2005 +0000 @@ -6,6 +6,7 @@ #include "pool.h" #include "tile.h" +#include "variables.h" struct Depot { TileIndex xy; diff -r fe994f127588 -r ecfc674410b4 extmidi.c --- a/extmidi.c Thu Jul 21 18:01:43 2005 +0000 +++ b/extmidi.c Thu Jul 21 18:44:27 2005 +0000 @@ -6,6 +6,7 @@ #include "hal.h" #include "sound.h" #include "string.h" +#include "variables.h" #include #include #include diff -r fe994f127588 -r ecfc674410b4 fileio.c --- a/fileio.c Thu Jul 21 18:01:43 2005 +0000 +++ b/fileio.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 gfx.c --- a/gfx.c Thu Jul 21 18:01:43 2005 +0000 +++ b/gfx.c Thu Jul 21 18:44:27 2005 +0000 @@ -6,6 +6,7 @@ #include "gfx.h" #include "table/palettes.h" #include "hal.h" +#include "variables.h" Colour _cur_palette[256]; diff -r fe994f127588 -r ecfc674410b4 network.c --- a/network.c Thu Jul 21 18:01:43 2005 +0000 +++ b/network.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 network.h --- a/network.h Thu Jul 21 18:01:43 2005 +0000 +++ b/network.h Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 network_data.c --- a/network_data.c Thu Jul 21 18:01:43 2005 +0000 +++ b/network_data.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 network_udp.c --- a/network_udp.c Thu Jul 21 18:01:43 2005 +0000 +++ b/network_udp.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 openttd.h --- a/openttd.h Thu Jul 21 18:01:43 2005 +0000 +++ b/openttd.h Thu Jul 21 18:44:27 2005 +0000 @@ -72,6 +72,8 @@ 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 @@ VARDEF byte _no_scroll; #include "functions.h" -#include "variables.h" #endif /* OPENTTD_H */ diff -r fe994f127588 -r ecfc674410b4 pathfind.c --- a/pathfind.c Thu Jul 21 18:01:43 2005 +0000 +++ b/pathfind.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 settings.c --- a/settings.c Thu Jul 21 18:01:43 2005 +0000 +++ b/settings.c Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 signs.c --- a/signs.c Thu Jul 21 18:01:43 2005 +0000 +++ b/signs.c Thu Jul 21 18:44:27 2005 +0000 @@ -5,6 +5,7 @@ #include "saveload.h" #include "command.h" #include "strings.h" +#include "variables.h" enum { /* Max signs: 64000 (4 * 16000) */ diff -r fe994f127588 -r ecfc674410b4 sprite.c --- a/sprite.c Thu Jul 21 18:01:43 2005 +0000 +++ b/sprite.c Thu Jul 21 18:44:27 2005 +0000 @@ -4,6 +4,7 @@ #include "openttd.h" #include "sprite.h" +#include "variables.h" SpriteGroup *EvalDeterministicSpriteGroup(DeterministicSpriteGroup *dsg, int value) diff -r fe994f127588 -r ecfc674410b4 texteff.c --- a/texteff.c Thu Jul 21 18:01:43 2005 +0000 +++ b/texteff.c Thu Jul 21 18:44:27 2005 +0000 @@ -7,6 +7,7 @@ #include "hal.h" #include "console.h" #include "string.h" +#include "variables.h" #include /* va_list */ typedef struct TextEffect { diff -r fe994f127588 -r ecfc674410b4 tree_cmd.c --- a/tree_cmd.c Thu Jul 21 18:01:43 2005 +0000 +++ b/tree_cmd.c Thu Jul 21 18:44:27 2005 +0000 @@ -9,6 +9,7 @@ #include "command.h" #include "town.h" #include "sound.h" +#include "variables.h" static int GetRandomTreeType(TileIndex tile, uint seed) { diff -r fe994f127588 -r ecfc674410b4 variables.h --- a/variables.h Thu Jul 21 18:01:43 2005 +0000 +++ b/variables.h Thu Jul 21 18:44:27 2005 +0000 @@ -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 -r fe994f127588 -r ecfc674410b4 vehicle.h --- a/vehicle.h Thu Jul 21 18:01:43 2005 +0000 +++ b/vehicle.h Thu Jul 21 18:44:27 2005 +0000 @@ -4,6 +4,7 @@ #include "pool.h" #include "order.h" #include "rail.h" +#include "variables.h" enum { VEH_Train = 0x10,