mirror of https://github.com/OpenTTD/OpenTTD
(svn r18027) -Codechange: make some unneededly global variables static and remove some unused variables
parent
3702746756
commit
c2221885f4
|
@ -39,7 +39,7 @@ EngineOverrideManager _engine_mngr;
|
||||||
|
|
||||||
/** Year that engine aging stops. Engines will not reduce in reliability
|
/** Year that engine aging stops. Engines will not reduce in reliability
|
||||||
* and no more engines will be introduced */
|
* and no more engines will be introduced */
|
||||||
Year _year_engine_aging_stops;
|
static Year _year_engine_aging_stops;
|
||||||
|
|
||||||
/** Number of engines of each vehicle type in original engine data */
|
/** Number of engines of each vehicle type in original engine data */
|
||||||
const uint8 _engine_counts[4] = {
|
const uint8 _engine_counts[4] = {
|
||||||
|
|
|
@ -49,7 +49,7 @@ int _pal_first_dirty;
|
||||||
int _pal_count_dirty;
|
int _pal_count_dirty;
|
||||||
|
|
||||||
Colour _cur_palette[256];
|
Colour _cur_palette[256];
|
||||||
byte _stringwidth_table[FS_END][224]; ///< Cache containing width of often used characters. @see GetCharacterWidth()
|
static byte _stringwidth_table[FS_END][224]; ///< Cache containing width of often used characters. @see GetCharacterWidth()
|
||||||
DrawPixelInfo *_cur_dpi;
|
DrawPixelInfo *_cur_dpi;
|
||||||
byte _colour_gradient[COLOUR_END][8];
|
byte _colour_gradient[COLOUR_END][8];
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ const byte _tileh_to_sprite[32] = {
|
||||||
* Otherwise it points to a table loaded from a newGRF file, that describes the variable snowline
|
* Otherwise it points to a table loaded from a newGRF file, that describes the variable snowline
|
||||||
* @ingroup SnowLineGroup
|
* @ingroup SnowLineGroup
|
||||||
* @see GetSnowLine() GameCreationSettings */
|
* @see GetSnowLine() GameCreationSettings */
|
||||||
SnowLine *_snow_line = NULL;
|
static SnowLine *_snow_line = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies a foundation to a slope.
|
* Applies a foundation to a slope.
|
||||||
|
|
|
@ -67,7 +67,10 @@ uint32 _frame_counter_max; // To where we may go with our clients
|
||||||
uint32 _frame_counter;
|
uint32 _frame_counter;
|
||||||
uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients.
|
uint32 _last_sync_frame; // Used in the server to store the last time a sync packet was sent to clients.
|
||||||
NetworkAddressList _broadcast_list;
|
NetworkAddressList _broadcast_list;
|
||||||
uint32 _sync_seed_1, _sync_seed_2;
|
uint32 _sync_seed_1;
|
||||||
|
#ifdef NETWORK_SEND_DOUBLE_SEED
|
||||||
|
uint32 _sync_seed_2;
|
||||||
|
#endif
|
||||||
uint32 _sync_frame;
|
uint32 _sync_frame;
|
||||||
bool _network_first_time;
|
bool _network_first_time;
|
||||||
bool _network_udp_server;
|
bool _network_udp_server;
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
NetworkGameList *_network_game_list = NULL;
|
NetworkGameList *_network_game_list = NULL;
|
||||||
|
|
||||||
ThreadMutex *_network_game_list_mutex = ThreadMutex::New();
|
static ThreadMutex *_network_game_list_mutex = ThreadMutex::New();
|
||||||
NetworkGameList *_network_game_delayed_insertion_list = NULL;
|
static NetworkGameList *_network_game_delayed_insertion_list = NULL;
|
||||||
|
|
||||||
/** Add a new item to the linked gamelist, but do it delayed in the next tick
|
/** Add a new item to the linked gamelist, but do it delayed in the next tick
|
||||||
* or so to prevent race conditions.
|
* or so to prevent race conditions.
|
||||||
|
|
|
@ -112,7 +112,10 @@ extern uint32 _last_sync_frame; // Used in the server to store the last time a s
|
||||||
/* networking settings */
|
/* networking settings */
|
||||||
extern NetworkAddressList _broadcast_list;
|
extern NetworkAddressList _broadcast_list;
|
||||||
|
|
||||||
extern uint32 _sync_seed_1, _sync_seed_2;
|
extern uint32 _sync_seed_1;
|
||||||
|
#ifdef NETWORK_SEND_DOUBLE_SEED
|
||||||
|
extern uint32 _sync_seed_2;
|
||||||
|
#endif
|
||||||
extern uint32 _sync_frame;
|
extern uint32 _sync_frame;
|
||||||
extern bool _network_first_time;
|
extern bool _network_first_time;
|
||||||
/* Vars needed for the join-GUI */
|
/* Vars needed for the join-GUI */
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "core/udp.h"
|
#include "core/udp.h"
|
||||||
|
|
||||||
ThreadMutex *_network_udp_mutex = ThreadMutex::New();
|
static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
|
||||||
|
|
||||||
/** Session key to register ourselves to the master server */
|
/** Session key to register ourselves to the master server */
|
||||||
static uint64 _session_key = 0;
|
static uint64 _session_key = 0;
|
||||||
|
|
|
@ -65,7 +65,7 @@ static int _skip_sprites; // XXX
|
||||||
static uint _file_index; // XXX
|
static uint _file_index; // XXX
|
||||||
|
|
||||||
static GRFFile *_cur_grffile;
|
static GRFFile *_cur_grffile;
|
||||||
GRFFile *_first_grffile;
|
static GRFFile *_first_grffile;
|
||||||
static SpriteID _cur_spriteid;
|
static SpriteID _cur_spriteid;
|
||||||
static GrfLoadingStage _cur_stage;
|
static GrfLoadingStage _cur_stage;
|
||||||
static uint32 _nfo_line;
|
static uint32 _nfo_line;
|
||||||
|
@ -132,7 +132,7 @@ struct GRFLocation {
|
||||||
|
|
||||||
static std::map<GRFLocation, SpriteID> _grm_sprites;
|
static std::map<GRFLocation, SpriteID> _grm_sprites;
|
||||||
typedef std::map<GRFLocation, byte*> GRFLineToSpriteOverride;
|
typedef std::map<GRFLocation, byte*> GRFLineToSpriteOverride;
|
||||||
GRFLineToSpriteOverride _grf_line_to_action6_sprite_override;
|
static GRFLineToSpriteOverride _grf_line_to_action6_sprite_override;
|
||||||
|
|
||||||
/** DEBUG() function dedicated to newGRF debugging messages
|
/** DEBUG() function dedicated to newGRF debugging messages
|
||||||
* Function is essentialy the same as DEBUG(grf, severity, ...) with the
|
* Function is essentialy the same as DEBUG(grf, severity, ...) with the
|
||||||
|
@ -255,7 +255,7 @@ static void ClearTemporaryNewGRFData(GRFFile *gf)
|
||||||
|
|
||||||
|
|
||||||
typedef std::map<StringID *, uint32> StringIDToGRFIDMapping;
|
typedef std::map<StringID *, uint32> StringIDToGRFIDMapping;
|
||||||
StringIDToGRFIDMapping _string_to_grf_mapping;
|
static StringIDToGRFIDMapping _string_to_grf_mapping;
|
||||||
|
|
||||||
/** Used when setting an object's property to map to the GRF's strings
|
/** Used when setting an object's property to map to the GRF's strings
|
||||||
* while taking in consideration the "drift" between TTDPatch string system and OpenTTD's one
|
* while taking in consideration the "drift" between TTDPatch string system and OpenTTD's one
|
||||||
|
|
|
@ -118,8 +118,6 @@ struct GRFFile {
|
||||||
int traininfo_vehicle_width; ///< Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details
|
int traininfo_vehicle_width; ///< Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GRFFile *_first_grffile;
|
|
||||||
|
|
||||||
enum ShoreReplacement {
|
enum ShoreReplacement {
|
||||||
SHORE_REPLACE_NONE, ///< No shore sprites were replaced.
|
SHORE_REPLACE_NONE, ///< No shore sprites were replaced.
|
||||||
SHORE_REPLACE_ACTION_5, ///< Shore sprites were replaced by Action5.
|
SHORE_REPLACE_ACTION_5, ///< Shore sprites were replaced by Action5.
|
||||||
|
|
|
@ -161,7 +161,7 @@ void FixOldTowns()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StringID *_old_vehicle_names;
|
static StringID *_old_vehicle_names;
|
||||||
|
|
||||||
void FixOldVehicles()
|
void FixOldVehicles()
|
||||||
{
|
{
|
||||||
|
|
|
@ -278,7 +278,7 @@ static const SettingDescGlobVarList _misc_settings[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint GAME_DIFFICULTY_NUM = 18;
|
static const uint GAME_DIFFICULTY_NUM = 18;
|
||||||
uint16 _old_diff_custom[GAME_DIFFICULTY_NUM];
|
static uint16 _old_diff_custom[GAME_DIFFICULTY_NUM];
|
||||||
|
|
||||||
/* Most of these strings are used both for gameopt-backward compatability
|
/* Most of these strings are used both for gameopt-backward compatability
|
||||||
* and the settings tables. The rest is here for consistency. */
|
* and the settings tables. The rest is here for consistency. */
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
|
|
||||||
RailType _last_built_railtype;
|
RailType _last_built_railtype;
|
||||||
RoadType _last_built_roadtype;
|
static RoadType _last_built_roadtype;
|
||||||
|
|
||||||
enum ToolbarMode {
|
enum ToolbarMode {
|
||||||
TB_NORMAL,
|
TB_NORMAL,
|
||||||
|
|
|
@ -197,9 +197,6 @@ Town *CalcClosestTownFromTile(TileIndex tile, uint threshold = UINT_MAX);
|
||||||
#define FOR_ALL_TOWNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Town, town_index, var, start)
|
#define FOR_ALL_TOWNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Town, town_index, var, start)
|
||||||
#define FOR_ALL_TOWNS(var) FOR_ALL_TOWNS_FROM(var, 0)
|
#define FOR_ALL_TOWNS(var) FOR_ALL_TOWNS_FROM(var, 0)
|
||||||
|
|
||||||
extern Town *_cleared_town;
|
|
||||||
extern int _cleared_town_rating;
|
|
||||||
|
|
||||||
void ResetHouses();
|
void ResetHouses();
|
||||||
|
|
||||||
void ClearTownHouse(Town *t, TileIndex tile);
|
void ClearTownHouse(Town *t, TileIndex tile);
|
||||||
|
|
|
@ -50,13 +50,10 @@
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/town_land.h"
|
#include "table/town_land.h"
|
||||||
|
|
||||||
Town *_cleared_town;
|
static Town *_cleared_town;
|
||||||
int _cleared_town_rating;
|
static int _cleared_town_rating;
|
||||||
TownID _new_town_id;
|
TownID _new_town_id;
|
||||||
|
|
||||||
uint32 _cur_town_ctr; ///< iterator through all towns in OnTick_Town
|
|
||||||
uint32 _cur_town_iter; ///< frequency iterator at the same place
|
|
||||||
|
|
||||||
/* Initialize the town-pool */
|
/* Initialize the town-pool */
|
||||||
TownPool _town_pool("Town");
|
TownPool _town_pool("Town");
|
||||||
INSTANTIATE_POOL_METHODS(Town)
|
INSTANTIATE_POOL_METHODS(Town)
|
||||||
|
@ -2714,7 +2711,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _town_rating_test = false;
|
static bool _town_rating_test = false;
|
||||||
SmallMap<const Town *, int, 4> _town_test_ratings;
|
static SmallMap<const Town *, int, 4> _town_test_ratings;
|
||||||
|
|
||||||
void SetTownRatingTestMode(bool mode)
|
void SetTownRatingTestMode(bool mode)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue