Changeset - r12016:12cc374b77e8
[Not reviewed]
master
0 7 0
rubidium - 15 years ago 2009-05-26 11:19:04
rubidium@openttd.org
(svn r16428) -Codechange: use the less bloated SimpleTinyEnumT instead of TinyEnumT if the stuff provided by TinyEnumT but not SimpleTinyEnumT is not used.
7 files changed with 12 insertions and 31 deletions:
0 comments (0 inline, 0 general)
src/newgrf_station.h
Show inline comments
 
@@ -21,10 +21,7 @@ enum StationClassID {
 
	STAT_CLASS_WAYP,         ///< Waypoint class.
 
	STAT_CLASS_MAX = 32,     ///< Maximum number of classes.
 
};
 

	
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
 
typedef TinyEnumT<StationClassID> StationClassIDByte;
 
typedef SimpleTinyEnumT<StationClassID, byte> StationClassIDByte;
 

	
 
/** Allow incrementing of StationClassID variables */
 
DECLARE_POSTFIX_INCREMENT(StationClassID);
src/order_type.h
Show inline comments
 
@@ -34,10 +34,8 @@ enum OrderType {
 
	OT_END
 
};
 

	
 
/* It needs to be 8bits, because we save and load it as such */
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {};
 
typedef TinyEnumT<OrderType> OrderTypeByte;
 
/** It needs to be 8bits, because we save and load it as such */
 
typedef SimpleTinyEnumT<OrderType, byte> OrderTypeByte;
 

	
 

	
 
/**
src/road_type.h
Show inline comments
 
@@ -34,8 +34,7 @@ enum RoadTypes {
 
	INVALID_ROADTYPES  = 0xFF                              ///< Invalid roadtypes
 
};
 
DECLARE_ENUM_AS_BIT_SET(RoadTypes);
 
template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES> {};
 
typedef TinyEnumT<RoadTypes> RoadTypesByte;
 
typedef SimpleTinyEnumT<RoadTypes, byte> RoadTypesByte;
 

	
 

	
 
/**
src/settings_internal.h
Show inline comments
 
@@ -24,9 +24,7 @@ enum SettingDescTypeLong {
 
	SDT_END,
 
	/* 10 more possible primitives */
 
};
 

	
 
template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
 
typedef TinyEnumT<SettingDescTypeLong> SettingDescType;
 
typedef SimpleTinyEnumT<SettingDescTypeLong, byte> SettingDescType;
 

	
 

	
 
enum SettingGuiFlagLong {
 
@@ -42,10 +40,8 @@ enum SettingGuiFlagLong {
 
	SGF_NEWGAME_ONLY = 1 << 6, ///< this setting cannot be changed in inside a game
 
	SGF_END          = 1 << 7,
 
};
 

	
 
DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong);
 
template <> struct EnumPropsT<SettingGuiFlagLong> : MakeEnumPropsT<SettingGuiFlagLong, byte, SGF_NONE, SGF_END, SGF_END> {};
 
typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
 
typedef SimpleTinyEnumT<SettingGuiFlagLong, byte> SettingGuiFlag;
 

	
 

	
 
typedef bool OnChange(int32 var);           ///< callback prototype on data modification
src/town_type.h
Show inline comments
 
@@ -85,10 +85,8 @@ enum TownLayout {
 
	NUM_TLS,             ///< Number of town layouts
 
};
 

	
 
/** It needs to be 8bits, because we save and load it as such
 
 * Define basic enum properties */
 
template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_BEGIN, NUM_TLS, NUM_TLS> {};
 
typedef TinyEnumT<TownLayout> TownLayoutByte; // typedefing-enumification of TownLayout
 
/** It needs to be 8bits, because we save and load it as such */
 
typedef SimpleTinyEnumT<TownLayout, byte> TownLayoutByte; // typedefing-enumification of TownLayout
 

	
 
enum {
 
	MAX_LENGTH_TOWN_NAME_BYTES  =  31, ///< The maximum length of a town name in bytes including '\0'
src/track_type.h
Show inline comments
 
@@ -52,12 +52,8 @@ enum TrackBits {
 
	TRACK_BIT_DEPOT   = 0x80U,                                              ///< Bitflag for a depot
 
	INVALID_TRACK_BIT = 0xFF                                                ///< Flag for an invalid trackbits value
 
};
 

	
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
 
typedef TinyEnumT<TrackBits> TrackBitsByte;
 

	
 
DECLARE_ENUM_AS_BIT_SET(TrackBits);
 
typedef SimpleTinyEnumT<TrackBits, byte> TrackBitsByte;
 

	
 
/**
 
 * Enumeration for tracks and directions.
 
@@ -118,11 +114,8 @@ enum TrackdirBits {
 
	TRACKDIR_BIT_MASK     = 0x3F3F, ///< Bitmask for bit-operations
 
	INVALID_TRACKDIR_BIT  = 0xFFFF, ///< Flag for an invalid trackdirbit value
 
};
 

	
 
/** Define basic enum properties */
 
template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
 
typedef TinyEnumT<TrackdirBits> TrackdirBitsShort;
 
DECLARE_ENUM_AS_BIT_SET(TrackdirBits);
 
typedef SimpleTinyEnumT<TrackdirBits, uint16> TrackdirBitsShort;
 

	
 
typedef uint32 TrackStatus;
 

	
src/vehicle_type.h
Show inline comments
 
@@ -20,8 +20,8 @@ enum VehicleType {
 
	VEH_INVALID = 0xFF,
 
};
 
DECLARE_POSTFIX_INCREMENT(VehicleType);
 
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {};
 
typedef TinyEnumT<VehicleType> VehicleTypeByte;
 
/** It needs to be 8bits, because we save and load it as such */
 
typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
 

	
 
struct Vehicle;
 
struct Train;
0 comments (0 inline, 0 general)