diff --git a/src/town_map.h b/src/town_map.h --- a/src/town_map.h +++ b/src/town_map.h @@ -20,7 +20,7 @@ * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD) but not a road depot * @return TownID */ -static inline TownID GetTownIndex(Tile t) +inline TownID GetTownIndex(Tile t) { assert(IsTileType(t, MP_HOUSE) || (IsTileType(t, MP_ROAD) && !IsRoadDepot(t))); return t.m2(); @@ -32,7 +32,7 @@ static inline TownID GetTownIndex(Tile t * @param index the index of the town * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD) but not a road depot */ -static inline void SetTownIndex(Tile t, TownID index) +inline void SetTownIndex(Tile t, TownID index) { assert(IsTileType(t, MP_HOUSE) || (IsTileType(t, MP_ROAD) && !IsRoadDepot(t))); t.m2() = index; @@ -45,7 +45,7 @@ static inline void SetTownIndex(Tile t, * @pre IsTileType(t, MP_HOUSE) * @return house type */ -static inline HouseID GetCleanHouseType(Tile t) +inline HouseID GetCleanHouseType(Tile t) { assert(IsTileType(t, MP_HOUSE)); return t.m4() | (GB(t.m3(), 6, 1) << 8); @@ -57,7 +57,7 @@ static inline HouseID GetCleanHouseType( * @pre IsTileType(t, MP_HOUSE) * @return house type */ -static inline HouseID GetHouseType(Tile t) +inline HouseID GetHouseType(Tile t) { return GetTranslatedHouseID(GetCleanHouseType(t)); } @@ -68,7 +68,7 @@ static inline HouseID GetHouseType(Tile * @param house_id the new house type * @pre IsTileType(t, MP_HOUSE) */ -static inline void SetHouseType(Tile t, HouseID house_id) +inline void SetHouseType(Tile t, HouseID house_id) { assert(IsTileType(t, MP_HOUSE)); t.m4() = GB(house_id, 0, 8); @@ -80,7 +80,7 @@ static inline void SetHouseType(Tile t, * @param t the tile * @return has destination */ -static inline bool LiftHasDestination(Tile t) +inline bool LiftHasDestination(Tile t) { return HasBit(t.m7(), 0); } @@ -91,7 +91,7 @@ static inline bool LiftHasDestination(Ti * @param t the tile * @param dest new destination */ -static inline void SetLiftDestination(Tile t, byte dest) +inline void SetLiftDestination(Tile t, byte dest) { SetBit(t.m7(), 0); SB(t.m7(), 1, 3, dest); @@ -102,7 +102,7 @@ static inline void SetLiftDestination(Ti * @param t the tile * @return destination */ -static inline byte GetLiftDestination(Tile t) +inline byte GetLiftDestination(Tile t) { return GB(t.m7(), 1, 3); } @@ -113,7 +113,7 @@ static inline byte GetLiftDestination(Ti * and the destination. * @param t the tile */ -static inline void HaltLift(Tile t) +inline void HaltLift(Tile t) { SB(t.m7(), 0, 4, 0); } @@ -123,7 +123,7 @@ static inline void HaltLift(Tile t) * @param t the tile * @return position, from 0 to 36 */ -static inline byte GetLiftPosition(Tile t) +inline byte GetLiftPosition(Tile t) { return GB(t.m6(), 2, 6); } @@ -133,7 +133,7 @@ static inline byte GetLiftPosition(Tile * @param t the tile * @param pos position, from 0 to 36 */ -static inline void SetLiftPosition(Tile t, byte pos) +inline void SetLiftPosition(Tile t, byte pos) { SB(t.m6(), 2, 6, pos); } @@ -143,7 +143,7 @@ static inline void SetLiftPosition(Tile * @param t the tile * @return true if it is, false if it is not */ -static inline bool IsHouseCompleted(Tile t) +inline bool IsHouseCompleted(Tile t) { assert(IsTileType(t, MP_HOUSE)); return HasBit(t.m3(), 7); @@ -154,7 +154,7 @@ static inline bool IsHouseCompleted(Tile * @param t the tile * @param status */ -static inline void SetHouseCompleted(Tile t, bool status) +inline void SetHouseCompleted(Tile t, bool status) { assert(IsTileType(t, MP_HOUSE)); SB(t.m3(), 7, 1, !!status); @@ -181,7 +181,7 @@ static inline void SetHouseCompleted(Til * @pre IsTileType(t, MP_HOUSE) * @return the building stage of the house */ -static inline byte GetHouseBuildingStage(Tile t) +inline byte GetHouseBuildingStage(Tile t) { assert(IsTileType(t, MP_HOUSE)); return IsHouseCompleted(t) ? (byte)TOWN_HOUSE_COMPLETED : GB(t.m5(), 3, 2); @@ -193,7 +193,7 @@ static inline byte GetHouseBuildingStage * @pre IsTileType(t, MP_HOUSE) * @return the construction stage of the house */ -static inline byte GetHouseConstructionTick(Tile t) +inline byte GetHouseConstructionTick(Tile t) { assert(IsTileType(t, MP_HOUSE)); return IsHouseCompleted(t) ? 0 : GB(t.m5(), 0, 3); @@ -206,7 +206,7 @@ static inline byte GetHouseConstructionT * @param t the tile of the house to increment the construction stage of * @pre IsTileType(t, MP_HOUSE) */ -static inline void IncHouseConstructionTick(Tile t) +inline void IncHouseConstructionTick(Tile t) { assert(IsTileType(t, MP_HOUSE)); AB(t.m5(), 0, 5, 1); @@ -224,7 +224,7 @@ static inline void IncHouseConstructionT * @param t the tile of this house * @pre IsTileType(t, MP_HOUSE) && IsHouseCompleted(t) */ -static inline void ResetHouseAge(Tile t) +inline void ResetHouseAge(Tile t) { assert(IsTileType(t, MP_HOUSE) && IsHouseCompleted(t)); t.m5() = 0; @@ -235,7 +235,7 @@ static inline void ResetHouseAge(Tile t) * @param t the tile of this house * @pre IsTileType(t, MP_HOUSE) */ -static inline void IncrementHouseAge(Tile t) +inline void IncrementHouseAge(Tile t) { assert(IsTileType(t, MP_HOUSE)); if (IsHouseCompleted(t) && t.m5() < 0xFF) t.m5()++; @@ -247,7 +247,7 @@ static inline void IncrementHouseAge(Til * @pre IsTileType(t, MP_HOUSE) * @return year */ -static inline TimerGameCalendar::Year GetHouseAge(Tile t) +inline TimerGameCalendar::Year GetHouseAge(Tile t) { assert(IsTileType(t, MP_HOUSE)); return IsHouseCompleted(t) ? t.m5() : 0; @@ -260,7 +260,7 @@ static inline TimerGameCalendar::Year Ge * @param random the new random bits * @pre IsTileType(t, MP_HOUSE) */ -static inline void SetHouseRandomBits(Tile t, byte random) +inline void SetHouseRandomBits(Tile t, byte random) { assert(IsTileType(t, MP_HOUSE)); t.m1() = random; @@ -273,7 +273,7 @@ static inline void SetHouseRandomBits(Ti * @pre IsTileType(t, MP_HOUSE) * @return random bits */ -static inline byte GetHouseRandomBits(Tile t) +inline byte GetHouseRandomBits(Tile t) { assert(IsTileType(t, MP_HOUSE)); return t.m1(); @@ -286,7 +286,7 @@ static inline byte GetHouseRandomBits(Ti * @param triggers the activated triggers * @pre IsTileType(t, MP_HOUSE) */ -static inline void SetHouseTriggers(Tile t, byte triggers) +inline void SetHouseTriggers(Tile t, byte triggers) { assert(IsTileType(t, MP_HOUSE)); SB(t.m3(), 0, 5, triggers); @@ -299,7 +299,7 @@ static inline void SetHouseTriggers(Tile * @pre IsTileType(t, MP_HOUSE) * @return triggers */ -static inline byte GetHouseTriggers(Tile t) +inline byte GetHouseTriggers(Tile t) { assert(IsTileType(t, MP_HOUSE)); return GB(t.m3(), 0, 5); @@ -311,7 +311,7 @@ static inline byte GetHouseTriggers(Tile * @pre IsTileType(t, MP_HOUSE) * @return time remaining */ -static inline byte GetHouseProcessingTime(Tile t) +inline byte GetHouseProcessingTime(Tile t) { assert(IsTileType(t, MP_HOUSE)); return GB(t.m6(), 2, 6); @@ -323,7 +323,7 @@ static inline byte GetHouseProcessingTim * @param time the time to be set * @pre IsTileType(t, MP_HOUSE) */ -static inline void SetHouseProcessingTime(Tile t, byte time) +inline void SetHouseProcessingTime(Tile t, byte time) { assert(IsTileType(t, MP_HOUSE)); SB(t.m6(), 2, 6, time); @@ -334,7 +334,7 @@ static inline void SetHouseProcessingTim * @param t the house tile * @pre IsTileType(t, MP_HOUSE) */ -static inline void DecHouseProcessingTime(Tile t) +inline void DecHouseProcessingTime(Tile t) { assert(IsTileType(t, MP_HOUSE)); t.m6() -= 1 << 2; @@ -350,7 +350,7 @@ static inline void DecHouseProcessingTim * @param random_bits required for newgrf houses * @pre IsTileType(t, MP_CLEAR) */ -static inline void MakeHouseTile(Tile t, TownID tid, byte counter, byte stage, HouseID type, byte random_bits) +inline void MakeHouseTile(Tile t, TownID tid, byte counter, byte stage, HouseID type, byte random_bits) { assert(IsTileType(t, MP_CLEAR));