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

@@ -889,9 +889,8 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
* Do this for all tiles (like trees), not only objects. */
ClearedObjectArea *coa = FindClearedObject(end_tile);
if (coa == NULL) {
coa = _cleared_object_areas.Append();
coa->first_tile = end_tile;
coa->area = TileArea(end_tile, 1, 1);
/*C++17: coa = &*/ _cleared_object_areas.push_back({end_tile, TileArea(end_tile, 1, 1)});
coa = &_cleared_object_areas.back();
}
/* Hide the tile from the terraforming command */
@@ -907,8 +906,9 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
* Deliberately clear the coa pointer to avoid leaving dangling pointers which could
* inadvertently be dereferenced.
*/
assert(coa >= _cleared_object_areas.Begin() && coa < _cleared_object_areas.End());
size_t coa_index = coa - _cleared_object_areas.Begin();
ClearedObjectArea *begin = _cleared_object_areas.data();
assert(coa >= begin && coa < begin + _cleared_object_areas.size());
size_t coa_index = coa - begin;
assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself
coa = NULL;
@@ -1162,7 +1162,7 @@ static CommandCost DoClearBridge(TileIndex tile, DoCommandFlag flags)
/* read this value before actual removal of bridge */
Owner owner = GetTileOwner(tile);
int height = GetBridgeHeight(tile);
SmallVector<Train *, 2> vehicles_affected;
std::vector<Train *> vehicles_affected;
if (rail) {
auto find_train_reservations = [&vehicles_affected](TileIndex tile) {
@@ -1172,7 +1172,7 @@ static CommandCost DoClearBridge(TileIndex tile, DoCommandFlag flags)
Train *v = GetTrainForReservation(tile, track);
if (v != NULL) {
FreeTrainTrackReservation(v);
*vehicles_affected.Append() = v;
vehicles_affected.push_back(v);
}
}
};
@@ -1222,7 +1222,7 @@ static CommandCost DoClearBridge(TileIndex tile, DoCommandFlag flags)
notify_track_change(tile, direction, tile_tracks);
notify_track_change(endtile, ReverseDiagDir(direction), endtile_tracks);
for (uint i = 0; i < vehicles_affected.Length(); ++i) {
for (uint i = 0; i < vehicles_affected.size(); ++i) {
TryPathReserve(vehicles_affected[i], true);
}
}