Add road stops flag to disable drawing catenary
This commit is contained in:
@@ -51,7 +51,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
|
||||
GRFFeatureInfo("action0_object_edge_foundation_mode", 2),
|
||||
GRFFeatureInfo("action0_object_flood_resistant", 1),
|
||||
GRFFeatureInfo("action0_object_viewport_map_tile_type", 1),
|
||||
GRFFeatureInfo("road_stops", 1),
|
||||
GRFFeatureInfo("road_stops", 2),
|
||||
GRFFeatureInfo(),
|
||||
};
|
||||
|
||||
|
@@ -66,6 +66,7 @@ DECLARE_ENUM_AS_BIT_SET(RoadStopDrawMode)
|
||||
enum RoadStopSpecFlags {
|
||||
RSF_CB141_RANDOM_BITS, ///< Callback 141 needs random bits.
|
||||
RSF_NO_ONE_WAY_OVERLAY, ///< Do not show one-way road overlays.
|
||||
RSF_NO_CATENARY, ///< Do not show catenary.
|
||||
};
|
||||
|
||||
enum RoadStopSpecIntlFlags {
|
||||
|
@@ -2115,7 +2115,7 @@ static SpriteID GetRoadGroundSprite(const TileInfo *ti, Roadside roadside, const
|
||||
* Draw ground sprite and road pieces
|
||||
* @param ti TileInfo
|
||||
*/
|
||||
void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside, bool snow_or_desert)
|
||||
void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside, bool snow_or_desert, bool draw_catenary)
|
||||
{
|
||||
const bool is_road_tile = IsTileType(ti->tile, MP_ROAD);
|
||||
|
||||
@@ -2154,8 +2154,10 @@ void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Draw road, tram catenary */
|
||||
DrawRoadCatenary(ti);
|
||||
if (draw_catenary) {
|
||||
/* Draw road, tram catenary */
|
||||
DrawRoadCatenary(ti);
|
||||
}
|
||||
|
||||
/* Return if full detail is disabled, or we are zoomed fully out. */
|
||||
if (!HasBit(_display_opt, DO_FULL_DETAIL) || _cur_dpi->zoom > ZOOM_LVL_DETAIL) return;
|
||||
@@ -2184,12 +2186,12 @@ void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside,
|
||||
|
||||
void DrawRoadBitsRoad(TileInfo *ti)
|
||||
{
|
||||
DrawRoadBits(ti, GetRoadBits(ti->tile, RTT_ROAD), GetRoadBits(ti->tile, RTT_TRAM), GetRoadside(ti->tile), IsOnSnow(ti->tile));
|
||||
DrawRoadBits(ti, GetRoadBits(ti->tile, RTT_ROAD), GetRoadBits(ti->tile, RTT_TRAM), GetRoadside(ti->tile), IsOnSnow(ti->tile), true);
|
||||
}
|
||||
|
||||
void DrawRoadBitsTunnelBridge(TileInfo *ti)
|
||||
{
|
||||
DrawRoadBits(ti, GetCustomBridgeHeadRoadBits(ti->tile, RTT_ROAD), GetCustomBridgeHeadRoadBits(ti->tile, RTT_TRAM), ROADSIDE_PAVED, false);
|
||||
DrawRoadBits(ti, GetCustomBridgeHeadRoadBits(ti->tile, RTT_ROAD), GetCustomBridgeHeadRoadBits(ti->tile, RTT_TRAM), ROADSIDE_PAVED, false, true);
|
||||
}
|
||||
|
||||
/** Tile callback function for rendering a road tile to the screen */
|
||||
|
@@ -3450,10 +3450,10 @@ draw_default_foundation:
|
||||
}
|
||||
} else if (IsRoadWaypointTile(ti->tile)) {
|
||||
RoadBits bits = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? ROAD_X : ROAD_Y;
|
||||
extern void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside, bool snow_or_desert);
|
||||
extern void DrawRoadBits(TileInfo *ti, RoadBits road, RoadBits tram, Roadside roadside, bool snow_or_desert, bool draw_catenary);
|
||||
DrawRoadBits(ti, GetRoadTypeRoad(ti->tile) != INVALID_ROADTYPE ? bits : ROAD_NONE,
|
||||
GetRoadTypeTram(ti->tile) != INVALID_ROADTYPE ? bits : ROAD_NONE,
|
||||
GetRoadWaypointRoadside(ti->tile), IsRoadWaypointOnSnowOrDesert(ti->tile));
|
||||
GetRoadWaypointRoadside(ti->tile), IsRoadWaypointOnSnowOrDesert(ti->tile), false);
|
||||
} else {
|
||||
if (layout != nullptr) {
|
||||
/* Sprite layout which needs preprocessing */
|
||||
@@ -3559,8 +3559,10 @@ draw_default_foundation:
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw road, tram catenary */
|
||||
DrawRoadCatenary(ti);
|
||||
if (stopspec == nullptr || !HasBit(stopspec->flags, RSF_NO_CATENARY)) {
|
||||
/* Draw road, tram catenary */
|
||||
DrawRoadCatenary(ti);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsRailWaypoint(ti->tile)) {
|
||||
|
Reference in New Issue
Block a user