Changeset - r6484:7a9ab9f50ee4
[Not reviewed]
master
0 11 0
belugas - 17 years ago 2007-04-18 00:41:09
belugas@openttd.org
(svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
11 files changed with 32 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1174,13 +1174,12 @@ static RoadStop **FindRoadStopSpot(bool 
 
	}
 
}
 

	
 
/** Build a bus or truck stop
 
 * @param tile tile to build the stop at
 
 * @param flags operation to perform
 
 * @param flags operation to perform
 
 * @param p1 entrance direction (DiagDirection)
 
 * @param p2 bit 0: 0 for Bus stops, 1 for truck stops
 
 *           bit 1: 0 for normal, 1 for drive-through
 
 */
 
int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 
{
src/table/sprites.h
Show inline comments
 
@@ -1299,13 +1299,13 @@ enum AnimCursors {
 
 * the sprite to be displayed. This variable contains various information:<p>
 
 * <ul><li> SPRITE_WIDTH is the number of bits used for the actual sprite to be displayed.
 
 * This always starts at bit 0.</li>
 
 * <li> TRANSPARENT_BIT is the bit number which toggles sprite transparency</li>
 
 * <li> RECOLOR_BIT toggles the recoloring system</li>
 
 * <li> PALETTE_SPRITE_WIDTH and PALETTE_SPRITE_START determine the position and number of
 
 * bits used for the recoloring process. For transparency, it must be 0x322.</li>
 
 * bits used for the recoloring process. For transparency, it must be 0x322.</li></ul>
 
 */
 
enum SpriteSetup {
 
	TRANSPARENT_BIT = 31,       ///< toggles transparency in the sprite
 
	RECOLOR_BIT = 30,           ///< toggles recoloring in the sprite
 
	OFFSET_BIT = 29,
 

	
src/town.h
Show inline comments
 
@@ -276,13 +276,13 @@ static inline bool IsValidTown(const Tow
 
{
 
	return town->xy != 0;
 
}
 

	
 
/**
 
 * Check if a TownID is valid.
 
 * @param TownID to inquiry
 
 * @param index to inquiry in the pool of town
 
 * @return true if it exists
 
 */
 
static inline bool IsValidTownID(TownID index)
 
{
 
	return index < GetTownPoolSize() && IsValidTown(GetTown(index));
 
}
src/town_cmd.cpp
Show inline comments
 
@@ -1540,12 +1540,13 @@ static bool DoBuildStatueOfCompany(TileI
 

	
 
	return true;
 
}
 

	
 
/**
 
 * Search callback function for TownActionBuildStatue
 
 * @param tile on which to perform the search
 
 * @param town_id The town_id for which we want a statue
 
 * @return the result of the test
 
 */
 
static bool SearchTileForStatue(TileIndex tile, uint32 town_id)
 
{
 
	return DoBuildStatueOfCompany(tile, town_id);
src/train_cmd.cpp
Show inline comments
 
@@ -3104,13 +3104,13 @@ extern TileIndex CheckTunnelBusy(TileInd
 

	
 
/**
 
 * Deletes/Clears the last wagon of a crashed train. It takes the engine of the
 
 * train, then goes to the last wagon and deletes that. Each call to this function
 
 * will remove the last wagon of a crashed train. If this wagon was on a crossing,
 
 * or inside a tunnel, recalculate the signals as they might need updating
 
 * @param v the @Vehicle of which last wagon is to be removed
 
 * @param v the Vehicle of which last wagon is to be removed
 
 */
 
static void DeleteLastWagon(Vehicle *v)
 
{
 
	/* Go to the last wagon and delete the link pointing there
 
	 * *u is then the one-before-last wagon, and *v the last
 
	 * one which will physicially be removed */
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -437,13 +437,13 @@ not_valid_below:;
 

	
 
	return cost;
 
}
 

	
 

	
 
/** Build Tunnel.
 
 * @param tile start tile of tunnel
 
 * @param start_tile start tile of tunnel
 
 * @param flags type of operation
 
 * @param p1 railtype, 0x200 for road tunnel
 
 * @param p2 unused
 
 */
 
int32 CmdBuildTunnel(TileIndex start_tile, uint32 flags, uint32 p1, uint32 p2)
 
{
src/unmovable_cmd.cpp
Show inline comments
 
@@ -24,14 +24,15 @@
 
#include "genworld.h"
 
#include "bridge.h"
 

	
 
/** Destroy a HQ.
 
 * During normal gameplay you can only implicitely destroy a HQ when you are
 
 * rebuilding it. Otherwise, only water can destroy it.
 
 * @param tile tile coordinates where HQ is located to destroy
 
 * @param pid Player requesting the destruction of his HQ
 
 * @param flags docommand flags of calling function
 
 * @return cost of the operation
 
 */
 
static int32 DestroyCompanyHQ(PlayerID pid, uint32 flags)
 
{
 
	Player* p = GetPlayer(pid);
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
src/vehicle.cpp
Show inline comments
 
@@ -764,13 +764,13 @@ bool CanFillVehicle(Vehicle *v)
 
bool CanRefitTo(EngineID engine_type, CargoID cid_to)
 
{
 
	return HASBIT(EngInfo(engine_type)->refit_mask, cid_to);
 
}
 

	
 
/** Find the first cargo type that an engine can be refitted to.
 
 * @param engine Which engine to find cargo for.
 
 * @param engine_type Which engine to find cargo for.
 
 * @return A climate dependent cargo type. CT_INVALID is returned if not refittable.
 
 */
 
CargoID FindFirstRefittableCargo(EngineID engine_type)
 
{
 
	uint32 refit_mask = EngInfo(engine_type)->refit_mask;
 

	
 
@@ -781,13 +781,13 @@ CargoID FindFirstRefittableCargo(EngineI
 
	}
 

	
 
	return CT_INVALID;
 
}
 

	
 
/** Learn the price of refitting a certain engine
 
* @param engine Which engine to refit
 
* @param engine_type Which engine to refit
 
* @return Price for refitting
 
*/
 
int32 GetRefitCost(EngineID engine_type)
 
{
 
	int32 base_cost = 0;
 

	
 
@@ -1901,13 +1901,13 @@ static inline void ExtendVehicleListSize
 
	*engine_list = ReallocT(*engine_list, *engine_list_length);
 
}
 

	
 
/** Generates a list of vehicles inside a depot
 
 * Will enlarge allocated space for the list if they are too small, so it's ok to call with (pointer to NULL array, pointer to uninitised uint16, pointer to 0)
 
 * If one of the lists is not needed (say wagons when finding ships), all the pointers regarding that list should be set to NULL
 
 * @param Type type of vehicle
 
 * @param type Type of vehicle
 
 * @param tile The tile the depot is located in
 
 * @param ***engine_list Pointer to a pointer to an array of vehicles in the depot (old list is freed and a new one is malloced)
 
 * @param *engine_list_length Allocated size of engine_list. Needs to be set to 0 when engine_list points to a NULL array
 
 * @param *engine_count The number of engines stored in the list
 
 * @param ***wagon_list Pointer to a pointer to an array of free wagons in the depot (old list is freed and a new one is malloced)
 
 * @param *wagon_list_length Allocated size of wagon_list. Needs to be set to 0 when wagon_list points to a NULL array
 
@@ -1983,17 +1983,19 @@ void BuildDepotVehicleList(byte type, Ti
 

	
 
/**
 
* @param sort_list list to store the list in. Either NULL or the length length_of_array tells
 
* @param length_of_array informs the length allocated for sort_list. This is not the same as the number of vehicles in the list. Needs to be 0 when sort_list is NULL
 
* @param type type of vehicle
 
* @param owner PlayerID of owner to generate a list for
 
* @param index This parameter got different meanings depending on window_type
 
			VLW_STATION_LIST:  index of station to generate a list for
 
			VLW_SHARED_ORDERS: index of order to generate a list for
 
			VLW_STANDARD: not used
 
			VLW_DEPOT_LIST: TileIndex of the depot/hangar to make the list for
 
* @param index This parameter has different meanings depending on window_type
 
    <ul>
 
      <li>VLW_STATION_LIST:  index of station to generate a list for</li>
 
      <li>VLW_SHARED_ORDERS: index of order to generate a list for<li>
 
      <li>VLW_STANDARD: not used<li>
 
      <li>VLW_DEPOT_LIST: TileIndex of the depot/hangar to make the list for</li>
 
    </ul>
 
* @param window_type tells what kind of window the list is for. Use the VLW flags in vehicle_gui.h
 
* @return the number of vehicles added to the list
 
*/
 
uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array, byte type, PlayerID owner, uint32 index, uint16 window_type)
 
{
 
	const byte subtype = (type != VEH_AIRCRAFT) ? (byte)Train_Front : (byte)AIR_AIRCRAFT;
 
@@ -2085,13 +2087,13 @@ uint GenerateVehicleSortList(const Vehic
 

	
 
/** send all vehicles of type to depots
 
 * @param type type of vehicle
 
 * @param flags the flags used for DoCommand()
 
 * @param service should the vehicles only get service in the depots
 
 * @param owner PlayerID of owner of the vehicles to send
 
 * @param VLW_flag tells what kind of list requested the goto depot
 
 * @param vlw_flag tells what kind of list requested the goto depot
 
 * @return 0 for success and CMD_ERROR if no vehicle is able to go to depot
 
 */
 
int32 SendAllVehiclesToDepot(byte type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id)
 
{
 
	const Vehicle **sort_list = NULL;
 
	uint n, i;
src/vehicle_gui.cpp
Show inline comments
 
@@ -276,14 +276,17 @@ static RefitList *BuildRefitList(const V
 

	
 
	return list;
 
}
 

	
 
/** Draw the list of available refit options for a consist.
 
 * Draw the list and highlight the selected refit option (if any)
 
 * @param *v first vehicle in consist to get the refit-options of
 
 * @param *list first vehicle in consist to get the refit-options of
 
 * @param sel selected refit cargo-type in the window
 
 * @param pos position of the selected item in caller widow
 
 * @param rows number of rows(capacity) in caller window
 
 * @param delta step height in caller window
 
 * @return the refit option that is hightlighted, NULL if none
 
 */
 
static RefitOption *DrawVehicleRefitWindow(const RefitList *list, int sel, uint pos, uint rows, uint delta)
 
{
 
	RefitOption *refit = list->items;
 
	RefitOption *selected = NULL;
src/viewport.cpp
Show inline comments
 
@@ -2020,14 +2020,15 @@ static byte Check2x1AutoRail(int mode)
 
 * in the case of a line (HT_RAIL, HT_LINE):  DIR_NE, DIR_NW, DIR_N, DIR_E
 
 * in the case of a rect (HT_RECT, HT_POINT): DIR_S, DIR_E
 
 * For example dragging a rectangle area from south to north should be swapped to
 
 * north-south (DIR_S) to obtain the same results with less code. This is what
 
 * the return value signifies.
 
 * @param style HighLightStyle dragging style
 
 * @param start_tile, end_tile start and end tile of drag
 
 * @param boolean value which when true means start/end should be swapped */
 
 * @param start_tile start tile of drag
 
 * @param end_tile end tile of drag
 
 * @return boolean value which when true means start/end should be swapped */
 
static bool SwapDirection(HighLightStyle style, TileIndex start_tile, TileIndex end_tile)
 
{
 
	uint start_x = TileX(start_tile);
 
	uint start_y = TileY(start_tile);
 
	uint end_x = TileX(end_tile);
 
	uint end_y = TileY(end_tile);
src/yapf/yapf.h
Show inline comments
 
@@ -17,23 +17,22 @@
 
Trackdir YapfChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks);
 

	
 
/** Finds the best path for given road vehicle.
 
 * @param v        the RV that needs to find a path
 
 * @param tile     the tile to find the path from (should be next tile the RV is about to enter)
 
 * @param enterdir diagonal direction which the RV will enter this new tile from
 
 * @param tracks   available tracks on the new tile (to choose from)
 
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
 
 */
 
Trackdir YapfChooseRoadTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir);
 

	
 
/** Finds the best path for given train.
 
 * @param v        the train that needs to find a path
 
 * @param tile     the tile to find the path from (should be next tile the train is about to enter)
 
 * @param enterdir diagonal direction which the RV will enter this new tile from
 
 * @param trackdirs available trackdirs on the new tile (to choose from)
 
 * @param no_path_found [out] true is returned if no path can be found (returned Trackdir is only a 'guess')
 
 * @param tracks   available trackdirs on the new tile (to choose from)
 
 * @param path_not_found [out] true is returned if no path can be found (returned Trackdir is only a 'guess')
 
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
 
 */
 
Trackdir YapfChooseRailTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool *path_not_found);
 

	
 
/** Used by RV multistop feature to find the nearest road stop that has a free slot.
 
 * @param v      RV (its current tile will be the origin)
 
@@ -45,19 +44,19 @@ uint YapfRoadVehDistanceToTile(const Veh
 
/** Used when user sends RV to the nearest depot or if RV needs servicing.
 
 * Returns the nearest depot (or NULL if depot was not found).
 
 */
 
Depot* YapfFindNearestRoadDepot(const Vehicle *v);
 

	
 
/** Used when user sends train to the nearest depot or if train needs servicing.
 
 * @v            train that needs to go to some depot
 
 * @max_distance max distance (number of track tiles) from the current train position
 
 * @param v            train that needs to go to some depot
 
 * @param max_distance max distance (number of track tiles) from the current train position
 
 *                  (used also as optimization - the pathfinder can stop path finding if max_distance
 
 *                  was reached and no depot was seen)
 
 * @reverse_penalty penalty that should be added for the path that requires reversing the train first
 
 * @depot_tile   receives the depot tile if depot was found
 
 * @reversed     receives true if train needs to reversed first
 
 * @param reverse_penalty penalty that should be added for the path that requires reversing the train first
 
 * @param depot_tile   receives the depot tile if depot was found
 
 * @param reversed     receives true if train needs to reversed first
 
 * @return       the true if depot was found.
 
 */
 
bool YapfFindNearestRailDepotTwoWay(Vehicle *v, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed);
 

	
 
/** Returns true if it is better to reverse the train before leaving station */
 
bool YapfCheckReverseTrain(Vehicle* v);
0 comments (0 inline, 0 general)