(svn r12765) -Codechange: move some stuff out of variables.h that required including other headers in variables.h.
--- a/src/landscape.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/landscape.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -610,6 +610,7 @@
}
+TileIndex _cur_tileloop_tile;
#define TILELOOP_BITS 4
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE - 1) + ((TILELOOP_SIZE - 1) << MapLogX()))
--- a/src/misc.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/misc.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -31,6 +31,7 @@
#include "table/sprites.h"
char _name_array[512][32];
+extern TileIndex _cur_tileloop_tile;
void InitializeVehicles();
void InitializeWaypoints();
--- a/src/misc_gui.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/misc_gui.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -567,6 +567,7 @@
case WE_DESTROY:
SetRedErrorSquare(0);
+ extern StringID _switch_mode_errorstr;
_switch_mode_errorstr = INVALID_STRING_ID;
break;
--- a/src/network/core/tcp.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/network/core/tcp.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -75,6 +75,7 @@
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;
--- a/src/network/network.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/network/network.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -224,6 +224,7 @@
static void NetworkError(StringID error_string)
{
_switch_mode = SM_MENU;
+ extern StringID _switch_mode_errorstr;
_switch_mode_errorstr = error_string;
}
--- a/src/network/network_client.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/network/network_client.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -328,6 +328,7 @@
// **********
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm, Subdirectory subdir);
+extern StringID _switch_mode_errorstr;
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FULL)
{
--- a/src/oldloader.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/oldloader.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -1473,6 +1473,7 @@
return !ls->failed;
}
+extern TileIndex _cur_tileloop_tile;
static uint32 _old_cur_town_ctr;
static const OldChunks main_chunk[] = {
OCL_ASSERT( 0 ),
--- a/src/openttd.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/openttd.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -84,6 +84,8 @@
#include "table/strings.h"
+StringID _switch_mode_errorstr;
+
void CallLandscapeTick();
void IncreaseDate();
void DoPaletteAnimations();
--- a/src/rail_gui.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/rail_gui.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -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"
--- a/src/road_gui.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/road_gui.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -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"
--- a/src/tunnelbridge.h Fri Apr 18 09:49:23 2008 +0000
+++ b/src/tunnelbridge.h Fri Apr 18 10:16:51 2008 +0000
@@ -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 @@
return abs(x2 + y2 - x1 - y1) - 1;
}
+extern TileIndex _build_tunnel_endtile;
+
#endif /* TUNNELBRIDGE_H */
--- a/src/tunnelbridge_cmd.cpp Fri Apr 18 09:49:23 2008 +0000
+++ b/src/tunnelbridge_cmd.cpp Fri Apr 18 10:16:51 2008 +0000
@@ -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()
--- a/src/variables.h Fri Apr 18 09:49:23 2008 +0000
+++ b/src/variables.h Fri Apr 18 10:16:51 2008 +0000
@@ -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 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];