mirror of https://github.com/OpenTTD/OpenTTD
(svn r4130) - CodeChange: Add proper semantics for TownID for such variables instead of using the general uint16-type. We probably need to change GetTown() and IsTownIndex() as well to use TownID.
parent
fa86dff4c3
commit
2ba792d644
2
depot.h
2
depot.h
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
struct Depot {
|
struct Depot {
|
||||||
TileIndex xy;
|
TileIndex xy;
|
||||||
uint16 town_index;
|
TownID town_index;
|
||||||
uint16 index;
|
uint16 index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ VARDEF Economy _economy;
|
||||||
typedef struct Subsidy {
|
typedef struct Subsidy {
|
||||||
CargoID cargo_type;
|
CargoID cargo_type;
|
||||||
byte age;
|
byte age;
|
||||||
|
/* from and to can either be TownID, StationID or IndustryID */
|
||||||
uint16 from;
|
uint16 from;
|
||||||
uint16 to;
|
uint16 to;
|
||||||
} Subsidy;
|
} Subsidy;
|
||||||
|
|
|
@ -61,6 +61,7 @@ typedef struct NewsItem NewsItem;
|
||||||
typedef struct Industry Industry;
|
typedef struct Industry Industry;
|
||||||
typedef struct DrawPixelInfo DrawPixelInfo;
|
typedef struct DrawPixelInfo DrawPixelInfo;
|
||||||
typedef uint16 VehicleID;
|
typedef uint16 VehicleID;
|
||||||
|
typedef uint16 TownID;
|
||||||
typedef byte PlayerID;
|
typedef byte PlayerID;
|
||||||
typedef byte OrderID;
|
typedef byte OrderID;
|
||||||
typedef byte CargoID;
|
typedef byte CargoID;
|
||||||
|
|
6
town.h
6
town.h
|
@ -70,7 +70,7 @@ struct Town {
|
||||||
byte road_build_months;
|
byte road_build_months;
|
||||||
|
|
||||||
// Index in town array
|
// Index in town array
|
||||||
uint16 index;
|
TownID index;
|
||||||
|
|
||||||
// NOSAVE: UpdateTownRadius updates this given the house count.
|
// NOSAVE: UpdateTownRadius updates this given the house count.
|
||||||
uint16 radius[5];
|
uint16 radius[5];
|
||||||
|
@ -80,7 +80,7 @@ uint32 GetWorldPopulation(void);
|
||||||
|
|
||||||
void UpdateTownVirtCoord(Town *t);
|
void UpdateTownVirtCoord(Town *t);
|
||||||
void InitializeTown(void);
|
void InitializeTown(void);
|
||||||
void ShowTownViewWindow(uint town);
|
void ShowTownViewWindow(TownID town);
|
||||||
void DeleteTown(Town *t);
|
void DeleteTown(Town *t);
|
||||||
void ExpandTown(Town *t);
|
void ExpandTown(Town *t);
|
||||||
Town *CreateRandomTown(uint attempts);
|
Town *CreateRandomTown(uint attempts);
|
||||||
|
@ -130,7 +130,7 @@ enum {
|
||||||
|
|
||||||
bool CheckforTownRating(uint32 flags, Town *t, byte type);
|
bool CheckforTownRating(uint32 flags, Town *t, byte type);
|
||||||
|
|
||||||
VARDEF uint16 *_town_sort;
|
VARDEF TownID *_town_sort;
|
||||||
|
|
||||||
extern MemoryPool _town_pool;
|
extern MemoryPool _town_pool;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ struct Waypoint {
|
||||||
TileIndex xy; ///< Tile of waypoint
|
TileIndex xy; ///< Tile of waypoint
|
||||||
uint16 index; ///< Index of waypoint
|
uint16 index; ///< Index of waypoint
|
||||||
|
|
||||||
uint16 town_index; ///< Town associated with the waypoint
|
TownID town_index; ///< Town associated with the waypoint
|
||||||
byte town_cn; ///< The Nth waypoint for this town (consecutive number)
|
byte town_cn; ///< The Nth waypoint for this town (consecutive number)
|
||||||
StringID string; ///< If this is zero (i.e. no custom name), town + town_cn is used for naming
|
StringID string; ///< If this is zero (i.e. no custom name), town + town_cn is used for naming
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue