Files
@ r6273:40c57f49e2b7
Branch filter:
Location: cpp/openttd-patchpack/source/src/aircraft.h - annotation
r6273:40c57f49e2b7
2.0 KiB
text/x-c
(svn r9082) -Codechange: [win32] Update VS2003 and VS2005 project files to use the same outpath, and build in UNICODE mode. When making a release it is probably better to make two binaries, one without UNICODE, the other with, guaranteeing full Win9x compatibility (UNICODE with MSLU also works, without it's even better).
-Remove: [os/2] Relic project file remains from watcom
-Remove: [os/2] Relic project file remains from watcom
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6121:a8ff6abe7fb2 r6117:d11b4c5c0aea r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6248:b940b09d7ab8 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r6248:b940b09d7ab8 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r6259:e2dba394134b r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5854:d116ce6001d7 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6259:e2dba394134b r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6237:48ff143a04eb r6245:8321bb387e52 r6237:48ff143a04eb r6237:48ff143a04eb r6087:a13ab75a089f r5475:3f5cd13d1b63 r5780:df0b8d779b37 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5972:0afe141fca29 r5475:3f5cd13d1b63 r6087:a13ab75a089f r6087:a13ab75a089f r5475:3f5cd13d1b63 | /* $Id$ */
/** @file aircraft.h */
#ifndef AIRCRAFT_H
#define AIRCRAFT_H
#include "station_map.h"
#include "vehicle.h"
enum AircraftSubType {
AIR_HELICOPTER = 0,
AIR_AIRCRAFT = 2,
AIR_SHADOW = 4,
AIR_ROTOR = 6
};
/** Check if the aircraft type is a normal flying device; eg
* not a rotor or a shadow
* @param v vehicle to check
* @return Returns true if the aircraft is a helicopter/airplane and
* false if it is a shadow or a rotor) */
static inline bool IsNormalAircraft(const Vehicle *v)
{
assert(v->type == VEH_AIRCRAFT);
/* To be fully correct the commented out functionality is the proper one,
* but since value can only be 0 or 2, it is sufficient to only check <= 2
* return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */
return v->subtype <= AIR_AIRCRAFT;
}
static inline bool IsAircraftInHangar(const Vehicle* v)
{
assert(v->type == VEH_AIRCRAFT);
return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
}
static inline bool IsAircraftInHangarStopped(const Vehicle* v)
{
return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
}
/** Checks if an aircraft is buildable at the tile in question
* @param engine The engine to test
* @param tile The tile where the hangar is
* @return true if the aircraft can be build
*/
static inline bool IsAircraftBuildableAtStation(EngineID engine, TileIndex tile)
{
const Station *st = GetStationByTile(tile);
const AirportFTAClass *apc = st->Airport();
const AircraftVehicleInfo *avi = AircraftVehInfo(engine);
return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0;
}
uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo*);
void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
void HandleAircraftEnterHangar(Vehicle *v);
void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height);
void UpdateAirplanesOnNewStation(const Station *st);
#endif /* AIRCRAFT_H */
|