Loading

Paste #pvhc6l46d

  1. Index: src/elrail.cpp
  2. ===================================================================
  3. --- src/elrail.cpp  (revision 27675)
  4. +++ src/elrail.cpp  (working copy)
  5. @@ -89,7 +89,7 @@
  6.  {
  7.     switch (GetTileType(t)) {
  8.         case MP_RAILWAY:
  9. -           if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  10. +           if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  11.             switch (GetRailTileType(t)) {
  12.                 case RAIL_TILE_NORMAL: case RAIL_TILE_SIGNALS:
  13.                     return GetTrackBits(t);
  14. @@ -99,7 +99,7 @@
  15.             break;
  16.  
  17.         case MP_TUNNELBRIDGE:
  18. -           if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  19. +           if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  20.             if (override != NULL && (IsTunnel(t) || GetTunnelBridgeLength(t, GetOtherBridgeEnd(t)) > 0)) {
  21.                 *override = 1 << GetTunnelBridgeDirection(t);
  22.             }
  23. @@ -107,12 +107,12 @@
  24.  
  25.         case MP_ROAD:
  26.             if (!IsLevelCrossing(t)) return TRACK_BIT_NONE;
  27. -           if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  28. +           if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  29.             return GetCrossingRailBits(t);
  30.  
  31.         case MP_STATION:
  32.             if (!HasStationRail(t)) return TRACK_BIT_NONE;
  33. -           if (!HasCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  34. +           if (!HasRailCatenary(GetRailType(t))) return TRACK_BIT_NONE;
  35.             return TrackToTrackBits(GetRailStationTrack(t));
  36.  
  37.         default:
  38. @@ -135,7 +135,7 @@
  39.          * axis that still display wires to preserve visual continuity. */
  40.         TileIndex next_tile = TileAddByDiagDir(t, d);
  41.         RailType rt = GetTileRailType(next_tile);
  42. -       if (rt == INVALID_RAILTYPE || !HasCatenary(rt) ||
  43. +       if (rt == INVALID_RAILTYPE || !HasRailCatenary(rt) ||
  44.                 ((TrackStatusToTrackBits(GetTileTrackStatus(next_tile, TRANSPORT_RAIL, 0)) & DiagdirReachesTracks(d)) == TRACK_BIT_NONE &&
  45.                 (!HasStationTileRail(next_tile) || GetRailStationAxis(next_tile) != DiagDirToAxis(d) || !CanStationTileHaveWires(next_tile)))) {
  46.             neighbour_tdb |= DiagdirReachesTrackdirs(ReverseDiagDir(d));
  47. @@ -241,7 +241,7 @@
  48.   *
  49.   * @param ti The Tileinfo to draw the tile for
  50.   */
  51. -void DrawCatenaryOnTunnel(const TileInfo *ti)
  52. +void DrawRailCatenaryOnTunnel(const TileInfo *ti)
  53.  {
  54.     /* xmin, ymin, xmax + 1, ymax + 1 of BB */
  55.     static const int _tunnel_wire_BB[4][4] = {
  56. @@ -255,7 +255,7 @@
  57.  
  58.     SpriteID wire_base = GetWireBase(ti->tile);
  59.  
  60. -   const SortableSpriteStruct *sss = &CatenarySpriteData_Tunnel[dir];
  61. +   const SortableSpriteStruct *sss = &RailCatenarySpriteData_Tunnel[dir];
  62.     const int *BB_data = _tunnel_wire_BB[dir];
  63.     AddSortableSpriteToDraw(
  64.         wire_base + sss->image_offset, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
  65. @@ -270,7 +270,7 @@
  66.   * Draws wires and, if required, pylons on a given tile
  67.   * @param ti The Tileinfo to draw the tile for
  68.   */
  69. -static void DrawCatenaryRailway(const TileInfo *ti)
  70. +static void DrawRailCatenaryRailway(const TileInfo *ti)
  71.  {
  72.     /* Pylons are placed on a tile edge, so we need to take into account
  73.      * the track configuration of 2 adjacent tiles. trackconfig[0] stores the
  74. @@ -379,7 +379,7 @@
  75.         if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
  76.  
  77.         /* Read the foundations if they are present, and adjust the tileh */
  78. -       if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
  79. +       if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasRailCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
  80.         if (IsBridgeTile(neighbour)) {
  81.             foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
  82.         }
  83. @@ -442,7 +442,7 @@
  84.         }
  85.     }
  86.  
  87. -   /* The wire above the tunnel is drawn together with the tunnel-roof (see DrawCatenaryOnTunnel()) */
  88. +   /* The wire above the tunnel is drawn together with the tunnel-roof (see DrawRailCatenaryOnTunnel()) */
  89.     if (IsTunnelTile(ti->tile)) return;
  90.  
  91.     /* Don't draw a wire under a low bridge */
  92. @@ -478,7 +478,7 @@
  93.  
  94.         assert(PCPconfig != 0); // We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that)
  95.         assert(!IsSteepSlope(tileh[TS_HOME]));
  96. -       sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
  97. +       sss = &RailCatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
  98.  
  99.         /*
  100.          * The "wire"-sprite position is inside the tile, i.e. 0 <= sss->?_offset < TILE_SIZE.
  101. @@ -498,7 +498,7 @@
  102.   *
  103.   * @param ti The Tileinfo to draw the tile for
  104.   */
  105. -void DrawCatenaryOnBridge(const TileInfo *ti)
  106. +void DrawRailCatenaryOnBridge(const TileInfo *ti)
  107.  {
  108.     TileIndex end = GetSouthernBridgeEnd(ti->tile);
  109.     TileIndex start = GetOtherBridgeEnd(end);
  110. @@ -511,15 +511,15 @@
  111.     Axis axis = GetBridgeAxis(ti->tile);
  112.     TLG tlg = GetTLG(ti->tile);
  113.  
  114. -   CatenarySprite offset = (CatenarySprite)(axis == AXIS_X ? 0 : WIRE_Y_FLAT_BOTH - WIRE_X_FLAT_BOTH);
  115. +   RailCatenarySprite offset = (RailCatenarySprite)(axis == AXIS_X ? 0 : WIRE_Y_FLAT_BOTH - WIRE_X_FLAT_BOTH);
  116.  
  117.     if ((length % 2) && num == length) {
  118.         /* Draw the "short" wire on the southern end of the bridge
  119.          * only needed if the length of the bridge is odd */
  120. -       sss = &CatenarySpriteData[WIRE_X_FLAT_BOTH + offset];
  121. +       sss = &RailCatenarySpriteData[WIRE_X_FLAT_BOTH + offset];
  122.     } else {
  123.         /* Draw "long" wires on all other tiles of the bridge (one pylon every two tiles) */
  124. -       sss = &CatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset];
  125. +       sss = &RailCatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset];
  126.     }
  127.  
  128.     height = GetBridgePixelHeight(end);
  129. @@ -558,14 +558,14 @@
  130.  /**
  131.   * Draws overhead wires and pylons for electric railways.
  132.   * @param ti The TileInfo struct of the tile being drawn
  133. - * @see DrawCatenaryRailway
  134. + * @see DrawRailCatenaryRailway
  135.   */
  136. -void DrawCatenary(const TileInfo *ti)
  137. +void DrawRailCatenary(const TileInfo *ti)
  138.  {
  139.     switch (GetTileType(ti->tile)) {
  140.         case MP_RAILWAY:
  141.             if (IsRailDepot(ti->tile)) {
  142. -               const SortableSpriteStruct *sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
  143. +               const SortableSpriteStruct *sss = &RailCatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
  144.  
  145.                 SpriteID wire_base = GetWireBase(ti->tile);
  146.  
  147. @@ -587,7 +587,7 @@
  148.  
  149.         default: return;
  150.     }
  151. -   DrawCatenaryRailway(ti);
  152. +   DrawRailCatenaryRailway(ti);
  153.  }
  154.  
  155.  bool SettingsDisableElrail(int32 p1)
  156. Index: src/elrail_func.h
  157. ===================================================================
  158. --- src/elrail_func.h   (revision 27675)
  159. +++ src/elrail_func.h   (working copy)
  160. @@ -20,7 +20,7 @@
  161.   * Test if a rail type has catenary
  162.   * @param rt Rail type to test
  163.   */
  164. -static inline bool HasCatenary(RailType rt)
  165. +static inline bool HasRailCatenary(RailType rt)
  166.  {
  167.     return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
  168.  }
  169. @@ -29,14 +29,14 @@
  170.   * Test if we should draw rail catenary
  171.   * @param rt Rail type to test
  172.   */
  173. -static inline bool HasCatenaryDrawn(RailType rt)
  174. +static inline bool HasRailCatenaryDrawn(RailType rt)
  175.  {
  176. -   return HasCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
  177. +   return HasRailCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
  178.  }
  179.  
  180. -void DrawCatenary(const TileInfo *ti);
  181. -void DrawCatenaryOnTunnel(const TileInfo *ti);
  182. -void DrawCatenaryOnBridge(const TileInfo *ti);
  183. +void DrawRailCatenary(const TileInfo *ti);
  184. +void DrawRailCatenaryOnTunnel(const TileInfo *ti);
  185. +void DrawRailCatenaryOnBridge(const TileInfo *ti);
  186.  
  187.  bool SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback
  188.  
  189. Index: src/newgrf.cpp
  190. ===================================================================
  191. --- src/newgrf.cpp  (revision 27675)
  192. +++ src/newgrf.cpp  (working copy)
  193. @@ -5584,7 +5584,7 @@
  194.     /* 0x02 */ { A5BLOCK_INVALID,      0,                            0, 0,                                           "Type 0x02"                },
  195.     /* 0x03 */ { A5BLOCK_INVALID,      0,                            0, 0,                                           "Type 0x03"                },
  196.     /* 0x04 */ { A5BLOCK_ALLOW_OFFSET, SPR_SIGNALS_BASE,             1, PRESIGNAL_SEMAPHORE_AND_PBS_SPRITE_COUNT,    "Signal graphics"          },
  197. -   /* 0x05 */ { A5BLOCK_ALLOW_OFFSET, SPR_ELRAIL_BASE,              1, ELRAIL_SPRITE_COUNT,                         "Catenary graphics"        },
  198. +   /* 0x05 */ { A5BLOCK_ALLOW_OFFSET, SPR_ELRAIL_BASE,              1, ELRAIL_SPRITE_COUNT,                         "Rail catenary graphics"   },
  199.     /* 0x06 */ { A5BLOCK_ALLOW_OFFSET, SPR_SLOPES_BASE,              1, NORMAL_AND_HALFTILE_FOUNDATION_SPRITE_COUNT, "Foundation graphics"      },
  200.     /* 0x07 */ { A5BLOCK_INVALID,      0,                           75, 0,                                           "TTDP GUI graphics"        }, // Not used by OTTD.
  201.     /* 0x08 */ { A5BLOCK_ALLOW_OFFSET, SPR_CANALS_BASE,              1, CANALS_SPRITE_COUNT,                         "Canal graphics"           },
  202. Index: src/rail_cmd.cpp
  203. ===================================================================
  204. --- src/rail_cmd.cpp    (revision 27675)
  205. +++ src/rail_cmd.cpp    (working copy)
  206. @@ -2394,7 +2394,7 @@
  207.  
  208.         if (HasBit(_display_opt, DO_FULL_DETAIL)) DrawTrackDetails(ti, rti);
  209.  
  210. -       if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
  211. +       if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti);
  212.  
  213.         if (HasSignals(ti->tile)) DrawSignals(ti->tile, rails, rti);
  214.     } else {
  215. @@ -2469,7 +2469,7 @@
  216.         int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT);
  217.         relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->GetRailtypeSpriteOffset();
  218.  
  219. -       if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
  220. +       if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti);
  221.  
  222.         DrawRailTileSeq(ti, dts, TO_BUILDINGS, relocation, 0, _drawtile_track_palette);
  223.     }
  224. Index: src/road_cmd.cpp
  225. ===================================================================
  226. --- src/road_cmd.cpp    (revision 27675)
  227. +++ src/road_cmd.cpp    (working copy)
  228. @@ -1191,7 +1191,7 @@
  229.   * @param ti   information about the tile (slopes, height etc)
  230.   * @param tram the roadbits for the tram
  231.   */
  232. -void DrawTramCatenary(const TileInfo *ti, RoadBits tram)
  233. +void DrawRoadCatenary(const TileInfo *ti, RoadBits tram)
  234.  {
  235.     /* Do not draw catenary if it is invisible */
  236.     if (IsInvisibilitySet(TO_CATENARY)) return;
  237. @@ -1298,7 +1298,7 @@
  238.         return;
  239.     }
  240.  
  241. -   if (tram != ROAD_NONE) DrawTramCatenary(ti, tram);
  242. +   if (tram != ROAD_NONE) DrawRoadCatenary(ti, tram);
  243.  
  244.     /* Return if full detail is disabled, or we are zoomed fully out. */
  245.     if (!HasBit(_display_opt, DO_FULL_DETAIL) || _cur_dpi->zoom > ZOOM_LVL_DETAIL) return;
  246. @@ -1388,9 +1388,9 @@
  247.  
  248.             if (HasTileRoadType(ti->tile, ROADTYPE_TRAM)) {
  249.                 DrawGroundSprite(SPR_TRAMWAY_OVERLAY + (GetCrossingRoadAxis(ti->tile) ^ 1), pal);
  250. -               DrawTramCatenary(ti, GetCrossingRoadBits(ti->tile));
  251. +               DrawRoadCatenary(ti, GetCrossingRoadBits(ti->tile));
  252.             }
  253. -           if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
  254. +           if (HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti);
  255.             break;
  256.         }
  257.  
  258. Index: src/road_internal.h
  259. ===================================================================
  260. --- src/road_internal.h (revision 27675)
  261. +++ src/road_internal.h (working copy)
  262. @@ -19,6 +19,6 @@
  263.  
  264.  CommandCost CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, RoadType rt, DoCommandFlag flags, bool town_check = true);
  265.  
  266. -void DrawTramCatenary(const TileInfo *ti, RoadBits tram);
  267. +void DrawRoadCatenary(const TileInfo *ti, RoadBits tram);
  268.  
  269.  #endif /* ROAD_INTERNAL_H */
  270. Index: src/station_cmd.cpp
  271. ===================================================================
  272. --- src/station_cmd.cpp (revision 27675)
  273. +++ src/station_cmd.cpp (working copy)
  274. @@ -2897,12 +2897,12 @@
  275.         }
  276.     }
  277.  
  278. -   if (HasStationRail(ti->tile) && HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
  279. +   if (HasStationRail(ti->tile) && HasRailCatenaryDrawn(GetRailType(ti->tile))) DrawRailCatenary(ti);
  280.  
  281.     if (HasBit(roadtypes, ROADTYPE_TRAM)) {
  282.         Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y;
  283.         DrawGroundSprite((HasBit(roadtypes, ROADTYPE_ROAD) ? SPR_TRAMWAY_OVERLAY : SPR_TRAMWAY_TRAM) + (axis ^ 1), PAL_NONE);
  284. -       DrawTramCatenary(ti, axis == AXIS_X ? ROAD_X : ROAD_Y);
  285. +       DrawRoadCatenary(ti, axis == AXIS_X ? ROAD_X : ROAD_Y);
  286.     }
  287.  
  288.     if (IsRailWaypoint(ti->tile)) {
  289. Index: src/table/elrail_data.h
  290. ===================================================================
  291. --- src/table/elrail_data.h (revision 27675)
  292. +++ src/table/elrail_data.h (working copy)
  293. @@ -331,7 +331,7 @@
  294.  /** Wires that a draw one level higher than the north corner. */
  295.  static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT;
  296.  
  297. -static const SortableSpriteStruct CatenarySpriteData[] = {
  298. +static const SortableSpriteStruct RailCatenarySpriteData[] = {
  299.  /* X direction
  300.      * Flat tiles:
  301.          * Wires */
  302. @@ -392,7 +392,7 @@
  303.     { WSO_EW_E,         15,  8,  3,  3,  1, ELRAIL_ELEVATION }  //!33: LOWER trackbit wire, pylon on both ends
  304.  };
  305.  
  306. -static const SortableSpriteStruct CatenarySpriteData_Depot[] = {
  307. +static const SortableSpriteStruct RailCatenarySpriteData_Depot[] = {
  308.     { WSO_ENTRANCE_NE,   0,  7, 15,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE depot exit
  309.     { WSO_ENTRANCE_SE,   7,  0,  1, 15,  1, ELRAIL_ELEVATION }, //! Wire for SE depot exit
  310.     { WSO_ENTRANCE_SW,   0,  7, 15,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW depot exit
  311. @@ -399,7 +399,7 @@
  312.     { WSO_ENTRANCE_NW,   7,  0,  1, 15,  1, ELRAIL_ELEVATION }  //! Wire for NW depot exit
  313.  };
  314.  
  315. -static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = {
  316. +static const SortableSpriteStruct RailCatenarySpriteData_Tunnel[] = {
  317.     { WSO_ENTRANCE_NE,   0,  7, 15,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE tunnel exit
  318.     { WSO_ENTRANCE_SE,   7,  0,  1, 15,  1, ELRAIL_ELEVATION }, //! Wire for SE tunnel exit
  319.     { WSO_ENTRANCE_SW,   0,  7, 15,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW tunnel exit
  320. @@ -419,7 +419,7 @@
  321.   * <li>Position of the Pylon relative to the track</li>
  322.   * <li>Position of the Pylon inside the tile</li></ol>
  323.   */
  324. -enum CatenarySprite {
  325. +enum RailCatenarySprite {
  326.     WIRE_X_FLAT_SW,
  327.     WIRE_X_FLAT_NE,
  328.     WIRE_X_FLAT_BOTH,
  329. @@ -471,7 +471,7 @@
  330.   * c) the second
  331.   * d) both
  332.   * PCP exists.*/
  333. -static const CatenarySprite Wires[5][TRACK_END][4] = {
  334. +static const RailCatenarySprite Wires[5][TRACK_END][4] = {
  335.     { // Tileh == 0
  336.         {INVALID_CATENARY, WIRE_X_FLAT_NE,   WIRE_X_FLAT_SW,   WIRE_X_FLAT_BOTH},
  337.         {INVALID_CATENARY, WIRE_Y_FLAT_SE,   WIRE_Y_FLAT_NW,   WIRE_Y_FLAT_BOTH},
  338. Index: src/tunnelbridge_cmd.cpp
  339. ===================================================================
  340. --- src/tunnelbridge_cmd.cpp    (revision 27675)
  341. +++ src/tunnelbridge_cmd.cpp    (working copy)
  342. @@ -1216,14 +1216,14 @@
  343.                 }
  344.             }
  345.  
  346. -           if (HasCatenaryDrawn(GetRailType(ti->tile))) {
  347. +           if (HasRailCatenaryDrawn(GetRailType(ti->tile))) {
  348.                 /* Maybe draw pylons on the entry side */
  349. -               DrawCatenary(ti);
  350. +               DrawRailCatenary(ti);
  351.  
  352.                 catenary = true;
  353.                 StartSpriteCombine();
  354.                 /* Draw wire above the ramp */
  355. -               DrawCatenaryOnTunnel(ti);
  356. +               DrawRailCatenaryOnTunnel(ti);
  357.             }
  358.         }
  359.  
  360. @@ -1341,8 +1341,8 @@
  361.             }
  362.  
  363.             EndSpriteCombine();
  364. -           if (HasCatenaryDrawn(GetRailType(ti->tile))) {
  365. -               DrawCatenary(ti);
  366. +           if (HasRailCatenaryDrawn(GetRailType(ti->tile))) {
  367. +               DrawRailCatenary(ti);
  368.             }
  369.         }
  370.  
  371. @@ -1392,7 +1392,7 @@
  372.  {
  373.     /* Sectional view of bridge bounding boxes:
  374.      *
  375. -    *  1           2                                1,2 = SpriteCombine of Bridge front/(back&floor) and TramCatenary
  376. +    *  1           2                                1,2 = SpriteCombine of Bridge front/(back&floor) and RoadCatenary
  377.      *  1           2                                  3 = empty helper BB
  378.      *  1     7     2                                4,5 = pillars under higher bridges
  379.      *  1 6 88888 6 2                                  6 = elrail-pylons
  380. @@ -1491,8 +1491,8 @@
  381.  
  382.         EndSpriteCombine();
  383.  
  384. -       if (HasCatenaryDrawn(GetRailType(rampsouth))) {
  385. -           DrawCatenaryOnBridge(ti);
  386. +       if (HasRailCatenaryDrawn(GetRailType(rampsouth))) {
  387. +           DrawRailCatenaryOnBridge(ti);
  388.         }
  389.     }
  390.  
  391.  

Comments