Merge 1.9.0-beta2

This commit is contained in:
Pavel Stupnikov
2019-02-14 00:47:22 +03:00
1364 changed files with 22213 additions and 10721 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: station_gui.cpp 27894 2017-08-20 07:11:08Z alberth $ */
/* $Id$ */
/*
* This file is part of OpenTTD.
@@ -56,7 +56,7 @@
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
{
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
uint32 cargo_mask = 0;
CargoTypes cargo_mask = 0;
if (_thd.drawstyle == HT_RECT && tile < MapSize()) {
CargoArray cargoes;
if (supplies) {
@@ -156,8 +156,8 @@ protected:
static Listing last_sorting;
static byte facilities; // types of stations of interest
static bool include_empty; // whether we should include stations without waiting cargo
static const uint32 cargo_filter_max;
static uint32 cargo_filter; // bitmap of cargo types to include
static const CargoTypes cargo_filter_max;
static CargoTypes cargo_filter; // bitmap of cargo types to include
static const Station *last_station;
/* Constants for sorting stations */
@@ -621,9 +621,8 @@ public:
}
}
virtual void OnTick()
virtual void OnGameTick()
{
if (_pause_mode != PM_UNPAUSED) return;
if (this->stations.NeedResort()) {
DEBUG(misc, 3, "Periodic rebuild station list company %d", this->window_number);
this->SetDirty();
@@ -654,11 +653,11 @@ public:
Listing CompanyStationsWindow::last_sorting = {false, 0};
byte CompanyStationsWindow::facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
bool CompanyStationsWindow::include_empty = true;
const uint32 CompanyStationsWindow::cargo_filter_max = UINT32_MAX;
uint32 CompanyStationsWindow::cargo_filter = UINT32_MAX;
const CargoTypes CompanyStationsWindow::cargo_filter_max = ALL_CARGOTYPES;
CargoTypes CompanyStationsWindow::cargo_filter = ALL_CARGOTYPES;
const Station *CompanyStationsWindow::last_station = NULL;
/* Availible station sorting functions */
/* Available station sorting functions */
GUIStationList::SortFunction * const CompanyStationsWindow::sorter_funcs[] = {
&StationNameSorter,
&StationTypeSorter,
@@ -802,7 +801,6 @@ static const NWidgetPart _nested_station_view_widgets[] = {
* @param left left most coordinate to draw on
* @param right right most coordinate to draw on
* @param y y coordinate
* @param width the width of the view
*/
static void DrawCargoIcons(CargoID i, uint waiting, int left, int right, int y)
{
@@ -1800,7 +1798,7 @@ struct StationViewWindow : public Window {
{
const Station *st = Station::Get(this->window_number);
uint32 cargo_mask = 0;
CargoTypes cargo_mask = 0;
for (CargoID i = 0; i < NUM_CARGO; i++) {
if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i);
}
@@ -2232,7 +2230,7 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join)
if (distant_join && min(ta.w, ta.h) >= _settings_game.station.station_spread) return NULL;
uint max_dist = distant_join ? _settings_game.station.station_spread - min(ta.w, ta.h) : 1;
TileIndex tile = TILE_ADD(ctx.tile, TileOffsByDir(DIR_N));
TileIndex tile = TileAddByDir(ctx.tile, DIR_N);
CircularTileSearch(&tile, max_dist, ta.w, ta.h, AddNearbyStation<T>, &ctx);
return NULL;
@@ -2338,7 +2336,7 @@ struct SelectStationWindow : WindowPopup {
DeleteWindowById(WC_SELECT_STATION, 0);
}
virtual void OnTick()
virtual void OnRealtimeTick(uint delta_ms)
{
if (_thd.dirty & 2) {
_thd.dirty &= ~2;