mirror of https://github.com/OpenTTD/OpenTTD
(svn r21797) -Fix/Change: unify the size (in characters) of the string inputs with eachother and TTD to prevent crashes/asserts with e.g. signs that are too long
parent
080a941eda
commit
6b86ee9888
|
@ -37,7 +37,7 @@ enum Owner {
|
||||||
};
|
};
|
||||||
DECLARE_POSTFIX_INCREMENT(Owner)
|
DECLARE_POSTFIX_INCREMENT(Owner)
|
||||||
|
|
||||||
static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 31; ///< The maximum length of a president name in characters including '\0'
|
static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32; ///< The maximum length of a president name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_PRESIDENT_NAME_PIXELS = 94; ///< The maximum length of a president name in pixels
|
static const uint MAX_LENGTH_PRESIDENT_NAME_PIXELS = 94; ///< The maximum length of a president name in pixels
|
||||||
static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32; ///< The maximum length of a company name in characters including '\0'
|
static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32; ///< The maximum length of a company name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_COMPANY_NAME_PIXELS = 150; ///< The maximum length of a company name in pixels
|
static const uint MAX_LENGTH_COMPANY_NAME_PIXELS = 150; ///< The maximum length of a company name in pixels
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
typedef uint16 DepotID;
|
typedef uint16 DepotID;
|
||||||
struct Depot;
|
struct Depot;
|
||||||
|
|
||||||
static const uint MAX_LENGTH_DEPOT_NAME_CHARS = 31; ///< The maximum length of a depot name in characters including '\0'
|
static const uint MAX_LENGTH_DEPOT_NAME_CHARS = 32; ///< The maximum length of a depot name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_DEPOT_NAME_PIXELS = 180; ///< The maximum length of a depot name in pixels
|
static const uint MAX_LENGTH_DEPOT_NAME_PIXELS = 180; ///< The maximum length of a depot name in pixels
|
||||||
|
|
||||||
#endif /* DEPOT_TYPE_H */
|
#endif /* DEPOT_TYPE_H */
|
||||||
|
|
|
@ -146,7 +146,7 @@ enum EngineFlags {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint NUM_VEHICLE_TYPES = 6;
|
static const uint NUM_VEHICLE_TYPES = 6;
|
||||||
static const uint MAX_LENGTH_ENGINE_NAME_CHARS = 31; ///< The maximum length of an engine name in characters including '\0'
|
static const uint MAX_LENGTH_ENGINE_NAME_CHARS = 32; ///< The maximum length of an engine name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_ENGINE_NAME_PIXELS = 160; ///< The maximum length of an engine name in pixels
|
static const uint MAX_LENGTH_ENGINE_NAME_PIXELS = 160; ///< The maximum length of an engine name in pixels
|
||||||
|
|
||||||
static const EngineID INVALID_ENGINE = 0xFFFF;
|
static const EngineID INVALID_ENGINE = 0xFFFF;
|
||||||
|
|
|
@ -18,7 +18,7 @@ static const GroupID ALL_GROUP = 0xFFFD;
|
||||||
static const GroupID DEFAULT_GROUP = 0xFFFE; ///< ungrouped vehicles are in this group.
|
static const GroupID DEFAULT_GROUP = 0xFFFE; ///< ungrouped vehicles are in this group.
|
||||||
static const GroupID INVALID_GROUP = 0xFFFF;
|
static const GroupID INVALID_GROUP = 0xFFFF;
|
||||||
|
|
||||||
static const uint MAX_LENGTH_GROUP_NAME_CHARS = 31; ///< The maximum length of a group name in characters including '\0'
|
static const uint MAX_LENGTH_GROUP_NAME_CHARS = 32; ///< The maximum length of a group name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_GROUP_NAME_PIXELS = 150; ///< The maximum length of a group name in pixels
|
static const uint MAX_LENGTH_GROUP_NAME_PIXELS = 150; ///< The maximum length of a group name in pixels
|
||||||
|
|
||||||
struct Group;
|
struct Group;
|
||||||
|
|
|
@ -17,7 +17,7 @@ struct Sign;
|
||||||
|
|
||||||
static const SignID INVALID_SIGN = 0xFFFF;
|
static const SignID INVALID_SIGN = 0xFFFF;
|
||||||
|
|
||||||
static const uint MAX_LENGTH_SIGN_NAME_CHARS = 31; ///< The maximum length of a sign name in characters including '\0'
|
static const uint MAX_LENGTH_SIGN_NAME_CHARS = 32; ///< The maximum length of a sign name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_SIGN_NAME_PIXELS = 255; ///< The maximum length of a sign name in pixels
|
static const uint MAX_LENGTH_SIGN_NAME_PIXELS = 255; ///< The maximum length of a sign name in pixels
|
||||||
|
|
||||||
#endif /* SIGNS_TYPE_H */
|
#endif /* SIGNS_TYPE_H */
|
||||||
|
|
|
@ -86,7 +86,7 @@ enum CatchmentArea {
|
||||||
MAX_CATCHMENT = 10, ///< Maximum catchment for airports with "modified catchment" enabled
|
MAX_CATCHMENT = 10, ///< Maximum catchment for airports with "modified catchment" enabled
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint MAX_LENGTH_STATION_NAME_CHARS = 31; ///< The maximum length of a station name in characters including '\0'
|
static const uint MAX_LENGTH_STATION_NAME_CHARS = 32; ///< The maximum length of a station name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_STATION_NAME_PIXELS = 180; ///< The maximum length of a station name in pixels
|
static const uint MAX_LENGTH_STATION_NAME_PIXELS = 180; ///< The maximum length of a station name in pixels
|
||||||
|
|
||||||
/** List of stations */
|
/** List of stations */
|
||||||
|
|
|
@ -105,7 +105,7 @@ enum TownFounding {
|
||||||
/** It needs to be 8bits, because we save and load it as such */
|
/** It needs to be 8bits, because we save and load it as such */
|
||||||
typedef SimpleTinyEnumT<TownFounding, byte> TownFoundingByte;
|
typedef SimpleTinyEnumT<TownFounding, byte> TownFoundingByte;
|
||||||
|
|
||||||
static const uint MAX_LENGTH_TOWN_NAME_CHARS = 31; ///< The maximum length of a town name in characters including '\0'
|
static const uint MAX_LENGTH_TOWN_NAME_CHARS = 32; ///< The maximum length of a town name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_TOWN_NAME_PIXELS = 130; ///< The maximum length of a town name in pixels
|
static const uint MAX_LENGTH_TOWN_NAME_PIXELS = 130; ///< The maximum length of a town name in pixels
|
||||||
|
|
||||||
#endif /* TOWN_TYPE_H */
|
#endif /* TOWN_TYPE_H */
|
||||||
|
|
|
@ -64,7 +64,7 @@ enum DepotCommand {
|
||||||
DEPOT_COMMAND_MASK = 0xFU << 28,
|
DEPOT_COMMAND_MASK = 0xFU << 28,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 31; ///< The maximum length of a vehicle name in characters including '\0'
|
static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; ///< The maximum length of a vehicle name in characters including '\0'
|
||||||
static const uint MAX_LENGTH_VEHICLE_NAME_PIXELS = 150; ///< The maximum length of a vehicle name in pixels
|
static const uint MAX_LENGTH_VEHICLE_NAME_PIXELS = 150; ///< The maximum length of a vehicle name in pixels
|
||||||
|
|
||||||
/** Vehicle acceleration models. */
|
/** Vehicle acceleration models. */
|
||||||
|
|
Loading…
Reference in New Issue