Merge branch 'master' into jgrpp

# Conflicts:
#	src/3rdparty/squirrel/include/squirrel.h
#	src/blitter/32bpp_sse_func.hpp
#	src/bridge_map.h
#	src/clear_map.h
#	src/company_manager_face.h
#	src/console_func.h
#	src/core/bitmath_func.hpp
#	src/core/endian_func.hpp
#	src/core/random_func.hpp
#	src/depot_map.h
#	src/elrail_func.h
#	src/fontcache.h
#	src/industry_map.h
#	src/map_func.h
#	src/newgrf_spritegroup.h
#	src/object_map.h
#	src/rail.h
#	src/rail_map.h
#	src/road_func.h
#	src/road_map.h
#	src/saveload/saveload.h
#	src/saveload/saveload_error.hpp
#	src/settings_gui.cpp
#	src/sl/oldloader.h
#	src/sprite.h
#	src/spritecache.h
#	src/station_func.h
#	src/station_map.h
#	src/story_base.h
#	src/strings_func.h
#	src/tile_cmd.h
#	src/tile_map.h
#	src/tile_type.h
#	src/town.h
#	src/town_map.h
#	src/tree_map.h
#	src/tunnel_map.h
#	src/tunnelbridge_map.h
#	src/vehicle_func.h
#	src/viewport_func.h
#	src/void_map.h
#	src/water.h
#	src/water_map.h
#	src/widget_type.h
This commit is contained in:
Jonathan G Rennison
2024-01-07 15:00:16 +00:00
106 changed files with 1080 additions and 1080 deletions

View File

