(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.
authorDarkvater
Sun, 26 Mar 2006 22:41:56 +0000
changeset 3346 96c5db77aa83
parent 3345 40dc834caa24
child 3347 d5d8ace1bb13
(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.
depot.h
economy.h
openttd.h
town.h
waypoint.h
--- a/depot.h	Sun Mar 26 22:25:29 2006 +0000
+++ b/depot.h	Sun Mar 26 22:41:56 2006 +0000
@@ -15,7 +15,7 @@
 
 struct Depot {
 	TileIndex xy;
-	uint16 town_index;
+	TownID town_index;
 	uint16 index;
 };
 
--- a/economy.h	Sun Mar 26 22:25:29 2006 +0000
+++ b/economy.h	Sun Mar 26 22:41:56 2006 +0000
@@ -23,6 +23,7 @@
 typedef struct Subsidy {
 	CargoID cargo_type;
 	byte age;
+	/* from and to can either be TownID, StationID or IndustryID */
 	uint16 from;
 	uint16 to;
 } Subsidy;
--- a/openttd.h	Sun Mar 26 22:25:29 2006 +0000
+++ b/openttd.h	Sun Mar 26 22:41:56 2006 +0000
@@ -61,6 +61,7 @@
 typedef struct Industry Industry;
 typedef struct DrawPixelInfo DrawPixelInfo;
 typedef uint16 VehicleID;
+typedef uint16 TownID;
 typedef byte PlayerID;
 typedef byte OrderID;
 typedef byte CargoID;
--- a/town.h	Sun Mar 26 22:25:29 2006 +0000
+++ b/town.h	Sun Mar 26 22:41:56 2006 +0000
@@ -70,7 +70,7 @@
 	byte road_build_months;
 
 	// Index in town array
-	uint16 index;
+	TownID index;
 
 	// NOSAVE: UpdateTownRadius updates this given the house count.
 	uint16 radius[5];
@@ -80,7 +80,7 @@
 
 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);
@@ -130,7 +130,7 @@
 
 bool CheckforTownRating(uint32 flags, Town *t, byte type);
 
-VARDEF uint16 *_town_sort;
+VARDEF TownID *_town_sort;
 
 extern MemoryPool _town_pool;
 
--- a/waypoint.h	Sun Mar 26 22:25:29 2006 +0000
+++ b/waypoint.h	Sun Mar 26 22:41:56 2006 +0000
@@ -10,7 +10,7 @@
 	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