Changeset - r23669:a998a23bf906
[Not reviewed]
master
0 8 0
Charles Pigott - 6 years ago 2019-04-22 06:39:52
charlespigott@googlemail.com
Codechange: Remove RailTypeByte type
8 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1014,8 +1014,8 @@ void DisplayVehicleSortDropDown(Window *
 
struct BuildVehicleWindow : Window {
 
	VehicleType vehicle_type;                   ///< Type of vehicles shown in the window.
 
	union {
 
		RailTypeByte railtype;              ///< Rail type to show, or #RAILTYPE_END.
 
		RoadTypes roadtypes;                ///< Road type to show, or #ROADTYPES_ALL.
 
		RailType railtype;   ///< Rail type to show, or #RAILTYPE_END.
 
		RoadTypes roadtypes; ///< Road type to show, or #ROADTYPES_ALL.
 
	} filter;                                   ///< Filter to apply.
 
	bool descending_sort_order;                 ///< Sort direction, @see _engine_sort_direction
 
	byte sort_criteria;                         ///< Current sort criterium.
src/engine_type.h
Show inline comments
 
@@ -44,7 +44,7 @@ struct RailVehicleInfo {
 
	byte image_index;
 
	RailVehicleTypes railveh_type;
 
	byte cost_factor;               ///< Purchase cost factor;      For multiheaded engines the sum of both engine prices.
 
	RailTypeByte railtype;
 
	RailType railtype;
 
	uint16 max_speed;               ///< Maximum speed (1 unit = 1/1.6 mph = 1 km-ish/h)
 
	uint16 power;                   ///< Power of engine (hp);      For multiheaded engines the sum of both engine powers.
 
	uint16 weight;                  ///< Weight of vehicle (tons);  For multiheaded engines the weight of each single engine.
src/newgrf.h
Show inline comments
 
@@ -126,7 +126,7 @@ struct GRFFile : ZeroedMemoryAllocator {
 
	uint8 cargo_map[NUM_CARGO];                     ///< Inverse cargo translation table (CargoID -> local ID)
 

	
 
	std::vector<RailTypeLabel> railtype_list;       ///< Railtype translation table
 
	RailTypeByte railtype_map[RAILTYPE_END];
 
	RailType railtype_map[RAILTYPE_END];
 

	
 
	CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF
 

	
src/rail_type.h
Show inline comments
 
@@ -26,7 +26,7 @@ static const RailTypeLabel RAILTYPE_MAGL
 
 *
 
 * This enumeration defines all 4 possible railtypes.
 
 */
 
enum RailType {
 
enum RailType : byte {
 
	RAILTYPE_BEGIN    = 0,          ///< Used for iterations
 
	RAILTYPE_RAIL     = 0,          ///< Standard non-electric rails
 
	RAILTYPE_ELECTRIC = 1,          ///< Electric rails
 
@@ -44,7 +44,6 @@ enum RailType {
 
DECLARE_POSTFIX_INCREMENT(RailType)
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE, 6> {};
 
typedef TinyEnumT<RailType> RailTypeByte;
 

	
 
/**
 
 * The different railtypes we support, but then a bitmask of them.
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -1277,7 +1277,8 @@ bool LoadOldVehicle(LoadgameState *ls, i
 
					};
 
					if (v->spritenum / 2 >= lengthof(spriteset_rail)) return false;
 
					v->spritenum = spriteset_rail[v->spritenum / 2]; // adjust railway sprite set offset
 
					Train::From(v)->railtype = type == 0x25 ? 1 : 0; // monorail / rail
 
					/* Should be the original values for monorail / rail, can't use RailType constants */
 
					Train::From(v)->railtype = static_cast<RailType>(type == 0x25 ? 1 : 0);
 
					break;
 
				}
 

	
src/script/api/script_rail.cpp
Show inline comments
 
@@ -68,7 +68,7 @@
 

	
 
/* static */ bool ScriptRail::IsRailTypeAvailable(RailType rail_type)
 
{
 
	if ((::RailType)rail_type < RAILTYPE_BEGIN || (::RailType)rail_type >= RAILTYPE_END) return false;
 
	if ((::RailType)rail_type >= RAILTYPE_END) return false;
 

	
 
	return ScriptObject::GetCompany() == OWNER_DEITY || ::HasRailtypeAvail(ScriptObject::GetCompany(), (::RailType)rail_type);
 
}
src/table/engines.h
Show inline comments
 
@@ -388,7 +388,7 @@ static const EngineInfo _orig_engine_inf
 
 * Tractive effort coefficient by default is the same as TTDPatch, 0.30*256=76
 
 * Air drag value depends on the top speed of the vehicle.
 
 */
 
#define RVI(a, b, c, d, e, f, g, h, i, j, k) { a, b, c, {j}, d, e, f, g, h, k, i, 0, 0, 0, VE_DEFAULT, 0, 76, 0, 0 }
 
#define RVI(a, b, c, d, e, f, g, h, i, j, k) { a, b, c, j, d, e, f, g, h, k, i, 0, 0, 0, VE_DEFAULT, 0, 76, 0, 0 }
 
#define M RAILVEH_MULTIHEAD
 
#define W RAILVEH_WAGON
 
#define G RAILVEH_SINGLEHEAD
src/train.h
Show inline comments
 
@@ -95,7 +95,7 @@ struct Train FINAL : public GroundVehicl
 
	uint16 flags;
 
	TrackBitsByte track;
 
	TrainForceProceeding force_proceed;
 
	RailTypeByte railtype;
 
	RailType railtype;
 
	RailTypes compatible_railtypes;
 

	
 
	/** Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals. */
0 comments (0 inline, 0 general)