Changeset - r12208:4a6d754234c5
[Not reviewed]
master
0 5 0
smatz - 15 years ago 2009-06-23 09:52:26
smatz@openttd.org
(svn r16632) -Codechange: rename Town::flags12 to Town::flags
5 files changed with 16 insertions and 16 deletions:
0 comments (0 inline, 0 general)
src/newgrf_town.cpp
Show inline comments
 
@@ -30,7 +30,7 @@ uint32 TownGetVariable(byte variable, by
 
		case 0x82: return ClampToU16(t->population);
 
		case 0x83: return GB(ClampToU16(t->population), 8, 8);
 
		case 0x8A: return t->grow_counter;
 
		case 0x92: return t->flags12;  // In original game, 0x92 and 0x93 are really one word. Since flags12 is a byte, this is to adjust
 
		case 0x92: return t->flags;  // In original game, 0x92 and 0x93 are really one word. Since flags is a byte, this is to adjust
 
		case 0x93: return 0;
 
		case 0x94: return ClampToU16(t->squared_town_zone_radius[0]);
 
		case 0x95: return GB(ClampToU16(t->squared_town_zone_radius[0]), 8, 8);
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -527,7 +527,7 @@ static const OldChunks town_chunk[] = {
 
	OCL_NULL( 1 ),         ///< sort_index,        no longer in use
 
	OCL_NULL( 4 ),         ///< sign-coordinates,  no longer in use
 
	OCL_NULL( 2 ),         ///< namewidth,         no longer in use
 
	OCL_SVAR( OC_FILE_U16 |  OC_VAR_U8, Town, flags12 ),
 
	OCL_SVAR( OC_FILE_U16 |  OC_VAR_U8, Town, flags ),
 
	OCL_NULL( 10 ),        ///< radius,            no longer in use
 

	
 
	OCL_SVAR( OC_INT16, Town, ratings[0] ),
src/saveload/town_sl.cpp
Show inline comments
 
@@ -70,7 +70,7 @@ static const SaveLoad _town_desc[] = {
 
	    SLE_VAR(Town, townnameparts,         SLE_UINT32),
 
	SLE_CONDSTR(Town, name,                  SLE_STR, 0, 84, SL_MAX_VERSION),
 

	
 
	    SLE_VAR(Town, flags12,               SLE_UINT8),
 
	    SLE_VAR(Town, flags,                 SLE_UINT8),
 
	SLE_CONDVAR(Town, statues,               SLE_FILE_U8  | SLE_VAR_U16, 0, 103),
 
	SLE_CONDVAR(Town, statues,               SLE_UINT16,               104, SL_MAX_VERSION),
 

	
src/town.h
Show inline comments
 
@@ -123,7 +123,7 @@ struct Town : TownPool::PoolItem<&_town_
 
	 * bit 0 = Building funds received
 
	 * bit 1 = CHURCH
 
	 * bit 2 = STADIUM */
 
	byte flags12;
 
	byte flags;
 

	
 
	/* level of noise that all the airports are generating */
 
	uint16 noise_reached;
 
@@ -272,11 +272,11 @@ static const byte TOWN_GROWTH_FREQUENCY 
 
 * construction. */
 
static const byte TOWN_HOUSE_COMPLETED = 3;
 

	
 
/** This enum is used in conjonction with town->flags12.
 
/** This enum is used in conjonction with town->flags.
 
 * IT simply states what bit is used for.
 
 * It is pretty unrealistic (IMHO) to only have one church/stadium
 
 * per town, NO MATTER the population of it.
 
 * And there are 5 more bits available on flags12...
 
 * And there are 5 more bits available on flags...
 
 */
 
enum {
 
	TOWN_IS_FUNDED      = 0,   ///< Town has received some funds for
src/town_cmd.cpp
Show inline comments
 
@@ -488,7 +488,7 @@ static void TileLoop_Town(TileIndex tile
 
	_current_company = OWNER_TOWN;
 

	
 
	if ((hs->building_flags & BUILDING_HAS_1_TILE) &&
 
			HasBit(t->flags12, TOWN_IS_FUNDED) &&
 
			HasBit(t->flags, TOWN_IS_FUNDED) &&
 
			CanDeleteHouse(tile) &&
 
			GetHouseAge(tile) >= hs->minimum_life &&
 
			--t->time_until_rebuild == 0) {
 
@@ -656,7 +656,7 @@ static bool GrowTown(Town *t);
 

	
 
static void TownTickHandler(Town *t)
 
{
 
	if (HasBit(t->flags12, TOWN_IS_FUNDED)) {
 
	if (HasBit(t->flags, TOWN_IS_FUNDED)) {
 
		int i = t->grow_counter - 1;
 
		if (i < 0) {
 
			if (GrowTown(t)) {
 
@@ -1460,7 +1460,7 @@ static void DoCreateTown(Town *t, TileIn
 
	t->num_houses = 0;
 
	t->time_until_rebuild = 10;
 
	UpdateTownRadius(t);
 
	t->flags12 = 0;
 
	t->flags = 0;
 
	t->population = 0;
 
	t->grow_counter = 0;
 
	t->growth_rate = 250;
 
@@ -2121,7 +2121,7 @@ static bool BuildTownHouse(Town *t, Tile
 
			SetBit(oneof, TOWN_HAS_STADIUM);
 
		}
 

	
 
		if (t->flags12 & oneof) continue;
 
		if (t->flags & oneof) continue;
 

	
 
		/* Make sure there is no slope? */
 
		bool noslope = (hs->building_flags & TILE_NOT_SLOPED) != 0;
 
@@ -2146,7 +2146,7 @@ static bool BuildTownHouse(Town *t, Tile
 
		t->num_houses++;
 

	
 
		/* Special houses that there can be only one of. */
 
		t->flags12 |= oneof;
 
		t->flags |= oneof;
 

	
 
		byte construction_counter = 0;
 
		byte construction_stage = 0;
 
@@ -2233,9 +2233,9 @@ void ClearTownHouse(Town *t, TileIndex t
 

	
 
	/* Clear flags for houses that only may exist once/town. */
 
	if (hs->building_flags & BUILDING_IS_CHURCH) {
 
		ClrBit(t->flags12, TOWN_HAS_CHURCH);
 
		ClrBit(t->flags, TOWN_HAS_CHURCH);
 
	} else if (hs->building_flags & BUILDING_IS_STADIUM) {
 
		ClrBit(t->flags12, TOWN_HAS_STADIUM);
 
		ClrBit(t->flags, TOWN_HAS_STADIUM);
 
	}
 

	
 
	/* Do the actual clearing of tiles */
 
@@ -2404,7 +2404,7 @@ static void TownActionFundBuildings(Town
 
	/* Build next tick */
 
	t->grow_counter = 1;
 
	/* If we were not already growing */
 
	SetBit(t->flags12, TOWN_IS_FUNDED);
 
	SetBit(t->flags, TOWN_IS_FUNDED);
 
	/* And grow for 3 months */
 
	t->fund_buildings_months = 3;
 
}
 
@@ -2591,7 +2591,7 @@ static void UpdateTownGrowRate(Town *t)
 

	
 
	InvalidateWindow(WC_TOWN_AUTHORITY, t->index);
 

	
 
	ClrBit(t->flags12, TOWN_IS_FUNDED);
 
	ClrBit(t->flags, TOWN_IS_FUNDED);
 
	if (_settings_game.economy.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
 

	
 
	/** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the
 
@@ -2630,7 +2630,7 @@ static void UpdateTownGrowRate(Town *t)
 
	if (m <= t->grow_counter)
 
		t->grow_counter = m;
 

	
 
	SetBit(t->flags12, TOWN_IS_FUNDED);
 
	SetBit(t->flags, TOWN_IS_FUNDED);
 
}
 

	
 
static void UpdateTownAmounts(Town *t)
0 comments (0 inline, 0 general)