Loading

Paste #ptspgfzdz

  1. diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
  2. index 2c6d380..c7da9e6 100644
  3. --- a/src/road_cmd.cpp
  4. +++ b/src/road_cmd.cpp
  5. @@ -93,9 +93,9 @@ void ResolveRoadTypeGUISprites(RoadtypeInfo *rti)
  6.   * @param second The roadtype to compare.
  7.   * @return True iff the first should be sorted before the second.
  8.   */
  9. -static int CDECL CompareRoadTypes(const uint32 first, const uint32 second)
  10. +static int CDECL CompareRoadTypes(const RoadTypeIdentifier *first, const RoadTypeIdentifier *second)
  11.  {
  12. -   return GetRoadTypeInfo(first)->sorting_order - GetRoadTypeInfo(second)->sorting_order;
  13. +   return GetRoadTypeInfo(*first)->sorting_order - GetRoadTypeInfo(*second)->sorting_order;
  14.  }
  15.  
  16.  /**
  17. @@ -116,7 +116,7 @@ void InitRoadTypes()
  18.                 _sorted_roadtypes[rt][_sorted_roadtypes_size[rt]++] = RoadTypeIdentifier(rt, rst);
  19.             }
  20.         }
  21. -       //QSortT(_sorted_roadtypes[rt], _sorted_roadtypes_size[rt], CompareRoadTypes);
  22. +       QSortT(_sorted_roadtypes[rt], _sorted_roadtypes_size[rt], CompareRoadTypes);
  23.     }
  24.  }
  25.  
  26. diff --git a/src/road_map.h b/src/road_map.h
  27. index 247cbb1..73f817d 100644
  28. --- a/src/road_map.h
  29. +++ b/src/road_map.h
  30. @@ -657,7 +657,8 @@ struct RoadTypeIdentifiers {
  31.         assert(IsTileType(t, MP_ROAD) || IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE));
  32.         TileType tt = GetTileType(t);
  33.  
  34. -       switch (tt) {
  35. +       switch (tt) {
  36. +           default: NOT_REACHED();
  37.             case MP_ROAD:
  38.                 if (GetRoadBits(t, ROADTYPE_ROAD) != ROAD_NONE) {
  39.                     road_identifier = GetRoadTypeRoad(t);
  40. @@ -787,7 +788,7 @@ struct RoadTypeIdentifiers {
  41.   * @param rtid The road type identifier to add
  42.   * @return The combined road types
  43.   */
  44. -static RoadTypeIdentifiers CombineTileRoadTypeIds(TileIndex tile, RoadTypeIdentifier rtid)
  45. +static inline RoadTypeIdentifiers CombineTileRoadTypeIds(TileIndex tile, RoadTypeIdentifier rtid)
  46.  {
  47.     /* Extract road types from tile, like "GetRoadTypes(tile)" */
  48.     RoadTypeIdentifiers tile_roadtype_ids = RoadTypeIdentifiers(tile);
  49. diff --git a/src/table/roadtypes.h b/src/table/roadtypes.h
  50. index f410f34..56e56ca 100644
  51. --- a/src/table/roadtypes.h
  52. +++ b/src/table/roadtypes.h
  53. @@ -136,9 +136,9 @@ static const RoadtypeInfo _original_tramtypes[] = {
  54.                 0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536
  55.             },
  56.             SPR_TRAMWAY_SLOPED_OFFSET,
  57. -           NULL,
  58. -           NULL,
  59. -           NULL
  60. +           0,
  61. +           0,
  62. +           0
  63.         },
  64.  
  65.         /* GUI sprites */
  66.  

Comments