mirror of https://github.com/OpenTTD/OpenTTD
(svn r2669) Shuffle some more stuff around to reduce dependencies
parent
a446294e7c
commit
0762aa9ec9
|
@ -7,6 +7,7 @@
|
||||||
#include "ai_new.h"
|
#include "ai_new.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "station.h"
|
#include "station.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
// Build HQ
|
// Build HQ
|
||||||
// Params:
|
// Params:
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the purchase info details of an aircraft at a given location.
|
* Draw the purchase info details of an aircraft at a given location.
|
||||||
|
|
13
airport.c
13
airport.c
|
@ -3,6 +3,8 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
|
#include "macros.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
AirportFTAClass *CountryAirport;
|
AirportFTAClass *CountryAirport;
|
||||||
AirportFTAClass *CityAirport;
|
AirportFTAClass *CityAirport;
|
||||||
|
@ -359,3 +361,14 @@ const AirportFTAClass* GetAirport(const byte airport_type)
|
||||||
}
|
}
|
||||||
return Airport;
|
return Airport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 GetValidAirports(void)
|
||||||
|
{
|
||||||
|
uint32 bytemask = _avail_aircraft; /// sets the first 3 bytes, 0 - 2, @see AdjustAvailAircraft()
|
||||||
|
|
||||||
|
// 1980-1-1 is --> 21915
|
||||||
|
// 1990-1-1 is --> 25568
|
||||||
|
if (_date >= 21915) {SETBIT(bytemask, 3);} // metropilitan airport 1980
|
||||||
|
if (_date >= 25568) {SETBIT(bytemask, 4);} // international airport 1990
|
||||||
|
return bytemask;
|
||||||
|
}
|
||||||
|
|
12
airport.h
12
airport.h
|
@ -2,7 +2,6 @@
|
||||||
#define AIRPORT_H
|
#define AIRPORT_H
|
||||||
|
|
||||||
#include "airport_movement.h"
|
#include "airport_movement.h"
|
||||||
#include "variables.h"
|
|
||||||
|
|
||||||
enum {MAX_TERMINALS = 6};
|
enum {MAX_TERMINALS = 6};
|
||||||
enum {MAX_HELIPADS = 2};
|
enum {MAX_HELIPADS = 2};
|
||||||
|
@ -54,15 +53,6 @@ const AirportFTAClass* GetAirport(const byte airport_type);
|
||||||
* Bit 0 means the small airport is buildable, etc.
|
* Bit 0 means the small airport is buildable, etc.
|
||||||
* @todo set availability of airports by year, instead of airplane
|
* @todo set availability of airports by year, instead of airplane
|
||||||
*/
|
*/
|
||||||
static inline uint32 GetValidAirports(void)
|
uint32 GetValidAirports(void);
|
||||||
{
|
|
||||||
uint32 bytemask = _avail_aircraft; /// sets the first 3 bytes, 0 - 2, @see AdjustAvailAircraft()
|
|
||||||
|
|
||||||
// 1980-1-1 is --> 21915
|
|
||||||
// 1990-1-1 is --> 25568
|
|
||||||
if (_date >= 21915) {SETBIT(bytemask, 3);} // metropilitan airport 1980
|
|
||||||
if (_date >= 25568) {SETBIT(bytemask, 4);} // international airport 1990
|
|
||||||
return bytemask;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* AIRPORT_H */
|
#endif /* AIRPORT_H */
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define AIRPORT_MOVEMENT_H
|
#define AIRPORT_MOVEMENT_H
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "macros.h"
|
|
||||||
|
|
||||||
typedef struct AirportMovingData {
|
typedef struct AirportMovingData {
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static struct BridgeData {
|
static struct BridgeData {
|
||||||
uint count;
|
uint count;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
const char* _cmd_text = NULL;
|
const char* _cmd_text = NULL;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "variables.h"
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <windows.h> /* GetTickCount */
|
# include <windows.h> /* GetTickCount */
|
||||||
# include <conio.h>
|
# include <conio.h>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "airport_movement.h"
|
#include "airport_movement.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static void DisasterClearSquare(TileIndex tile)
|
static void DisasterClearSquare(TileIndex tile)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static void ShowBuildDockStationPicker(void);
|
static void ShowBuildDockStationPicker(void);
|
||||||
static void ShowBuildDocksDepotPicker(void);
|
static void ShowBuildDocksDepotPicker(void);
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "network_data.h"
|
#include "network_data.h"
|
||||||
|
#include "variables.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
// get a mask of the allowed currencies depending on the year
|
// get a mask of the allowed currencies depending on the year
|
||||||
uint GetMaskOfAllowedCurrencies(void)
|
uint GetMaskOfAllowedCurrencies(void)
|
||||||
|
|
1
engine.c
1
engine.c
|
@ -11,6 +11,7 @@
|
||||||
#include "news.h"
|
#include "news.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ENGINE_AVAILABLE = 1,
|
ENGINE_AVAILABLE = 1,
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "news.h"
|
#include "news.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
|
|
||||||
static StringID GetEngineCategoryName(byte engine)
|
static StringID GetEngineCategoryName(byte engine)
|
||||||
|
|
1
fileio.c
1
fileio.c
|
@ -1,6 +1,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
|
#include "macros.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
#if defined(UNIX) || defined(__OS2__)
|
#if defined(UNIX) || defined(__OS2__)
|
||||||
#include <ctype.h> // required for tolower()
|
#include <ctype.h> // required for tolower()
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "signs.h"
|
#include "signs.h"
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static uint _legend_excludebits;
|
static uint _legend_excludebits;
|
||||||
static uint _legend_cargobits;
|
static uint _legend_cargobits;
|
||||||
|
|
2
gui.h
2
gui.h
|
@ -114,8 +114,6 @@ bool InsertTextBufferChar(Textbuf *tb, byte key);
|
||||||
bool InsertTextBufferClipboard(Textbuf *tb);
|
bool InsertTextBufferClipboard(Textbuf *tb);
|
||||||
bool MoveTextBufferPos(Textbuf *tb, int navmode);
|
bool MoveTextBufferPos(Textbuf *tb, int navmode);
|
||||||
void UpdateTextBufferSize(Textbuf *tb);
|
void UpdateTextBufferSize(Textbuf *tb);
|
||||||
/* IS_INT_INSIDE = filter for ascii-function codes like BELL and so on [we need an special filter here later] */
|
|
||||||
static inline bool IsValidAsciiChar(byte key) {return IS_INT_INSIDE(key, ' ', 256);}
|
|
||||||
|
|
||||||
void BuildFileList(void);
|
void BuildFileList(void);
|
||||||
void SetFiosType(const byte fiostype);
|
void SetFiosType(const byte fiostype);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* Max industries: 64000 (8 * 8000) */
|
/* Max industries: 64000 (8 * 8000) */
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
/* Present in table/build_industry.h" */
|
/* Present in table/build_industry.h" */
|
||||||
extern const byte _build_industry_types[4][12];
|
extern const byte _build_industry_types[4][12];
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
extern void SwitchMode(int new_mode);
|
extern void SwitchMode(int new_mode);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
extern const TileTypeProcs
|
extern const TileTypeProcs
|
||||||
_tile_type_clear_procs,
|
_tile_type_clear_procs,
|
||||||
|
|
17
macros.h
17
macros.h
|
@ -110,17 +110,6 @@ static inline int KillFirstBit2x64(int value)
|
||||||
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
|
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
|
||||||
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
|
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
|
||||||
|
|
||||||
#define BEGIN_TILE_LOOP(var,w,h,tile) \
|
|
||||||
{int h_cur = h; \
|
|
||||||
uint var = tile; \
|
|
||||||
do { \
|
|
||||||
int w_cur = w; \
|
|
||||||
do {
|
|
||||||
|
|
||||||
#define END_TILE_LOOP(var,w,h,tile) \
|
|
||||||
} while (++var, --w_cur != 0); \
|
|
||||||
} while (var += TileDiffXY(0, 1) - (w), --h_cur != 0);}
|
|
||||||
|
|
||||||
|
|
||||||
#define for_each_bit(_i,_b) \
|
#define for_each_bit(_i,_b) \
|
||||||
for(_i=0; _b!=0; _i++,_b>>=1) \
|
for(_i=0; _b!=0; _i++,_b>>=1) \
|
||||||
|
@ -165,4 +154,10 @@ static inline void swap_tile(TileIndex *a, TileIndex *b) { TileIndex t = *a; *a
|
||||||
#define ROL(x, n) ((x) << (n) | (x) >> (sizeof(x) * 8 - (n)))
|
#define ROL(x, n) ((x) << (n) | (x) >> (sizeof(x) * 8 - (n)))
|
||||||
#define ROR(x, n) ((x) >> (n) | (x) << (sizeof(x) * 8 - (n)))
|
#define ROR(x, n) ((x) >> (n) | (x) << (sizeof(x) * 8 - (n)))
|
||||||
|
|
||||||
|
/* IS_INT_INSIDE = filter for ascii-function codes like BELL and so on [we need an special filter here later] */
|
||||||
|
static inline bool IsValidAsciiChar(byte key)
|
||||||
|
{
|
||||||
|
return IS_INT_INSIDE(key, ' ', 256);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* MACROS_H */
|
#endif /* MACROS_H */
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "signs.h"
|
#include "signs.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#include "network_data.h"
|
#include "network_data.h"
|
||||||
#include "network_client.h"
|
#include "network_client.h"
|
||||||
|
|
1
map.c
1
map.c
|
@ -2,6 +2,7 @@
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "macros.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
uint _map_log_x;
|
uint _map_log_x;
|
||||||
|
|
14
map.h
14
map.h
|
@ -146,6 +146,20 @@ uint DistanceTrack(TileIndex, TileIndex); // Returns the shortest distance one c
|
||||||
uint DistanceFromEdge(TileIndex); // shortest distance from any edge of the map
|
uint DistanceFromEdge(TileIndex); // shortest distance from any edge of the map
|
||||||
|
|
||||||
|
|
||||||
|
#define BEGIN_TILE_LOOP(var,w,h,tile) \
|
||||||
|
{ \
|
||||||
|
int h_cur = h; \
|
||||||
|
uint var = tile; \
|
||||||
|
do { \
|
||||||
|
int w_cur = w; \
|
||||||
|
do {
|
||||||
|
|
||||||
|
#define END_TILE_LOOP(var,w,h,tile) \
|
||||||
|
} while (++var, --w_cur != 0); \
|
||||||
|
} while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline TileIndexDiff TileOffsByDir(uint dir)
|
static inline TileIndexDiff TileOffsByDir(uint dir)
|
||||||
{
|
{
|
||||||
extern const TileIndexDiffC _tileoffs_by_dir[4];
|
extern const TileIndexDiffC _tileoffs_by_dir[4];
|
||||||
|
|
1
misc.c
1
misc.c
|
@ -13,6 +13,7 @@
|
||||||
#include "network_server.h"
|
#include "network_server.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "vehicle_gui.h"
|
#include "vehicle_gui.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
extern void StartupEconomy(void);
|
extern void StartupEconomy(void);
|
||||||
extern void InitNewsItemStructs(void);
|
extern void InitNewsItemStructs(void);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
/** Change the player's face.
|
/** Change the player's face.
|
||||||
* @param x,y unused
|
* @param x,y unused
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#include "hal.h" // for file list
|
#include "hal.h" // for file list
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
#include "macros.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static byte _music_wnd_cursong;
|
static byte _music_wnd_cursong;
|
||||||
static bool _song_is_active;
|
static bool _song_is_active;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
|
|
||||||
// This file handles all the client-commands
|
// This file handles all the client-commands
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "station.h"
|
#include "station.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
// This file handles all the server-commands
|
// This file handles all the server-commands
|
||||||
|
|
||||||
|
|
1
newgrf.c
1
newgrf.c
|
@ -10,6 +10,7 @@
|
||||||
#include "station.h"
|
#include "station.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
/* TTDPatch extended GRF format codec
|
/* TTDPatch extended GRF format codec
|
||||||
* (c) Petr Baudis 2004 (GPL'd)
|
* (c) Petr Baudis 2004 (GPL'd)
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "news.h"
|
#include "news.h"
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
/* News system
|
/* News system
|
||||||
News system is realized as a FIFO queue (in an array)
|
News system is realized as a FIFO queue (in an array)
|
||||||
|
|
1
npf.h
1
npf.h
|
@ -7,6 +7,7 @@
|
||||||
#include "pbs.h"
|
#include "pbs.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
//mowing grass
|
//mowing grass
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -51,7 +51,7 @@ typedef struct YearMonthDay {
|
||||||
#define MAX_YEAR_END_REAL 2090
|
#define MAX_YEAR_END_REAL 2090
|
||||||
#define MAX_YEAR_END 170
|
#define MAX_YEAR_END 170
|
||||||
|
|
||||||
#include "macros.h"
|
#include "map.h"
|
||||||
|
|
||||||
// Forward declarations of structs.
|
// Forward declarations of structs.
|
||||||
typedef struct Vehicle Vehicle;
|
typedef struct Vehicle Vehicle;
|
||||||
|
|
1
order.h
1
order.h
|
@ -1,6 +1,7 @@
|
||||||
#ifndef ORDER_H
|
#ifndef ORDER_H
|
||||||
#define ORDER_H
|
#define ORDER_H
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
#include "pool.h"
|
#include "pool.h"
|
||||||
|
|
||||||
/* Order types */
|
/* Order types */
|
||||||
|
|
1
pbs.h
1
pbs.h
|
@ -5,7 +5,6 @@
|
||||||
* @see pbs.c */
|
* @see pbs.c */
|
||||||
|
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "tile.h"
|
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
|
|
||||||
|
|
1
player.h
1
player.h
|
@ -2,7 +2,6 @@
|
||||||
#define PLAYER_H
|
#define PLAYER_H
|
||||||
|
|
||||||
#include "aystar.h"
|
#include "aystar.h"
|
||||||
#include "engine.h"
|
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
|
|
||||||
typedef struct PlayerEconomyEntry {
|
typedef struct PlayerEconomyEntry {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
#include "network_data.h"
|
#include "network_data.h"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
|
#include "engine.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
@ -15,6 +16,7 @@
|
||||||
#include "ai_new.h"
|
#include "ai_new.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
PlayerID _current_player;
|
PlayerID _current_player;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "station.h"
|
#include "station.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static uint _cur_railtype;
|
static uint _cur_railtype;
|
||||||
static bool _remove_button_clicked;
|
static bool _remove_button_clicked;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "variables.h"
|
||||||
//needed for catchments
|
//needed for catchments
|
||||||
#include "station.h"
|
#include "station.h"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the purchase info details of road vehicle at a given location.
|
* Draw the purchase info details of road vehicle at a given location.
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SAVEGAME_MAJOR_VERSION = 15,
|
SAVEGAME_MAJOR_VERSION = 15,
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
char _screenshot_format_name[8];
|
char _screenshot_format_name[8];
|
||||||
uint _num_screenshot_formats;
|
uint _num_screenshot_formats;
|
||||||
|
|
1
sdl.c
1
sdl.c
|
@ -10,6 +10,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static uint32 _difficulty_click_a;
|
static uint32 _difficulty_click_a;
|
||||||
static uint32 _difficulty_click_b;
|
static uint32 _difficulty_click_b;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "npf.h"
|
#include "npf.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
|
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
|
||||||
static const byte _ship_sometracks[4] = {0x19, 0x16, 0x25, 0x2A};
|
static const byte _ship_sometracks[4] = {0x19, 0x16, 0x25, 0x2A};
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw the purchase info details of a ship at a given location.
|
* Draw the purchase info details of a ship at a given location.
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static const Widget _smallmap_widgets[] = {
|
static const Widget _smallmap_widgets[] = {
|
||||||
{ WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
|
{ WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
|
#include "variables.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#define SPRITECACHE_ID 0xF00F0006
|
#define SPRITECACHE_ID 0xF00F0006
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "variables.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
static void StationsWndShowStationRating(int x, int y, int type, uint acceptance, int rating)
|
static void StationsWndShowStationRating(int x, int y, int type, uint acceptance, int rating)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static char *StationGetSpecialString(char *buff, int x);
|
static char *StationGetSpecialString(char *buff, int x);
|
||||||
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed);
|
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static void HandleSubsidyClick(int y)
|
static void HandleSubsidyClick(int y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "signs.h"
|
#include "signs.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* Max towns: 64000 (8 * 8000) */
|
/* Max towns: 64000 (8 * 8000) */
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
static const Widget _town_authority_widgets[] = {
|
static const Widget _town_authority_widgets[] = {
|
||||||
{ WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
|
{ WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "pbs.h"
|
#include "pbs.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
extern void DrawCanalWater(TileIndex tile);
|
extern void DrawCanalWater(TileIndex tile);
|
||||||
|
|
||||||
|
|
1
unix.c
1
unix.c
|
@ -4,6 +4,7 @@
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "economy.h"
|
#include "economy.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
/** Destroy a HQ.
|
/** Destroy a HQ.
|
||||||
* During normal gameplay you can only implicitely destroy a HQ when you are
|
* During normal gameplay you can only implicitely destroy a HQ when you are
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include "pool.h"
|
#include "pool.h"
|
||||||
#include "order.h"
|
#include "order.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
#include "variables.h"
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
VEH_Train = 0x10,
|
VEH_Train = 0x10,
|
||||||
|
|
|
@ -11,6 +11,14 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
#include "variables.h"
|
||||||
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
|
Sorting _sorting;
|
||||||
|
|
||||||
|
static uint32 _internal_name_sorter_id; // internal StringID for default vehicle-names
|
||||||
|
static uint32 _last_vehicle_idx; // cached index to hopefully speed up name-sorting
|
||||||
|
static bool _internal_sort_order; // descending/ascending
|
||||||
|
|
||||||
VehicleSortListingTypeFunctions * const _vehicle_sorter[] = {
|
VehicleSortListingTypeFunctions * const _vehicle_sorter[] = {
|
||||||
&VehicleUnsortedSorter,
|
&VehicleUnsortedSorter,
|
||||||
|
|
|
@ -17,9 +17,6 @@ void BuildVehicleList(struct vehiclelist_d *vl, int type, int owner, int station
|
||||||
void SortVehicleList(struct vehiclelist_d *vl);
|
void SortVehicleList(struct vehiclelist_d *vl);
|
||||||
|
|
||||||
int CDECL GeneralOwnerSorter(const void *a, const void *b);
|
int CDECL GeneralOwnerSorter(const void *a, const void *b);
|
||||||
VARDEF uint32 _internal_name_sorter_id; // internal StringID for default vehicle-names
|
|
||||||
VARDEF uint32 _last_vehicle_idx; // cached index to hopefully speed up name-sorting
|
|
||||||
VARDEF bool _internal_sort_order; // descending/ascending
|
|
||||||
|
|
||||||
#define PERIODIC_RESORT_DAYS 10
|
#define PERIODIC_RESORT_DAYS 10
|
||||||
#define DEF_SORTER(yyyy) int CDECL yyyy(const void *a, const void *b)
|
#define DEF_SORTER(yyyy) int CDECL yyyy(const void *a, const void *b)
|
||||||
|
@ -60,7 +57,7 @@ typedef struct Sorting {
|
||||||
Listing train;
|
Listing train;
|
||||||
} Sorting;
|
} Sorting;
|
||||||
|
|
||||||
VARDEF Sorting _sorting;
|
extern Sorting _sorting;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
|
PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "signs.h"
|
#include "signs.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
#define VIEWPORT_DRAW_MEM (65536 * 2)
|
#define VIEWPORT_DRAW_MEM (65536 * 2)
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
#include "variables.h"
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/track_land.h"
|
#include "table/track_land.h"
|
||||||
|
|
1
window.c
1
window.c
|
@ -7,6 +7,7 @@
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "variables.h"
|
||||||
|
|
||||||
// delta between mouse cursor and upper left corner of dragged window
|
// delta between mouse cursor and upper left corner of dragged window
|
||||||
static Point _drag_delta;
|
static Point _drag_delta;
|
||||||
|
|
2
window.h
2
window.h
|
@ -1,8 +1,6 @@
|
||||||
#ifndef WINDOW_H
|
#ifndef WINDOW_H
|
||||||
#define WINDOW_H
|
#define WINDOW_H
|
||||||
|
|
||||||
#include "vehicle_gui.h"
|
|
||||||
|
|
||||||
typedef union WindowEvent WindowEvent;
|
typedef union WindowEvent WindowEvent;
|
||||||
|
|
||||||
//typedef void WindowProc(Window *w, int event, int wparam, long lparam);
|
//typedef void WindowProc(Window *w, int event, int wparam, long lparam);
|
||||||
|
|
Loading…
Reference in New Issue