Changeset - r3346:134319cc6f99
[Not reviewed]
master
0 5 0
Darkvater - 18 years ago 2006-03-26 22:41:56
darkvater@openttd.org
(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.
5 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
depot.h
Show inline comments
 
@@ -12,13 +12,13 @@
 
#include "road_map.h"
 
#include "tile.h"
 
#include "variables.h"
 

	
 
struct Depot {
 
	TileIndex xy;
 
	uint16 town_index;
 
	TownID town_index;
 
	uint16 index;
 
};
 

	
 
extern MemoryPool _depot_pool;
 

	
 
/**
economy.h
Show inline comments
 
@@ -20,12 +20,13 @@ typedef struct {
 

	
 
VARDEF Economy _economy;
 

	
 
typedef struct Subsidy {
 
	CargoID cargo_type;
 
	byte age;
 
	/* from and to can either be TownID, StationID or IndustryID */
 
	uint16 from;
 
	uint16 to;
 
} Subsidy;
 

	
 

	
 
enum {
openttd.h
Show inline comments
 
@@ -58,12 +58,13 @@ typedef struct Station Station;
 
typedef struct ViewPort ViewPort;
 
typedef struct Town Town;
 
typedef struct NewsItem NewsItem;
 
typedef struct Industry Industry;
 
typedef struct DrawPixelInfo DrawPixelInfo;
 
typedef uint16 VehicleID;
 
typedef uint16 TownID;
 
typedef byte PlayerID;
 
typedef byte OrderID;
 
typedef byte CargoID;
 
typedef uint16 StringID;
 
typedef uint32 SpriteID;    ///< The number of a sprite, without mapping bits and colortables
 
typedef uint32 PalSpriteID; ///< The number of a sprite plus all the mapping bits and colortables
town.h
Show inline comments
 
@@ -67,23 +67,23 @@ struct Town {
 
	byte fund_buildings_months;
 

	
 
	// Fund road reconstruction in action?
 
	byte road_build_months;
 

	
 
	// Index in town array
 
	uint16 index;
 
	TownID index;
 

	
 
	// NOSAVE: UpdateTownRadius updates this given the house count.
 
	uint16 radius[5];
 
};
 

	
 
uint32 GetWorldPopulation(void);
 

	
 
void UpdateTownVirtCoord(Town *t);
 
void InitializeTown(void);
 
void ShowTownViewWindow(uint town);
 
void ShowTownViewWindow(TownID town);
 
void DeleteTown(Town *t);
 
void ExpandTown(Town *t);
 
Town *CreateRandomTown(uint attempts);
 

	
 
enum {
 
	ROAD_REMOVE = 0,
 
@@ -127,13 +127,13 @@ enum {
 
	RATING_BRIBE_MAXIMUM = 800,
 
	RATING_BRIBE_DOWN_TO = -50 					// XXX SHOULD BE SOMETHING LOWER?
 
};
 

	
 
bool CheckforTownRating(uint32 flags, Town *t, byte type);
 

	
 
VARDEF uint16 *_town_sort;
 
VARDEF TownID *_town_sort;
 

	
 
extern MemoryPool _town_pool;
 

	
 
/**
 
 * Check if a Town really exists.
 
 */
waypoint.h
Show inline comments
 
@@ -7,13 +7,13 @@
 
#include "rail_map.h"
 

	
 
struct Waypoint {
 
	TileIndex xy;      ///< Tile 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)
 
	StringID string;   ///< If this is zero (i.e. no custom name), town + town_cn is used for naming
 

	
 
	ViewportSign sign; ///< Dimensions of sign (not saved)
 
	uint16 build_date; ///< Date of construction
 

	
0 comments (0 inline, 0 general)