mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r20499) -Doc: Spelling fixes, and one doxygen comment addition.
This commit is contained in:
parent
15514baf8b
commit
35fec79700
@ -30,7 +30,7 @@ public:
|
||||
{}
|
||||
|
||||
/**
|
||||
* Get the amount ot ticks the AI should be suspended.
|
||||
* Get the amount of ticks the AI should be suspended.
|
||||
* @return The amount of AI ticks to suspend the AI.
|
||||
*/
|
||||
int GetSuspendTime() { return time; }
|
||||
@ -172,7 +172,7 @@ private:
|
||||
void RegisterAPI();
|
||||
|
||||
/**
|
||||
* Load squirrel scipts to emulate an older API.
|
||||
* Load squirrel scripts to emulate an older API.
|
||||
*/
|
||||
bool LoadCompatibilityScripts(const char *api_version);
|
||||
|
||||
@ -182,7 +182,7 @@ private:
|
||||
void Died();
|
||||
|
||||
/**
|
||||
* Save one object (int / string / arrray / table) to the savegame.
|
||||
* Save one object (int / string / array / table) to the savegame.
|
||||
* @param vm The virtual machine to get all the data from.
|
||||
* @param index The index on the squirrel stack of the element to save.
|
||||
* @param max_depth The maximum depth recursive arrays / tables will be stored
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get a random value.
|
||||
* @param unused_param This param is not used, but is needed to work with lists.
|
||||
* @param unused_param This parameter is not used, but is needed to work with lists.
|
||||
* @return A random value between 0 and MAX(uint32).
|
||||
*/
|
||||
static uint32 RandItem(int unused_param);
|
||||
@ -50,14 +50,14 @@ public:
|
||||
|
||||
/**
|
||||
* Get a random value in a range.
|
||||
* @param unused_param This param is not used, but is needed to work with lists.
|
||||
* @param unused_param This parameter is not used, but is needed to work with lists.
|
||||
* @param max The first number this function will never return (the maximum it returns is max - 1).
|
||||
* @return A random value between 0 .. max - 1.
|
||||
*/
|
||||
static uint RandRangeItem(int unused_param, uint max);
|
||||
|
||||
/**
|
||||
* Returns approximatelly 'out' times true when called 'max' times.
|
||||
* Returns approximately 'out' times true when called 'max' times.
|
||||
* After all, it is a random function.
|
||||
* @param out How many times it should return true.
|
||||
* @param max Out of this many times.
|
||||
@ -66,9 +66,9 @@ public:
|
||||
static bool Chance(uint out, uint max);
|
||||
|
||||
/**
|
||||
* Returns approximatelly 'out' times true when called 'max' times.
|
||||
* Returns approximately 'out' times true when called 'max' times.
|
||||
* After all, it is a random function.
|
||||
* @param unused_param This param is not used, but is needed to work with lists.
|
||||
* @param unused_param This parameter is not used, but is needed to work with lists.
|
||||
* @param out How many times it should return true.
|
||||
* @param max Out of this many times.
|
||||
* @return True if the chance worked out.
|
||||
|
@ -716,7 +716,7 @@ int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number)
|
||||
* @param type Type of vehicle (VEH_*)
|
||||
* @param l The left most location of the list
|
||||
* @param r The right most location of the list
|
||||
* @param y The top most location of teh list
|
||||
* @param y The top most location of the list
|
||||
* @param eng_list What engines to draw
|
||||
* @param min where to start in the list
|
||||
* @param max where in the list to end
|
||||
|
@ -80,7 +80,7 @@ enum GenerateLandscapeWindowWidgets {
|
||||
GLAND_START_DATE_TEXT, ///< Start year
|
||||
GLAND_START_DATE_UP, ///< Increase start year
|
||||
|
||||
GLAND_SNOW_LEVEL_DOWN, ///< Docrease snow level
|
||||
GLAND_SNOW_LEVEL_DOWN, ///< Decrease snow level
|
||||
GLAND_SNOW_LEVEL_TEXT, ///< Snow level
|
||||
GLAND_SNOW_LEVEL_UP, ///< Increase snow level
|
||||
|
||||
@ -1244,7 +1244,7 @@ void PrepareGenerateWorldProgress()
|
||||
_gws.current = 0;
|
||||
_gws.total = 0;
|
||||
_gws.percent = 0;
|
||||
_gws.timer = 0; // Forces to paint the progress window immediatelly
|
||||
_gws.timer = 0; // Forces to paint the progress window immediately
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1991,7 +1991,7 @@ static void MaybeNewIndustry()
|
||||
|
||||
if (!ind_spc->enabled || chance == 0 || ind_spc->num_table == 0) continue;
|
||||
|
||||
/* If there is no Callback CBID_INDUSTRY_AVAILABLE or if this one did anot failed,
|
||||
/* If there is no Callback CBID_INDUSTRY_AVAILABLE or if this one did not fail,
|
||||
* and if appearing chance for this landscape is above 0, this industry can be chosen */
|
||||
if (CheckIfCallBackAllowsAvailability(j, IACT_RANDOMCREATION)) {
|
||||
probability_max += chance;
|
||||
|
@ -331,7 +331,7 @@ public:
|
||||
}
|
||||
d = maxdim(d, GetStringBoundingBox(str));
|
||||
|
||||
/* Draw the produced cargos, if any. Otherwhise, will print "Nothing" */
|
||||
/* Draw the produced cargoes, if any. Otherwise, will print "Nothing". */
|
||||
GetAllCargoSuffixes(3, CST_FUND, NULL, this->index[i], indsp, indsp->produced_cargo, cargo_suffix);
|
||||
str = STR_INDUSTRY_VIEW_PRODUCES_CARGO;
|
||||
p = 0;
|
||||
@ -422,7 +422,7 @@ public:
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
}
|
||||
|
||||
/* Draw the accepted cargos, if any. Otherwhise, will print "Nothing" */
|
||||
/* Draw the accepted cargoes, if any. Otherwise, will print "Nothing". */
|
||||
char cargo_suffix[3][512];
|
||||
GetAllCargoSuffixes(0, CST_FUND, NULL, this->selected_type, indsp, indsp->accepts_cargo, cargo_suffix);
|
||||
StringID str = STR_INDUSTRY_VIEW_REQUIRES_CARGO;
|
||||
@ -438,7 +438,7 @@ public:
|
||||
DrawString(left, right, y, str);
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
|
||||
/* Draw the produced cargos, if any. Otherwhise, will print "Nothing" */
|
||||
/* Draw the produced cargoes, if any. Otherwise, will print "Nothing". */
|
||||
GetAllCargoSuffixes(3, CST_FUND, NULL, this->selected_type, indsp, indsp->produced_cargo, cargo_suffix);
|
||||
str = STR_INDUSTRY_VIEW_PRODUCES_CARGO;
|
||||
p = 0;
|
||||
@ -1259,7 +1259,7 @@ public:
|
||||
Listing IndustryDirectoryWindow::last_sorting = {false, 0};
|
||||
const Industry *IndustryDirectoryWindow::last_industry = NULL;
|
||||
|
||||
/* Availible station sorting functions */
|
||||
/* Available station sorting functions. */
|
||||
GUIIndustryList::SortFunction * const IndustryDirectoryWindow::sorter_funcs[] = {
|
||||
&IndustryNameSorter,
|
||||
&IndustryTypeSorter,
|
||||
|
@ -191,7 +191,7 @@ protected:
|
||||
* Handle the given packet, i.e. pass it to the right
|
||||
* parser receive command.
|
||||
* @param p the packet to handle
|
||||
* @return true if we should immediatelly handle further packets, false otherwise
|
||||
* @return true if we should immediately handle further packets, false otherwise
|
||||
*/
|
||||
bool HandlePacket(Packet *p);
|
||||
public:
|
||||
|
@ -988,7 +988,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci)
|
||||
|
||||
/* Nothing depends on us, mark the whole graph as unselected.
|
||||
* After that's done run over them once again to test their children
|
||||
* to unselect. Don't do it immediatelly because it'll do exactly what
|
||||
* to unselect. Don't do it immediately because it'll do exactly what
|
||||
* we're doing now. */
|
||||
for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) {
|
||||
const ContentInfo *c = *iter;
|
||||
|
@ -146,6 +146,15 @@ SpriteID RoadVehicle::GetImage(Direction direction) const
|
||||
return sprite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a road vehicle engine.
|
||||
* @param left Left edge to draw within.
|
||||
* @param right Right edge to draw within.
|
||||
* @param preferred_x Preferred position of the engine.
|
||||
* @param y Vertical position of the engine.
|
||||
* @param engine Engine to draw
|
||||
* @param pal Palette to use.
|
||||
*/
|
||||
void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal)
|
||||
{
|
||||
SpriteID sprite = GetRoadVehIcon(engine);
|
||||
@ -1122,7 +1131,7 @@ static Trackdir FollowPreviousRoadVehicle(const RoadVehicle *v, const RoadVehicl
|
||||
if (already_reversed && prev->tile != tile) {
|
||||
/*
|
||||
* The vehicle has reversed, but did not go straight back.
|
||||
* It immediatelly turn onto another tile. This means that
|
||||
* It immediately turn onto another tile. This means that
|
||||
* the roadstate of the previous vehicle cannot be used
|
||||
* as the direction we have to go with this vehicle.
|
||||
*
|
||||
|
@ -1500,7 +1500,7 @@ static bool StationJoinerNeeded(CommandContainer cmd, TileArea ta)
|
||||
|
||||
/* Test for adjacent station or station below selection.
|
||||
* If adjacent-stations is disabled and we are building next to a station, do not show the selection window.
|
||||
* but join the other station immediatelly. */
|
||||
* but join the other station immediately. */
|
||||
const T *st = FindStationsNearby<T>(ta, false);
|
||||
return st == NULL && (_settings_game.station.adjacent_stations || _stations_nearby_list.Length() == 0);
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ int GetTrainStopLocation(StationID station_id, TileIndex tile, const Train *v, i
|
||||
break;
|
||||
}
|
||||
|
||||
/* Substract half the front vehicle length of the train so we get the real
|
||||
/* Subtract half the front vehicle length of the train so we get the real
|
||||
* stop location of the train. */
|
||||
return stop - (v->tcache.cached_veh_length + 1) / 2;
|
||||
}
|
||||
@ -717,7 +717,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
CountArticulatedParts(eid, false);
|
||||
|
||||
/* Check if depot and new engine uses the same kind of tracks *
|
||||
* We need to see if the engine got power on the tile to avoid eletric engines in non-electric depots */
|
||||
* We need to see if the engine got power on the tile to avoid electric engines in non-electric depots */
|
||||
if (!HasPowerOnRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR;
|
||||
|
||||
/* Allow for the dual-heads and the articulated parts */
|
||||
@ -821,7 +821,7 @@ bool Train::IsInDepot() const
|
||||
|
||||
bool Train::IsStoppedInDepot() const
|
||||
{
|
||||
/* Are we stopped? Ofcourse wagons don't really care... */
|
||||
/* Are we stopped? Of course wagons don't really care... */
|
||||
if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false;
|
||||
return this->IsInDepot();
|
||||
}
|
||||
@ -948,7 +948,7 @@ static void NormaliseSubtypes(Train *chain)
|
||||
/* We must be the first in the chain. */
|
||||
assert(chain->Previous() == NULL);
|
||||
|
||||
/* Set the appropirate bits for the first in the chain. */
|
||||
/* Set the appropriate bits for the first in the chain. */
|
||||
if (chain->IsWagon()) {
|
||||
chain->SetFreeWagon();
|
||||
} else {
|
||||
@ -974,7 +974,7 @@ static void NormaliseSubtypes(Train *chain)
|
||||
*/
|
||||
static CommandCost CheckNewTrain(Train *original_dst, Train *dst, Train *original_src, Train *src)
|
||||
{
|
||||
/* Just add 'new' engines and substract the original ones.
|
||||
/* Just add 'new' engines and subtract the original ones.
|
||||
* If that's less than or equal to 0 we can be sure we did
|
||||
* not add any engines (read: trains) along the way. */
|
||||
if ((src != NULL && src->IsEngine() ? 1 : 0) +
|
||||
@ -1405,7 +1405,7 @@ CommandCost CmdSellRailWagon(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
|
||||
if (v == first && v->IsEngine() && !sell_chain && new_head != NULL && new_head->IsFrontEngine()) {
|
||||
/* We are selling the front engine. In this case we want to
|
||||
* 'give' the order, unitnumber and such to the new head. */
|
||||
* 'give' the order, unit number and such to the new head. */
|
||||
new_head->orders.list = first->orders.list;
|
||||
new_head->AddToShared(first);
|
||||
DeleteVehicleOrders(first);
|
||||
@ -1555,7 +1555,7 @@ static void ReverseTrainSwapVeh(Train *v, int l, int r)
|
||||
if (a->track != TRACK_BIT_WORMHOLE) VehicleEnterTile(a, a->tile, a->x_pos, a->y_pos);
|
||||
}
|
||||
|
||||
/* Update train's power incase tiles were different rail type */
|
||||
/* Update power of the train in case tiles were different rail type. */
|
||||
v->PowerChanged();
|
||||
}
|
||||
|
||||
@ -1713,13 +1713,13 @@ static void AdvanceWagonsAfterSwap(Train *v)
|
||||
Train *last = v->Last(); // last vehicle to move
|
||||
uint length = CountVehiclesInChain(v);
|
||||
|
||||
/* we have to make sure all wagons that leave a depot because of train reversing are moved coorectly
|
||||
/* We have to make sure all wagons that leave a depot because of train reversing are moved correctly
|
||||
* they have already correct spacing, so we have to make sure they are moved how they should */
|
||||
bool nomove = (dep == NULL); // if there is no vehicle leaving a depot, limit the number of wagons moved immediatelly
|
||||
bool nomove = (dep == NULL); // If there is no vehicle leaving a depot, limit the number of wagons moved immediately.
|
||||
|
||||
while (length > 2) {
|
||||
/* we reached vehicle (originally) in front of a depot, stop now
|
||||
* (we would move wagons that are alredy moved with new wagon length) */
|
||||
* (we would move wagons that are already moved with new wagon length). */
|
||||
if (base == dep) break;
|
||||
|
||||
/* the last wagon was that one leaving a depot, so do not move it anymore */
|
||||
@ -2066,7 +2066,7 @@ static void HandleLocomotiveSmokeCloud(const Train *v)
|
||||
/* No smoke in depots or tunnels */
|
||||
if (IsRailDepotTile(v->tile) || IsTunnelTile(v->tile)) continue;
|
||||
|
||||
/* No sparks for electric vehicles on nonelectrified tracks */
|
||||
/* No sparks for electric vehicles on non-electrified tracks. */
|
||||
if (!HasPowerOnRail(v->railtype, GetTileRailType(v->tile))) continue;
|
||||
|
||||
if (effect_type == 0) {
|
||||
@ -2787,7 +2787,7 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay)
|
||||
|
||||
Vehicle *other_train = NULL;
|
||||
PBSTileInfo origin = FollowTrainReservation(v, &other_train);
|
||||
/* The path we are driving on is alread blocked by some other train.
|
||||
/* The path we are driving on is already blocked by some other train.
|
||||
* This can only happen in certain situations when mixing path and
|
||||
* block signals or when changing tracks and/or signals.
|
||||
* Exit here as doing any further reservations will probably just
|
||||
@ -2804,7 +2804,7 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* If we are in a depot, tentativly reserve the depot. */
|
||||
/* If we are in a depot, tentatively reserve the depot. */
|
||||
if (v->track == TRACK_BIT_DEPOT) {
|
||||
SetDepotReservation(v->tile, true);
|
||||
if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(v->tile);
|
||||
@ -3225,7 +3225,7 @@ static void TrainController(Train *v, Vehicle *nomove)
|
||||
|
||||
if (bits == TRACK_BIT_NONE) goto invalid_rail;
|
||||
|
||||
/* Check if the new tile contrains tracks that are compatible
|
||||
/* Check if the new tile constrains tracks that are compatible
|
||||
* with the current train, if not, bail out. */
|
||||
if (!CheckCompatibleRail(v, gp.new_tile)) goto invalid_rail;
|
||||
|
||||
@ -3309,8 +3309,8 @@ static void TrainController(Train *v, Vehicle *nomove)
|
||||
* This case is active if 'prev' is already on the second next tile, when 'v' just enters the next tile.
|
||||
* I.e. when the tile between them has only space for a single vehicle like
|
||||
* 1) horizontal/vertical track tiles and
|
||||
* 2) some orientations of tunnelentries, where the vehicle is already inside the wormhole at 8/16 from the tileedge.
|
||||
* Is also the train just reversing, the wagon inside the tunnel is 'on' the tile of the opposite tunnelentry.
|
||||
* 2) some orientations of tunnel entries, where the vehicle is already inside the wormhole at 8/16 from the tile edge.
|
||||
* Is also the train just reversing, the wagon inside the tunnel is 'on' the tile of the opposite tunnel entry.
|
||||
*/
|
||||
static const TrackBits _connecting_track[DIAGDIR_END][DIAGDIR_END] = {
|
||||
{TRACK_BIT_X, TRACK_BIT_LOWER, TRACK_BIT_NONE, TRACK_BIT_LEFT },
|
||||
@ -3382,7 +3382,7 @@ static void TrainController(Train *v, Vehicle *nomove)
|
||||
if (v->IsFrontEngine()) {
|
||||
v->wait_counter = 0;
|
||||
|
||||
/* If we are approching a crossing that is reserved, play the sound now. */
|
||||
/* If we are approaching a crossing that is reserved, play the sound now. */
|
||||
TileIndex crossing = TrainApproachingCrossingTile(v);
|
||||
if (crossing != INVALID_TILE && HasCrossingReservation(crossing)) SndPlayTileFx(SND_0E_LEVEL_CROSSING, crossing);
|
||||
|
||||
@ -3514,7 +3514,7 @@ static void DeleteLastWagon(Train *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 */
|
||||
* one which will physically be removed */
|
||||
Train *u = v;
|
||||
for (; v->Next() != NULL; v = v->Next()) u = v;
|
||||
u->SetNext(NULL);
|
||||
|
@ -136,7 +136,7 @@ bool Vehicle::NeedsServicing() const
|
||||
/* Is there anything to refit? */
|
||||
if (union_mask != 0) {
|
||||
CargoID cargo_type;
|
||||
/* We cannot refit to mixed cargos in an automated way */
|
||||
/* We cannot refit to mixed cargoes in an automated way */
|
||||
if (IsArticulatedVehicleCarryingDifferentCargos(v, &cargo_type)) continue;
|
||||
|
||||
/* Did the old vehicle carry anything? */
|
||||
@ -569,7 +569,7 @@ void ResetVehicleColourMap()
|
||||
|
||||
/**
|
||||
* List of vehicles that should check for autoreplace this tick.
|
||||
* Mapping of vehicle -> leave depot immediatelly after autoreplace.
|
||||
* Mapping of vehicle -> leave depot immediately after autoreplace.
|
||||
*/
|
||||
typedef SmallMap<Vehicle *, bool, 4> AutoreplaceMap;
|
||||
static AutoreplaceMap _vehicles_to_autoreplace;
|
||||
@ -1416,7 +1416,7 @@ const Livery *GetEngineLivery(EngineID engine_type, CompanyID company, EngineID
|
||||
default: NOT_REACHED();
|
||||
case VEH_TRAIN: {
|
||||
if (v != NULL && parent_engine_type != INVALID_ENGINE && (UsesWagonOverride(v) || (Train::From(v)->IsArticulatedPart() && e->u.rail.railveh_type != RAILVEH_WAGON))) {
|
||||
/* Wagonoverrides use the coloir scheme of the front engine.
|
||||
/* Wagonoverrides use the colour scheme of the front engine.
|
||||
* Articulated parts use the colour scheme of the first part. (Not supported for articulated wagons) */
|
||||
engine_type = parent_engine_type;
|
||||
e = Engine::Get(engine_type);
|
||||
|
Loading…
Reference in New Issue
Block a user