(svn r8582) -Fix

Reorder the attributes of some structs to reduce their size
This commit is contained in:
tron 2007-02-04 13:46:21 +00:00
parent ccffde6d7e
commit 6b72228df5
3 changed files with 12 additions and 11 deletions

View File

@ -190,12 +190,12 @@ AirportFTAClass::AirportFTAClass(
uint size_y_ uint size_y_
) : ) :
moving_data(moving_data_), moving_data(moving_data_),
nofelements(AirportGetNofElements(apFA)),
terminals(terminals_), terminals(terminals_),
helipads(helipads_), helipads(helipads_),
entry_point(entry_point_),
airport_depots(depots_), airport_depots(depots_),
nof_depots(nof_depots_), nof_depots(nof_depots_),
nofelements(AirportGetNofElements(apFA)),
entry_point(entry_point_),
size_x(size_x_), size_x(size_x_),
size_y(size_y_) size_y(size_y_)
{ {

View File

@ -123,7 +123,8 @@ enum {
}; };
typedef struct AirportMovingData { typedef struct AirportMovingData {
int x,y; int16 x;
int16 y;
byte flag; byte flag;
DirectionByte direction; DirectionByte direction;
} AirportMovingData; } AirportMovingData;
@ -155,25 +156,25 @@ typedef struct AirportFTAClass {
} }
const AirportMovingData *moving_data; const AirportMovingData *moving_data;
byte nofelements; // number of positions the airport consists of struct AirportFTA *layout; // state machine for airport
const byte *terminals; const byte *terminals;
const byte *helipads; const byte *helipads;
byte entry_point; // when an airplane arrives at this airport, enter it at position entry_point
AcceptPlanesByte acc_planes; // accept airplanes or helicopters or both
const TileIndexDiffC *airport_depots; // gives the position of the depots on the airports const TileIndexDiffC *airport_depots; // gives the position of the depots on the airports
byte nof_depots; // number of depots this airport has byte nof_depots; // number of depots this airport has
struct AirportFTA *layout; // state machine for airport byte nofelements; // number of positions the airport consists of
byte entry_point; // when an airplane arrives at this airport, enter it at position entry_point
AcceptPlanesByte acc_planes; // accept airplanes or helicopters or both
byte size_x; byte size_x;
byte size_y; byte size_y;
} AirportFTAClass; } AirportFTAClass;
// internal structure used in openttd - Finite sTate mAchine --> FTA // internal structure used in openttd - Finite sTate mAchine --> FTA
typedef struct AirportFTA { typedef struct AirportFTA {
struct AirportFTA *next; // possible extra movement choices from this position
uint32 block; // 32 bit blocks (st->airport_flags), should be enough for the most complex airports
byte position; // the position that an airplane is at byte position; // the position that an airplane is at
byte next_position; // next position from this position byte next_position; // next position from this position
uint32 block; // 32 bit blocks (st->airport_flags), should be enough for the most complex airports
byte heading; // heading (current orders), guiding an airplane to its target on an airport byte heading; // heading (current orders), guiding an airplane to its target on an airport
struct AirportFTA *next; // possible extra movement choices from this position
} AirportFTA; } AirportFTA;
void InitializeAirports(void); void InitializeAirports(void);

View File

@ -89,12 +89,12 @@ enum {
* - REF_SHEDULE (all REFs are currently limited to 16 bits!!) * - REF_SHEDULE (all REFs are currently limited to 16 bits!!)
*/ */
typedef struct Order { typedef struct Order {
struct Order *next; ///< Pointer to next order. If NULL, end of list
OrderTypeByte type; OrderTypeByte type;
uint8 flags; uint8 flags;
DestinationID dest; ///< The destionation of the order. DestinationID dest; ///< The destionation of the order.
struct Order *next; ///< Pointer to next order. If NULL, end of list
OrderID index; ///< Index of the order, is not saved or anything, just for reference OrderID index; ///< Index of the order, is not saved or anything, just for reference
CargoID refit_cargo; // Refit CargoID CargoID refit_cargo; // Refit CargoID