mirror of https://github.com/OpenTTD/OpenTTD
parent
1623cb553b
commit
d8ccad91f9
|
@ -278,7 +278,7 @@ static void ParseResolution(Dimension *res, const char *s)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unitializes drivers, frees allocated memory, cleans pools, ...
|
* Uninitializes drivers, frees allocated memory, cleans pools, ...
|
||||||
* Generally, prepares the game for shutting down
|
* Generally, prepares the game for shutting down
|
||||||
*/
|
*/
|
||||||
static void ShutdownGame()
|
static void ShutdownGame()
|
||||||
|
|
|
@ -1767,16 +1767,16 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||||
bool distant_join = (station_to_join != INVALID_STATION);
|
bool distant_join = (station_to_join != INVALID_STATION);
|
||||||
|
|
||||||
uint8 width = (uint8)GB(p1, 0, 8);
|
uint8 width = (uint8)GB(p1, 0, 8);
|
||||||
uint8 lenght = (uint8)GB(p1, 8, 8);
|
uint8 length = (uint8)GB(p1, 8, 8);
|
||||||
|
|
||||||
/* Check if the requested road stop is too big */
|
/* Check if the requested road stop is too big */
|
||||||
if (width > _settings_game.station.station_spread || lenght > _settings_game.station.station_spread) return_cmd_error(STR_ERROR_STATION_TOO_SPREAD_OUT);
|
if (width > _settings_game.station.station_spread || length > _settings_game.station.station_spread) return_cmd_error(STR_ERROR_STATION_TOO_SPREAD_OUT);
|
||||||
/* Check for incorrect width / length. */
|
/* Check for incorrect width / length. */
|
||||||
if (width == 0 || lenght == 0) return CMD_ERROR;
|
if (width == 0 || length == 0) return CMD_ERROR;
|
||||||
/* Check if the first tile and the last tile are valid */
|
/* Check if the first tile and the last tile are valid */
|
||||||
if (!IsValidTile(tile) || TileAddWrap(tile, width - 1, lenght - 1) == INVALID_TILE) return CMD_ERROR;
|
if (!IsValidTile(tile) || TileAddWrap(tile, width - 1, length - 1) == INVALID_TILE) return CMD_ERROR;
|
||||||
|
|
||||||
TileArea roadstop_area(tile, width, lenght);
|
TileArea roadstop_area(tile, width, length);
|
||||||
|
|
||||||
if (distant_join && (!_settings_game.station.distant_join_stations || !Station::IsValidID(station_to_join))) return CMD_ERROR;
|
if (distant_join && (!_settings_game.station.distant_join_stations || !Station::IsValidID(station_to_join))) return CMD_ERROR;
|
||||||
|
|
||||||
|
@ -3433,7 +3433,7 @@ void RerouteCargo(Station *st, CargoID c, StationID avoid, StationID avoid2)
|
||||||
/* Reroute cargo in station. */
|
/* Reroute cargo in station. */
|
||||||
ge.cargo.Reroute(UINT_MAX, &ge.cargo, avoid, avoid2, &ge);
|
ge.cargo.Reroute(UINT_MAX, &ge.cargo, avoid, avoid2, &ge);
|
||||||
|
|
||||||
/* Reroute cargo staged to be transfered. */
|
/* Reroute cargo staged to be transferred. */
|
||||||
for (std::list<Vehicle *>::iterator it(st->loading_vehicles.begin()); it != st->loading_vehicles.end(); ++it) {
|
for (std::list<Vehicle *>::iterator it(st->loading_vehicles.begin()); it != st->loading_vehicles.end(); ++it) {
|
||||||
for (Vehicle *v = *it; v != NULL; v = v->Next()) {
|
for (Vehicle *v = *it; v != NULL; v = v->Next()) {
|
||||||
if (v->cargo_type != c) continue;
|
if (v->cargo_type != c) continue;
|
||||||
|
@ -3443,7 +3443,7 @@ void RerouteCargo(Station *st, CargoID c, StationID avoid, StationID avoid2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check all next hops of cargo packets in this station for existance of a
|
* Check all next hops of cargo packets in this station for existence of a
|
||||||
* a valid link they may use to travel on. Reroute any cargo not having a valid
|
* a valid link they may use to travel on. Reroute any cargo not having a valid
|
||||||
* link and remove timed out links found like this from the linkgraph. We're
|
* link and remove timed out links found like this from the linkgraph. We're
|
||||||
* not all links here as that is expensive and useless. A link no one is using
|
* not all links here as that is expensive and useless. A link no one is using
|
||||||
|
@ -4230,7 +4230,7 @@ void FlowStat::Invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change share for specified station. By specifing INT_MIN as parameter you
|
* Change share for specified station. By specifying INT_MIN as parameter you
|
||||||
* can erase a share. Newly added flows will be unrestricted.
|
* can erase a share. Newly added flows will be unrestricted.
|
||||||
* @param st Next Hop to be removed.
|
* @param st Next Hop to be removed.
|
||||||
* @param flow Share to be added or removed.
|
* @param flow Share to be added or removed.
|
||||||
|
|
|
@ -657,7 +657,7 @@ const CargoTypes CompanyStationsWindow::cargo_filter_max = ALL_CARGOTYPES;
|
||||||
CargoTypes CompanyStationsWindow::cargo_filter = ALL_CARGOTYPES;
|
CargoTypes CompanyStationsWindow::cargo_filter = ALL_CARGOTYPES;
|
||||||
const Station *CompanyStationsWindow::last_station = NULL;
|
const Station *CompanyStationsWindow::last_station = NULL;
|
||||||
|
|
||||||
/* Availible station sorting functions */
|
/* Available station sorting functions */
|
||||||
GUIStationList::SortFunction * const CompanyStationsWindow::sorter_funcs[] = {
|
GUIStationList::SortFunction * const CompanyStationsWindow::sorter_funcs[] = {
|
||||||
&StationNameSorter,
|
&StationNameSorter,
|
||||||
&StationTypeSorter,
|
&StationTypeSorter,
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
* second sets the major variations to that, ... until finally the smallest
|
* second sets the major variations to that, ... until finally the smallest
|
||||||
* bumps are added.
|
* bumps are added.
|
||||||
*
|
*
|
||||||
* Usefully, this routine is totally scaleable; so when 32bpp comes along, the
|
* Usefully, this routine is totally scalable; so when 32bpp comes along, the
|
||||||
* terrain can be as bumpy as you like! It is also infinitely expandable; a
|
* terrain can be as bumpy as you like! It is also infinitely expandable; a
|
||||||
* single random seed terrain continues in X & Y as far as you care to
|
* single random seed terrain continues in X & Y as far as you care to
|
||||||
* calculate. In theory, we could use just one seed value, but randomly select
|
* calculate. In theory, we could use just one seed value, but randomly select
|
||||||
|
@ -262,7 +262,7 @@ static amplitude_t GetAmplitude(int frequency)
|
||||||
* areas with a particular gradient so that we are able to create maps without too
|
* areas with a particular gradient so that we are able to create maps without too
|
||||||
* many steep slopes up to the wanted height level. It's definitely not perfect since
|
* many steep slopes up to the wanted height level. It's definitely not perfect since
|
||||||
* it will bring larger rectangles with similar slopes which makes the rectangular
|
* it will bring larger rectangles with similar slopes which makes the rectangular
|
||||||
* behaviour of TGP more noticable. However, these height differentiations cannot
|
* behaviour of TGP more noticeable. However, these height differentiations cannot
|
||||||
* happen over much smaller areas; we basically double the "range" to give a similar
|
* happen over much smaller areas; we basically double the "range" to give a similar
|
||||||
* slope for every doubling of map height.
|
* slope for every doubling of map height.
|
||||||
*/
|
*/
|
||||||
|
@ -977,7 +977,7 @@ static void TgenSetTileHeight(TileIndex tile, int height)
|
||||||
* The main new land generator using Perlin noise. Desert landscape is handled
|
* The main new land generator using Perlin noise. Desert landscape is handled
|
||||||
* different to all others to give a desert valley between two high mountains.
|
* different to all others to give a desert valley between two high mountains.
|
||||||
* Clearly if a low height terrain (flat/very flat) is chosen, then the tropic
|
* Clearly if a low height terrain (flat/very flat) is chosen, then the tropic
|
||||||
* areas wont be high enough, and there will be very little tropic on the map.
|
* areas won't be high enough, and there will be very little tropic on the map.
|
||||||
* Thus Tropic works best on Hilly or Mountainous.
|
* Thus Tropic works best on Hilly or Mountainous.
|
||||||
*/
|
*/
|
||||||
void GenerateTerrainPerlin()
|
void GenerateTerrainPerlin()
|
||||||
|
|
|
@ -2945,7 +2945,7 @@ static CommandCost TownActionFundBuildings(Town *t, DoCommandFlag flags)
|
||||||
* Also emulate original behaviour when town was only growing in
|
* Also emulate original behaviour when town was only growing in
|
||||||
* TOWN_GROWTH_TICKS intervals, to make sure that it's not too
|
* TOWN_GROWTH_TICKS intervals, to make sure that it's not too
|
||||||
* tick-perfect and gives player some time window where he can
|
* tick-perfect and gives player some time window where he can
|
||||||
* spam funding with the exact same effeciency.
|
* spam funding with the exact same efficiency.
|
||||||
*/
|
*/
|
||||||
t->grow_counter = min(t->grow_counter, 2 * TOWN_GROWTH_TICKS - (t->growth_rate - t->grow_counter) % TOWN_GROWTH_TICKS);
|
t->grow_counter = min(t->grow_counter, 2 * TOWN_GROWTH_TICKS - (t->growth_rate - t->grow_counter) % TOWN_GROWTH_TICKS);
|
||||||
|
|
||||||
|
|
|
@ -723,7 +723,7 @@ bool Vehicle::IsEngineCountable() const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether Vehicle::engine_type has any meaning.
|
* Check whether Vehicle::engine_type has any meaning.
|
||||||
* @return true if the vehicle has a useable engine type.
|
* @return true if the vehicle has a usable engine type.
|
||||||
*/
|
*/
|
||||||
bool Vehicle::HasEngineType() const
|
bool Vehicle::HasEngineType() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Rows are horizontal sections of the viewport, also half a tile wide.
|
* Rows are horizontal sections of the viewport, also half a tile wide.
|
||||||
* This time the nothern most tile on the map defines 0 and
|
* This time the northern most tile on the map defines 0 and
|
||||||
* everything south of that has a positive number.
|
* everything south of that has a positive number.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
|
||||||
|
|
||||||
/* Clicked on a widget that is not disabled.
|
/* Clicked on a widget that is not disabled.
|
||||||
* So unless the clicked widget is the caption bar, change focus to this widget.
|
* So unless the clicked widget is the caption bar, change focus to this widget.
|
||||||
* Exception: In the OSK we always want the editbox to stay focussed. */
|
* Exception: In the OSK we always want the editbox to stay focused. */
|
||||||
if (widget_type != WWT_CAPTION && w->window_class != WC_OSK) {
|
if (widget_type != WWT_CAPTION && w->window_class != WC_OSK) {
|
||||||
/* focused_widget_changed is 'now' only true if the window this widget
|
/* focused_widget_changed is 'now' only true if the window this widget
|
||||||
* is in gained focus. In that case it must remain true, also if the
|
* is in gained focus. In that case it must remain true, also if the
|
||||||
|
|
Loading…
Reference in New Issue