@@ -29,7 +29,7 @@ enum RoadTileType {
* @param t Tile to query.
* @return true if tile can be queried about road/tram types.
*/
static inline bool MayHaveRoad(TileIndex t)
inline bool MayHaveRoad(TileIndex t)
{
switch (GetTileType(t)) {
case MP_ROAD:
@@ -85,7 +85,7 @@ debug_inline static bool IsNormalRoadTile(TileIndex t)
* @pre IsTileType(t, MP_ROAD)
* @return True if level crossing.
*/
static inline bool IsLevelCrossing(TileIndex t)
inline bool IsLevelCrossing(TileIndex t)
{
return GetRoadTileType(t) == ROAD_TILE_CROSSING;
}
@@ -95,7 +95,7 @@ static inline bool IsLevelCrossing(TileIndex t)
* @param t Tile to query.
* @return True if level crossing tile.
*/
static inline bool IsLevelCrossingTile(TileIndex t)
inline bool IsLevelCrossingTile(TileIndex t)
{
return IsTileType(t, MP_ROAD) && IsLevelCrossing(t);
}
@@ -128,7 +128,7 @@ debug_inline static bool IsRoadDepotTile(TileIndex t)
* @pre IsNormalRoad(t)
* @return The present road bits for the road type.
*/
static inline RoadBits GetRoadBits(TileIndex t, RoadTramType rtt)
inline RoadBits GetRoadBits(TileIndex t, RoadTramType rtt)
{
dbg_assert_tile(IsNormalRoad(t), t);
if (rtt == RTT_TRAM) return (RoadBits)GB(_m[t].m3, 0, 4);
@@ -141,7 +141,7 @@ static inline RoadBits GetRoadBits(TileIndex t, RoadTramType rtt)
* @param tile The tile from which we want to get the RoadBits
* @return all set RoadBits of the tile
*/
static inline RoadBits GetAllRoadBits(TileIndex tile)
inline RoadBits GetAllRoadBits(TileIndex tile)
{
return GetRoadBits(tile, RTT_ROAD) | GetRoadBits(tile, RTT_TRAM);
}
@@ -153,7 +153,7 @@ static inline RoadBits GetAllRoadBits(TileIndex tile)
* @param rt Road type.
* @pre IsNormalRoad(t)
*/
static inline void SetRoadBits(TileIndex t, RoadBits r, RoadTramType rtt)
inline void SetRoadBits(TileIndex t, RoadBits r, RoadTramType rtt)
{
assert_tile(IsNormalRoad(t), t); // XXX incomplete
if (rtt == RTT_TRAM) {
@@ -163,19 +163,19 @@ static inline void SetRoadBits(TileIndex t, RoadBits r, RoadTramType rtt)
}
}
static inline RoadType GetRoadTypeRoad(TileIndex t)
inline RoadType GetRoadTypeRoad(TileIndex t)
{
dbg_assert(MayHaveRoad(t));
return (RoadType)GB(_m[t].m4, 0, 6);
}
static inline RoadType GetRoadTypeTram(TileIndex t)
inline RoadType GetRoadTypeTram(TileIndex t)
{
dbg_assert(MayHaveRoad(t));
return (RoadType)GB(_me[t].m8, 6, 6);
}
static inline RoadType GetRoadType(TileIndex t, RoadTramType rtt)
inline RoadType GetRoadType(TileIndex t, RoadTramType rtt)
{
return (rtt == RTT_TRAM) ? GetRoadTypeTram(t) : GetRoadTypeRoad(t);
}
@@ -185,7 +185,7 @@ static inline RoadType GetRoadType(TileIndex t, RoadTramType rtt)
* @param t The tile to query.
* @return Present road types.
*/
static inline RoadTypes GetPresentRoadTypes(TileIndex t)
inline RoadTypes GetPresentRoadTypes(TileIndex t)
{
RoadTypes result = ROADTYPES_NONE;
if (MayHaveRoad(t)) {
@@ -195,12 +195,12 @@ static inline RoadTypes GetPresentRoadTypes(TileIndex t)
return result;
}
static inline bool HasRoadTypeRoad(TileIndex t)
inline bool HasRoadTypeRoad(TileIndex t)
{
return GetRoadTypeRoad(t) != INVALID_ROADTYPE;
}
static inline bool HasRoadTypeTram(TileIndex t)
inline bool HasRoadTypeTram(TileIndex t)
{
return GetRoadTypeTram(t) != INVALID_ROADTYPE;
}
@@ -210,7 +210,7 @@ static inline bool HasRoadTypeTram(TileIndex t)
* @param t The tile to query.
* @return Present road types.
*/
static inline RoadTramTypes GetPresentRoadTramTypes(TileIndex t)
inline RoadTramTypes GetPresentRoadTramTypes(TileIndex t)
{
RoadTramTypes result = (RoadTramTypes)0;
if (MayHaveRoad(t)) {
@@ -226,7 +226,7 @@ static inline RoadTramTypes GetPresentRoadTramTypes(TileIndex t)
* @param tram True to check tram, false to check road.
* @return True if the tile has the specified road type.
*/
static inline bool HasTileRoadType(TileIndex t, RoadTramType rtt)
inline bool HasTileRoadType(TileIndex t, RoadTramType rtt)
{
return GetRoadType(t, rtt) != INVALID_ROADTYPE;
}
@@ -237,7 +237,7 @@ static inline bool HasTileRoadType(TileIndex t, RoadTramType rtt)
* @param rts Allowed road types.
* @return True if the tile has one of the specified road types.
*/
static inline bool HasTileAnyRoadType(TileIndex t, RoadTypes rts)
inline bool HasTileAnyRoadType(TileIndex t, RoadTypes rts)
{
if (!MayHaveRoad(t)) return false;
return (GetPresentRoadTypes(t) & rts);
@@ -249,7 +249,7 @@ static inline bool HasTileAnyRoadType(TileIndex t, RoadTypes rts)
* @param rtt RoadTramType.
* @return Owner of the given road type.
*/
static inline Owner GetRoadOwner(TileIndex t, RoadTramType rtt)
inline Owner GetRoadOwner(TileIndex t, RoadTramType rtt)
{
dbg_assert(MayHaveRoad(t));
if (rtt == RTT_ROAD) return (Owner)GB(IsNormalRoadTile(t) ? _m[t].m1 : _me[t].m7, 0, 5);
@@ -266,7 +266,7 @@ static inline Owner GetRoadOwner(TileIndex t, RoadTramType rtt)
* @param rtt RoadTramType.
* @param o New owner of the given road type.
*/
static inline void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
inline void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
{
if (rtt == RTT_ROAD) {
SB(IsNormalRoadTile(t) ? _m[t].m1 : _me[t].m7, 0, 5, o);
@@ -283,7 +283,7 @@ static inline void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
* @pre HasTileRoadType(t, rt)
* @return True if the road type is owned by the given owner.
*/
static inline bool IsRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
inline bool IsRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
{
dbg_assert_tile(HasTileRoadType(t, rtt), t);
return (GetRoadOwner(t, rtt) == o);
@@ -295,7 +295,7 @@ static inline bool IsRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
* @pre IsTileType(t, MP_ROAD)
* @return true iff tile has road and the road is owned by a town
*/
static inline bool HasTownOwnedRoad(TileIndex t)
inline bool HasTownOwnedRoad(TileIndex t)
{
return HasTileRoadType(t, RTT_ROAD) && IsRoadOwner(t, RTT_ROAD, OWNER_TOWN);
}
@@ -317,7 +317,7 @@ template <> struct EnumPropsT<DisallowedRoadDirections> : MakeEnumPropsT<Disallo
* @param t the tile to get the directions from
* @return the disallowed directions
*/
static inline DisallowedRoadDirections GetDisallowedRoadDirections(TileIndex t)
inline DisallowedRoadDirections GetDisallowedRoadDirections(TileIndex t)
{
dbg_assert_tile(IsNormalRoad(t), t);
return (DisallowedRoadDirections)GB(_m[t].m5, 4, 2);
@@ -328,7 +328,7 @@ static inline DisallowedRoadDirections GetDisallowedRoadDirections(TileIndex t)
* @param t the tile to set the directions for
* @param drd the disallowed directions
*/
static inline void SetDisallowedRoadDirections(TileIndex t, DisallowedRoadDirections drd)
inline void SetDisallowedRoadDirections(TileIndex t, DisallowedRoadDirections drd)
{
assert_tile(IsNormalRoad(t), t);
assert(drd < DRD_END);
@@ -350,7 +350,7 @@ enum RoadCachedOneWayState {
* @pre MayHaveRoad(t)
* @return road cached one way state
*/
static inline RoadCachedOneWayState GetRoadCachedOneWayState(TileIndex t)
inline RoadCachedOneWayState GetRoadCachedOneWayState(TileIndex t)
{
dbg_assert(MayHaveRoad(t));
return (RoadCachedOneWayState)GB(_me[t].m8, 12, 3);
@@ -362,7 +362,7 @@ static inline RoadCachedOneWayState GetRoadCachedOneWayState(TileIndex t)
* @param rcows road cached one way state
* @pre MayHaveRoad(t)
*/
static inline void SetRoadCachedOneWayState(TileIndex t, RoadCachedOneWayState rcows)
inline void SetRoadCachedOneWayState(TileIndex t, RoadCachedOneWayState rcows)
{
assert(MayHaveRoad(t));
SB(_me[t].m8, 12, 3, rcows);
@@ -374,7 +374,7 @@ static inline void SetRoadCachedOneWayState(TileIndex t, RoadCachedOneWayState r
* @pre IsLevelCrossing(t)
* @return The axis of the road.
*/
static inline Axis GetCrossingRoadAxis(TileIndex t)
inline Axis GetCrossingRoadAxis(TileIndex t)
{
dbg_assert_tile(IsLevelCrossing(t), t);
return (Axis)GB(_m[t].m5, 0, 1);
@@ -386,7 +386,7 @@ static inline Axis GetCrossingRoadAxis(TileIndex t)
* @pre IsLevelCrossing(t)
* @return The axis of the rail.
*/
static inline Axis GetCrossingRailAxis(TileIndex t)
inline Axis GetCrossingRailAxis(TileIndex t)
{
dbg_assert_tile(IsLevelCrossing(t), t);
return OtherAxis((Axis)GetCrossingRoadAxis(t));
@@ -397,7 +397,7 @@ static inline Axis GetCrossingRailAxis(TileIndex t)
* @param tile The tile to query.
* @return The present road bits.
*/
static inline RoadBits GetCrossingRoadBits(TileIndex tile)
inline RoadBits GetCrossingRoadBits(TileIndex tile)
{
return GetCrossingRoadAxis(tile) == AXIS_X ? ROAD_X : ROAD_Y;
}
@@ -407,7 +407,7 @@ static inline RoadBits GetCrossingRoadBits(TileIndex tile)
* @param tile The tile to query.
* @return The rail track.
*/
static inline Track GetCrossingRailTrack(TileIndex tile)
inline Track GetCrossingRailTrack(TileIndex tile)
{
return AxisToTrack(GetCrossingRailAxis(tile));
}
@@ -417,7 +417,7 @@ static inline Track GetCrossingRailTrack(TileIndex tile)
* @param tile The tile to query.
* @return The rail track bits.
*/
static inline TrackBits GetCrossingRailBits(TileIndex tile)
inline TrackBits GetCrossingRailBits(TileIndex tile)
{
return AxisToTrackBits(GetCrossingRailAxis(tile));
}
@@ -429,7 +429,7 @@ static inline TrackBits GetCrossingRailBits(TileIndex tile)
* @return reservation state
* @pre IsLevelCrossingTile(t)
*/
static inline bool HasCrossingReservation(TileIndex t)
inline bool HasCrossingReservation(TileIndex t)
{
dbg_assert_tile(IsLevelCrossingTile(t), t);
return HasBit(_m[t].m5, 4);
@@ -442,7 +442,7 @@ static inline bool HasCrossingReservation(TileIndex t)
* @param b the reservation state
* @pre IsLevelCrossingTile(t)
*/
static inline void SetCrossingReservation(TileIndex t, bool b)
inline void SetCrossingReservation(TileIndex t, bool b)
{
assert_tile(IsLevelCrossingTile(t), t);
SB(_m[t].m5, 4, 1, b ? 1 : 0);
@@ -454,7 +454,7 @@ static inline void SetCrossingReservation(TileIndex t, bool b)
* @pre IsLevelCrossingTile(t)
* @return reserved track bits
*/
static inline TrackBits GetCrossingReservationTrackBits(TileIndex t)
inline TrackBits GetCrossingReservationTrackBits(TileIndex t)
{
return HasCrossingReservation(t) ? GetCrossingRailBits(t) : TRACK_BIT_NONE;
}
@@ -465,7 +465,7 @@ static inline TrackBits GetCrossingReservationTrackBits(TileIndex t)
* @pre IsLevelCrossing(t)
* @return True if the level crossing is barred.
*/
static inline bool IsCrossingBarred(TileIndex t)
inline bool IsCrossingBarred(TileIndex t)
{
dbg_assert_tile(IsLevelCrossing(t), t);
return HasBit(_m[t].m5, 5);
@@ -477,7 +477,7 @@ static inline bool IsCrossingBarred(TileIndex t)
* @param barred True if the crossing should be barred, false otherwise.
* @pre IsLevelCrossing(t)
*/
static inline void SetCrossingBarred(TileIndex t, bool barred)
inline void SetCrossingBarred(TileIndex t, bool barred)
{
assert_tile(IsLevelCrossing(t), t);
SB(_m[t].m5, 5, 1, barred ? 1 : 0);
@@ -489,7 +489,7 @@ static inline void SetCrossingBarred(TileIndex t, bool barred)
* @pre IsLevelCrossing(t)
* @return True if the level crossing is marked as occupied. This may return false positives.
*/
static inline bool IsCrossingPossiblyOccupiedByRoadVehicle(TileIndex t)
inline bool IsCrossingPossiblyOccupiedByRoadVehicle(TileIndex t)
{
dbg_assert_tile(IsLevelCrossing(t), t);
return HasBit(_m[t].m5, 1);
@@ -501,7 +501,7 @@ static inline bool IsCrossingPossiblyOccupiedByRoadVehicle(TileIndex t)
* @param barred True if the crossing should be marked as occupied, false otherwise.
* @pre IsLevelCrossing(t)
*/
static inline void SetCrossingOccupiedByRoadVehicle(TileIndex t, bool occupied)
inline void SetCrossingOccupiedByRoadVehicle(TileIndex t, bool occupied)
{
assert_tile(IsLevelCrossing(t), t);
SB(_m[t].m5, 1, 1, occupied ? 1 : 0);
@@ -514,7 +514,7 @@ static inline void SetCrossingOccupiedByRoadVehicle(TileIndex t, bool occupied)
* @param t The tile to query.
* @return True if the tile has snow/desert.
*/
static inline bool IsOnSnow(TileIndex t)
inline bool IsOnSnow(TileIndex t)
{
return HasBit(_me[t].m7, 5);
}
@@ -525,7 +525,7 @@ static inline bool IsOnSnow(TileIndex t)
* Toggle the snow/desert state of a road tile.
* @param t The tile to change.
*/
static inline void ToggleSnow(TileIndex t)
inline void ToggleSnow(TileIndex t)
{
ToggleBit(_me[t].m7, 5);
}
@@ -548,7 +548,7 @@ enum Roadside {
* @param tile The tile to query.
* @return The road decoration of the tile.
*/
static inline Roadside GetRoadside(TileIndex tile)
inline Roadside GetRoadside(TileIndex tile)
{
return (Roadside)GB(_me[tile].m6, 3, 3);
}
@@ -558,7 +558,7 @@ static inline Roadside GetRoadside(TileIndex tile)
* @param tile The tile to change.
* @param s The new road decoration of the tile.
*/
static inline void SetRoadside(TileIndex tile, Roadside s)
inline void SetRoadside(TileIndex tile, Roadside s)
{
SB(_me[tile].m6, 3, 3, s);
}
@@ -568,7 +568,7 @@ static inline void SetRoadside(TileIndex tile, Roadside s)
* @param t The tile to check.
* @return True if the tile has road works in progress.
*/
static inline bool HasRoadWorks(TileIndex t)
inline bool HasRoadWorks(TileIndex t)
{
return GetRoadside(t) >= ROADSIDE_GRASS_ROAD_WORKS;
}
@@ -578,7 +578,7 @@ static inline bool HasRoadWorks(TileIndex t)
* @param t The tile to modify.
* @return True if the road works are in the last stage.
*/
static inline bool IncreaseRoadWorksCounter(TileIndex t)
inline bool IncreaseRoadWorksCounter(TileIndex t)
{
AB(_me[t].m7, 0, 4, 1);
@@ -590,7 +590,7 @@ static inline bool IncreaseRoadWorksCounter(TileIndex t)
* @param t The tile to start the work on.
* @pre !HasRoadWorks(t)
*/
static inline void StartRoadWorks(TileIndex t)
inline void StartRoadWorks(TileIndex t)
{
assert_tile(!HasRoadWorks(t), t);
/* Remove any trees or lamps in case or roadwork */
@@ -606,7 +606,7 @@ static inline void StartRoadWorks(TileIndex t)
* @param t Tile to stop the road works on.
* @pre HasRoadWorks(t)
*/
static inline void TerminateRoadWorks(TileIndex t)
inline void TerminateRoadWorks(TileIndex t)
{
assert_tile(HasRoadWorks(t), t);
SetRoadside(t, (Roadside)(GetRoadside(t) - ROADSIDE_GRASS_ROAD_WORKS + ROADSIDE_GRASS));
@@ -620,7 +620,7 @@ static inline void TerminateRoadWorks(TileIndex t)
* @param t The tile to query.
* @return Diagonal direction of the depot exit.
*/
static inline DiagDirection GetRoadDepotDirection(TileIndex t)
inline DiagDirection GetRoadDepotDirection(TileIndex t)
{
dbg_assert_tile(IsRoadDepot(t), t);
return (DiagDirection)GB(_m[t].m5, 0, 2);
@@ -634,7 +634,7 @@ RoadBits GetAnyRoadBits(TileIndex tile, RoadTramType rtt, bool straight_tunnel_b
* @param t The tile to change.
* @param rt The road type to set.
*/
static inline void SetRoadTypeRoad(TileIndex t, RoadType rt)
inline void SetRoadTypeRoad(TileIndex t, RoadType rt)
{
assert(MayHaveRoad(t));
assert(rt == INVALID_ROADTYPE || RoadTypeIsRoad(rt));
@@ -646,7 +646,7 @@ static inline void SetRoadTypeRoad(TileIndex t, RoadType rt)
* @param t The tile to change.
* @param rt The road type to set.
*/
static inline void SetRoadTypeTram(TileIndex t, RoadType rt)
inline void SetRoadTypeTram(TileIndex t, RoadType rt)
{
assert(MayHaveRoad(t));
assert(rt == INVALID_ROADTYPE || RoadTypeIsTram(rt));
@@ -659,7 +659,7 @@ static inline void SetRoadTypeTram(TileIndex t, RoadType rt)
* @param rtt Set road or tram type.
* @param rt The road type to set.
*/
static inline void SetRoadType(TileIndex t, RoadTramType rtt, RoadType rt)
inline void SetRoadType(TileIndex t, RoadTramType rtt, RoadType rt)
{
if (rtt == RTT_TRAM) {
SetRoadTypeTram(t, rt);
@@ -674,7 +674,7 @@ static inline void SetRoadType(TileIndex t, RoadTramType rtt, RoadType rt)
* @param road_rt The road roadtype to set for the tile.
* @param tram_rt The tram roadtype to set for the tile.
*/
static inline void SetRoadTypes(TileIndex t, RoadType road_rt, RoadType tram_rt)
inline void SetRoadTypes(TileIndex t, RoadType road_rt, RoadType tram_rt)
{
SetRoadTypeRoad(t, road_rt);
SetRoadTypeTram(t, tram_rt);
@@ -690,7 +690,7 @@ static inline void SetRoadTypes(TileIndex t, RoadType road_rt, RoadType tram_rt)
* @param road New owner of road.
* @param tram New owner of tram tracks.
*/
static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadType road_rt, RoadType tram_rt, TownID town, Owner road, Owner tram)
inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadType road_rt, RoadType tram_rt, TownID town, Owner road, Owner tram)
{
SetTileType(t, MP_ROAD);
SetTileOwner(t, road);
@@ -715,7 +715,7 @@ static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadType road_rt,
* @param tram_rt The tram roadtype to set for the tile.
* @param town Town ID if the road is a town-owned road.
*/
static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadType road_rt, RoadType tram_rt, uint town)
inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadType road_rt, RoadType tram_rt, uint town)
{
SetTileType(t, MP_ROAD);
SetTileOwner(t, rail);
@@ -738,7 +738,7 @@ static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner r
* @param dir Direction of the depot exit.*
* @param rt Road type of the depot.
*/
static inline void MakeRoadDepot(TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt)
inline void MakeRoadDepot(TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt)
{
SetTileType(t, MP_ROAD);
SetTileOwner(t, owner);