(svn r8321) -Fix

Reduce the size of EngineInfo (from 28 to 24 bytes) by moving one of its attributes
replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
tron 18 years ago
parent fb8b0557f9
commit 8ac3272e85

@ -78,9 +78,9 @@ typedef struct RoadVehicleInfo {
*/ */
typedef struct EngineInfo { typedef struct EngineInfo {
Date base_intro; Date base_intro;
byte unk2; ///< Carriages have the highest bit set in this one
Year lifelength; Year lifelength;
Year base_life; Year base_life;
byte unk2; ///< Carriages have the highest bit set in this one
byte load_amount; byte load_amount;
byte climates; byte climates;
uint32 refit_mask; uint32 refit_mask;

@ -15,26 +15,26 @@
* @param e Bitmask of the climates * @param e Bitmask of the climates
* @note the 5 between d and e is the load amount * @note the 5 between d and e is the load amount
*/ */
#define MK(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, b, c, d, 5, e, 0, 8, 0, 0 } #define MK(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 5, e, 0, 8, 0, 0 }
/** Writes the properties of a train carriage into the EngineInfo struct. /** Writes the properties of a train carriage into the EngineInfo struct.
* @see MK * @see MK
* @note the 0x80 in parameter b sets the "is carriage bit" * @note the 0x80 in parameter b sets the "is carriage bit"
* @note the 5 between d and e is the load amount * @note the 5 between d and e is the load amount
*/ */
#define MW(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, b | 0x80, c, d, 5, e, 0, 8, 0, 0 } #define MW(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b | 0x80, 5, e, 0, 8, 0, 0 }
/** Writes the properties of a ship into the EngineInfo struct. /** Writes the properties of a ship into the EngineInfo struct.
* @see MK * @see MK
* @note the 10 between d and e is the load amount * @note the 10 between d and e is the load amount
*/ */
#define MS(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, b, c, d, 10, e, 0, 8, 0, 0 } #define MS(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 10, e, 0, 8, 0, 0 }
/** Writes the properties of an aeroplane into the EngineInfo struct. /** Writes the properties of an aeroplane into the EngineInfo struct.
* @see MK * @see MK
* @note the 20 between d and e is the load amount * @note the 20 between d and e is the load amount
*/ */
#define MA(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, b, c, d, 20, e, 0, 8, 0, 0 } #define MA(a, b, c, d, e) { DAYS_TILL_ORIGINAL_BASE_YEAR + a, c, d, b, 20, e, 0, 8, 0, 0 }
// Climates // Climates
// T = Temperate // T = Temperate

Loading…
Cancel
Save