diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/elrail.cpp | 38 | ||||
-rw-r--r-- | src/elrail_func.h | 12 | ||||
-rw-r--r-- | src/newgrf.cpp | 2 | ||||
-rw-r--r-- | src/rail_cmd.cpp | 4 | ||||
-rw-r--r-- | src/road_cmd.cpp | 8 | ||||
-rw-r--r-- | src/road_internal.h | 2 | ||||
-rw-r--r-- | src/station_cmd.cpp | 4 | ||||
-rw-r--r-- | src/table/elrail_data.h | 10 | ||||
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 16 |
9 files changed, 48 insertions, 48 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp index 1927be03e..ac3616161 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -89,7 +89,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) { 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 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) 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 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) 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 @@ static TrackBits MaskWireBits(TileIndex t, TrackBits tracks) * 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 @@ static int GetPCPElevation(TileIndex tile, DiagDirection PCPpos) * * @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 @@ void DrawCatenaryOnTunnel(const TileInfo *ti) 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 @@ void DrawCatenaryOnTunnel(const TileInfo *ti) * 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 @@ static void DrawCatenaryRailway(const TileInfo *ti) 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 @@ static void DrawCatenaryRailway(const TileInfo *ti) } } - /* 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 @@ static void DrawCatenaryRailway(const TileInfo *ti) 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 @@ static void DrawCatenaryRailway(const TileInfo *ti) * * @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 @@ void DrawCatenaryOnBridge(const TileInfo *ti) 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 @@ void DrawCatenaryOnBridge(const TileInfo *ti) /** * 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 @@ void DrawCatenary(const TileInfo *ti) default: return; } - DrawCatenaryRailway(ti); + DrawRailCatenaryRailway(ti); } bool SettingsDisableElrail(int32 p1) diff --git a/src/elrail_func.h b/src/elrail_func.h index 60cb782bb..5cdae20c5 100644 --- a/src/elrail_func.h +++ b/src/elrail_func.h @@ -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 @@ static inline bool HasCatenary(RailType rt) * 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 diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 6624e2bfd..3f4a8db6f 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5584,7 +5584,7 @@ static const Action5Type _action5_types[] = { /* 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" }, diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 2010f9b30..eda02481c 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2394,7 +2394,7 @@ static void DrawTile_Track(TileInfo *ti) 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 @@ static void DrawTile_Track(TileInfo *ti) 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); } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index aa445eb91..ddd8bd0e9 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1191,7 +1191,7 @@ static bool DrawRoadAsSnowDesert(TileIndex tile, Roadside roadside) * @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 @@ static void DrawRoadBits(TileInfo *ti) 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 @@ static void DrawTile_Road(TileInfo *ti) 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; } diff --git a/src/road_internal.h b/src/road_internal.h index c8cae8422..8da909e94 100644 --- a/src/road_internal.h +++ b/src/road_internal.h @@ -19,6 +19,6 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb); 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 */ diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index eb90c29ab..5883afc08 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2897,12 +2897,12 @@ draw_default_foundation: } } - 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)) { diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h index 156f0e941..102ad4264 100644 --- a/src/table/elrail_data.h +++ b/src/table/elrail_data.h @@ -331,7 +331,7 @@ static const uint ELRAIL_ELEVATION = 10; /** 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,14 +392,14 @@ static const SortableSpriteStruct CatenarySpriteData[] = { { 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 { 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 @@ static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = { * <li>Position of the Pylon relative to the track</li> * <li>Position of the Pylon inside the tile</li></ol> */ -enum CatenarySprite { +enum RailCatenarySprite { WIRE_X_FLAT_SW, WIRE_X_FLAT_NE, WIRE_X_FLAT_BOTH, @@ -471,7 +471,7 @@ enum CatenarySprite { * c) the second * d) both * PCP exists.*/ -static const CatenarySprite Wires[5][TRACK_END][4] = { +static const RailCatenarySprite Wires[5][TRACK_END][4] = { { // Tileh == 0 {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH}, {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH}, diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 5f2534b58..677cf9975 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1216,14 +1216,14 @@ static void DrawTile_TunnelBridge(TileInfo *ti) } } - if (HasCatenaryDrawn(GetRailType(ti->tile))) { + if (HasRailCatenaryDrawn(GetRailType(ti->tile))) { /* Maybe draw pylons on the entry side */ - DrawCatenary(ti); + DrawRailCatenary(ti); catenary = true; StartSpriteCombine(); /* Draw wire above the ramp */ - DrawCatenaryOnTunnel(ti); + DrawRailCatenaryOnTunnel(ti); } } @@ -1341,8 +1341,8 @@ static void DrawTile_TunnelBridge(TileInfo *ti) } EndSpriteCombine(); - if (HasCatenaryDrawn(GetRailType(ti->tile))) { - DrawCatenary(ti); + if (HasRailCatenaryDrawn(GetRailType(ti->tile))) { + DrawRailCatenary(ti); } } @@ -1392,7 +1392,7 @@ void DrawBridgeMiddle(const TileInfo *ti) { /* Sectional view of bridge bounding boxes: * - * 1 2 1,2 = SpriteCombine of Bridge front/(back&floor) and TramCatenary + * 1 2 1,2 = SpriteCombine of Bridge front/(back&floor) and RoadCatenary * 1 2 3 = empty helper BB * 1 7 2 4,5 = pillars under higher bridges * 1 6 88888 6 2 6 = elrail-pylons @@ -1491,8 +1491,8 @@ void DrawBridgeMiddle(const TileInfo *ti) EndSpriteCombine(); - if (HasCatenaryDrawn(GetRailType(rampsouth))) { - DrawCatenaryOnBridge(ti); + if (HasRailCatenaryDrawn(GetRailType(rampsouth))) { + DrawRailCatenaryOnBridge(ti); } } |