Codechange: rename and make RoadSpriteType a scoped enum

RoadTypeSpriteGroup is now renamed to RoadSpriteType
This commit is contained in:
Peter Nelson
2026-04-16 21:01:17 +01:00
committed by Peter Nelson
parent d15f105974
commit 5cef1ca68a
10 changed files with 58 additions and 57 deletions
+10 -10
View File
@@ -1145,8 +1145,8 @@ static void GetBridgeRoadCatenary(const RoadTypeInfo *rti, TileIndex head_tile,
static const SpriteID front_offsets[6] = { 97, 98, 103, 106, 104, 105 };
/* Simplified from DrawRoadTypeCatenary() to remove all the special cases required for regular ground road */
spr_back = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_BACK, head ? TCX_NORMAL : TCX_ON_BRIDGE);
spr_front = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_FRONT, head ? TCX_NORMAL : TCX_ON_BRIDGE);
spr_back = GetCustomRoadSprite(rti, head_tile, RoadSpriteType::CatenaryRear, head ? TCX_NORMAL : TCX_ON_BRIDGE);
spr_front = GetCustomRoadSprite(rti, head_tile, RoadSpriteType::CatenaryFront, head ? TCX_NORMAL : TCX_ON_BRIDGE);
if (spr_back == 0 && spr_front == 0) {
spr_back = SPR_TRAMWAY_BASE + back_offsets[offset];
spr_front = SPR_TRAMWAY_BASE + front_offsets[offset];
@@ -1184,14 +1184,14 @@ static void DrawBridgeRoadBits(TileIndex head_tile, int x, int y, int z, int off
trans_back[0] = !head && IsTransparencySet(TO_BRIDGES);
if (road_rti != nullptr) {
if (road_rti->UsesOverlay()) {
seq_back[0] = GetCustomRoadSprite(road_rti, head_tile, ROTSG_BRIDGE, head ? TCX_NORMAL : TCX_ON_BRIDGE) + offset;
seq_back[0] = GetCustomRoadSprite(road_rti, head_tile, RoadSpriteType::Bridge, head ? TCX_NORMAL : TCX_ON_BRIDGE) + offset;
} else if (is_custom_layout) {
/* For custom layouts draw a custom bridge deck. */
seq_back[0] = SPR_BRIDGE_DECKS_ROAD + offset;
}
} else if (tram_rti != nullptr) {
if (tram_rti->UsesOverlay()) {
seq_back[0] = GetCustomRoadSprite(tram_rti, head_tile, ROTSG_BRIDGE, head ? TCX_NORMAL : TCX_ON_BRIDGE) + offset;
seq_back[0] = GetCustomRoadSprite(tram_rti, head_tile, RoadSpriteType::Bridge, head ? TCX_NORMAL : TCX_ON_BRIDGE) + offset;
} else {
seq_back[0] = SPR_TRAMWAY_BRIDGE + offset;
}
@@ -1201,7 +1201,7 @@ static void DrawBridgeRoadBits(TileIndex head_tile, int x, int y, int z, int off
trans_back[1] = !head && IsTransparencySet(TO_BRIDGES);
if (road_rti != nullptr) {
if (road_rti->UsesOverlay()) {
seq_back[1] = GetCustomRoadSprite(road_rti, head_tile, ROTSG_OVERLAY, head ? TCX_NORMAL : TCX_ON_BRIDGE);
seq_back[1] = GetCustomRoadSprite(road_rti, head_tile, RoadSpriteType::Overlay, head ? TCX_NORMAL : TCX_ON_BRIDGE);
if (seq_back[1] != 0) seq_back[1] += overlay_offsets[offset];
}
}
@@ -1210,7 +1210,7 @@ static void DrawBridgeRoadBits(TileIndex head_tile, int x, int y, int z, int off
trans_back[2] = !head && IsTransparencySet(TO_BRIDGES);
if (tram_rti != nullptr) {
if (tram_rti->UsesOverlay()) {
seq_back[2] = GetCustomRoadSprite(tram_rti, head_tile, ROTSG_OVERLAY, head ? TCX_NORMAL : TCX_ON_BRIDGE);
seq_back[2] = GetCustomRoadSprite(tram_rti, head_tile, RoadSpriteType::Overlay, head ? TCX_NORMAL : TCX_ON_BRIDGE);
if (seq_back[2] != 0) seq_back[2] += overlay_offsets[offset];
} else if (road_rti != nullptr) {
seq_back[2] = SPR_TRAMWAY_OVERLAY + overlay_offsets[offset];
@@ -1355,7 +1355,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
/* Road underlay takes precedence over tram */
if (road_rti != nullptr) {
if (road_rti->UsesOverlay()) {
SpriteID ground = GetCustomRoadSprite(road_rti, ti->tile, ROTSG_TUNNEL);
SpriteID ground = GetCustomRoadSprite(road_rti, ti->tile, RoadSpriteType::Tunnel);
if (ground != 0) {
DrawGroundSprite(ground + tunnelbridge_direction, PAL_NONE);
draw_underlay = false;
@@ -1363,7 +1363,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
}
} else {
if (tram_rti->UsesOverlay()) {
SpriteID ground = GetCustomRoadSprite(tram_rti, ti->tile, ROTSG_TUNNEL);
SpriteID ground = GetCustomRoadSprite(tram_rti, ti->tile, RoadSpriteType::Tunnel);
if (ground != 0) {
DrawGroundSprite(ground + tunnelbridge_direction, PAL_NONE);
draw_underlay = false;
@@ -1376,14 +1376,14 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
/* Road catenary takes precedence over tram */
SpriteID catenary_sprite_base = 0;
if (road_rti != nullptr && HasRoadCatenaryDrawn(road_rt)) {
catenary_sprite_base = GetCustomRoadSprite(road_rti, ti->tile, ROTSG_CATENARY_FRONT);
catenary_sprite_base = GetCustomRoadSprite(road_rti, ti->tile, RoadSpriteType::CatenaryFront);
if (catenary_sprite_base == 0) {
catenary_sprite_base = SPR_TRAMWAY_TUNNEL_WIRES;
} else {
catenary_sprite_base += 19;
}
} else if (tram_rti != nullptr && HasRoadCatenaryDrawn(tram_rt)) {
catenary_sprite_base = GetCustomRoadSprite(tram_rti, ti->tile, ROTSG_CATENARY_FRONT);
catenary_sprite_base = GetCustomRoadSprite(tram_rti, ti->tile, RoadSpriteType::CatenaryFront);
if (catenary_sprite_base == 0) {
catenary_sprite_base = SPR_TRAMWAY_TUNNEL_WIRES;
} else {