diff options
author | alberth <alberth@openttd.org> | 2011-01-29 21:37:11 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2011-01-29 21:37:11 +0000 |
commit | eea2f90da74546d7587f51c4080e6380aecbaa98 (patch) | |
tree | 5cb48034bffae274d8bbca47e8149818f185686e /src/vehicle.cpp | |
parent | 734994c9ba642f5c75b709d4b44e0c4b993a949a (diff) | |
download | openttd-eea2f90da74546d7587f51c4080e6380aecbaa98.tar.xz |
(svn r21925) -Doc: Doxygen additions and markup corrections to vehicle-related functions.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index fe5cf1842..d2e4556d4 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -903,6 +903,10 @@ static void DoDrawVehicle(const Vehicle *v) v->x_extent, v->y_extent, v->z_extent, v->z_pos, (v->vehstatus & VS_SHADOW) != 0); } +/** + * Add the vehicle sprites that should be drawn at a part of the screen. + * @param dpi Rectangle being drawn. + */ void ViewportAddVehicles(DrawPixelInfo *dpi) { /* The bounding rectangle */ @@ -954,6 +958,13 @@ void ViewportAddVehicles(DrawPixelInfo *dpi) } } +/** + * Find the vehicle close to the clicked coordinates. + * @param vp Viewport clicked in. + * @param x X coordinate in the viewport. + * @param y Y coordinate in the viewport. + * @return Closest vehicle, or \c NULL if none found. + */ Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y) { Vehicle *found = NULL, *v; @@ -984,6 +995,10 @@ Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y) return found; } +/** + * Decrease the value of a vehicle. + * @param v %Vehicle to devaluate. + */ void DecreaseVehicleValue(Vehicle *v) { v->value -= v->value >> 8; @@ -1187,6 +1202,10 @@ uint8 CalcPercentVehicleFilled(const Vehicle *v, StringID *colour) return (count * 100) / max; } +/** + * Vehicle entirely entered the depot, update its status, orders, vehicle windows, service it, etc. + * @param v Vehicle that entered a depot. + */ void VehicleEnterDepot(Vehicle *v) { /* Always work with the front of the vehicle */ @@ -2357,11 +2376,11 @@ const GroundVehicleCache *Vehicle::GetGroundVehicleCache() const /** * Calculates the set of vehicles that will be affected by a given selection. - * @param set Set of affected vehicles. + * @param set [inout] Set of affected vehicles. * @param v First vehicle of the selection. * @param num_vehicles Number of vehicles in the selection (not counting articulated parts). - * @pre \c set must be empty. - * @post \c set will contain the vehicles that will be refitted. + * @pre \a set must be empty. + * @post \a set will contain the vehicles that will be refitted. */ void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8 num_vehicles) { |