Merge branch 'master' into jgrpp

Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2019-03-27 18:12:04 +00:00
422 changed files with 4697 additions and 6619 deletions

View File

@@ -2071,7 +2071,7 @@ bool AfterLoadGame()
if (_settings_game.pf.yapf.ship_use_yapf) {
_settings_game.pf.pathfinder_for_ships = VPF_YAPF;
} else {
_settings_game.pf.pathfinder_for_ships = (_settings_game.pf.new_pathfinding_all ? VPF_NPF : VPF_OPF);
_settings_game.pf.pathfinder_for_ships = VPF_NPF;
}
}
@@ -2414,14 +2414,14 @@ bool AfterLoadGame()
/* Animated tiles would sometimes not be actually animated or
* in case of old savegames duplicate. */
extern SmallVector<TileIndex, 256> _animated_tiles;
extern std::vector<TileIndex> _animated_tiles;
for (TileIndex *tile = _animated_tiles.Begin(); tile < _animated_tiles.End(); /* Nothing */) {
for (auto tile = _animated_tiles.begin(); tile < _animated_tiles.end(); /* Nothing */) {
/* Remove if tile is not animated */
bool remove = _tile_type_procs[GetTileType(*tile)]->animate_tile_proc == NULL;
/* and remove if duplicate */
for (TileIndex *j = _animated_tiles.Begin(); !remove && j < tile; j++) {
for (auto j = _animated_tiles.begin(); !remove && j < tile; j++) {
remove = *tile == *j;
}
@@ -3243,10 +3243,10 @@ bool AfterLoadGame()
* So, make articulated parts catch up. */
RoadVehicle *v;
bool roadside = _settings_game.vehicle.road_side == 1;
SmallVector<uint, 16> skip_frames;
std::vector<uint> skip_frames;
FOR_ALL_ROADVEHICLES(v) {
if (!v->IsFrontEngine()) continue;
skip_frames.Clear();
skip_frames.clear();
TileIndex prev_tile = v->tile;
uint prev_tile_skip = 0;
uint cur_skip = 0;
@@ -3258,24 +3258,24 @@ bool AfterLoadGame()
cur_skip = prev_tile_skip;
}
uint *this_skip = skip_frames.Append();
*this_skip = prev_tile_skip;
/*C++17: uint &this_skip = */ skip_frames.push_back(prev_tile_skip);
uint &this_skip = skip_frames.back();
/* The following 3 curves now take longer than before */
switch (u->state) {
case 2:
cur_skip++;
if (u->frame <= (roadside ? 9 : 5)) *this_skip = cur_skip;
if (u->frame <= (roadside ? 9 : 5)) this_skip = cur_skip;
break;
case 4:
cur_skip++;
if (u->frame <= (roadside ? 5 : 9)) *this_skip = cur_skip;
if (u->frame <= (roadside ? 5 : 9)) this_skip = cur_skip;
break;
case 5:
cur_skip++;
if (u->frame <= (roadside ? 4 : 2)) *this_skip = cur_skip;
if (u->frame <= (roadside ? 4 : 2)) this_skip = cur_skip;
break;
default:
@@ -3285,9 +3285,12 @@ bool AfterLoadGame()
while (cur_skip > skip_frames[0]) {
RoadVehicle *u = v;
RoadVehicle *prev = NULL;
for (uint *it = skip_frames.Begin(); it != skip_frames.End(); ++it, prev = u, u = u->Next()) {
for (uint sf : skip_frames) {
extern bool IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *prev);
if (*it >= cur_skip) IndividualRoadVehicleController(u, prev);
if (sf >= cur_skip) IndividualRoadVehicleController(u, prev);
prev = u;
u = u->Next();
}
cur_skip--;
}
@@ -3560,6 +3563,13 @@ bool AfterLoadGame()
FOR_ALL_INDUSTRIES(ind) if (ind->neutral_station != NULL) ind->neutral_station->industry = ind;
}
if (IsSavegameVersionBefore(SLV_TREES_WATER_CLASS) && !SlXvIsFeaturePresent(XSLFI_CHUNNEL, 2)) {
/* Update water class for trees. */
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_TREES)) SetWaterClass(t, GetTreeGround(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
}
}
/* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */
Station::RecomputeCatchmentForAll();
@@ -3666,14 +3676,6 @@ bool AfterLoadGame()
}
}
if (!SlXvIsFeaturePresent(XSLFI_CHUNNEL, 2)) {
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_TREES)) {
SetWaterClass(t, GetTreeDensity(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
}
}
}
if (SlXvIsFeatureMissing(XSLFI_SAVEGAME_UNIQUE_ID)) {
/* Generate a random id for savegames that didn't have one */
/* We keep id 0 for old savegames that don't have an id */