Merge branch 'master' into jgrpp-nrt

Merge NRT feature

# Conflicts:
#	docs/landscape.html
#	docs/landscape_grid.html
#	src/bridge_map.h
#	src/build_vehicle_gui.cpp
#	src/company_base.h
#	src/company_cmd.cpp
#	src/misc_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_engine.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/npf/npf.cpp
#	src/road_cmd.cpp
#	src/road_func.h
#	src/road_gui.cpp
#	src/road_map.h
#	src/road_type.h
#	src/roadveh_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/company_sl.cpp
#	src/script/api/script_bridge.cpp
#	src/table/newgrf_debug_data.h
#	src/tile_cmd.h
#	src/town_cmd.cpp
#	src/tunnel_map.h
#	src/tunnelbridge_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2019-07-11 19:45:56 +01:00
177 changed files with 4839 additions and 1461 deletions

View File

@@ -16,36 +16,37 @@
extern uint32 _road_layout_change_counter;
typedef uint32 RoadTypeLabel;
static const RoadTypeLabel ROADTYPE_ROAD_LABEL = 'ROAD';
static const RoadTypeLabel ROADTYPE_TRAM_LABEL = 'TRAM';
/**
* The different roadtypes we support
*
* @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
*/
enum RoadType {
ROADTYPE_BEGIN = 0, ///< Used for iterations
ROADTYPE_ROAD = 0, ///< Basic road type
ROADTYPE_TRAM = 1, ///< Trams
ROADTYPE_END, ///< Used for iterations
INVALID_ROADTYPE = 0xFF, ///< flag for invalid roadtype
ROADTYPE_BEGIN = 0, ///< Used for iterations
ROADTYPE_ROAD = 0, ///< Basic road type
ROADTYPE_TRAM = 1, ///< Trams
ROADTYPE_END = 63, ///< Used for iterations
INVALID_ROADTYPE = 63, ///< flag for invalid roadtype
};
DECLARE_POSTFIX_INCREMENT(RoadType)
template <> struct EnumPropsT<RoadType> : MakeEnumPropsT<RoadType, byte, ROADTYPE_BEGIN, ROADTYPE_END, INVALID_ROADTYPE, 2> {};
template <> struct EnumPropsT<RoadType> : MakeEnumPropsT<RoadType, byte, ROADTYPE_BEGIN, ROADTYPE_END, INVALID_ROADTYPE, 6> {};
/**
* The different roadtypes we support, but then a bitmask of them
* @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
* The different roadtypes we support, but then a bitmask of them.
* @note Must be treated as a uint64 type, narrowing it causes bit membership tests to give wrong results.
*/
enum RoadTypes : byte {
enum RoadTypes : uint64 {
ROADTYPES_NONE = 0, ///< No roadtypes
ROADTYPES_ROAD = 1 << ROADTYPE_ROAD, ///< Road
ROADTYPES_TRAM = 1 << ROADTYPE_TRAM, ///< Trams
ROADTYPES_ALL = ROADTYPES_ROAD | ROADTYPES_TRAM, ///< Road + trams
ROADTYPES_END, ///< Used for iterations?
INVALID_ROADTYPES = 0xFF, ///< Invalid roadtypes
INVALID_ROADTYPES = UINT64_MAX, ///< Invalid roadtypes
};
DECLARE_ENUM_AS_BIT_SET(RoadTypes)
template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES, 2> {};
/**
* Enumeration for the road parts on a tile.