(svn r6005) -Cleanup: introduce IndustryID and use it
-Cleanup: use TownID and StationID for two instances of uint16
This commit is contained in:
		@@ -844,7 +844,7 @@ Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode)
 | 
				
			|||||||
	return tp;
 | 
						return tp;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeleteSubsidyWithIndustry(uint16 index)
 | 
					void DeleteSubsidyWithIndustry(IndustryID index)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Subsidy *s;
 | 
						Subsidy *s;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -857,7 +857,7 @@ void DeleteSubsidyWithIndustry(uint16 index)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeleteSubsidyWithStation(uint16 index)
 | 
					void DeleteSubsidyWithStation(StationID index)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Subsidy *s;
 | 
						Subsidy *s;
 | 
				
			||||||
	bool dirty = false;
 | 
						bool dirty = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@ struct Industry {
 | 
				
			|||||||
	Year last_prod_year;
 | 
						Year last_prod_year;
 | 
				
			||||||
	byte was_cargo_delivered;
 | 
						byte was_cargo_delivered;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint16 index;
 | 
						IndustryID index;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct IndustryTileTable {
 | 
					typedef struct IndustryTileTable {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -811,7 +811,7 @@ static void SetupFarmFieldFence(TileIndex tile, int size, byte type, Axis direct
 | 
				
			|||||||
	} while (--size);
 | 
						} while (--size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void PlantFarmField(TileIndex tile, uint16 industry)
 | 
					static void PlantFarmField(TileIndex tile, IndustryID industry)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	uint size_x, size_y;
 | 
						uint size_x, size_y;
 | 
				
			||||||
	uint32 r;
 | 
						uint32 r;
 | 
				
			||||||
@@ -1404,7 +1404,7 @@ static Industry *AllocateIndustry(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	FOR_ALL_INDUSTRIES(i) {
 | 
						FOR_ALL_INDUSTRIES(i) {
 | 
				
			||||||
		if (i->xy == 0) {
 | 
							if (i->xy == 0) {
 | 
				
			||||||
			uint index = i->index;
 | 
								IndustryID index = i->index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (i->index > _total_industries) _total_industries = i->index;
 | 
								if (i->index > _total_industries) _total_industries = i->index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@ enum {
 | 
				
			|||||||
	GFX_TOY_FACTORY       = 143
 | 
						GFX_TOY_FACTORY       = 143
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline uint GetIndustryIndex(TileIndex t)
 | 
					static inline IndustryID GetIndustryIndex(TileIndex t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	assert(IsTileType(t, MP_INDUSTRY));
 | 
						assert(IsTileType(t, MP_INDUSTRY));
 | 
				
			||||||
	return _m[t].m2;
 | 
						return _m[t].m2;
 | 
				
			||||||
@@ -95,7 +95,7 @@ static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx)
 | 
				
			|||||||
	_m[t].m5 = gfx;
 | 
						_m[t].m5 = gfx;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void MakeIndustry(TileIndex t, uint index, IndustryGfx gfx)
 | 
					static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SetTileType(t, MP_INDUSTRY);
 | 
						SetTileType(t, MP_INDUSTRY);
 | 
				
			||||||
	_m[t].m1 = 0;
 | 
						_m[t].m1 = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,7 @@ typedef struct DrawPixelInfo DrawPixelInfo;
 | 
				
			|||||||
typedef uint16 VehicleID;
 | 
					typedef uint16 VehicleID;
 | 
				
			||||||
typedef uint16 StationID;
 | 
					typedef uint16 StationID;
 | 
				
			||||||
typedef uint16 TownID;
 | 
					typedef uint16 TownID;
 | 
				
			||||||
 | 
					typedef uint16 IndustryID;
 | 
				
			||||||
typedef byte PlayerID;
 | 
					typedef byte PlayerID;
 | 
				
			||||||
typedef byte OrderID;
 | 
					typedef byte OrderID;
 | 
				
			||||||
typedef byte CargoID;
 | 
					typedef byte CargoID;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -951,7 +951,7 @@ static Town *AllocateTown(void)
 | 
				
			|||||||
	Town *t;
 | 
						Town *t;
 | 
				
			||||||
	FOR_ALL_TOWNS(t) {
 | 
						FOR_ALL_TOWNS(t) {
 | 
				
			||||||
		if (t->xy == 0) {
 | 
							if (t->xy == 0) {
 | 
				
			||||||
			uint index = t->index;
 | 
								TownID index = t->index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (t->index > _total_towns)
 | 
								if (t->index > _total_towns)
 | 
				
			||||||
				_total_towns = t->index;
 | 
									_total_towns = t->index;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user