diff --git a/docs/newgrf-roadstops-nml.html b/docs/newgrf-roadstops-nml.html
index 03bfc9d97e..27298adb81 100644
--- a/docs/newgrf-roadstops-nml.html
+++ b/docs/newgrf-roadstops-nml.html
@@ -78,6 +78,8 @@
Animation callback requires random bits in variable extra_callback_info1.
RST_GENERAL_FLAG_NO_ONE_WAY_OVERLAY
Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using the one_way_info variable.
+ RST_GENERAL_FLAG_NO_CATENARY
+ Do not show catenary graphics. (This only takes effect from road_stops version 2).
minimum_bridge_height | Array of 6 items [0..255, ...] | Minimum clearances required for a bridge for each of the 6 views/rotations (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px). |
disallowed_bridge_pillars | Array of 6 items [bitmask(RST_BRIDGE_PILLAR_FLAG_, ...), ...] |
diff --git a/docs/newgrf-roadstops.html b/docs/newgrf-roadstops.html
index 959e50e187..3fe9d73944 100644
--- a/docs/newgrf-roadstops.html
+++ b/docs/newgrf-roadstops.html
@@ -19,8 +19,9 @@
A subset of the functionality listed below is also supported in a fork of NML, see the associated NML road stops and NML additions documents for more details.
NewGRFs which use this feature SHOULD use the feature testing mechanism to check whether the road stop feature and/or feature ID mapping is supported.
NewGRFs which use this feature MUST use the feature ID mapping mechanism to map the non-standard NewGRF road stop feature to a local feature ID.
- This feature is indicated by the feature name: road_stops, version 1.
- The feature name to use for feature ID mapping is road_stops.
+ This feature is indicated by the feature name: road_stops, version 1.
+ The feature name to use for feature ID mapping is road_stops.
+ Features/properties/variables which require a higher version will indicate the required version. Unless indicated otherwise these will fall back to doing nothing on versions which do not support them.
Actions:
@@ -149,6 +150,7 @@
|
Bit | Value | Meaning |
0 | 1 | Callback 141 needs random bits in variable 10 |
1 | 2 | Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using bits 0..1 of variable 50. |
+ 2 | 4 | Do not catenary graphics.This requires road_stops, version 2. |
The default value is 0 (no flags enabled).
diff --git a/src/newgrf_extension.cpp b/src/newgrf_extension.cpp
index 74ddbb1275..43ba27d9ee 100644
--- a/src/newgrf_extension.cpp
+++ b/src/newgrf_extension.cpp
@@ -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(),
};
diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h
index 3763b731c2..19dfbd10a7 100644
--- a/src/newgrf_roadstop.h
+++ b/src/newgrf_roadstop.h
@@ -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 {
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 6519e6297c..d112bf259a 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -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 */
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 4506b0ff6e..449f2fa772 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -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)) {