diff options
-rw-r--r-- | src/aircraft.h | 37 | ||||
-rw-r--r-- | src/aircraft_cmd.cpp | 10 | ||||
-rw-r--r-- | src/newgrf_config.cpp | 2 |
3 files changed, 37 insertions, 12 deletions
diff --git a/src/aircraft.h b/src/aircraft.h index 0e0cd76ad..fe2e7494c 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -8,11 +8,12 @@ #include "station_map.h" #include "vehicle.h" +/* An aircraft can be one ot those types */ enum AircraftSubType { - AIR_HELICOPTER = 0, - AIR_AIRCRAFT = 2, - AIR_SHADOW = 4, - AIR_ROTOR = 6 + AIR_HELICOPTER = 0, ///< an helicopter + AIR_AIRCRAFT = 2, ///< an airplace + AIR_SHADOW = 4, ///< shadow of the aircraft + AIR_ROTOR = 6 ///< rotor of an helicopter }; @@ -30,13 +31,20 @@ static inline bool IsNormalAircraft(const Vehicle *v) return v->subtype <= AIR_AIRCRAFT; } - +/** Check if this aircraft is in a hangar + * @param v vehicle to check + * @return true if in hangar + */ static inline bool IsAircraftInHangar(const Vehicle* v) { assert(v->type == VEH_AIRCRAFT); return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile); } +/** Check if this aircraft is in a hangar and stopped + * @param v vehicle to check + * @return true if in hangar and stopped + */ static inline bool IsAircraftInHangarStopped(const Vehicle* v) { return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED; @@ -56,11 +64,28 @@ static inline bool IsAircraftBuildableAtStation(EngineID engine, TileIndex tile) return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0; } -uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo*); +/** + * Calculates cargo capacity based on an aircraft's passenger + * and mail capacities. + * @param cid Which cargo type to calculate a capacity for. + * @param avi Which engine to find a cargo capacity for. + * @return New cargo capacity value. + */ +uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo avi*); void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); + +/** Handle Aircraft specific tasks when a an Aircraft enters a hangar + * @param *v Vehicle that enters the hangar + */ void HandleAircraftEnterHangar(Vehicle *v); + +/** Get the size of the sprite of an aircraft sprite heading west (used for lists) + * @param engine The engine to get the sprite from + * @param width The width of the sprite + * @param height The height of the sprite + */ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height); void UpdateAirplanesOnNewStation(const Station *st); diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index d0dd6f6d8..4c53254f0 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -174,8 +174,8 @@ void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal) /** Get the size of the sprite of an aircraft sprite heading west (used for lists) * @param engine The engine to get the sprite from - * @param &width The width of the sprite - * @param &height The height of the sprite + * @param width The width of the sprite + * @param height The height of the sprite */ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height) { @@ -207,7 +207,7 @@ static int32 EstimateAircraftCost(const AircraftVehicleInfo *avi) * Calculates cargo capacity based on an aircraft's passenger * and mail capacities. * @param cid Which cargo type to calculate a capacity for. - * @param engine Which engine to find a cargo capacity for. + * @param avi Which engine to find a cargo capacity for. * @return New cargo capacity value. */ uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo *avi) @@ -1913,9 +1913,9 @@ static bool AirportHasBlock(Vehicle *v, const AirportFTA *current_pos, const Air } /** - * ... + * "reserve" a block for the plane * @param v airplane that requires the operation - * @param currentpos of the vehicle in the list of blocks + * @param current_pos of the vehicle in the list of blocks * @param apc airport on which block is requsted to be set * @returns true on success. Eg, next block was free and we have occupied it */ diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index f03340601..44ffbf8ce 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -1,6 +1,6 @@ /* $Id$ */ -/** @file newgfr_config.cpp */ +/** @file newgrf_config.cpp */ #include "stdafx.h" #include "openttd.h" |