summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-18 10:16:51 +0000
committerrubidium <rubidium@openttd.org>2008-04-18 10:16:51 +0000
commit1b2773445d12037bb1293d35e5f1b9a4a44168d9 (patch)
treedfc71064bea779abeeec229e5820046f40499776
parent2070cee0892591be5842842c1e6be41cdeda2f36 (diff)
downloadopenttd-1b2773445d12037bb1293d35e5f1b9a4a44168d9.tar.xz
(svn r12765) -Codechange: move some stuff out of variables.h that required including other headers in variables.h.
-rw-r--r--src/landscape.cpp1
-rw-r--r--src/misc.cpp1
-rw-r--r--src/misc_gui.cpp1
-rw-r--r--src/network/core/tcp.cpp1
-rw-r--r--src/network/network.cpp1
-rw-r--r--src/network/network_client.cpp1
-rw-r--r--src/oldloader.cpp1
-rw-r--r--src/openttd.cpp2
-rw-r--r--src/rail_gui.cpp1
-rw-r--r--src/road_gui.cpp1
-rw-r--r--src/tunnelbridge.h4
-rw-r--r--src/tunnelbridge_cmd.cpp1
-rw-r--r--src/variables.h8
13 files changed, 14 insertions, 10 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 4c45c4675..a386a637c 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -610,6 +610,7 @@ CommandCost CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
+TileIndex _cur_tileloop_tile;
#define TILELOOP_BITS 4
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE - 1) + ((TILELOOP_SIZE - 1) << MapLogX()))
diff --git a/src/misc.cpp b/src/misc.cpp
index 8b195d5fb..5d91c295b 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -31,6 +31,7 @@
#include "table/sprites.h"
char _name_array[512][32];
+extern TileIndex _cur_tileloop_tile;
void InitializeVehicles();
void InitializeWaypoints();
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index f8faea218..78053470d 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -567,6 +567,7 @@ static void ErrmsgWndProc(Window *w, WindowEvent *e)
case WE_DESTROY:
SetRedErrorSquare(0);
+ extern StringID _switch_mode_errorstr;
_switch_mode_errorstr = INVALID_STRING_ID;
break;
diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp
index a4b763b1a..f44f1741c 100644
--- a/src/network/core/tcp.cpp
+++ b/src/network/core/tcp.cpp
@@ -75,6 +75,7 @@ NetworkRecvStatus NetworkTCPSocketHandler::CloseConnection()
if (!_network_server && _networking) {
_switch_mode = SM_MENU;
_networking = false;
+ extern StringID _switch_mode_errorstr;
_switch_mode_errorstr = STR_NETWORK_ERR_LOSTCONNECTION;
return NETWORK_RECV_STATUS_CONN_LOST;
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 8ec1a2a8a..26009d749 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -224,6 +224,7 @@ uint NetworkCalculateLag(const NetworkTCPSocketHandler *cs)
static void NetworkError(StringID error_string)
{
_switch_mode = SM_MENU;
+ extern StringID _switch_mode_errorstr;
_switch_mode_errorstr = error_string;
}
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 378e6de56..abc5c6203 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -328,6 +328,7 @@ DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_RCON)(const char *pass, const char *
// **********
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm, Subdirectory subdir);
+extern StringID _switch_mode_errorstr;
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FULL)
{
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 103845a3d..3f2ee4c35 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1473,6 +1473,7 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
return !ls->failed;
}
+extern TileIndex _cur_tileloop_tile;
static uint32 _old_cur_town_ctr;
static const OldChunks main_chunk[] = {
OCL_ASSERT( 0 ),
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 70bc76a45..cf4e23a37 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -84,6 +84,8 @@
#include "table/strings.h"
+StringID _switch_mode_errorstr;
+
void CallLandscapeTick();
void IncreaseDate();
void DoPaletteAnimations();
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index fdfdf3364..bfcad9ba7 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -29,6 +29,7 @@
#include "settings_type.h"
#include "widgets/dropdown_type.h"
#include "widgets/dropdown_func.h"
+#include "tunnelbridge.h"
#include "bridge_map.h"
#include "rail_map.h"
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index c483b3fa6..2f184d7a9 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -22,6 +22,7 @@
#include "sound_func.h"
#include "player_func.h"
#include "settings_type.h"
+#include "tunnelbridge.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/tunnelbridge.h b/src/tunnelbridge.h
index 758ba59a5..88b42ae8c 100644
--- a/src/tunnelbridge.h
+++ b/src/tunnelbridge.h
@@ -6,8 +6,6 @@
#define TUNNELBRIDGE_H
#include "tile_type.h"
-#include "map_func.h"
-#include "tunnelbridge_map.h"
/**
* Calculates the length of a tunnel or a bridge (without end tiles)
@@ -23,4 +21,6 @@ static inline uint GetTunnelBridgeLength(TileIndex begin, TileIndex end)
return abs(x2 + y2 - x1 - y1) - 1;
}
+extern TileIndex _build_tunnel_endtile;
+
#endif /* TUNNELBRIDGE_H */
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 66b61b020..109f86baf 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -44,6 +44,7 @@
#include "table/bridge_land.h"
BridgeSpec _bridge[MAX_BRIDGES];
+TileIndex _build_tunnel_endtile;
/** Reset the data been eventually changed by the grf loaded. */
void ResetBridges()
diff --git a/src/variables.h b/src/variables.h
index a49fa32ce..17bc0ceba 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -5,18 +5,12 @@
#ifndef VARIABLES_H
#define VARIABLES_H
-#include "tile_type.h"
-#include "strings_type.h"
-
/* Amount of game ticks */
VARDEF uint16 _tick_counter;
/* Skip aging of cargo? */
VARDEF byte _age_cargo_skip_counter;
-/* Position in tile loop */
-VARDEF TileIndex _cur_tileloop_tile;
-
/* Also save scrollpos_x, scrollpos_y and zoom */
VARDEF uint16 _disaster_delay;
@@ -57,12 +51,10 @@ VARDEF int _caret_timer;
VARDEF bool _rightclick_emulate;
/* IN/OUT parameters to commands */
-VARDEF TileIndex _build_tunnel_endtile;
VARDEF bool _generating_world;
/* Used when switching from the intro menu. */
VARDEF byte _switch_mode;
-VARDEF StringID _switch_mode_errorstr;
VARDEF char _savegame_format[8];