Index: src/elrail.cpp =================================================================== --- src/elrail.cpp (revision 27675) +++ src/elrail.cpp (working copy) @@ -89,7 +89,7 @@ { switch (GetTileType(t)) { case MP_RAILWAY: - if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE; + if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE; switch (GetRailTileType(t)) { case RAIL_TILE_NORMAL: case RAIL_TILE_SIGNALS: return GetTrackBits(t); @@ -99,7 +99,7 @@ break; case MP_TUNNELBRIDGE: - if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE; + if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE; if (override != NULL && (IsTunnel(t) || GetTunnelBridgeLength(t, GetOtherBridgeEnd(t)) > 0)) { *override = 1 << GetTunnelBridgeDirection(t); } @@ -107,12 +107,12 @@ case MP_ROAD: if (!IsLevelCrossing(t)) return TRACK_BIT_NONE; - if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE; + if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE; return GetCrossingRailBits(t); case MP_STATION: if (!HasStationRail(t)) return TRACK_BIT_NONE; - if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE; + if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE; return TrackToTrackBits(GetRailStationTrack(t)); default: @@ -135,7 +135,7 @@ * axis that still display wires to preserve visual continuity. */ TileIndex next_tile = TileAddByDiagDir(t, d); RailType rt = GetTileRailType(next_tile); - if (rt == INVALID_RAILTYPE || !HasCatenary(rt) || + if (rt == INVALID_RAILTYPE || !HasRailCatenary(rt) || ((TrackStatusToTrackBits(GetTileTrackStatus(next_tile, TRANSPORT_RAIL, 0)) & DiagdirReachesTracks(d)) == TRACK_BIT_NONE && (!HasStationTileRail(next_tile) || GetRailStationAxis(next_tile) != DiagDirToAxis(d) || !CanStationTileHaveWires(next_tile)))) { neighbour_tdb |= DiagdirReachesTrackdirs(ReverseDiagDir(d)); @@ -241,7 +241,7 @@ * * @param ti The Tileinfo to draw the tile for */ -void DrawCatenaryOnTunnel(const TileInfo *ti) +void DrawRailCatenaryOnTunnel(const TileInfo *ti) { /* xmin, ymin, xmax + 1, ymax + 1 of BB */ static const int _tunnel_wire_BB[4][4] = { @@ -255,7 +255,7 @@ SpriteID wire_base = GetWireBase(ti->tile); - const SortableSpriteStruct *sss = &CatenarySpriteData_Tunnel[dir]; + const SortableSpriteStruct *sss = &RailCatenarySpriteData_Tunnel[dir]; const int *BB_data = _tunnel_wire_BB[dir]; AddSortableSpriteToDraw( wire_base + sss->image_offset, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, @@ -270,7 +270,7 @@ * Draws wires and, if required, pylons on a given tile * @param ti The Tileinfo to draw the tile for */ -static void DrawCatenaryRailway(const TileInfo *ti) +static void DrawRailCatenaryRailway(const TileInfo *ti) { /* Pylons are placed on a tile edge, so we need to take into account * the track configuration of 2 adjacent tiles. trackconfig[0] stores the @@ -379,7 +379,7 @@ if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT; /* Read the foundations if they are present, and adjust the tileh */ - if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]); + if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasRailCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]); if (IsBridgeTile(neighbour)) { foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour))); } @@ -442,7 +442,7 @@ } } - /* The wire above the tunnel is drawn together with the tunnel-roof (see DrawCatenaryOnTunnel()) */ + /* The wire above the tunnel is drawn together with the tunnel-roof (see DrawRailCatenaryOnTunnel()) */ if (IsTunnelTile(ti->tile)) return; /* Don't draw a wire under a low bridge */ @@ -478,7 +478,7 @@ assert(PCPconfig != 0); // We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) assert(!IsSteepSlope(tileh[TS_HOME])); - sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]]; + sss = &RailCatenarySpriteData[Wires[tileh_selector][t][PCPconfig]]; /* * The "wire"-sprite position is inside the tile, i.e. 0 <= sss->?_offset < TILE_SIZE. @@ -498,7 +498,7 @@ * * @param ti The Tileinfo to draw the tile for */ -void DrawCatenaryOnBridge(const TileInfo *ti) +void DrawRailCatenaryOnBridge(const TileInfo *ti) { TileIndex end = GetSouthernBridgeEnd(ti->tile); TileIndex start = GetOtherBridgeEnd(end); @@ -511,15 +511,15 @@ Axis axis = GetBridgeAxis(ti->tile); TLG tlg = GetTLG(ti->tile); - CatenarySprite offset = (CatenarySprite)(axis == AXIS_X ? 0 : WIRE_Y_FLAT_BOTH - WIRE_X_FLAT_BOTH); + RailCatenarySprite offset = (RailCatenarySprite)(axis == AXIS_X ? 0 : WIRE_Y_FLAT_BOTH - WIRE_X_FLAT_BOTH); if ((length % 2) && num == length) { /* Draw the "short" wire on the southern end of the bridge * only needed if the length of the bridge is odd */ - sss = &CatenarySpriteData[WIRE_X_FLAT_BOTH + offset]; + sss = &RailCatenarySpriteData[WIRE_X_FLAT_BOTH + offset]; } else { /* Draw "long" wires on all other tiles of the bridge (one pylon every two tiles) */ - sss = &CatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset]; + sss = &RailCatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset]; } height = GetBridgePixelHeight(end); @@ -558,14 +558,14 @@ /** * Draws overhead wires and pylons for electric railways. * @param ti The TileInfo struct of the tile being drawn - * @see DrawCatenaryRailway + * @see DrawRailCatenaryRailway */ -void DrawCatenary(const TileInfo *ti) +void DrawRailCatenary(const TileInfo *ti) { switch (GetTileType(ti->tile)) { case MP_RAILWAY: if (IsRailDepot(ti->tile)) { - const SortableSpriteStruct *sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)]; + const SortableSpriteStruct *sss = &RailCatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)]; SpriteID wire_base = GetWireBase(ti->tile); @@ -587,7 +587,7 @@ default: return; } - DrawCatenaryRailway(ti); + DrawRailCatenaryRailway(ti); } bool SettingsDisableElrail(int32 p1) Index: src/elrail_func.h =================================================================== --- src/elrail_func.h (revision 27675) +++ src/elrail_func.h (working copy) @@ -20,7 +20,7 @@ * Test if a rail type has catenary * @param rt Rail type to test */ -static inline bool HasCatenary(RailType rt) +static inline bool HasRailCatenary(RailType rt) { return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY); } @@ -29,14 +29,14 @@ * Test if we should draw rail catenary * @param rt Rail type to test */ -static inline bool HasCatenaryDrawn(RailType rt) +static inline bool HasRailCatenaryDrawn(RailType rt) { - return HasCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails; + return HasRailCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails; } -void DrawCatenary(const TileInfo *ti); -void DrawCatenaryOnTunnel(const TileInfo *ti); -void DrawCatenaryOnBridge(const TileInfo *ti); +void DrawRailCatenary(const TileInfo *ti); +void DrawRailCatenaryOnTunnel(const TileInfo *ti); +void DrawRailCatenaryOnBridge(const TileInfo *ti); bool SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback Index: src/newgrf.cpp =================================================================== --- src/newgrf.cpp (revision 27675) +++ src/newgrf.cpp (working copy) @@ -5584,7 +5584,7 @@ /* 0x02 */ { A5BLOCK_INVALID, 0, 0, 0, "Type 0x02" }, /* 0x03 */ { A5BLOCK_INVALID, 0, 0, 0, "Type 0x03" }, /* 0x04 */ { A5BLOCK_ALLOW_OFFSET, SPR_SIGNALS_BASE, 1, PRESIGNAL_SEMAPHORE_AND_PBS_SPRITE_COUNT, "Signal graphics" }, - /* 0x05 */ { A5BLOCK_ALLOW_OFFSET, SPR_ELRAIL_BASE, 1, ELRAIL_SPRITE_COUNT, "Catenary graphics" }, + /* 0x05 */ { A5BLOCK_ALLOW_OFFSET, SPR_ELRAIL_BASE, 1, ELRAIL_SPRITE_COUNT, "Rail catenary graphics" }, /* 0x06 */ { A5BLOCK_ALLOW_OFFSET, SPR_SLOPES_BASE, 1, NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT, "Foundation graphics" }, /* 0x07 */ { A5BLOCK_INVALID, 0, 75, 0, "TTDP GUI graphics" }, // Not used by OTTD. /* 0x08 */ { A5BLOCK_ALLOW_OFFSET, SPR_CANALS_BASE, 1, CANALS_SPRITE_COUNT, "Canal graphics" }, Index: src/rail_cmd.cpp =================================================================== --- src/rail_cmd.cpp (revision 27675) +++ src/rail_cmd.cpp (working copy) @@ -2394,7 +2394,7 @@ if (HasBit(_display_opt, DO_FULL_DETAIL)) DrawTrackDetails(ti, rti); - if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti); + if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti); if (HasSignals(ti->tile)) DrawSignals(ti->tile, rails, rti); } else { @@ -2469,7 +2469,7 @@ int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT); relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->GetRailtypeSpriteOffset(); - if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti); + if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti); DrawRailTileSeq(ti, dts, TO_BUILDINGS, relocation, 0, _drawtile_track_palette); } Index: src/road_cmd.cpp =================================================================== --- src/road_cmd.cpp (revision 27675) +++ src/road_cmd.cpp (working copy) @@ -1191,7 +1191,7 @@ * @param ti information about the tile (slopes, height etc) * @param tram the roadbits for the tram */ -void DrawTramCatenary(const TileInfo *ti, RoadBits tram) +void DrawRoadCatenary(const TileInfo *ti, RoadBits tram) { /* Do not draw catenary if it is invisible */ if (IsInvisibilitySet(TO_CATENARY)) return; @@ -1298,7 +1298,7 @@ return; } - if (tram != ROAD_NONE) DrawTramCatenary(ti, tram); + if (tram != ROAD_NONE) DrawRoadCatenary(ti, tram); /* 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; @@ -1388,9 +1388,9 @@ if (HasTileRoadType(ti->tile, ROADTYPE_TRAM)) { DrawGroundSprite(SPR_TRAMWAY_OVERLAY + (GetCrossingRoadAxis(ti->tile) ^ 1), pal); - DrawTramCatenary(ti, GetCrossingRoadBits(ti->tile)); + DrawRoadCatenary(ti, GetCrossingRoadBits(ti->tile)); } - if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti); + if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti); break; } Index: src/road_internal.h =================================================================== --- src/road_internal.h (revision 27675) +++ src/road_internal.h (working copy) @@ -19,6 +19,6 @@ CommandCost CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, RoadType rt, DoCommandFlag flags, bool town_check = true); -void DrawTramCatenary(const TileInfo *ti, RoadBits tram); +void DrawRoadCatenary(const TileInfo *ti, RoadBits tram); #endif /* ROAD_INTERNAL_H */ Index: src/station_cmd.cpp =================================================================== --- src/station_cmd.cpp (revision 27675) +++ src/station_cmd.cpp (working copy) @@ -2897,12 +2897,12 @@ } } - if (HasStationRail(ti->tile) && HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti); + if (HasStationRail(ti->tile) && HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti); if (HasBit(roadtypes, ROADTYPE_TRAM)) { Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y; DrawGroundSprite((HasBit(roadtypes, ROADTYPE_ROAD) ? SPR_TRAMWAY_OVERLAY : SPR_TRAMWAY_TRAM) + (axis ^ 1), PAL_NONE); - DrawTramCatenary(ti, axis == AXIS_X ? ROAD_X : ROAD_Y); + DrawRoadCatenary(ti, axis == AXIS_X ? ROAD_X : ROAD_Y); } if (IsRailWaypoint(ti->tile)) { Index: src/table/elrail_data.h =================================================================== --- src/table/elrail_data.h (revision 27675) +++ src/table/elrail_data.h (working copy) @@ -331,7 +331,7 @@ /** Wires that a draw one level higher than the north corner. */ static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT; -static const SortableSpriteStruct CatenarySpriteData[] = { +static const SortableSpriteStruct RailCatenarySpriteData[] = { /* X direction * Flat tiles: * Wires */ @@ -392,7 +392,7 @@ { WSO_EW_E, 15, 8, 3, 3, 1, ELRAIL_ELEVATION } //!33: LOWER trackbit wire, pylon on both ends }; -static const SortableSpriteStruct CatenarySpriteData_Depot[] = { +static const SortableSpriteStruct RailCatenarySpriteData_Depot[] = { { WSO_ENTRANCE_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION }, //! Wire for NE depot exit { WSO_ENTRANCE_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION }, //! Wire for SE depot exit { WSO_ENTRANCE_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION }, //! Wire for SW depot exit @@ -399,7 +399,7 @@ { WSO_ENTRANCE_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION } //! Wire for NW depot exit }; -static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = { +static const SortableSpriteStruct RailCatenarySpriteData_Tunnel[] = { { WSO_ENTRANCE_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION }, //! Wire for NE tunnel exit { WSO_ENTRANCE_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION }, //! Wire for SE tunnel exit { WSO_ENTRANCE_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION }, //! Wire for SW tunnel exit @@ -419,7 +419,7 @@ *