mirror of https://github.com/OpenTTD/OpenTTD
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
parent
89a2ba2a6d
commit
c24374f99c
|
@ -197,7 +197,7 @@
|
||||||
|
|
||||||
/* static */ void AI::ResetConfig()
|
/* static */ void AI::ResetConfig()
|
||||||
{
|
{
|
||||||
/* Check for both newgame as current game if we can reload the AIInfo insde
|
/* Check for both newgame as current game if we can reload the AIInfo inside
|
||||||
* the AIConfig. If not, remove the AI from the list (which will assign
|
* the AIConfig. If not, remove the AI from the list (which will assign
|
||||||
* a random new AI on reload). */
|
* a random new AI on reload). */
|
||||||
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
||||||
|
|
|
@ -635,7 +635,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||||
/* Adjust distance moved by plane speed setting */
|
/* Adjust distance moved by plane speed setting */
|
||||||
if (_settings_game.vehicle.plane_speed > 1) spd /= _settings_game.vehicle.plane_speed;
|
if (_settings_game.vehicle.plane_speed > 1) spd /= _settings_game.vehicle.plane_speed;
|
||||||
|
|
||||||
/* Convert direction-indepenent speed into direction-dependent speed. (old movement method) */
|
/* Convert direction-independent speed into direction-dependent speed. (old movement method) */
|
||||||
spd = v->GetOldAdvanceSpeed(spd);
|
spd = v->GetOldAdvanceSpeed(spd);
|
||||||
|
|
||||||
spd += v->progress;
|
spd += v->progress;
|
||||||
|
@ -660,7 +660,7 @@ int GetAircraftFlyingAltitude(const Aircraft *v)
|
||||||
int base_altitude = PLANE_HOLDING_ALTITUDE;
|
int base_altitude = PLANE_HOLDING_ALTITUDE;
|
||||||
|
|
||||||
/* Make sure eastbound and westbound planes do not "crash" into each
|
/* Make sure eastbound and westbound planes do not "crash" into each
|
||||||
* other by providing them with vertical seperation
|
* other by providing them with vertical separation
|
||||||
*/
|
*/
|
||||||
switch (v->direction) {
|
switch (v->direction) {
|
||||||
case DIR_N:
|
case DIR_N:
|
||||||
|
@ -1380,7 +1380,7 @@ static void AircraftEventHandler_AtTerminal(Aircraft *v, const AirportFTAClass *
|
||||||
* and get serviced at the same time - setting */
|
* and get serviced at the same time - setting */
|
||||||
if (_settings_game.order.serviceathelipad) {
|
if (_settings_game.order.serviceathelipad) {
|
||||||
if (v->subtype == AIR_HELICOPTER && apc->num_helipads > 0) {
|
if (v->subtype == AIR_HELICOPTER && apc->num_helipads > 0) {
|
||||||
/* an exerpt of ServiceAircraft, without the invisibility stuff */
|
/* an excerpt of ServiceAircraft, without the invisibility stuff */
|
||||||
v->date_of_last_service = _date;
|
v->date_of_last_service = _date;
|
||||||
v->breakdowns_since_last_service = 0;
|
v->breakdowns_since_last_service = 0;
|
||||||
v->reliability = v->GetEngine()->reliability;
|
v->reliability = v->GetEngine()->reliability;
|
||||||
|
@ -1402,7 +1402,7 @@ static void AircraftEventHandler_AtTerminal(Aircraft *v, const AirportFTAClass *
|
||||||
switch (v->current_order.GetType()) {
|
switch (v->current_order.GetType()) {
|
||||||
case OT_GOTO_STATION: // ready to fly to another airport
|
case OT_GOTO_STATION: // ready to fly to another airport
|
||||||
break;
|
break;
|
||||||
case OT_GOTO_DEPOT: // visit hangar for serivicing, sale, etc.
|
case OT_GOTO_DEPOT: // visit hangar for servicing, sale, etc.
|
||||||
go_to_hangar = v->current_order.GetDestination() == v->targetairport;
|
go_to_hangar = v->current_order.GetDestination() == v->targetairport;
|
||||||
break;
|
break;
|
||||||
case OT_CONDITIONAL:
|
case OT_CONDITIONAL:
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* @param terminals The terminals.
|
* @param terminals The terminals.
|
||||||
* @param num_helipads Number of heli pads.
|
* @param num_helipads Number of heli pads.
|
||||||
* @param flags Information about the class of FTA.
|
* @param flags Information about the class of FTA.
|
||||||
* @param delta_z Height of the arport above the land.
|
* @param delta_z Height of the airport above the land.
|
||||||
*/
|
*/
|
||||||
#define AIRPORT_GENERIC(name, terminals, num_helipads, flags, delta_z) \
|
#define AIRPORT_GENERIC(name, terminals, num_helipads, flags, delta_z) \
|
||||||
static AirportFTAClass _airportfta_ ## name(_airport_moving_data_ ## name, terminals, \
|
static AirportFTAClass _airportfta_ ## name(_airport_moving_data_ ## name, terminals, \
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
* Define a heliport.
|
* Define a heliport.
|
||||||
* @param name Suffix of the names of the helipad data.
|
* @param name Suffix of the names of the helipad data.
|
||||||
* @param num_helipads Number of heli pads.
|
* @param num_helipads Number of heli pads.
|
||||||
* @param delta_z Height of the arport above the land.
|
* @param delta_z Height of the airport above the land.
|
||||||
*/
|
*/
|
||||||
#define HELIPORT(name, num_helipads, delta_z) \
|
#define HELIPORT(name, num_helipads, delta_z) \
|
||||||
AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z)
|
AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z)
|
||||||
|
|
|
@ -68,7 +68,7 @@ bool IsArticulatedEngine(EngineID engine_type)
|
||||||
* Count the number of articulated parts of an engine.
|
* Count the number of articulated parts of an engine.
|
||||||
* @param engine_type The engine to get the number of parts of.
|
* @param engine_type The engine to get the number of parts of.
|
||||||
* @param purchase_window Whether we are in the scope of the purchase window or not, i.e. whether we cannot allocate vehicles.
|
* @param purchase_window Whether we are in the scope of the purchase window or not, i.e. whether we cannot allocate vehicles.
|
||||||
* @return The nmumber of parts.
|
* @return The number of parts.
|
||||||
*/
|
*/
|
||||||
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default (non-refitted) capacity of a specific EngineID.
|
* Returns the default (non-refitted) capacity of a specific EngineID.
|
||||||
* @param engine the EngineID of iterest
|
* @param engine the EngineID of interest
|
||||||
* @param cargo_type returns the default cargo type, if needed
|
* @param cargo_type returns the default cargo type, if needed
|
||||||
* @return capacity
|
* @return capacity
|
||||||
*/
|
*/
|
||||||
|
@ -113,7 +113,7 @@ static inline uint16 GetVehicleDefaultCapacity(EngineID engine, CargoID *cargo_t
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all cargoes a vehicle can carry.
|
* Returns all cargoes a vehicle can carry.
|
||||||
* @param engine the EngineID of iterest
|
* @param engine the EngineID of interest
|
||||||
* @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
|
* @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
|
||||||
* @return bit set of CargoIDs
|
* @return bit set of CargoIDs
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,18 +66,18 @@ bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
|
||||||
/* make sure the railtypes are compatible */
|
/* make sure the railtypes are compatible */
|
||||||
if ((GetRailTypeInfo(e_from->u.rail.railtype)->compatible_railtypes & GetRailTypeInfo(e_to->u.rail.railtype)->compatible_railtypes) == 0) return false;
|
if ((GetRailTypeInfo(e_from->u.rail.railtype)->compatible_railtypes & GetRailTypeInfo(e_to->u.rail.railtype)->compatible_railtypes) == 0) return false;
|
||||||
|
|
||||||
/* make sure we do not replace wagons with engines or vise versa */
|
/* make sure we do not replace wagons with engines or vice versa */
|
||||||
if ((e_from->u.rail.railveh_type == RAILVEH_WAGON) != (e_to->u.rail.railveh_type == RAILVEH_WAGON)) return false;
|
if ((e_from->u.rail.railveh_type == RAILVEH_WAGON) != (e_to->u.rail.railveh_type == RAILVEH_WAGON)) return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case VEH_ROAD:
|
case VEH_ROAD:
|
||||||
/* make sure that we do not replace a tram with a normal road vehicles or vise versa */
|
/* make sure that we do not replace a tram with a normal road vehicles or vice versa */
|
||||||
if (HasBit(e_from->info.misc_flags, EF_ROAD_TRAM) != HasBit(e_to->info.misc_flags, EF_ROAD_TRAM)) return false;
|
if (HasBit(e_from->info.misc_flags, EF_ROAD_TRAM) != HasBit(e_to->info.misc_flags, EF_ROAD_TRAM)) return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VEH_AIRCRAFT:
|
case VEH_AIRCRAFT:
|
||||||
/* make sure that we do not replace a plane with a helicopter or vise versa */
|
/* make sure that we do not replace a plane with a helicopter or vice versa */
|
||||||
if ((e_from->u.air.subtype & AIR_CTOL) != (e_to->u.air.subtype & AIR_CTOL)) return false;
|
if ((e_from->u.air.subtype & AIR_CTOL) != (e_to->u.air.subtype & AIR_CTOL)) return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ static CommandCost GetNewEngineType(const Vehicle *v, const Company *c, bool alw
|
||||||
* Builds and refits a replacement vehicle
|
* Builds and refits a replacement vehicle
|
||||||
* Important: The old vehicle is still in the original vehicle chain (used for determining the cargo when the old vehicle did not carry anything, but the new one does)
|
* Important: The old vehicle is still in the original vehicle chain (used for determining the cargo when the old vehicle did not carry anything, but the new one does)
|
||||||
* @param old_veh A single (articulated/multiheaded) vehicle that shall be replaced.
|
* @param old_veh A single (articulated/multiheaded) vehicle that shall be replaced.
|
||||||
* @param new_vehicle Returns the newly build and refittet vehicle
|
* @param new_vehicle Returns the newly build and refitted vehicle
|
||||||
* @param part_of_chain The vehicle is part of a train
|
* @param part_of_chain The vehicle is part of a train
|
||||||
* @return cost or error
|
* @return cost or error
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int CDECL EngineNumberSorter(const EngineID *a, const EngineID *b)
|
||||||
* @param id_g The group the engine belongs to
|
* @param id_g The group the engine belongs to
|
||||||
* Note: this function only works if it is called either
|
* Note: this function only works if it is called either
|
||||||
* - when a new vehicle is build, but before it's counted in num_engines
|
* - when a new vehicle is build, but before it's counted in num_engines
|
||||||
* - when a vehicle is deleted and after it's substracted from num_engines
|
* - when a vehicle is deleted and after it's subtracted from num_engines
|
||||||
* - when not changing the count (used when changing replace orders)
|
* - when not changing the count (used when changing replace orders)
|
||||||
*/
|
*/
|
||||||
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
|
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
|
||||||
|
|
|
@ -269,7 +269,7 @@ template <class Tbase_set>
|
||||||
if (missing == 0) {
|
if (missing == 0) {
|
||||||
p += seprintf(p, last, " (%i corrupt file%s)\n", invalid, invalid == 1 ? "" : "s");
|
p += seprintf(p, last, " (%i corrupt file%s)\n", invalid, invalid == 1 ? "" : "s");
|
||||||
} else {
|
} else {
|
||||||
p += seprintf(p, last, " (unuseable: %i missing file%s)\n", missing, missing == 1 ? "" : "s");
|
p += seprintf(p, last, " (unusable: %i missing file%s)\n", missing, missing == 1 ? "" : "s");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p += seprintf(p, last, "\n");
|
p += seprintf(p, last, "\n");
|
||||||
|
|
|
@ -107,7 +107,7 @@ void Blitter_32bppBase::ScrollBuffer(void *video, int &left, int &top, int &widt
|
||||||
dst = (uint32 *)video + left + top * _screen.pitch;
|
dst = (uint32 *)video + left + top * _screen.pitch;
|
||||||
src = dst - scroll_y * _screen.pitch;
|
src = dst - scroll_y * _screen.pitch;
|
||||||
|
|
||||||
/* Decrese height. (scroll_y is <=0). */
|
/* Decrease height. (scroll_y is <=0). */
|
||||||
height += scroll_y;
|
height += scroll_y;
|
||||||
assert(height > 0);
|
assert(height > 0);
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ void Blitter_8bppBase::ScrollBuffer(void *video, int &left, int &top, int &width
|
||||||
dst = (uint8 *)video + left + top * _screen.pitch;
|
dst = (uint8 *)video + left + top * _screen.pitch;
|
||||||
src = dst - scroll_y * _screen.pitch;
|
src = dst - scroll_y * _screen.pitch;
|
||||||
|
|
||||||
/* Decrese height. (scroll_y is <=0). */
|
/* Decrease height. (scroll_y is <=0). */
|
||||||
height += scroll_y;
|
height += scroll_y;
|
||||||
assert(height > 0);
|
assert(height > 0);
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy from a buffer to the screen.
|
* Copy from a buffer to the screen.
|
||||||
* @param video The destionation pointer (video-buffer).
|
* @param video The destination pointer (video-buffer).
|
||||||
* @param src The buffer from which the data will be read.
|
* @param src The buffer from which the data will be read.
|
||||||
* @param width The width of the buffer.
|
* @param width The width of the buffer.
|
||||||
* @param height The height of the buffer.
|
* @param height The height of the buffer.
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
/* virtual */ int GetBytesPerPixel() { return 0; }
|
/* virtual */ int GetBytesPerPixel() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Factory for the blitter that doesn nothing. */
|
/** Factory for the blitter that does nothing. */
|
||||||
class FBlitter_Null: public BlitterFactory<FBlitter_Null> {
|
class FBlitter_Null: public BlitterFactory<FBlitter_Null> {
|
||||||
public:
|
public:
|
||||||
/* virtual */ const char *GetName() { return "null"; }
|
/* virtual */ const char *GetName() { return "null"; }
|
||||||
|
|
|
@ -205,7 +205,7 @@ public:
|
||||||
#endif /* defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) */
|
#endif /* defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle all procedures for bootstrapping OpenTTD without a base grapics set.
|
* Handle all procedures for bootstrapping OpenTTD without a base graphics set.
|
||||||
* This requires all kinds of trickery that is needed to avoid the use of
|
* This requires all kinds of trickery that is needed to avoid the use of
|
||||||
* sprites from the base graphics set which are pretty interwoven.
|
* sprites from the base graphics set which are pretty interwoven.
|
||||||
* @return True if a base set exists, otherwise false.
|
* @return True if a base set exists, otherwise false.
|
||||||
|
|
|
@ -381,7 +381,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
||||||
/* The bridge length without ramps. */
|
/* The bridge length without ramps. */
|
||||||
const uint bridge_len = GetTunnelBridgeLength(start, end);
|
const uint bridge_len = GetTunnelBridgeLength(start, end);
|
||||||
|
|
||||||
/* If Ctrl is being pressed, check wether the last bridge built is available
|
/* If Ctrl is being pressed, check whether the last bridge built is available
|
||||||
* If so, return this bridge type. Otherwise continue normally.
|
* If so, return this bridge type. Otherwise continue normally.
|
||||||
* We store bridge types for each transport type, so we have to check for
|
* We store bridge types for each transport type, so we have to check for
|
||||||
* the transport type beforehand.
|
* the transport type beforehand.
|
||||||
|
|
|
@ -41,7 +41,7 @@ static inline bool IsBridgeTile(TileIndex t)
|
||||||
* checks for the possibility that a bridge may be on this tile
|
* checks for the possibility that a bridge may be on this tile
|
||||||
* These are in fact all the tile types on which a bridge can be found
|
* These are in fact all the tile types on which a bridge can be found
|
||||||
* @param t The tile to analyze
|
* @param t The tile to analyze
|
||||||
* @return true if a bridge migh be present
|
* @return true if a bridge might be present
|
||||||
*/
|
*/
|
||||||
static inline bool MayHaveBridgeAbove(TileIndex t)
|
static inline bool MayHaveBridgeAbove(TileIndex t)
|
||||||
{
|
{
|
||||||
|
|
|
@ -272,7 +272,7 @@ static int CDECL EnginePowerVsRunningCostSorter(const EngineID *a, const EngineI
|
||||||
* we will actually calculate cunning cost/power (to make it more than 1).
|
* we will actually calculate cunning cost/power (to make it more than 1).
|
||||||
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
|
* Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
|
||||||
* Another thing is that both power and running costs should be doubled for multiheaded engines.
|
* Another thing is that both power and running costs should be doubled for multiheaded engines.
|
||||||
* Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
|
* Since it would be multiplying with 2 in both numerator and denominator, it will even themselves out and we skip checking for multiheaded. */
|
||||||
Money va = (e_a->GetRunningCost()) / max(1U, (uint)e_a->GetPower());
|
Money va = (e_a->GetRunningCost()) / max(1U, (uint)e_a->GetPower());
|
||||||
Money vb = (e_b->GetRunningCost()) / max(1U, (uint)e_b->GetPower());
|
Money vb = (e_b->GetRunningCost()) / max(1U, (uint)e_b->GetPower());
|
||||||
int r = ClampToI32(vb - va);
|
int r = ClampToI32(vb - va);
|
||||||
|
@ -967,7 +967,7 @@ struct BuildVehicleWindow : Window {
|
||||||
this->vscroll = this->GetScrollbar(WID_BV_SCROLLBAR);
|
this->vscroll = this->GetScrollbar(WID_BV_SCROLLBAR);
|
||||||
|
|
||||||
/* If we are just viewing the list of vehicles, we do not need the Build button.
|
/* If we are just viewing the list of vehicles, we do not need the Build button.
|
||||||
* So we just hide it, and enlarge the Rename buton by the now vacant place. */
|
* So we just hide it, and enlarge the Rename button by the now vacant place. */
|
||||||
if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
|
if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
|
||||||
|
|
||||||
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
|
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
|
||||||
|
|
|
@ -31,7 +31,7 @@ void ClearCargoDeliveryMonitoring()
|
||||||
/**
|
/**
|
||||||
* Get and reset the amount associated with a cargo monitor.
|
* Get and reset the amount associated with a cargo monitor.
|
||||||
* @param[in,out] monitor_map Monitoring map to search (and reset for the queried entry).
|
* @param[in,out] monitor_map Monitoring map to search (and reset for the queried entry).
|
||||||
* @oaram monitor Cargo monitor to query/reset.
|
* @param monitor Cargo monitor to query/reset.
|
||||||
* @param keep_monitoring After returning from this call, continue monitoring.
|
* @param keep_monitoring After returning from this call, continue monitoring.
|
||||||
* @return Amount collected since last query/activation for the monitored combination.
|
* @return Amount collected since last query/activation for the monitored combination.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -161,7 +161,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple collection class for a list of cargo packets.
|
* Simple collection class for a list of cargo packets.
|
||||||
* @tparam Tinst Actual instantation of this cargo list.
|
* @tparam Tinst Actual instantiation of this cargo list.
|
||||||
*/
|
*/
|
||||||
template <class Tinst>
|
template <class Tinst>
|
||||||
class CargoList {
|
class CargoList {
|
||||||
|
|
|
@ -46,7 +46,7 @@ enum CargoClass {
|
||||||
CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber)
|
CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber)
|
||||||
CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit)
|
CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit)
|
||||||
CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
|
CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
|
||||||
CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
|
CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transportation in Box Vans, Silo Wagons, etc.)
|
||||||
CC_SPECIAL = 1 << 15, ///< Special bit used for livery refit tricks instead of normal cargoes.
|
CC_SPECIAL = 1 << 15, ///< Special bit used for livery refit tricks instead of normal cargoes.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ static int32 ClickChangeCompanyCheat(int32 p1, int32 p2)
|
||||||
* Allow (or disallow) changing production of all industries.
|
* Allow (or disallow) changing production of all industries.
|
||||||
* @param p1 new value
|
* @param p1 new value
|
||||||
* @param p2 unused
|
* @param p2 unused
|
||||||
* @return New value allwing change of industry production.
|
* @return New value allowing change of industry production.
|
||||||
*/
|
*/
|
||||||
static int32 ClickSetProdCheat(int32 p1, int32 p2)
|
static int32 ClickSetProdCheat(int32 p1, int32 p2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -190,12 +190,12 @@ static void TileLoopClearAlps(TileIndex tile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Update snow density. */
|
/* Update snow density. */
|
||||||
uint curent_density = GetClearDensity(tile);
|
uint current_density = GetClearDensity(tile);
|
||||||
uint req_density = (k < 0) ? 0u : min((uint)k, 3);
|
uint req_density = (k < 0) ? 0u : min((uint)k, 3);
|
||||||
|
|
||||||
if (curent_density < req_density) {
|
if (current_density < req_density) {
|
||||||
AddClearDensity(tile, 1);
|
AddClearDensity(tile, 1);
|
||||||
} else if (curent_density > req_density) {
|
} else if (current_density > req_density) {
|
||||||
AddClearDensity(tile, -1);
|
AddClearDensity(tile, -1);
|
||||||
} else {
|
} else {
|
||||||
/* Density at the required level. */
|
/* Density at the required level. */
|
||||||
|
|
|
@ -277,7 +277,7 @@ enum Commands {
|
||||||
|
|
||||||
CMD_GIVE_MONEY, ///< give money to another company
|
CMD_GIVE_MONEY, ///< give money to another company
|
||||||
CMD_CHANGE_SETTING, ///< change a setting
|
CMD_CHANGE_SETTING, ///< change a setting
|
||||||
CMD_CHANGE_COMPANY_SETTING, ///< change a company etting
|
CMD_CHANGE_COMPANY_SETTING, ///< change a company setting
|
||||||
|
|
||||||
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry
|
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ static inline void SetCompanyManagerFaceBits(CompanyManagerFace &cmf, CompanyMan
|
||||||
/**
|
/**
|
||||||
* Increase/Decrease the company manager's face variable by the given amount.
|
* Increase/Decrease the company manager's face variable by the given amount.
|
||||||
* If the new value greater than the max value for this variable it will be set to 0.
|
* If the new value greater than the max value for this variable it will be set to 0.
|
||||||
* Or is it negativ (< 0) it will be set to max value.
|
* Or is it negative (< 0) it will be set to max value.
|
||||||
*
|
*
|
||||||
* @param cmf the company manager face to write the bits to
|
* @param cmf the company manager face to write the bits to
|
||||||
* @param cmfv the company manager face variable to write the data of
|
* @param cmfv the company manager face variable to write the data of
|
||||||
|
|
|
@ -355,7 +355,7 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
||||||
aliasstream[astream_i++] = '"';
|
aliasstream[astream_i++] = '"';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ';': // Cmd seperator, start new command
|
case ';': // Cmd separator, start new command
|
||||||
aliasstream[astream_i] = '\0';
|
aliasstream[astream_i] = '\0';
|
||||||
aliases[++a_index] = &aliasstream[++astream_i];
|
aliases[++a_index] = &aliasstream[++astream_i];
|
||||||
cmdptr++;
|
cmdptr++;
|
||||||
|
@ -364,7 +364,7 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
||||||
case '%': // Some or all parameters
|
case '%': // Some or all parameters
|
||||||
cmdptr++;
|
cmdptr++;
|
||||||
switch (*cmdptr) {
|
switch (*cmdptr) {
|
||||||
case '+': { // All parameters seperated: "[param 1]" "[param 2]"
|
case '+': { // All parameters separated: "[param 1]" "[param 2]"
|
||||||
for (i = 0; i != tokencount; i++) {
|
for (i = 0; i != tokencount; i++) {
|
||||||
aliasstream[astream_i++] = '"';
|
aliasstream[astream_i++] = '"';
|
||||||
astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
|
astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
|
||||||
|
@ -412,7 +412,7 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a given command passed to us. First chop it up into
|
* Execute a given command passed to us. First chop it up into
|
||||||
* individual tokens (seperated by spaces), then execute it if possible
|
* individual tokens (separated by spaces), then execute it if possible
|
||||||
* @param cmdstr string to be parsed and executed
|
* @param cmdstr string to be parsed and executed
|
||||||
*/
|
*/
|
||||||
void IConsoleCmdExec(const char *cmdstr)
|
void IConsoleCmdExec(const char *cmdstr)
|
||||||
|
@ -439,14 +439,14 @@ void IConsoleCmdExec(const char *cmdstr)
|
||||||
memset(&tokens, 0, sizeof(tokens));
|
memset(&tokens, 0, sizeof(tokens));
|
||||||
memset(&tokenstream, 0, sizeof(tokenstream));
|
memset(&tokenstream, 0, sizeof(tokenstream));
|
||||||
|
|
||||||
/* 1. Split up commandline into tokens, seperated by spaces, commands
|
/* 1. Split up commandline into tokens, separated by spaces, commands
|
||||||
* enclosed in "" are taken as one token. We can only go as far as the amount
|
* enclosed in "" are taken as one token. We can only go as far as the amount
|
||||||
* of characters in our stream or the max amount of tokens we can handle */
|
* of characters in our stream or the max amount of tokens we can handle */
|
||||||
for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; cmdptr++) {
|
for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; cmdptr++) {
|
||||||
if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
|
if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
|
||||||
|
|
||||||
switch (*cmdptr) {
|
switch (*cmdptr) {
|
||||||
case ' ': // Token seperator
|
case ' ': // Token separator
|
||||||
if (!foundtoken) break;
|
if (!foundtoken) break;
|
||||||
|
|
||||||
if (longtoken) {
|
if (longtoken) {
|
||||||
|
|
|
@ -1066,7 +1066,7 @@ DEF_CONSOLE_CMD(ConRestart)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a text buffer line by line to the console. Lines are seperated by '\n'.
|
* Print a text buffer line by line to the console. Lines are separated by '\n'.
|
||||||
* @param buf The buffer to print.
|
* @param buf The buffer to print.
|
||||||
* @note All newlines are replace by '\0' characters.
|
* @note All newlines are replace by '\0' characters.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,7 +28,7 @@ enum ConsoleHookResult {
|
||||||
* --Commands--
|
* --Commands--
|
||||||
* Commands are commands, or functions. They get executed once and any
|
* Commands are commands, or functions. They get executed once and any
|
||||||
* effect they produce are carried out. The arguments to the commands
|
* effect they produce are carried out. The arguments to the commands
|
||||||
* are given to them, each input word seperated by a double-quote (") is an argument
|
* are given to them, each input word separated by a double-quote (") is an argument
|
||||||
* If you want to handle multiple words as one, enclose them in double-quotes
|
* If you want to handle multiple words as one, enclose them in double-quotes
|
||||||
* eg. 'say "hello sexy boy"'
|
* eg. 'say "hello sexy boy"'
|
||||||
*/
|
*/
|
||||||
|
@ -50,7 +50,7 @@ struct IConsoleCmd {
|
||||||
* (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
|
* (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
|
||||||
* given to them in the command line.
|
* given to them in the command line.
|
||||||
* - "%A - %Z" substitute arguments 1 t/m 26
|
* - "%A - %Z" substitute arguments 1 t/m 26
|
||||||
* - "%+" lists all parameters keeping them seperated
|
* - "%+" lists all parameters keeping them separated
|
||||||
* - "%!" also lists all parameters but presenting them to the aliased command as one argument
|
* - "%!" also lists all parameters but presenting them to the aliased command as one argument
|
||||||
* - ";" allows for combining commands (see example 'ng')
|
* - ";" allows for combining commands (see example 'ng')
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,7 +27,7 @@ const uint8 _ffb_64[64] = {
|
||||||
* Search the first set bit in a 32 bit variable.
|
* Search the first set bit in a 32 bit variable.
|
||||||
*
|
*
|
||||||
* This algorithm is a static implementation of a log
|
* This algorithm is a static implementation of a log
|
||||||
* conguence search algorithm. It checks the first half
|
* congruence search algorithm. It checks the first half
|
||||||
* if there is a bit set search there further. And this
|
* if there is a bit set search there further. And this
|
||||||
* way further. If no bit is set return 0.
|
* way further. If no bit is set return 0.
|
||||||
*
|
*
|
||||||
|
@ -55,7 +55,7 @@ uint8 FindFirstBit(uint32 x)
|
||||||
* Search the last set bit in a 64 bit variable.
|
* Search the last set bit in a 64 bit variable.
|
||||||
*
|
*
|
||||||
* This algorithm is a static implementation of a log
|
* This algorithm is a static implementation of a log
|
||||||
* conguence search algorithm. It checks the second half
|
* congruence search algorithm. It checks the second half
|
||||||
* if there is a bit set search there further. And this
|
* if there is a bit set search there further. And this
|
||||||
* way further. If no bit is set return 0.
|
* way further. If no bit is set return 0.
|
||||||
*
|
*
|
||||||
|
|
|
@ -89,7 +89,7 @@ template <typename Tenum_t> struct TinyEnumT;
|
||||||
template <typename Tenum_t>
|
template <typename Tenum_t>
|
||||||
struct TinyEnumT {
|
struct TinyEnumT {
|
||||||
typedef Tenum_t enum_type; ///< expose our enumeration type (i.e. Trackdir) to outside
|
typedef Tenum_t enum_type; ///< expose our enumeration type (i.e. Trackdir) to outside
|
||||||
typedef EnumPropsT<Tenum_t> Props; ///< make easier access to our enumeration propeties
|
typedef EnumPropsT<Tenum_t> Props; ///< make easier access to our enumeration properties
|
||||||
typedef typename Props::storage storage_type; ///< small storage type
|
typedef typename Props::storage storage_type; ///< small storage type
|
||||||
static const enum_type begin = Props::begin; ///< enum beginning (i.e. TRACKDIR_BEGIN)
|
static const enum_type begin = Props::begin; ///< enum beginning (i.e. TRACKDIR_BEGIN)
|
||||||
static const enum_type end = Props::end; ///< enum end (i.e. TRACKDIR_END)
|
static const enum_type end = Props::end; ///< enum end (i.e. TRACKDIR_END)
|
||||||
|
|
|
@ -108,7 +108,7 @@ DEFINE_POOL_METHOD(inline void *)::AllocateItem(size_t size, size_t index)
|
||||||
item = (Titem *)this->alloc_cache;
|
item = (Titem *)this->alloc_cache;
|
||||||
this->alloc_cache = this->alloc_cache->next;
|
this->alloc_cache = this->alloc_cache->next;
|
||||||
if (Tzero) {
|
if (Tzero) {
|
||||||
/* Explicitly casting to (void *) prevets a clang warning -
|
/* Explicitly casting to (void *) prevents a clang warning -
|
||||||
* we are actually memsetting a (not-yet-constructed) object */
|
* we are actually memsetting a (not-yet-constructed) object */
|
||||||
memset((void *)item, 0, sizeof(Titem));
|
memset((void *)item, 0, sizeof(Titem));
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct PoolBase {
|
||||||
static void Clean(PoolType);
|
static void Clean(PoolType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contructor registers this object in the pool vector.
|
* Constructor registers this object in the pool vector.
|
||||||
* @param pt type of this pool.
|
* @param pt type of this pool.
|
||||||
*/
|
*/
|
||||||
PoolBase(PoolType pt) : type(pt)
|
PoolBase(PoolType pt) : type(pt)
|
||||||
|
@ -278,7 +278,7 @@ struct Pool : PoolBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const size_t NO_FREE_ITEM = MAX_UVALUE(size_t); ///< Contant to indicate we can't allocate any more items
|
static const size_t NO_FREE_ITEM = MAX_UVALUE(size_t); ///< Constant to indicate we can't allocate any more items
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper struct to cache 'freed' PoolItems so we
|
* Helper struct to cache 'freed' PoolItems so we
|
||||||
|
|
|
@ -37,7 +37,7 @@ static inline void QSortT(T *base, uint num, int (CDECL *comparator)(const T*, c
|
||||||
/**
|
/**
|
||||||
* Type safe Gnome Sort.
|
* Type safe Gnome Sort.
|
||||||
*
|
*
|
||||||
* This is a slightly modifyied Gnome search. The basic
|
* This is a slightly modified Gnome search. The basic
|
||||||
* Gnome search tries to sort already sorted list parts.
|
* Gnome search tries to sort already sorted list parts.
|
||||||
* The modification skips these.
|
* The modification skips these.
|
||||||
*
|
*
|
||||||
|
|
|
@ -72,7 +72,7 @@ protected:
|
||||||
virtual char *LogRegisters(char *buffer, const char *last) const;
|
virtual char *LogRegisters(char *buffer, const char *last) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the dynamically linked libaries/modules to the buffer, if there
|
* Writes the dynamically linked libraries/modules to the buffer, if there
|
||||||
* is information about it available.
|
* is information about it available.
|
||||||
* @param buffer The begin where to write at.
|
* @param buffer The begin where to write at.
|
||||||
* @param last The last position in the buffer to write to.
|
* @param last The last position in the buffer to write to.
|
||||||
|
|
|
@ -62,7 +62,7 @@ static const CurrencySpec origin_currency_specs[NUM_CURRENCY] = {
|
||||||
CurrencySpec _currency_specs[NUM_CURRENCY];
|
CurrencySpec _currency_specs[NUM_CURRENCY];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These enums are only declared in order to make sens
|
* These enums are only declared in order to make sense
|
||||||
* out of the TTDPatch_To_OTTDIndex array that will follow
|
* out of the TTDPatch_To_OTTDIndex array that will follow
|
||||||
* Every currency used by Ottd is there, just in case TTDPatch will
|
* Every currency used by Ottd is there, just in case TTDPatch will
|
||||||
* add those missing in its code
|
* add those missing in its code
|
||||||
|
@ -129,7 +129,7 @@ const byte TTDPatch_To_OTTDIndex[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will return the ottd's index correspondance to
|
* Will return the ottd's index correspondence to
|
||||||
* the ttdpatch's id. If the id is bigger than the array,
|
* the ttdpatch's id. If the id is bigger than the array,
|
||||||
* it is a grf written for ottd, thus returning the same id.
|
* it is a grf written for ottd, thus returning the same id.
|
||||||
* Only called from newgrf.cpp
|
* Only called from newgrf.cpp
|
||||||
|
@ -180,7 +180,7 @@ void CheckSwitchToEuro()
|
||||||
* Called only from newgrf.cpp and settings.cpp.
|
* Called only from newgrf.cpp and settings.cpp.
|
||||||
* @param preserve_custom will not reset custom currency (the latest one on the list)
|
* @param preserve_custom will not reset custom currency (the latest one on the list)
|
||||||
* if ever it is flagged to true. In which case, the total size of the memory to move
|
* if ever it is flagged to true. In which case, the total size of the memory to move
|
||||||
* will be one currency spec less, thus preserving the custom curreny from been
|
* will be one currency spec less, thus preserving the custom currency from been
|
||||||
* overwritten.
|
* overwritten.
|
||||||
*/
|
*/
|
||||||
void ResetCurrencies(bool preserve_custom)
|
void ResetCurrencies(bool preserve_custom)
|
||||||
|
|
|
@ -138,7 +138,7 @@ void ConvertDateToYMD(Date date, YearMonthDay *ymd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a tupe of Year, Month and Day to a Date.
|
* Converts a tuple of Year, Month and Day to a Date.
|
||||||
* @param year is a number between 0..MAX_YEAR
|
* @param year is a number between 0..MAX_YEAR
|
||||||
* @param month is a number between 0..11
|
* @param month is a number between 0..11
|
||||||
* @param day is a number between 1..31
|
* @param day is a number between 1..31
|
||||||
|
|
|
@ -83,7 +83,7 @@ uint64 ottd_rdtsc();
|
||||||
*
|
*
|
||||||
* for (int i = 0; i < 5; i++) {
|
* for (int i = 0; i < 5; i++) {
|
||||||
* TIC();
|
* TIC();
|
||||||
* --Do yuor code--
|
* --Do your code--
|
||||||
* TOC("A name", 5);
|
* TOC("A name", 5);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
|
|
@ -744,7 +744,7 @@ struct DepotWindow : Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
case WID_D_SELL_ALL:
|
case WID_D_SELL_ALL:
|
||||||
/* Only open the confimation window if there are anything to sell */
|
/* Only open the confirmation window if there are anything to sell */
|
||||||
if (this->vehicle_list.Length() != 0 || this->wagon_list.Length() != 0) {
|
if (this->vehicle_list.Length() != 0 || this->wagon_list.Length() != 0) {
|
||||||
TileIndex tile = this->window_number;
|
TileIndex tile = this->window_number;
|
||||||
byte vehtype = this->type;
|
byte vehtype = this->type;
|
||||||
|
|
|
@ -93,7 +93,7 @@ static inline DiagDirection ReverseDiagDir(DiagDirection d)
|
||||||
* the new DiagDirection.
|
* the new DiagDirection.
|
||||||
*
|
*
|
||||||
* @param d The DiagDirection
|
* @param d The DiagDirection
|
||||||
* @param delta The difference to applie on
|
* @param delta The difference to apply on
|
||||||
* @return The new direction which was calculated
|
* @return The new direction which was calculated
|
||||||
*/
|
*/
|
||||||
static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
|
static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
|
||||||
|
@ -207,7 +207,7 @@ static inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if an interger value is a valid DiagDirection
|
* Checks if an integer value is a valid DiagDirection
|
||||||
*
|
*
|
||||||
* @param d The value to check
|
* @param d The value to check
|
||||||
* @return True if the value belongs to a DiagDirection, else false
|
* @return True if the value belongs to a DiagDirection, else false
|
||||||
|
|
|
@ -66,7 +66,7 @@ enum DirDiff {
|
||||||
DIRDIFF_SAME = 0, ///< Both directions faces to the same direction
|
DIRDIFF_SAME = 0, ///< Both directions faces to the same direction
|
||||||
DIRDIFF_45RIGHT = 1, ///< Angle of 45 degrees right
|
DIRDIFF_45RIGHT = 1, ///< Angle of 45 degrees right
|
||||||
DIRDIFF_90RIGHT = 2, ///< Angle of 90 degrees right
|
DIRDIFF_90RIGHT = 2, ///< Angle of 90 degrees right
|
||||||
DIRDIFF_REVERSE = 4, ///< One direction is the opposit of the other one
|
DIRDIFF_REVERSE = 4, ///< One direction is the opposite of the other one
|
||||||
DIRDIFF_90LEFT = 6, ///< Angle of 90 degrees left
|
DIRDIFF_90LEFT = 6, ///< Angle of 90 degrees left
|
||||||
DIRDIFF_45LEFT = 7, ///< Angle of 45 degrees left
|
DIRDIFF_45LEFT = 7, ///< Angle of 45 degrees left
|
||||||
};
|
};
|
||||||
|
@ -119,7 +119,7 @@ DECLARE_POSTFIX_INCREMENT(DiagDirDiff)
|
||||||
/**
|
/**
|
||||||
* Enumeration for the two axis X and Y
|
* Enumeration for the two axis X and Y
|
||||||
*
|
*
|
||||||
* This enumeration represente the two axis X and Y in the game.
|
* This enumeration represents the two axis X and Y in the game.
|
||||||
* The X axis is the one which goes align the north-west edge
|
* The X axis is the one which goes align the north-west edge
|
||||||
* (and south-east edge). The Y axis must be so the one which goes
|
* (and south-east edge). The Y axis must be so the one which goes
|
||||||
* align the north-east edge (and south-west) edge.
|
* align the north-east edge (and south-west) edge.
|
||||||
|
|
|
@ -382,7 +382,7 @@ static void DestructIndustry(Industry *i)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aircraft handling, v->current_order.dest states:
|
* Aircraft handling, v->current_order.dest states:
|
||||||
* 0: Fly towards the targetted industry
|
* 0: Fly towards the targeted industry
|
||||||
* 1: If within 15 tiles, fire away rockets and destroy industry
|
* 1: If within 15 tiles, fire away rockets and destroy industry
|
||||||
* 2: Industry explosions
|
* 2: Industry explosions
|
||||||
* 3: Fly out of the map
|
* 3: Fly out of the map
|
||||||
|
|
|
@ -291,7 +291,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
if (old_owner == _local_company) {
|
if (old_owner == _local_company) {
|
||||||
/* Single player cheated to AI company.
|
/* Single player cheated to AI company.
|
||||||
* There are no specatators in single player, so we must pick some other company. */
|
* There are no spectators in single player, so we must pick some other company. */
|
||||||
assert(!_networking);
|
assert(!_networking);
|
||||||
Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
|
Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
|
||||||
Company *c;
|
Company *c;
|
||||||
|
@ -461,7 +461,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
|
||||||
if (new_owner != INVALID_OWNER) {
|
if (new_owner != INVALID_OWNER) {
|
||||||
/* Update all signals because there can be new segment that was owned by two companies
|
/* Update all signals because there can be new segment that was owned by two companies
|
||||||
* and signals were not propagated
|
* and signals were not propagated
|
||||||
* Similiar with crossings - it is needed to bar crossings that weren't before
|
* Similar with crossings - it is needed to bar crossings that weren't before
|
||||||
* because of different owner of crossing and approaching train */
|
* because of different owner of crossing and approaching train */
|
||||||
tile = 0;
|
tile = 0;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ static void CompanyCheckBankrupt(Company *c)
|
||||||
case 9:
|
case 9:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Warn about bancruptcy after 3 months */
|
/* Warn about bankruptcy after 3 months */
|
||||||
case 4: {
|
case 4: {
|
||||||
CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1);
|
CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1);
|
||||||
cni->FillData(c);
|
cni->FillData(c);
|
||||||
|
@ -572,7 +572,7 @@ static void CompanyCheckBankrupt(Company *c)
|
||||||
/* FALL THROUGH to case 10 */
|
/* FALL THROUGH to case 10 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bancrupt company after 6 months (if the company has no value) or latest
|
/* Bankrupt company after 6 months (if the company has no value) or latest
|
||||||
* after 9 months (if it still had value after 6 months) */
|
* after 9 months (if it still had value after 6 months) */
|
||||||
default:
|
default:
|
||||||
case 10: {
|
case 10: {
|
||||||
|
@ -696,7 +696,7 @@ bool AddInflation(bool check_year)
|
||||||
/* Approximation for (100 + infl_amount)% ** (1 / 12) - 100%
|
/* Approximation for (100 + infl_amount)% ** (1 / 12) - 100%
|
||||||
* scaled by 65536
|
* scaled by 65536
|
||||||
* 12 -> months per year
|
* 12 -> months per year
|
||||||
* This is only a good approxiamtion for small values
|
* This is only a good approximation for small values
|
||||||
*/
|
*/
|
||||||
_economy.inflation_prices += (_economy.inflation_prices * _economy.infl_amount * 54) >> 16;
|
_economy.inflation_prices += (_economy.inflation_prices * _economy.infl_amount * 54) >> 16;
|
||||||
_economy.inflation_payment += (_economy.inflation_payment * _economy.infl_amount_pr * 54) >> 16;
|
_economy.inflation_payment += (_economy.inflation_payment * _economy.infl_amount_pr * 54) >> 16;
|
||||||
|
@ -866,7 +866,7 @@ void StartupIndustryDailyChanges(bool init_counter)
|
||||||
* which stands for the days in a month.
|
* which stands for the days in a month.
|
||||||
* Using just 31 will make it so that a monthly reset (based on the real number of days of that month)
|
* Using just 31 will make it so that a monthly reset (based on the real number of days of that month)
|
||||||
* would not be needed.
|
* would not be needed.
|
||||||
* Since it is based on "fractionnal parts", the leftover days will not make much of a difference
|
* Since it is based on "fractional parts", the leftover days will not make much of a difference
|
||||||
* on the overall total number of changes performed */
|
* on the overall total number of changes performed */
|
||||||
_economy.industry_daily_increment = (1 << map_size) / 31;
|
_economy.industry_daily_increment = (1 << map_size) / 31;
|
||||||
|
|
||||||
|
|
|
@ -547,7 +547,7 @@ static EffectInitProc * const _effect_init_procs[] = {
|
||||||
};
|
};
|
||||||
assert_compile(lengthof(_effect_init_procs) == EV_END);
|
assert_compile(lengthof(_effect_init_procs) == EV_END);
|
||||||
|
|
||||||
/** Functions for controling effect vehicles at each tick. */
|
/** Functions for controlling effect vehicles at each tick. */
|
||||||
static EffectTickProc * const _effect_tick_procs[] = {
|
static EffectTickProc * const _effect_tick_procs[] = {
|
||||||
ChimneySmokeTick, // EV_CHIMNEY_SMOKE
|
ChimneySmokeTick, // EV_CHIMNEY_SMOKE
|
||||||
SteamSmokeTick, // EV_STEAM_SMOKE
|
SteamSmokeTick, // EV_STEAM_SMOKE
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
* Group 0: Tiles with both an even X coordinate and an even Y coordinate
|
* Group 0: Tiles with both an even X coordinate and an even Y coordinate
|
||||||
* Group 1: Tiles with an even X and an odd Y coordinate
|
* Group 1: Tiles with an even X and an odd Y coordinate
|
||||||
* Group 2: Tiles with an odd X and an even Y coordinate
|
* Group 2: Tiles with an odd X and an even Y coordinate
|
||||||
* Group 3: Tiles with both an odd X and Y coordnate.
|
* Group 3: Tiles with both an odd X and Y coordinate.
|
||||||
*
|
*
|
||||||
* <h3>Pylon Points</h3>
|
* <h3>Pylon Points</h3>
|
||||||
* <h4>Control Points</h4>
|
* <h4>Control Points</h4>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
* other tile.
|
* other tile.
|
||||||
*
|
*
|
||||||
* Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs
|
* Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs
|
||||||
* are merged using an OR operation (i. e. if one tile needs a PCP at the postion
|
* are merged using an OR operation (i. e. if one tile needs a PCP at the position
|
||||||
* in question, both tiles get it).
|
* in question, both tiles get it).
|
||||||
*
|
*
|
||||||
* <h4>Position Points</h4>
|
* <h4>Position Points</h4>
|
||||||
|
@ -127,7 +127,7 @@ static TrackBits MaskWireBits(TileIndex t, TrackBits tracks)
|
||||||
|
|
||||||
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
|
||||||
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
|
for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
|
||||||
/* If the neighbor tile is either not electrified or has no tracks that can be reached
|
/* If the neighbour tile is either not electrified or has no tracks that can be reached
|
||||||
* from this tile, mark all trackdirs that can be reached from the neighbour tile
|
* from this tile, mark all trackdirs that can be reached from the neighbour tile
|
||||||
* as needing no catenary. We make an exception for blocked station tiles with a matching
|
* as needing no catenary. We make an exception for blocked station tiles with a matching
|
||||||
* axis that still display wires to preserve visual continuity. */
|
* axis that still display wires to preserve visual continuity. */
|
||||||
|
@ -376,7 +376,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
|
||||||
/* Station and road crossings are always "flat", so adjust the tileh accordingly */
|
/* Station and road crossings are always "flat", so adjust the tileh accordingly */
|
||||||
if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
|
if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
|
||||||
|
|
||||||
/* Read the foundataions if they are present, and adjust the tileh */
|
/* Read the foundations if they are present, and adjust the tileh */
|
||||||
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
|
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
|
||||||
if (IsBridgeTile(neighbour)) {
|
if (IsBridgeTile(neighbour)) {
|
||||||
foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
|
foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
|
||||||
|
@ -426,7 +426,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
|
||||||
|
|
||||||
/* Don't build the pylon if it would be outside the tile */
|
/* Don't build the pylon if it would be outside the tile */
|
||||||
if (!HasBit(OwnedPPPonPCP[i], temp)) {
|
if (!HasBit(OwnedPPPonPCP[i], temp)) {
|
||||||
/* We have a neighour that will draw it, bail out */
|
/* We have a neighbour that will draw it, bail out */
|
||||||
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE) break;
|
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE) break;
|
||||||
continue; // No neighbour, go looking for a better position
|
continue; // No neighbour, go looking for a better position
|
||||||
}
|
}
|
||||||
|
|
|
@ -854,7 +854,7 @@ void EnginesDailyLoop()
|
||||||
* Accept an engine prototype. XXX - it is possible that the top-company
|
* Accept an engine prototype. XXX - it is possible that the top-company
|
||||||
* changes while you are waiting to accept the offer? Then it becomes invalid
|
* changes while you are waiting to accept the offer? Then it becomes invalid
|
||||||
* @param tile unused
|
* @param tile unused
|
||||||
* @param flags operation to perfom
|
* @param flags operation to perform
|
||||||
* @param p1 engine-prototype offered
|
* @param p1 engine-prototype offered
|
||||||
* @param p2 unused
|
* @param p2 unused
|
||||||
* @param text unused
|
* @param text unused
|
||||||
|
@ -1000,7 +1000,7 @@ static bool IsUniqueEngineName(const char *name)
|
||||||
/**
|
/**
|
||||||
* Rename an engine.
|
* Rename an engine.
|
||||||
* @param tile unused
|
* @param tile unused
|
||||||
* @param flags operation to perfom
|
* @param flags operation to perform
|
||||||
* @param p1 engine ID to rename
|
* @param p1 engine ID to rename
|
||||||
* @param p2 unused
|
* @param p2 unused
|
||||||
* @param text the new name or an empty string when resetting to the default
|
* @param text the new name or an empty string when resetting to the default
|
||||||
|
|
|
@ -72,7 +72,7 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
|
||||||
* Usually a valid cargo is returned, even though the vehicle has zero capacity, and can therefore not carry anything. But the cargotype is still used
|
* Usually a valid cargo is returned, even though the vehicle has zero capacity, and can therefore not carry anything. But the cargotype is still used
|
||||||
* for livery selection etc..
|
* for livery selection etc..
|
||||||
*
|
*
|
||||||
* Vehicles with CT_INVALID as default cargo are usally not available, but it can appear as default cargo of articulated parts.
|
* Vehicles with CT_INVALID as default cargo are usually not available, but it can appear as default cargo of articulated parts.
|
||||||
*
|
*
|
||||||
* @return The default cargo type.
|
* @return The default cargo type.
|
||||||
* @see CanCarryCargo
|
* @see CanCarryCargo
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
/** Message severity/type */
|
/** Message severity/type */
|
||||||
enum WarningLevel {
|
enum WarningLevel {
|
||||||
WL_INFO, ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
|
WL_INFO, ///< Used for DoCommand-like (and some non-fatal AI GUI) errors/information
|
||||||
WL_WARNING, ///< Other information
|
WL_WARNING, ///< Other information
|
||||||
WL_ERROR, ///< Errors (eg. saving/loading failed)
|
WL_ERROR, ///< Errors (eg. saving/loading failed)
|
||||||
WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
|
WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
|
||||||
|
|
|
@ -67,7 +67,7 @@ static const WindowDesc _errmsg_face_desc(
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy the given data into our instace.
|
* Copy the given data into our instance.
|
||||||
* @param data The data to copy.
|
* @param data The data to copy.
|
||||||
*/
|
*/
|
||||||
ErrorMessageData::ErrorMessageData(const ErrorMessageData &data)
|
ErrorMessageData::ErrorMessageData(const ErrorMessageData &data)
|
||||||
|
|
|
@ -643,7 +643,7 @@ static void SimplifyFileName(char *name)
|
||||||
/* Force lowercase */
|
/* Force lowercase */
|
||||||
strtolower(name);
|
strtolower(name);
|
||||||
|
|
||||||
/* Tar-files always have '/' path-seperator, but we want our PATHSEPCHAR */
|
/* Tar-files always have '/' path-separator, but we want our PATHSEPCHAR */
|
||||||
#if (PATHSEPCHAR != '/')
|
#if (PATHSEPCHAR != '/')
|
||||||
for (char *n = name; *n != '\0'; n++) if (*n == '/') *n = PATHSEPCHAR;
|
for (char *n = name; *n != '\0'; n++) if (*n == '/') *n = PATHSEPCHAR;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1364,7 +1364,7 @@ static uint ScanTar(FileScanner *fs, const char *extension, TarFileList::iterato
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scan for files with the given extention in the given search path.
|
* Scan for files with the given extension in the given search path.
|
||||||
* @param extension the extension of files to search for.
|
* @param extension the extension of files to search for.
|
||||||
* @param sd the sub directory to search in.
|
* @param sd the sub directory to search in.
|
||||||
* @param tars whether to search in the tars too.
|
* @param tars whether to search in the tars too.
|
||||||
|
@ -1410,7 +1410,7 @@ uint FileScanner::Scan(const char *extension, Subdirectory sd, bool tars, bool r
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scan for files with the given extention in the given search path.
|
* Scan for files with the given extension in the given search path.
|
||||||
* @param extension the extension of files to search for.
|
* @param extension the extension of files to search for.
|
||||||
* @param directory the sub directory to search in.
|
* @param directory the sub directory to search in.
|
||||||
* @param recursive whether to search recursively
|
* @param recursive whether to search recursively
|
||||||
|
|
|
@ -88,9 +88,9 @@ enum FileSlots {
|
||||||
CONFIG_SLOT = 0,
|
CONFIG_SLOT = 0,
|
||||||
/** Slot for the sound. */
|
/** Slot for the sound. */
|
||||||
SOUND_SLOT = 1,
|
SOUND_SLOT = 1,
|
||||||
/** First slot useable for (New)GRFs used during the game. */
|
/** First slot usable for (New)GRFs used during the game. */
|
||||||
FIRST_GRF_SLOT = 2,
|
FIRST_GRF_SLOT = 2,
|
||||||
/** Last slot useable for (New)GRFs used during the game. */
|
/** Last slot usable for (New)GRFs used during the game. */
|
||||||
LAST_GRF_SLOT = 63,
|
LAST_GRF_SLOT = 63,
|
||||||
/** Maximum number of slots. */
|
/** Maximum number of slots. */
|
||||||
MAX_FILE_SLOTS = 64
|
MAX_FILE_SLOTS = 64
|
||||||
|
|
|
@ -160,8 +160,8 @@ static FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
|
||||||
* - Batang & BatangChe & Gungsuh & GungsuhChe (TrueType)
|
* - Batang & BatangChe & Gungsuh & GungsuhChe (TrueType)
|
||||||
* We will strip the font-type '()' if any and work with the font name
|
* We will strip the font-type '()' if any and work with the font name
|
||||||
* itself, which must match exactly; if...
|
* itself, which must match exactly; if...
|
||||||
* TTC files, font files which contain more than one font are seperated
|
* TTC files, font files which contain more than one font are separated
|
||||||
* byt '&'. Our best bet will be to do substr match for the fontname
|
* by '&'. Our best bet will be to do substr match for the fontname
|
||||||
* and then let FreeType figure out which index to load */
|
* and then let FreeType figure out which index to load */
|
||||||
s = _tcschr(vbuffer, _T('('));
|
s = _tcschr(vbuffer, _T('('));
|
||||||
if (s != NULL) s[-1] = '\0';
|
if (s != NULL) s[-1] = '\0';
|
||||||
|
@ -182,7 +182,7 @@ static FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
|
||||||
* contain multiple fonts inside this single file. GetFontData however
|
* contain multiple fonts inside this single file. GetFontData however
|
||||||
* returns the whole file, so we need to check each font inside to get the
|
* returns the whole file, so we need to check each font inside to get the
|
||||||
* proper font.
|
* proper font.
|
||||||
* Also note that FreeType does not support UNICODE filesnames! */
|
* Also note that FreeType does not support UNICODE filenames! */
|
||||||
#if defined(UNICODE)
|
#if defined(UNICODE)
|
||||||
/* We need a cast here back from wide because FreeType doesn't support
|
/* We need a cast here back from wide because FreeType doesn't support
|
||||||
* widechar filenames. Just use the buffer we allocated before for the
|
* widechar filenames. Just use the buffer we allocated before for the
|
||||||
|
@ -570,7 +570,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||||
strecpy(buff, str, lastof(buff));
|
strecpy(buff, str, lastof(buff));
|
||||||
str_validate(buff, lastof(buff), SVS_ALLOW_NEWLINE);
|
str_validate(buff, lastof(buff), SVS_ALLOW_NEWLINE);
|
||||||
|
|
||||||
/* Extract a UniChar represenation of the sample string. */
|
/* Extract a UniChar representation of the sample string. */
|
||||||
CFStringRef cf_str = CFStringCreateWithCString(kCFAllocatorDefault, buff, kCFStringEncodingUTF8);
|
CFStringRef cf_str = CFStringCreateWithCString(kCFAllocatorDefault, buff, kCFStringEncodingUTF8);
|
||||||
if (cf_str == NULL) {
|
if (cf_str == NULL) {
|
||||||
/* Something went wrong. Corrupt/invalid sample string? */
|
/* Something went wrong. Corrupt/invalid sample string? */
|
||||||
|
@ -590,7 +590,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||||
ATSUCreateTextLayoutWithTextPtr(string, kATSUFromTextBeginning, kATSUToTextEnd, str_len, 1, &run_len, &style, &text_layout);
|
ATSUCreateTextLayoutWithTextPtr(string, kATSUFromTextBeginning, kATSUToTextEnd, str_len, 1, &run_len, &style, &text_layout);
|
||||||
|
|
||||||
/* Try to match a font for the sample text. ATSUMatchFontsToText stops after
|
/* Try to match a font for the sample text. ATSUMatchFontsToText stops after
|
||||||
* it finds the first continous character run not renderable with the currently
|
* it finds the first continuous character run not renderable with the currently
|
||||||
* selected font starting at offset. The matching needs to be repeated until
|
* selected font starting at offset. The matching needs to be repeated until
|
||||||
* the end of the string is reached to make sure the fallback font matches for
|
* the end of the string is reached to make sure the fallback font matches for
|
||||||
* all characters in the string and not only the first run. */
|
* all characters in the string and not only the first run. */
|
||||||
|
|
|
@ -159,7 +159,7 @@
|
||||||
|
|
||||||
/* static */ void Game::ResetConfig()
|
/* static */ void Game::ResetConfig()
|
||||||
{
|
{
|
||||||
/* Check for both newgame as current game if we can reload the GameInfo insde
|
/* Check for both newgame as current game if we can reload the GameInfo inside
|
||||||
* the GameConfig. If not, remove the Game from the list. */
|
* the GameConfig. If not, remove the Game from the list. */
|
||||||
if (_settings_game.game_config != NULL && _settings_game.game_config->HasScript()) {
|
if (_settings_game.game_config != NULL && _settings_game.game_config->HasScript()) {
|
||||||
if (!_settings_game.game_config->ResetInfo(true)) {
|
if (!_settings_game.game_config->ResetInfo(true)) {
|
||||||
|
|
12
src/gfx.cpp
12
src/gfx.cpp
|
@ -365,7 +365,7 @@ static WChar *HandleBiDiAndArabicShapes(WChar *buffer)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Truncate a given string to a maximum width if neccessary.
|
* Truncate a given string to a maximum width if necessary.
|
||||||
* If the string is truncated, add three dots ('...') to show this.
|
* If the string is truncated, add three dots ('...') to show this.
|
||||||
* @param *str string that is checked and possibly truncated
|
* @param *str string that is checked and possibly truncated
|
||||||
* @param maxw maximum width in pixels of the string
|
* @param maxw maximum width in pixels of the string
|
||||||
|
@ -754,7 +754,7 @@ uint32 FormatStringLinebreaks(char *str, const char *last, int maxw, FontSize si
|
||||||
end_of_inner_loop:
|
end_of_inner_loop:
|
||||||
/* String didn't fit on line (or a '\n' was encountered), so 'dummy' terminate
|
/* String didn't fit on line (or a '\n' was encountered), so 'dummy' terminate
|
||||||
* and increase linecount. We use Utf8PrevChar() as also non 1 char long
|
* and increase linecount. We use Utf8PrevChar() as also non 1 char long
|
||||||
* whitespace seperators are supported */
|
* whitespace separators are supported */
|
||||||
num++;
|
num++;
|
||||||
char *s = Utf8PrevChar(str);
|
char *s = Utf8PrevChar(str);
|
||||||
*s++ = '\0';
|
*s++ = '\0';
|
||||||
|
@ -1077,14 +1077,14 @@ void DrawCharCentered(WChar c, int x, int y, TextColour colour)
|
||||||
/**
|
/**
|
||||||
* Draw a string at the given coordinates with the given colour.
|
* Draw a string at the given coordinates with the given colour.
|
||||||
* While drawing the string, parse it in case some formatting is specified,
|
* While drawing the string, parse it in case some formatting is specified,
|
||||||
* like new colour, new size or even positionning.
|
* like new colour, new size or even positioning.
|
||||||
* @param string The string to draw. This is already bidi reordered.
|
* @param string The string to draw. This is already bidi reordered.
|
||||||
* @param x Offset from left side of the screen
|
* @param x Offset from left side of the screen
|
||||||
* @param y Offset from top side of the screen
|
* @param y Offset from top side of the screen
|
||||||
* @param params Text drawing parameters
|
* @param params Text drawing parameters
|
||||||
* @param parse_string_also_when_clipped
|
* @param parse_string_also_when_clipped
|
||||||
* By default, always test the available space where to draw the string.
|
* By default, always test the available space where to draw the string.
|
||||||
* When in multipline drawing, it would already be done,
|
* When in multiline drawing, it would already be done,
|
||||||
* so no need to re-perform the same kind (more or less) of verifications.
|
* so no need to re-perform the same kind (more or less) of verifications.
|
||||||
* It's not only an optimisation, it's also a way to ensures the string will be parsed
|
* It's not only an optimisation, it's also a way to ensures the string will be parsed
|
||||||
* (as there are certain side effects on global variables, which are important for the next line)
|
* (as there are certain side effects on global variables, which are important for the next line)
|
||||||
|
@ -1458,7 +1458,7 @@ void DoPaletteAnimations()
|
||||||
}
|
}
|
||||||
|
|
||||||
Colour *palette_pos = &_cur_palette.palette[PALETTE_ANIM_START]; // Points to where animations are taking place on the palette
|
Colour *palette_pos = &_cur_palette.palette[PALETTE_ANIM_START]; // Points to where animations are taking place on the palette
|
||||||
/* Makes a copy of the current anmation palette in old_val,
|
/* Makes a copy of the current animation palette in old_val,
|
||||||
* so the work on the current palette could be compared, see if there has been any changes */
|
* so the work on the current palette could be compared, see if there has been any changes */
|
||||||
memcpy(old_val, palette_pos, sizeof(old_val));
|
memcpy(old_val, palette_pos, sizeof(old_val));
|
||||||
|
|
||||||
|
@ -1840,7 +1840,7 @@ void DrawDirtyBlocks()
|
||||||
* @param left The left edge of the rectangle
|
* @param left The left edge of the rectangle
|
||||||
* @param top The top edge of the rectangle
|
* @param top The top edge of the rectangle
|
||||||
* @param right The right edge of the rectangle
|
* @param right The right edge of the rectangle
|
||||||
* @param bottom The bottm edge of the rectangle
|
* @param bottom The bottom edge of the rectangle
|
||||||
* @see DrawDirtyBlocks
|
* @see DrawDirtyBlocks
|
||||||
*
|
*
|
||||||
* @todo The name of the function should be called like @c AddDirtyBlock as
|
* @todo The name of the function should be called like @c AddDirtyBlock as
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
* This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
|
* This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
|
||||||
* rectangle defines the area on the screen which must be repaint. If a new object
|
* rectangle defines the area on the screen which must be repaint. If a new object
|
||||||
* needs to be repainted this rectangle is extended to 'catch' the object on the
|
* needs to be repainted this rectangle is extended to 'catch' the object on the
|
||||||
* screen. At some point (which is normaly uninteressted for patch writers) this
|
* screen. At some point (which is normally uninteresting for patch writers) this
|
||||||
* rectangle is send to the video drivers method
|
* rectangle is send to the video drivers method
|
||||||
* VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
|
* VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
|
||||||
* later point (which is uninteressted, too) the video driver
|
* later point (which is uninteresting, too) the video driver
|
||||||
* repaints all these saved rectangle instead of the whole screen and drop the
|
* repaints all these saved rectangle instead of the whole screen and drop the
|
||||||
* rectangle informations. Then a new round begins by marking objects "dirty".
|
* rectangle informations. Then a new round begins by marking objects "dirty".
|
||||||
*
|
*
|
||||||
|
|
|
@ -352,7 +352,7 @@ template <class Tbase_set>
|
||||||
|
|
||||||
const Tbase_set *best = NULL;
|
const Tbase_set *best = NULL;
|
||||||
for (const Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
|
for (const Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
|
||||||
/* Skip unuseable sets */
|
/* Skip unusable sets */
|
||||||
if (c->GetNumMissing() != 0) continue;
|
if (c->GetNumMissing() != 0) continue;
|
||||||
|
|
||||||
if (best == NULL ||
|
if (best == NULL ||
|
||||||
|
|
|
@ -285,7 +285,7 @@ protected:
|
||||||
ValuesInterval interval; ///< Interval that contains all of the graph data.
|
ValuesInterval interval; ///< Interval that contains all of the graph data.
|
||||||
int x_axis_offset; ///< Distance from the top of the graph to the x axis.
|
int x_axis_offset; ///< Distance from the top of the graph to the x axis.
|
||||||
|
|
||||||
/* the colours and cost array of GraphDrawer must accomodate
|
/* the colours and cost array of GraphDrawer must accommodate
|
||||||
* both values for cargo and companies. So if any are higher, quit */
|
* both values for cargo and companies. So if any are higher, quit */
|
||||||
assert_compile(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES);
|
assert_compile(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES);
|
||||||
assert(this->num_vert_lines > 0);
|
assert(this->num_vert_lines > 0);
|
||||||
|
@ -423,7 +423,7 @@ protected:
|
||||||
if (datapoint != INVALID_DATAPOINT) {
|
if (datapoint != INVALID_DATAPOINT) {
|
||||||
/*
|
/*
|
||||||
* Check whether we need to reduce the 'accuracy' of the
|
* Check whether we need to reduce the 'accuracy' of the
|
||||||
* datapoint value and the highest value to splut overflows.
|
* datapoint value and the highest value to split overflows.
|
||||||
* And when 'drawing' 'one million' or 'one million and one'
|
* And when 'drawing' 'one million' or 'one million and one'
|
||||||
* there is no significant difference, so the least
|
* there is no significant difference, so the least
|
||||||
* significant bits can just be removed.
|
* significant bits can just be removed.
|
||||||
|
|
|
@ -344,7 +344,7 @@ static void GrayscaleToMapHeights(uint img_width, uint img_height, byte *map)
|
||||||
(col < col_pad) || (col >= (width - col_pad - (_settings_game.construction.freeform_edges ? 0 : 1)))) {
|
(col < col_pad) || (col >= (width - col_pad - (_settings_game.construction.freeform_edges ? 0 : 1)))) {
|
||||||
SetTileHeight(tile, 0);
|
SetTileHeight(tile, 0);
|
||||||
} else {
|
} else {
|
||||||
/* Use nearest neighbor resizing to scale map data.
|
/* Use nearest neighbour resizing to scale map data.
|
||||||
* We rotate the map 45 degrees (counter)clockwise */
|
* We rotate the map 45 degrees (counter)clockwise */
|
||||||
img_row = (((row - row_pad) * num_div) / img_scale);
|
img_row = (((row - row_pad) * num_div) / img_scale);
|
||||||
switch (_settings_game.game_creation.heightmap_rotation) {
|
switch (_settings_game.game_creation.heightmap_rotation) {
|
||||||
|
@ -464,7 +464,7 @@ bool GetHeightmapDimensions(char *filename, uint *x, uint *y)
|
||||||
* Load a heightmap from file and change the map in his current dimensions
|
* Load a heightmap from file and change the map in his current dimensions
|
||||||
* to a landscape representing the heightmap.
|
* to a landscape representing the heightmap.
|
||||||
* It converts pixels to height. The brighter, the higher.
|
* It converts pixels to height. The brighter, the higher.
|
||||||
* @param filename of the heighmap file to be imported
|
* @param filename of the heightmap file to be imported
|
||||||
*/
|
*/
|
||||||
void LoadHeightmap(char *filename)
|
void LoadHeightmap(char *filename)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,7 +131,7 @@ static void ParseHotkeys(Hotkey<T> *hotkey, const char *value)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a hotkey to it's string representation so it can be written to the
|
* Convert a hotkey to it's string representation so it can be written to the
|
||||||
* config file. Seperate parts of the keycode (like "CTRL" and "F1" are split
|
* config file. Separate parts of the keycode (like "CTRL" and "F1" are split
|
||||||
* by a '+'.
|
* by a '+'.
|
||||||
* @param keycode The keycode to convert to a string.
|
* @param keycode The keycode to convert to a string.
|
||||||
* @return A string representation of this keycode.
|
* @return A string representation of this keycode.
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
|
||||||
/**
|
/**
|
||||||
* Check if a given tile belongs to this industry.
|
* Check if a given tile belongs to this industry.
|
||||||
* @param tile The tile to check.
|
* @param tile The tile to check.
|
||||||
* @return True if the tils is part of this industry.
|
* @return True if the tile is part of this industry.
|
||||||
*/
|
*/
|
||||||
inline bool TileBelongsToIndustry(TileIndex tile) const
|
inline bool TileBelongsToIndustry(TileIndex tile) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -329,7 +329,7 @@ static void DrawTile_Industry(TileInfo *ti)
|
||||||
|
|
||||||
SpriteID image = dits->ground.sprite;
|
SpriteID image = dits->ground.sprite;
|
||||||
|
|
||||||
/* DrawFoundation() modifes ti->z and ti->tileh */
|
/* DrawFoundation() modifies ti->z and ti->tileh */
|
||||||
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
|
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
|
||||||
|
|
||||||
/* If the ground sprite is the default flat water sprite, draw also canal/river borders.
|
/* If the ground sprite is the default flat water sprite, draw also canal/river borders.
|
||||||
|
@ -2655,7 +2655,7 @@ void IndustryDailyLoop()
|
||||||
* is sufficient for an industry. */
|
* is sufficient for an industry. */
|
||||||
uint16 change_loop = _economy.industry_daily_change_counter >> 16;
|
uint16 change_loop = _economy.industry_daily_change_counter >> 16;
|
||||||
|
|
||||||
/* Reset the active part of the counter, just keeping the "factional part" */
|
/* Reset the active part of the counter, just keeping the "fractional part" */
|
||||||
_economy.industry_daily_change_counter &= 0xFFFF;
|
_economy.industry_daily_change_counter &= 0xFFFF;
|
||||||
|
|
||||||
if (change_loop == 0) {
|
if (change_loop == 0) {
|
||||||
|
|
|
@ -247,7 +247,7 @@ class BuildIndustryWindow : public Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* first indutry type is selected if the current selection is invalid.
|
/* first industry type is selected if the current selection is invalid.
|
||||||
* I'll be damned if there are none available ;) */
|
* I'll be damned if there are none available ;) */
|
||||||
if (this->selected_index == -1) {
|
if (this->selected_index == -1) {
|
||||||
this->selected_index = 0;
|
this->selected_index = 0;
|
||||||
|
|
|
@ -157,7 +157,7 @@ static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns this indutry tile's construction counter value
|
* Returns this industry tile's construction counter value
|
||||||
* @param tile the tile to query
|
* @param tile the tile to query
|
||||||
* @pre IsTileType(tile, MP_INDUSTRY)
|
* @pre IsTileType(tile, MP_INDUSTRY)
|
||||||
* @return the construction counter
|
* @return the construction counter
|
||||||
|
@ -169,7 +169,7 @@ static inline byte GetIndustryConstructionCounter(TileIndex tile)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets this indutry tile's construction counter value
|
* Sets this industry tile's construction counter value
|
||||||
* @param tile the tile to query
|
* @param tile the tile to query
|
||||||
* @param value the new value for the construction counter
|
* @param value the new value for the construction counter
|
||||||
* @pre IsTileType(tile, MP_INDUSTRY)
|
* @pre IsTileType(tile, MP_INDUSTRY)
|
||||||
|
|
|
@ -143,7 +143,7 @@ struct IndustrySpec {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the data structure of each indivudual tile of an industry.
|
* Defines the data structure of each individual tile of an industry.
|
||||||
*/
|
*/
|
||||||
struct IndustryTileSpec {
|
struct IndustryTileSpec {
|
||||||
CargoID accepts_cargo[3]; ///< Cargo accepted by this tile
|
CargoID accepts_cargo[3]; ///< Cargo accepted by this tile
|
||||||
|
|
|
@ -76,7 +76,7 @@ void HandleOnEditText(const char *str)
|
||||||
|
|
||||||
uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0
|
uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0
|
||||||
|
|
||||||
/* Give 'id' the money, and substract it from ourself */
|
/* Give 'id' the money, and subtract it from ourself */
|
||||||
DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str);
|
DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ static inline uint ScaleByMapSize1D(uint n)
|
||||||
/**
|
/**
|
||||||
* An offset value between to tiles.
|
* An offset value between to tiles.
|
||||||
*
|
*
|
||||||
* This value is used fro the difference between
|
* This value is used for the difference between
|
||||||
* to tiles. It can be added to a tileindex to get
|
* to tiles. It can be added to a tileindex to get
|
||||||
* the resulting tileindex of the start tile applied
|
* the resulting tileindex of the start tile applied
|
||||||
* with this saved difference.
|
* with this saved difference.
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @par
|
* @par
|
||||||
* For further information about the Binary Heap algotithm, see
|
* For further information about the Binary Heap algorithm, see
|
||||||
* http://www.policyalmanac.org/games/binaryHeaps.htm
|
* http://www.policyalmanac.org/games/binaryHeaps.htm
|
||||||
*
|
*
|
||||||
* @tparam T Type of the items stored in the binary heap
|
* @tparam T Type of the items stored in the binary heap
|
||||||
|
@ -187,7 +187,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get the LAST item in the binary tree.
|
* Get the LAST item in the binary tree.
|
||||||
*
|
*
|
||||||
* @note The last item is not neccesary the biggest!
|
* @note The last item is not necessary the biggest!
|
||||||
*
|
*
|
||||||
* @return The last item
|
* @return The last item
|
||||||
*/
|
*/
|
||||||
|
@ -266,7 +266,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for an item in the priority queue.
|
* Search for an item in the priority queue.
|
||||||
* Matching is done by comparing adress of the
|
* Matching is done by comparing address of the
|
||||||
* item.
|
* item.
|
||||||
*
|
*
|
||||||
* @param item The reference to the item
|
* @param item The reference to the item
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* Always, when it allocates memory the allocated size is:
|
* Always, when it allocates memory the allocated size is:
|
||||||
* sizeof(BlobHeader) + <data capacity>
|
* sizeof(BlobHeader) + <data capacity>
|
||||||
* 3. Two 'virtual' members (items and capacity) are stored in the BlobHeader at beginning
|
* 3. Two 'virtual' members (items and capacity) are stored in the BlobHeader at beginning
|
||||||
* of the alloated block.
|
* of the allocated block.
|
||||||
* 4. The pointer of the union pobsize_ts behind the header (to the first data byte).
|
* 4. The pointer of the union pobsize_ts behind the header (to the first data byte).
|
||||||
* When memory block is allocated, the sizeof(BlobHeader) it added to it.
|
* When memory block is allocated, the sizeof(BlobHeader) it added to it.
|
||||||
* 5. Benefits of this layout:
|
* 5. Benefits of this layout:
|
||||||
|
|
|
@ -140,7 +140,7 @@ template <class T> struct AdaptT {
|
||||||
/**
|
/**
|
||||||
* Simple counted object. Use it as base of your struct/class if you want to use
|
* Simple counted object. Use it as base of your struct/class if you want to use
|
||||||
* basic reference counting. Your struct/class will destroy and free itself when
|
* basic reference counting. Your struct/class will destroy and free itself when
|
||||||
* last reference to it is released (using Relese() method). The initial reference
|
* last reference to it is released (using Release() method). The initial reference
|
||||||
* count (when it is created) is zero (don't forget AddRef() at least one time if
|
* count (when it is created) is zero (don't forget AddRef() at least one time if
|
||||||
* not using CCountedPtr<T>.
|
* not using CCountedPtr<T>.
|
||||||
*
|
*
|
||||||
|
|
|
@ -207,7 +207,7 @@ CommandCost CmdMoneyCheat(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
/**
|
/**
|
||||||
* Transfer funds (money) from one company to another.
|
* Transfer funds (money) from one company to another.
|
||||||
* To prevent abuse in multiplayer games you can only send money to other
|
* To prevent abuse in multiplayer games you can only send money to other
|
||||||
* companies if you have paid off your loan (either explicitely, or implicitely
|
* companies if you have paid off your loan (either explicitly, or implicitly
|
||||||
* given the fact that you have more money than loan).
|
* given the fact that you have more money than loan).
|
||||||
* @param tile unused
|
* @param tile unused
|
||||||
* @param flags operation to perform
|
* @param flags operation to perform
|
||||||
|
|
|
@ -35,7 +35,7 @@ enum OskActivation {
|
||||||
OSKA_DISABLED, ///< The OSK shall not be activated at all.
|
OSKA_DISABLED, ///< The OSK shall not be activated at all.
|
||||||
OSKA_DOUBLE_CLICK, ///< Double click on the edit box opens OSK.
|
OSKA_DOUBLE_CLICK, ///< Double click on the edit box opens OSK.
|
||||||
OSKA_SINGLE_CLICK, ///< Single click after focus click opens OSK.
|
OSKA_SINGLE_CLICK, ///< Single click after focus click opens OSK.
|
||||||
OSKA_IMMEDIATELY, ///< Focussing click already opens OSK.
|
OSKA_IMMEDIATELY, ///< Focusing click already opens OSK.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ static void SetMIDITypeIfNeeded(const FSRef *ref)
|
||||||
*
|
*
|
||||||
* @param *path String with the path of an existing MIDI file.
|
* @param *path String with the path of an existing MIDI file.
|
||||||
* @param *moov Pointer to a @c Movie where the result will be stored.
|
* @param *moov Pointer to a @c Movie where the result will be stored.
|
||||||
* @return Wether the file was loaded and the @c Movie successfully created.
|
* @return Whether the file was loaded and the @c Movie successfully created.
|
||||||
*/
|
*/
|
||||||
static bool LoadMovieForMIDIFile(const char *path, Movie *moov)
|
static bool LoadMovieForMIDIFile(const char *path, Movie *moov)
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ static bool LoadMovieForMIDIFile(const char *path, Movie *moov)
|
||||||
* XXX Manual check for MIDI header ('MThd'), as I don't know how to make
|
* XXX Manual check for MIDI header ('MThd'), as I don't know how to make
|
||||||
* QuickTime load MIDI files without a .mid suffix without knowing it's
|
* QuickTime load MIDI files without a .mid suffix without knowing it's
|
||||||
* a MIDI file and setting the OSType of the file to the 'Midi' value.
|
* a MIDI file and setting the OSType of the file to the 'Midi' value.
|
||||||
* Perhahaps ugly, but it seems that it does the Right Thing(tm).
|
* Perhaps ugly, but it seems that it does the Right Thing(tm).
|
||||||
*/
|
*/
|
||||||
fd = open(path, O_RDONLY, 0);
|
fd = open(path, O_RDONLY, 0);
|
||||||
if (fd == -1) return false;
|
if (fd == -1) return false;
|
||||||
|
@ -192,7 +192,7 @@ const char *MusicDriver_QtMidi::Start(const char * const *parm)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks wether the player is active.
|
* Checks whether the player is active.
|
||||||
*
|
*
|
||||||
* This function is called at regular intervals from OpenTTD's main loop, so
|
* This function is called at regular intervals from OpenTTD's main loop, so
|
||||||
* we call @c MoviesTask() from here to let QuickTime do its work.
|
* we call @c MoviesTask() from here to let QuickTime do its work.
|
||||||
|
|
|
@ -51,7 +51,7 @@ bool NetworkCoreInitialize()
|
||||||
if (OpenDevice("timer.device", UNIT_MICROHZ, (struct IORequest*)TimerRequest, 0) == 0) {
|
if (OpenDevice("timer.device", UNIT_MICROHZ, (struct IORequest*)TimerRequest, 0) == 0) {
|
||||||
TimerBase = TimerRequest->tr_node.io_Device;
|
TimerBase = TimerRequest->tr_node.io_Device;
|
||||||
if (TimerBase == NULL) {
|
if (TimerBase == NULL) {
|
||||||
/* free ressources... */
|
/* free resources... */
|
||||||
DEBUG(net, 0, "[core] can't initialize timer, network unavailable");
|
DEBUG(net, 0, "[core] can't initialize timer, network unavailable");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,12 @@ enum NetworkRecvStatus {
|
||||||
NETWORK_RECV_STATUS_DESYNC, ///< A desync did occur
|
NETWORK_RECV_STATUS_DESYNC, ///< A desync did occur
|
||||||
NETWORK_RECV_STATUS_NEWGRF_MISMATCH, ///< We did not have the required NewGRFs
|
NETWORK_RECV_STATUS_NEWGRF_MISMATCH, ///< We did not have the required NewGRFs
|
||||||
NETWORK_RECV_STATUS_SAVEGAME, ///< Something went wrong (down)loading the savegame
|
NETWORK_RECV_STATUS_SAVEGAME, ///< Something went wrong (down)loading the savegame
|
||||||
NETWORK_RECV_STATUS_CONN_LOST, ///< The conection is 'just' lost
|
NETWORK_RECV_STATUS_CONN_LOST, ///< The connection is 'just' lost
|
||||||
NETWORK_RECV_STATUS_MALFORMED_PACKET, ///< We apparently send a malformed packet
|
NETWORK_RECV_STATUS_MALFORMED_PACKET, ///< We apparently send a malformed packet
|
||||||
NETWORK_RECV_STATUS_SERVER_ERROR, ///< The server told us we made an error
|
NETWORK_RECV_STATUS_SERVER_ERROR, ///< The server told us we made an error
|
||||||
NETWORK_RECV_STATUS_SERVER_FULL, ///< The server is full
|
NETWORK_RECV_STATUS_SERVER_FULL, ///< The server is full
|
||||||
NETWORK_RECV_STATUS_SERVER_BANNED, ///< The server has banned us
|
NETWORK_RECV_STATUS_SERVER_BANNED, ///< The server has banned us
|
||||||
NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done quering the server
|
NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done querying the server
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Forward declaration due to circular dependencies */
|
/** Forward declaration due to circular dependencies */
|
||||||
|
@ -48,7 +48,7 @@ public:
|
||||||
/** Create a new unbound socket */
|
/** Create a new unbound socket */
|
||||||
NetworkSocketHandler() { this->has_quit = false; }
|
NetworkSocketHandler() { this->has_quit = false; }
|
||||||
|
|
||||||
/** Close the socket when distructing the socket handler */
|
/** Close the socket when destructing the socket handler */
|
||||||
virtual ~NetworkSocketHandler() { this->Close(); }
|
virtual ~NetworkSocketHandler() { this->Close(); }
|
||||||
|
|
||||||
/** Really close the socket */
|
/** Really close the socket */
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether there is something pending in the send queue.
|
* Whether there is something pending in the send queue.
|
||||||
* @return true when someting is pending in the send queue.
|
* @return true when something is pending in the send queue.
|
||||||
*/
|
*/
|
||||||
bool HasSendQueue() { return this->packet_queue != NULL; }
|
bool HasSendQueue() { return this->packet_queue != NULL; }
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ protected:
|
||||||
virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p);
|
virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notification about a removed company (e.g. due to banrkuptcy).
|
* Notification about a removed company (e.g. due to bankruptcy).
|
||||||
* uint8 ID of the company.
|
* uint8 ID of the company.
|
||||||
* uint8 Reason for being removed (see #AdminCompanyRemoveReason).
|
* uint8 Reason for being removed (see #AdminCompanyRemoveReason).
|
||||||
* @param p The packet that was just received.
|
* @param p The packet that was just received.
|
||||||
|
|
|
@ -139,7 +139,7 @@ protected:
|
||||||
/**
|
/**
|
||||||
* Client requesting a list of content info based on an external
|
* Client requesting a list of content info based on an external
|
||||||
* 'unique' id; GRF ID + MD5 checksum for NewGRFS, shortname and
|
* 'unique' id; GRF ID + MD5 checksum for NewGRFS, shortname and
|
||||||
* xor-ed MD5 checsums for base graphics and AIs.
|
* xor-ed MD5 checksums for base graphics and AIs.
|
||||||
* Scenarios and AI libraries are not supported
|
* Scenarios and AI libraries are not supported
|
||||||
* uint8 count of requests
|
* uint8 count of requests
|
||||||
* for each request:
|
* for each request:
|
||||||
|
|
|
@ -326,8 +326,8 @@ protected:
|
||||||
* Sends the current frame counter to the client:
|
* Sends the current frame counter to the client:
|
||||||
* uint32 Frame counter
|
* uint32 Frame counter
|
||||||
* uint32 Frame counter max (how far may the client walk before the server?)
|
* uint32 Frame counter max (how far may the client walk before the server?)
|
||||||
* uint32 General seed 1 (dependant on compile settings, not default).
|
* uint32 General seed 1 (dependent on compile settings, not default).
|
||||||
* uint32 General seed 2 (dependant on compile settings, not default).
|
* uint32 General seed 2 (dependent on compile settings, not default).
|
||||||
* uint8 Random token to validate the client is actually listening (only occasionally present).
|
* uint8 Random token to validate the client is actually listening (only occasionally present).
|
||||||
* @param p The packet that was just received.
|
* @param p The packet that was just received.
|
||||||
*/
|
*/
|
||||||
|
@ -337,7 +337,7 @@ protected:
|
||||||
* Sends a sync-check to the client:
|
* Sends a sync-check to the client:
|
||||||
* uint32 Frame counter.
|
* uint32 Frame counter.
|
||||||
* uint32 General seed 1.
|
* uint32 General seed 1.
|
||||||
* uint32 General seed 2 (dependant on compile settings, not default).
|
* uint32 General seed 2 (dependent on compile settings, not default).
|
||||||
* @param p The packet that was just received.
|
* @param p The packet that was just received.
|
||||||
*/
|
*/
|
||||||
virtual NetworkRecvStatus Receive_SERVER_SYNC(Packet *p);
|
virtual NetworkRecvStatus Receive_SERVER_SYNC(Packet *p);
|
||||||
|
@ -413,13 +413,13 @@ protected:
|
||||||
virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p);
|
virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client is quiting the game.
|
* The client is quitting the game.
|
||||||
* @param p The packet that was just received.
|
* @param p The packet that was just received.
|
||||||
*/
|
*/
|
||||||
virtual NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p);
|
virtual NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client made an error and is quiting the game.
|
* The client made an error and is quitting the game.
|
||||||
* uint8 Error of the code caused (see NetworkErrorCode).
|
* uint8 Error of the code caused (see NetworkErrorCode).
|
||||||
* @param p The packet that was just received.
|
* @param p The packet that was just received.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -177,7 +177,7 @@ int NetworkHTTPSocketHandler::HandleHeader()
|
||||||
int ret = NetworkHTTPSocketHandler::Connect(uri, this->callback, this->data, this->redirect_depth + 1);
|
int ret = NetworkHTTPSocketHandler::Connect(uri, this->callback, this->data, this->redirect_depth + 1);
|
||||||
if (ret != 0) return ret;
|
if (ret != 0) return ret;
|
||||||
|
|
||||||
/* We've relinguished control of data now. */
|
/* We've relinquished control of data now. */
|
||||||
this->data = NULL;
|
this->data = NULL;
|
||||||
|
|
||||||
/* Restore the header. */
|
/* Restore the header. */
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
virtual void OnConnect(SOCKET s)
|
virtual void OnConnect(SOCKET s)
|
||||||
{
|
{
|
||||||
new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth);
|
new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth);
|
||||||
/* We've relinguished control of data now. */
|
/* We've relinquished control of data now. */
|
||||||
this->data = NULL;
|
this->data = NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,7 +27,7 @@ enum PacketUDPType {
|
||||||
PACKET_UDP_CLIENT_DETAIL_INFO, ///< Queries a game server about details of the game, such as companies
|
PACKET_UDP_CLIENT_DETAIL_INFO, ///< Queries a game server about details of the game, such as companies
|
||||||
PACKET_UDP_SERVER_DETAIL_INFO, ///< Reply of the game server about details of the game, such as companies
|
PACKET_UDP_SERVER_DETAIL_INFO, ///< Reply of the game server about details of the game, such as companies
|
||||||
PACKET_UDP_SERVER_REGISTER, ///< Packet to register itself to the master server
|
PACKET_UDP_SERVER_REGISTER, ///< Packet to register itself to the master server
|
||||||
PACKET_UDP_MASTER_ACK_REGISTER, ///< Packet indicating registration has succedeed
|
PACKET_UDP_MASTER_ACK_REGISTER, ///< Packet indicating registration has succeeded
|
||||||
PACKET_UDP_CLIENT_GET_LIST, ///< Request for serverlist from master server
|
PACKET_UDP_CLIENT_GET_LIST, ///< Request for serverlist from master server
|
||||||
PACKET_UDP_MASTER_RESPONSE_LIST, ///< Response from master server with server ip's + port's
|
PACKET_UDP_MASTER_RESPONSE_LIST, ///< Response from master server with server ip's + port's
|
||||||
PACKET_UDP_SERVER_UNREGISTER, ///< Request to be removed from the server-list
|
PACKET_UDP_SERVER_UNREGISTER, ///< Request to be removed from the server-list
|
||||||
|
@ -73,7 +73,7 @@ protected:
|
||||||
* all 1 the version of this packet's structure
|
* all 1 the version of this packet's structure
|
||||||
*
|
*
|
||||||
* 4+ 1 number of GRFs attached (n)
|
* 4+ 1 number of GRFs attached (n)
|
||||||
* 4+ n * 20 unique identifier for GRF files. Constists of:
|
* 4+ n * 20 unique identifier for GRF files. Consists of:
|
||||||
* - one 4 byte variable with the GRF ID
|
* - one 4 byte variable with the GRF ID
|
||||||
* - 16 bytes (sent sequentially) for the MD5 checksum
|
* - 16 bytes (sent sequentially) for the MD5 checksum
|
||||||
* of the GRF
|
* of the GRF
|
||||||
|
|
|
@ -455,7 +455,7 @@ static void CheckPauseOnJoin()
|
||||||
* Converts a string to ip/port/company
|
* Converts a string to ip/port/company
|
||||||
* Format: IP:port#company
|
* Format: IP:port#company
|
||||||
*
|
*
|
||||||
* connection_string will be re-terminated to seperate out the hostname, and company and port will
|
* connection_string will be re-terminated to separate out the hostname, and company and port will
|
||||||
* be set to the company and port strings given by the user, inside the memory area originally
|
* be set to the company and port strings given by the user, inside the memory area originally
|
||||||
* occupied by connection_string.
|
* occupied by connection_string.
|
||||||
*/
|
*/
|
||||||
|
@ -488,7 +488,7 @@ void ParseConnectionString(const char **company, const char **port, char *connec
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the acception of a connection to the server.
|
* Handle the accepting of a connection to the server.
|
||||||
* @param s The socket of the new connection.
|
* @param s The socket of the new connection.
|
||||||
* @param address The address of the peer.
|
* @param address The address of the peer.
|
||||||
*/
|
*/
|
||||||
|
@ -549,7 +549,7 @@ void NetworkClose(bool close_admins)
|
||||||
InitializeNetworkPools(close_admins);
|
InitializeNetworkPools(close_admins);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inits the network (cleans sockets and stuff) */
|
/* Initializes the network (cleans sockets and stuff) */
|
||||||
static void NetworkInitialize(bool close_admins = true)
|
static void NetworkInitialize(bool close_admins = true)
|
||||||
{
|
{
|
||||||
InitializeNetworkPools(close_admins);
|
InitializeNetworkPools(close_admins);
|
||||||
|
@ -809,7 +809,7 @@ void NetworkDisconnect(bool blocking, bool close_admins)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives something from the network.
|
* Receives something from the network.
|
||||||
* @return true if everthing went fine, false when the connection got closed.
|
* @return true if everything went fine, false when the connection got closed.
|
||||||
*/
|
*/
|
||||||
static bool NetworkReceive()
|
static bool NetworkReceive()
|
||||||
{
|
{
|
||||||
|
|
|
@ -974,7 +974,7 @@ void ServerNetworkAdminSocketHandler::WelcomeAll()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send (push) updates to the admin network as they have registered for these updates.
|
* Send (push) updates to the admin network as they have registered for these updates.
|
||||||
* @param freq the frequency to be processd.
|
* @param freq the frequency to be processed.
|
||||||
*/
|
*/
|
||||||
void NetworkAdminUpdate(AdminUpdateFrequency freq)
|
void NetworkAdminUpdate(AdminUpdateFrequency freq)
|
||||||
{
|
{
|
||||||
|
|
|
@ -451,7 +451,7 @@ struct NetworkChatWindow : public Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (second_scan) {
|
if (second_scan) {
|
||||||
/* We walked all posibilities, and the user presses tab again.. revert to original text */
|
/* We walked all possibilities, and the user presses tab again.. revert to original text */
|
||||||
this->message_editbox.text.Assign(_chat_tab_completion_buf);
|
this->message_editbox.text.Assign(_chat_tab_completion_buf);
|
||||||
_chat_tab_completion_active = false;
|
_chat_tab_completion_active = false;
|
||||||
|
|
||||||
|
|
|
@ -617,8 +617,8 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CLIENT_INFO(Pac
|
||||||
}
|
}
|
||||||
|
|
||||||
/* There are at most as many ClientInfo as ClientSocket objects in a
|
/* There are at most as many ClientInfo as ClientSocket objects in a
|
||||||
* server. Having more Infos than a server can have means something
|
* server. Having more info than a server can have means something
|
||||||
* has gone wrong somewhere, i.e. the server has more Infos than it
|
* has gone wrong somewhere, i.e. the server has more info than it
|
||||||
* has actual clients. That means the server is feeding us an invalid
|
* has actual clients. That means the server is feeding us an invalid
|
||||||
* state. So, bail out! This server is broken. */
|
* state. So, bail out! This server is broken. */
|
||||||
if (!NetworkClientInfo::CanAllocateItem()) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
if (!NetworkClientInfo::CanAllocateItem()) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
||||||
|
@ -1056,7 +1056,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet
|
||||||
/* Only when we're trying to join we really
|
/* Only when we're trying to join we really
|
||||||
* care about the server shutting down. */
|
* care about the server shutting down. */
|
||||||
if (this->status >= STATUS_JOIN) {
|
if (this->status >= STATUS_JOIN) {
|
||||||
/* To trottle the reconnects a bit, every clients waits its
|
/* To throttle the reconnects a bit, every clients waits its
|
||||||
* Client ID modulo 16. This way reconnects should be spread
|
* Client ID modulo 16. This way reconnects should be spread
|
||||||
* out a bit. */
|
* out a bit. */
|
||||||
_network_reconnect = _network_own_client_id % 16;
|
_network_reconnect = _network_own_client_id % 16;
|
||||||
|
|
|
@ -29,7 +29,7 @@ private:
|
||||||
STATUS_JOIN, ///< We are trying to join a server.
|
STATUS_JOIN, ///< We are trying to join a server.
|
||||||
STATUS_NEWGRFS_CHECK, ///< Last action was checking NewGRFs.
|
STATUS_NEWGRFS_CHECK, ///< Last action was checking NewGRFs.
|
||||||
STATUS_AUTH_GAME, ///< Last action was requesting game (server) password.
|
STATUS_AUTH_GAME, ///< Last action was requesting game (server) password.
|
||||||
STATUS_AUTH_COMPANY, ///< Last action was requestion company password.
|
STATUS_AUTH_COMPANY, ///< Last action was requesting company password.
|
||||||
STATUS_AUTHORIZED, ///< The client is authorized at the server.
|
STATUS_AUTHORIZED, ///< The client is authorized at the server.
|
||||||
STATUS_MAP_WAIT, ///< The client is waiting as someone else is downloading the map.
|
STATUS_MAP_WAIT, ///< The client is waiting as someone else is downloading the map.
|
||||||
STATUS_MAP, ///< The client is downloading the map.
|
STATUS_MAP, ///< The client is downloading the map.
|
||||||
|
|
|
@ -528,7 +528,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWait()
|
||||||
/** This sends the map to the client */
|
/** This sends the map to the client */
|
||||||
NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
|
||||||
{
|
{
|
||||||
static uint sent_packets; // How many packets we did send succecfully last time
|
static uint sent_packets; // How many packets we did send successfully last time
|
||||||
|
|
||||||
if (this->status < STATUS_AUTHORIZED) {
|
if (this->status < STATUS_AUTHORIZED) {
|
||||||
/* Illegal call, return error and ignore the packet */
|
/* Illegal call, return error and ignore the packet */
|
||||||
|
@ -1500,7 +1500,7 @@ void NetworkSocketHandler::SendCompanyInformation(Packet *p, const Company *c, c
|
||||||
p->Send_uint64(income);
|
p->Send_uint64(income);
|
||||||
p->Send_uint16(c->old_economy[0].performance_history);
|
p->Send_uint16(c->old_economy[0].performance_history);
|
||||||
|
|
||||||
/* Send 1 if there is a passord for the company else send 0 */
|
/* Send 1 if there is a password for the company else send 0 */
|
||||||
p->Send_bool (!StrEmpty(_network_company_states[c->index].password));
|
p->Send_bool (!StrEmpty(_network_company_states[c->index].password));
|
||||||
|
|
||||||
for (uint i = 0; i < NETWORK_VEH_END; i++) {
|
for (uint i = 0; i < NETWORK_VEH_END; i++) {
|
||||||
|
@ -1620,7 +1620,7 @@ static void NetworkAutoCleanCompanies()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go through all the comapnies */
|
/* Go through all the companies */
|
||||||
FOR_ALL_COMPANIES(c) {
|
FOR_ALL_COMPANIES(c) {
|
||||||
/* Skip the non-active once */
|
/* Skip the non-active once */
|
||||||
if (c->is_ai) continue;
|
if (c->is_ai) continue;
|
||||||
|
@ -1786,7 +1786,7 @@ void NetworkServer_Tick(bool send_frame)
|
||||||
switch (cs->status) {
|
switch (cs->status) {
|
||||||
case NetworkClientSocket::STATUS_ACTIVE:
|
case NetworkClientSocket::STATUS_ACTIVE:
|
||||||
if (lag > _settings_client.network.max_lag_time) {
|
if (lag > _settings_client.network.max_lag_time) {
|
||||||
/* Client did still not report in within the specififed limit. */
|
/* Client did still not report in within the specified limit. */
|
||||||
IConsolePrintF(CC_ERROR, cs->last_packet + lag * MILLISECONDS_PER_TICK > _realtime_tick ?
|
IConsolePrintF(CC_ERROR, cs->last_packet + lag * MILLISECONDS_PER_TICK > _realtime_tick ?
|
||||||
/* A packet was received in the last three game days, so the client is likely lagging behind. */
|
/* A packet was received in the last three game days, so the client is likely lagging behind. */
|
||||||
"Client #%d is dropped because the client's game state is more than %d ticks behind" :
|
"Client #%d is dropped because the client's game state is more than %d ticks behind" :
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "../thread/thread.h"
|
#include "../thread/thread.h"
|
||||||
|
|
||||||
class ServerNetworkGameSocketHandler;
|
class ServerNetworkGameSocketHandler;
|
||||||
/** Make the code look slightliy nicer/simpler. */
|
/** Make the code look slightly nicer/simpler. */
|
||||||
typedef ServerNetworkGameSocketHandler NetworkClientSocket;
|
typedef ServerNetworkGameSocketHandler NetworkClientSocket;
|
||||||
/** Pool with all client sockets. */
|
/** Pool with all client sockets. */
|
||||||
typedef Pool<NetworkClientSocket, ClientIndex, 8, MAX_CLIENT_SLOTS, PT_NCLIENT> NetworkClientSocketPool;
|
typedef Pool<NetworkClientSocket, ClientIndex, 8, MAX_CLIENT_SLOTS, PT_NCLIENT> NetworkClientSocketPool;
|
||||||
|
|
|
@ -34,15 +34,15 @@
|
||||||
|
|
||||||
#include "core/udp.h"
|
#include "core/udp.h"
|
||||||
|
|
||||||
/** Mutex for all out threaded udp resoltion and such. */
|
/** Mutex for all out threaded udp resolution and such. */
|
||||||
static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
|
static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
|
||||||
|
|
||||||
/** Session key to register ourselves to the master server */
|
/** Session key to register ourselves to the master server */
|
||||||
static uint64 _session_key = 0;
|
static uint64 _session_key = 0;
|
||||||
|
|
||||||
static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes)
|
static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes)
|
||||||
static const uint ADVERTISE_RETRY_INTERVAL = 300; ///< readvertise when no response after this many ticks (9 seconds)
|
static const uint ADVERTISE_RETRY_INTERVAL = 300; ///< re-advertise when no response after this many ticks (9 seconds)
|
||||||
static const uint ADVERTISE_RETRY_TIMES = 3; ///< give up readvertising after this much failed retries
|
static const uint ADVERTISE_RETRY_TIMES = 3; ///< give up re-advertising after this much failed retries
|
||||||
|
|
||||||
NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket
|
NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket
|
||||||
NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket
|
NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket
|
||||||
|
|
|
@ -8821,7 +8821,7 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage, S
|
||||||
static void ActivateOldShore()
|
static void ActivateOldShore()
|
||||||
{
|
{
|
||||||
/* Use default graphics, if no shore sprites were loaded.
|
/* Use default graphics, if no shore sprites were loaded.
|
||||||
* Should not happen, as openttd(w/d).grf includes some. */
|
* Should not happen, as the base set's extra grf should include some. */
|
||||||
if (_loaded_newgrf_features.shore == SHORE_REPLACE_NONE) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_A;
|
if (_loaded_newgrf_features.shore == SHORE_REPLACE_NONE) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_A;
|
||||||
|
|
||||||
if (_loaded_newgrf_features.shore != SHORE_REPLACE_ACTION_5) {
|
if (_loaded_newgrf_features.shore != SHORE_REPLACE_ACTION_5) {
|
||||||
|
|
|
@ -167,7 +167,7 @@ struct GRFLoadedFeatures {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for grf miscelaneous bits
|
* Check for grf miscellaneous bits
|
||||||
* @param bit The bit to check.
|
* @param bit The bit to check.
|
||||||
* @return Whether the bit is set.
|
* @return Whether the bit is set.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -114,7 +114,7 @@ struct AirportSpec {
|
||||||
TTDPAirportType ttd_airport_type; ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
|
TTDPAirportType ttd_airport_type; ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
|
||||||
AirportClassID cls_id; ///< the class to which this airport type belongs
|
AirportClassID cls_id; ///< the class to which this airport type belongs
|
||||||
SpriteID preview_sprite; ///< preview sprite for this airport
|
SpriteID preview_sprite; ///< preview sprite for this airport
|
||||||
uint16 maintenance_cost; ///< maintenance cost mulltiplier
|
uint16 maintenance_cost; ///< maintenance cost multiplier
|
||||||
/* Newgrf data */
|
/* Newgrf data */
|
||||||
bool enabled; ///< Entity still available (by default true). Newgrf can disable it, though.
|
bool enabled; ///< Entity still available (by default true). Newgrf can disable it, though.
|
||||||
struct GRFFileProps grf_prop; ///< Properties related to the grf file.
|
struct GRFFileProps grf_prop; ///< Properties related to the grf file.
|
||||||
|
|
|
@ -133,11 +133,11 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32
|
||||||
const AirportTileSpec *ats = AirportTileSpec::Get(gfx);
|
const AirportTileSpec *ats = AirportTileSpec::Get(gfx);
|
||||||
|
|
||||||
if (gfx < NEW_AIRPORTTILE_OFFSET) { // Does it belongs to an old type?
|
if (gfx < NEW_AIRPORTTILE_OFFSET) { // Does it belongs to an old type?
|
||||||
/* It is an old tile. We have to see if it's been overriden */
|
/* It is an old tile. We have to see if it's been overridden */
|
||||||
if (ats->grf_prop.override == INVALID_AIRPORTTILE) { // has it been overridden?
|
if (ats->grf_prop.override == INVALID_AIRPORTTILE) { // has it been overridden?
|
||||||
return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
|
return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
|
||||||
}
|
}
|
||||||
/* Overriden */
|
/* Overridden */
|
||||||
const AirportTileSpec *tile_ovr = AirportTileSpec::Get(ats->grf_prop.override);
|
const AirportTileSpec *tile_ovr = AirportTileSpec::Get(ats->grf_prop.override);
|
||||||
|
|
||||||
if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
|
if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ struct AirportTileResolverObject : public ResolverObject {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the data structure of each indivudual tile of an airport.
|
* Defines the data structure of each individual tile of an airport.
|
||||||
*/
|
*/
|
||||||
struct AirportTileSpec {
|
struct AirportTileSpec {
|
||||||
AnimationInfo animation; ///< Information about the animation.
|
AnimationInfo animation; ///< Information about the animation.
|
||||||
|
|
|
@ -95,7 +95,7 @@ void OverrideManagerBase::ResetOverride()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the ID (if ever available) of a previously inserted entity.
|
* Return the ID (if ever available) of a previously inserted entity.
|
||||||
* @param grf_local_id ID of this enity withing the grfID
|
* @param grf_local_id ID of this entity within the grfID
|
||||||
* @param grfid ID of the grf file
|
* @param grfid ID of the grf file
|
||||||
* @return the ID of the candidate, of the Invalid flag item ID
|
* @return the ID of the candidate, of the Invalid flag item ID
|
||||||
*/
|
*/
|
||||||
|
@ -198,7 +198,7 @@ void HouseOverrideManager::SetEntitySpec(const HouseSpec *hs)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the ID (if ever available) of a previously inserted entity.
|
* Return the ID (if ever available) of a previously inserted entity.
|
||||||
* @param grf_local_id ID of this enity withing the grfID
|
* @param grf_local_id ID of this entity within the grfID
|
||||||
* @param grfid ID of the grf file
|
* @param grfid ID of the grf file
|
||||||
* @return the ID of the candidate, of the Invalid flag item ID
|
* @return the ID of the candidate, of the Invalid flag item ID
|
||||||
*/
|
*/
|
||||||
|
@ -226,7 +226,7 @@ uint16 IndustryOverrideManager::AddEntityID(byte grf_local_id, uint32 grfid, byt
|
||||||
{
|
{
|
||||||
/* This entity hasn't been defined before, so give it an ID now. */
|
/* This entity hasn't been defined before, so give it an ID now. */
|
||||||
for (uint16 id = 0; id < max_new_entities; id++) {
|
for (uint16 id = 0; id < max_new_entities; id++) {
|
||||||
/* Skip overriden industries */
|
/* Skip overridden industries */
|
||||||
if (id < max_offset && entity_overrides[id] != invalid_ID) continue;
|
if (id < max_offset && entity_overrides[id] != invalid_ID) continue;
|
||||||
|
|
||||||
/* Get the real live industry */
|
/* Get the real live industry */
|
||||||
|
@ -234,7 +234,7 @@ uint16 IndustryOverrideManager::AddEntityID(byte grf_local_id, uint32 grfid, byt
|
||||||
|
|
||||||
/* This industry must be one that is not available(enabled), mostly because of climate.
|
/* This industry must be one that is not available(enabled), mostly because of climate.
|
||||||
* And it must not already be used by a grf (grffile == NULL).
|
* And it must not already be used by a grf (grffile == NULL).
|
||||||
* So reseve this slot here, as it is the chosen one */
|
* So reserve this slot here, as it is the chosen one */
|
||||||
if (!inds->enabled && inds->grf_prop.grffile == NULL) {
|
if (!inds->enabled && inds->grf_prop.grffile == NULL) {
|
||||||
EntityIDMapping *map = &mapping_ID[id];
|
EntityIDMapping *map = &mapping_ID[id];
|
||||||
|
|
||||||
|
@ -252,8 +252,8 @@ uint16 IndustryOverrideManager::AddEntityID(byte grf_local_id, uint32 grfid, byt
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to install the new indistry data in its proper slot
|
* Method to install the new industry data in its proper slot
|
||||||
* The slot assigment is internal of this method, since it requires
|
* The slot assignment is internal of this method, since it requires
|
||||||
* checking what is available
|
* checking what is available
|
||||||
* @param inds Industryspec that comes from the grf decoding process
|
* @param inds Industryspec that comes from the grf decoding process
|
||||||
*/
|
*/
|
||||||
|
@ -264,11 +264,11 @@ void IndustryOverrideManager::SetEntitySpec(IndustrySpec *inds)
|
||||||
|
|
||||||
if (ind_id == invalid_ID) {
|
if (ind_id == invalid_ID) {
|
||||||
/* Not found.
|
/* Not found.
|
||||||
* Or it has already been overriden, so you've lost your place old boy.
|
* Or it has already been overridden, so you've lost your place old boy.
|
||||||
* Or it is a simple substitute.
|
* Or it is a simple substitute.
|
||||||
* We need to find a free available slot */
|
* We need to find a free available slot */
|
||||||
ind_id = this->AddEntityID(inds->grf_prop.local_id, inds->grf_prop.grffile->grfid, inds->grf_prop.subst_id);
|
ind_id = this->AddEntityID(inds->grf_prop.local_id, inds->grf_prop.grffile->grfid, inds->grf_prop.subst_id);
|
||||||
inds->grf_prop.override = invalid_ID; // make sure it will not be detected as overriden
|
inds->grf_prop.override = invalid_ID; // make sure it will not be detected as overridden
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ind_id == invalid_ID) {
|
if (ind_id == invalid_ID) {
|
||||||
|
@ -308,7 +308,7 @@ void IndustryTileOverrideManager::SetEntitySpec(const IndustryTileSpec *its)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to install the new object data in its proper slot
|
* Method to install the new object data in its proper slot
|
||||||
* The slot assigment is internal of this method, since it requires
|
* The slot assignment is internal of this method, since it requires
|
||||||
* checking what is available
|
* checking what is available
|
||||||
* @param spec ObjectSpec that comes from the grf decoding process
|
* @param spec ObjectSpec that comes from the grf decoding process
|
||||||
*/
|
*/
|
||||||
|
@ -319,7 +319,7 @@ void ObjectOverrideManager::SetEntitySpec(ObjectSpec *spec)
|
||||||
|
|
||||||
if (type == invalid_ID) {
|
if (type == invalid_ID) {
|
||||||
/* Not found.
|
/* Not found.
|
||||||
* Or it has already been overriden, so you've lost your place old boy.
|
* Or it has already been overridden, so you've lost your place old boy.
|
||||||
* Or it is a simple substitute.
|
* Or it is a simple substitute.
|
||||||
* We need to find a free available slot */
|
* We need to find a free available slot */
|
||||||
type = this->AddEntityID(spec->grf_prop.local_id, spec->grf_prop.grffile->grfid, OBJECT_TRANSMITTER);
|
type = this->AddEntityID(spec->grf_prop.local_id, spec->grf_prop.grffile->grfid, OBJECT_TRANSMITTER);
|
||||||
|
|
|
@ -199,7 +199,7 @@ protected:
|
||||||
uint16 max_offset; ///< what is the length of the original entity's array of specs
|
uint16 max_offset; ///< what is the length of the original entity's array of specs
|
||||||
uint16 max_new_entities; ///< what is the amount of entities, old and new summed
|
uint16 max_new_entities; ///< what is the amount of entities, old and new summed
|
||||||
|
|
||||||
uint16 invalid_ID; ///< ID used to dected invalid entities;
|
uint16 invalid_ID; ///< ID used to detected invalid entities;
|
||||||
virtual bool CheckValidNewID(uint16 testid) { return true; }
|
virtual bool CheckValidNewID(uint16 testid) { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -51,7 +51,7 @@ enum GRFBugs {
|
||||||
/** Status of post-gameload GRF compatibility check */
|
/** Status of post-gameload GRF compatibility check */
|
||||||
enum GRFListCompatibility {
|
enum GRFListCompatibility {
|
||||||
GLC_ALL_GOOD, ///< All GRF needed by game are present
|
GLC_ALL_GOOD, ///< All GRF needed by game are present
|
||||||
GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different chacksum) GRF found in at least one case
|
GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different checksum) GRF found in at least one case
|
||||||
GLC_NOT_FOUND, ///< At least one GRF couldn't be found (higher priority than GLC_COMPATIBLE)
|
GLC_NOT_FOUND, ///< At least one GRF couldn't be found (higher priority than GLC_COMPATIBLE)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ static inline uint GetInspectWindowNumber(GrfSpecFeature feature, uint index)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of a property to show. This is used to
|
* The type of a property to show. This is used to
|
||||||
* provide an appropriate represenation in the GUI.
|
* provide an appropriate representation in the GUI.
|
||||||
*/
|
*/
|
||||||
enum NIType {
|
enum NIType {
|
||||||
NIT_INT, ///< The property is a simple integer
|
NIT_INT, ///< The property is a simple integer
|
||||||
|
@ -278,7 +278,7 @@ struct NewGRFInspectWindow : Window {
|
||||||
/** GRFID of the caller of this window, 0 if it has no caller. */
|
/** GRFID of the caller of this window, 0 if it has no caller. */
|
||||||
uint32 caller_grfid;
|
uint32 caller_grfid;
|
||||||
|
|
||||||
/** The currently editted parameter, to update the right one. */
|
/** The currently edited parameter, to update the right one. */
|
||||||
byte current_edit_param;
|
byte current_edit_param;
|
||||||
|
|
||||||
Scrollbar *vscroll;
|
Scrollbar *vscroll;
|
||||||
|
|
|
@ -628,7 +628,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object,
|
||||||
return v->GetCurrentMaxSpeed();
|
return v->GetCurrentMaxSpeed();
|
||||||
|
|
||||||
/* Variables which use the parameter */
|
/* Variables which use the parameter */
|
||||||
case 0x60: // Count consist's engine ID occurance
|
case 0x60: // Count consist's engine ID occurrence
|
||||||
if (v->type != VEH_TRAIN) return v->GetEngine()->grf_prop.local_id == parameter ? 1 : 0;
|
if (v->type != VEH_TRAIN) return v->GetEngine()->grf_prop.local_id == parameter ? 1 : 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1059,7 +1059,7 @@ bool UsesWagonOverride(const Vehicle *v)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluate a newgrf callback for vehicles
|
* Evaluate a newgrf callback for vehicles
|
||||||
* @param callback The callback to evalute
|
* @param callback The callback to evaluate
|
||||||
* @param param1 First parameter of the callback
|
* @param param1 First parameter of the callback
|
||||||
* @param param2 Second parameter of the callback
|
* @param param2 Second parameter of the callback
|
||||||
* @param engine Engine type of the vehicle to evaluate the callback for
|
* @param engine Engine type of the vehicle to evaluate the callback for
|
||||||
|
@ -1077,11 +1077,11 @@ uint16 GetVehicleCallback(CallbackID callback, uint32 param1, uint32 param2, Eng
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluate a newgrf callback for vehicles with a different vehicle for parent scope.
|
* Evaluate a newgrf callback for vehicles with a different vehicle for parent scope.
|
||||||
* @param callback The callback to evalute
|
* @param callback The callback to evaluate
|
||||||
* @param param1 First parameter of the callback
|
* @param param1 First parameter of the callback
|
||||||
* @param param2 Second parameter of the callback
|
* @param param2 Second parameter of the callback
|
||||||
* @param engine Engine type of the vehicle to evaluate the callback for
|
* @param engine Engine type of the vehicle to evaluate the callback for
|
||||||
* @param v The vehicle to evaluate the callback for, or NULL if it doesnt exist yet
|
* @param v The vehicle to evaluate the callback for, or NULL if it doesn't exist yet
|
||||||
* @param parent The vehicle to use for parent scope
|
* @param parent The vehicle to use for parent scope
|
||||||
* @return The value the callback returned, or CALLBACK_FAILED if it failed
|
* @return The value the callback returned, or CALLBACK_FAILED if it failed
|
||||||
*/
|
*/
|
||||||
|
@ -1239,7 +1239,7 @@ void CommitVehicleListOrderChanges()
|
||||||
}
|
}
|
||||||
QSortT(ordering.Begin(), ordering.Length(), EnginePreSort);
|
QSortT(ordering.Begin(), ordering.Length(), EnginePreSort);
|
||||||
|
|
||||||
/* Apply Insertion-Sort opeations */
|
/* Apply Insertion-Sort operations */
|
||||||
const ListOrderChange *end = _list_order_changes.End();
|
const ListOrderChange *end = _list_order_changes.End();
|
||||||
for (const ListOrderChange *it = _list_order_changes.Begin(); it != end; ++it) {
|
for (const ListOrderChange *it = _list_order_changes.Begin(); it != end; ++it) {
|
||||||
EngineID source = it->engine;
|
EngineID source = it->engine;
|
||||||
|
|
|
@ -1466,7 +1466,7 @@ private:
|
||||||
#if defined(ENABLE_NETWORK)
|
#if defined(ENABLE_NETWORK)
|
||||||
/**
|
/**
|
||||||
* Show the content list window with all missing grfs from the given list.
|
* Show the content list window with all missing grfs from the given list.
|
||||||
* @param list The list of grfs to check for missings / not exactly matching ones.
|
* @param list The list of grfs to check for missing / not exactly matching ones.
|
||||||
*/
|
*/
|
||||||
void ShowMissingContentWindow(const GRFConfig *list)
|
void ShowMissingContentWindow(const GRFConfig *list)
|
||||||
{
|
{
|
||||||
|
@ -1584,12 +1584,12 @@ public:
|
||||||
uint avs_extra_width = min_list_width - min_avs_width; // Additional width needed for avs to reach min_list_width.
|
uint avs_extra_width = min_list_width - min_avs_width; // Additional width needed for avs to reach min_list_width.
|
||||||
uint acs_extra_width = min_list_width - min_acs_width; // Additional width needed for acs to reach min_list_width.
|
uint acs_extra_width = min_list_width - min_acs_width; // Additional width needed for acs to reach min_list_width.
|
||||||
|
|
||||||
/* Use 2 or 3 colmuns? */
|
/* Use 2 or 3 columns? */
|
||||||
uint min_three_columns = min_avs_width + min_acs_width + min_inf_width + 2 * INTER_COLUMN_SPACING;
|
uint min_three_columns = min_avs_width + min_acs_width + min_inf_width + 2 * INTER_COLUMN_SPACING;
|
||||||
uint min_two_columns = min_list_width + min_inf_width + INTER_COLUMN_SPACING;
|
uint min_two_columns = min_list_width + min_inf_width + INTER_COLUMN_SPACING;
|
||||||
bool use_three_columns = this->editable && (min_three_columns + MIN_EXTRA_FOR_3_COLUMNS <= given_width);
|
bool use_three_columns = this->editable && (min_three_columns + MIN_EXTRA_FOR_3_COLUMNS <= given_width);
|
||||||
|
|
||||||
/* Info panel is a seperate column in both modes. Compute its width first. */
|
/* Info panel is a separate column in both modes. Compute its width first. */
|
||||||
uint extra_width, inf_width;
|
uint extra_width, inf_width;
|
||||||
if (use_three_columns) {
|
if (use_three_columns) {
|
||||||
extra_width = given_width - min_three_columns;
|
extra_width = given_width - min_three_columns;
|
||||||
|
@ -1619,11 +1619,11 @@ public:
|
||||||
acs_width = ComputeMaxSize(min_acs_width, acs_width, this->acs->GetHorizontalStepSize(sizing)) -
|
acs_width = ComputeMaxSize(min_acs_width, acs_width, this->acs->GetHorizontalStepSize(sizing)) -
|
||||||
this->acs->padding_left - this->acs->padding_right;
|
this->acs->padding_left - this->acs->padding_right;
|
||||||
|
|
||||||
/* Never use fill_y on these; the minimal size is choosen, so that the 3 column view looks nice */
|
/* Never use fill_y on these; the minimal size is chosen, so that the 3 column view looks nice */
|
||||||
uint avs_height = ComputeMaxSize(this->avs->smallest_y, given_height, this->avs->resize_y);
|
uint avs_height = ComputeMaxSize(this->avs->smallest_y, given_height, this->avs->resize_y);
|
||||||
uint acs_height = ComputeMaxSize(this->acs->smallest_y, given_height, this->acs->resize_y);
|
uint acs_height = ComputeMaxSize(this->acs->smallest_y, given_height, this->acs->resize_y);
|
||||||
|
|
||||||
/* Assign size and position to the childs. */
|
/* Assign size and position to the children. */
|
||||||
if (rtl) {
|
if (rtl) {
|
||||||
x += this->inf->padding_left;
|
x += this->inf->padding_left;
|
||||||
this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
|
this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
|
||||||
|
@ -1662,7 +1662,7 @@ public:
|
||||||
if (this->editable) extra_height -= avs_height - this->avs->smallest_y;
|
if (this->editable) extra_height -= avs_height - this->avs->smallest_y;
|
||||||
uint acs_height = ComputeMaxSize(this->acs->smallest_y, this->acs->smallest_y + extra_height, this->acs->resize_y);
|
uint acs_height = ComputeMaxSize(this->acs->smallest_y, this->acs->smallest_y + extra_height, this->acs->resize_y);
|
||||||
|
|
||||||
/* Assign size and position to the childs. */
|
/* Assign size and position to the children. */
|
||||||
if (rtl) {
|
if (rtl) {
|
||||||
x += this->inf->padding_left;
|
x += this->inf->padding_left;
|
||||||
this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
|
this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
|
||||||
|
|
|
@ -32,7 +32,7 @@ HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
|
||||||
/**
|
/**
|
||||||
* Constructor of a house scope resolver.
|
* Constructor of a house scope resolver.
|
||||||
* @param ro Surrounding resolver.
|
* @param ro Surrounding resolver.
|
||||||
* @param house_id Houe type being queried.
|
* @param house_id House type being queried.
|
||||||
* @param tile %Tile containing the house.
|
* @param tile %Tile containing the house.
|
||||||
* @param town %Town containing the house.
|
* @param town %Town containing the house.
|
||||||
* @param not_yet_constructed House is still under construction.
|
* @param not_yet_constructed House is still under construction.
|
||||||
|
|
|
@ -63,11 +63,11 @@ uint32 GetIndustryIDAtOffset(TileIndex tile, const Industry *i, uint32 cur_grfid
|
||||||
const IndustryTileSpec *indtsp = GetIndustryTileSpec(gfx);
|
const IndustryTileSpec *indtsp = GetIndustryTileSpec(gfx);
|
||||||
|
|
||||||
if (gfx < NEW_INDUSTRYTILEOFFSET) { // Does it belongs to an old type?
|
if (gfx < NEW_INDUSTRYTILEOFFSET) { // Does it belongs to an old type?
|
||||||
/* It is an old tile. We have to see if it's been overriden */
|
/* It is an old tile. We have to see if it's been overridden */
|
||||||
if (indtsp->grf_prop.override == INVALID_INDUSTRYTILE) { // has it been overridden?
|
if (indtsp->grf_prop.override == INVALID_INDUSTRYTILE) { // has it been overridden?
|
||||||
return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
|
return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
|
||||||
}
|
}
|
||||||
/* Overriden */
|
/* Overridden */
|
||||||
const IndustryTileSpec *tile_ovr = GetIndustryTileSpec(indtsp->grf_prop.override);
|
const IndustryTileSpec *tile_ovr = GetIndustryTileSpec(indtsp->grf_prop.override);
|
||||||
|
|
||||||
if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
|
if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
|
||||||
|
|
|
@ -236,7 +236,7 @@ extern bool IsSlopeRefused(Slope current, Slope refused);
|
||||||
* @param initial_random_bits Random bits of industry after construction
|
* @param initial_random_bits Random bits of industry after construction
|
||||||
* @param founder Industry founder
|
* @param founder Industry founder
|
||||||
* @param creation_type The circumstances the industry is created under.
|
* @param creation_type The circumstances the industry is created under.
|
||||||
* @return Suceeded or failed command.
|
* @return Succeeded or failed command.
|
||||||
*/
|
*/
|
||||||
CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
|
CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,7 +198,7 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play a NewGRF sound effect at the location of a specfic tile.
|
* Play a NewGRF sound effect at the location of a specific tile.
|
||||||
* @param file NewGRF triggering the sound effect.
|
* @param file NewGRF triggering the sound effect.
|
||||||
* @param sound_id Sound effect the NewGRF wants to play.
|
* @param sound_id Sound effect the NewGRF wants to play.
|
||||||
* @param tile Location of the effect.
|
* @param tile Location of the effect.
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue