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

@@ -71,8 +71,8 @@ bool VehicleListIdentifier::UnpackIfValid(uint32 data)
*/
void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons)
{
engines->Clear();
if (wagons != NULL && wagons != engines) wagons->Clear();
engines->clear();
if (wagons != NULL && wagons != engines) wagons->clear();
const Vehicle *v;
FOR_ALL_VEHICLES(v) {
@@ -86,7 +86,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
if (t->IsArticulatedPart() || t->IsRearDualheaded()) continue;
if (t->track != TRACK_BIT_DEPOT) continue;
if (wagons != NULL && t->First()->IsFreeWagon()) {
if (individual_wagons || t->IsFreeWagon()) *wagons->Append() = t;
if (individual_wagons || t->IsFreeWagon()) wagons->push_back(t);
continue;
}
break;
@@ -99,13 +99,13 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
if (!v->IsPrimaryVehicle()) continue;
*engines->Append() = v;
engines->push_back(v);
}
/* Ensure the lists are not wasting too much space. If the lists are fresh
* (i.e. built within a command) then this will actually do nothing. */
engines->Compact();
if (wagons != NULL && wagons != engines) wagons->Compact();
engines->shrink_to_fit();
if (wagons != NULL && wagons != engines) wagons->shrink_to_fit();
}
/**
@@ -116,14 +116,14 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
*/
bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli)
{
list->Clear();
list->clear();
const Vehicle *v;
auto fill_all_vehicles = [&]() {
FOR_ALL_VEHICLES(v) {
if (!HasBit(v->subtype, GVSF_VIRTUAL) && v->type == vli.vtype && v->owner == vli.company && v->IsPrimaryVehicle()) {
*list->Append() = v;
list->push_back(v);
}
}
};
@@ -137,7 +137,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
FOR_VEHICLE_ORDERS(v, order) {
if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT) || order->IsType(OT_IMPLICIT))
&& order->GetDestination() == vli.index) {
*list->Append() = v;
list->push_back(v);
break;
}
}
@@ -151,7 +151,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
if (v == NULL || v->type != vli.vtype || !v->IsPrimaryVehicle()) return false;
for (; v != NULL; v = v->NextShared()) {
*list->Append() = v;
list->push_back(v);
}
break;
@@ -160,7 +160,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
FOR_ALL_VEHICLES(v) {
if (!HasBit(v->subtype, GVSF_VIRTUAL) && v->type == vli.vtype && v->IsPrimaryVehicle() &&
v->owner == vli.company && GroupIsInGroup(v->group_id, vli.index)) {
*list->Append() = v;
list->push_back(v);
}
}
break;
@@ -179,7 +179,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
FOR_VEHICLE_ORDERS(v, order) {
if (order->IsType(OT_GOTO_DEPOT) && !(order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) && order->GetDestination() == vli.index) {
*list->Append() = v;
list->push_back(v);
break;
}
}
@@ -194,7 +194,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
const TraceRestrictSlot *slot = TraceRestrictSlot::GetIfValid(vli.index);
if (slot == NULL) return false;
for (VehicleID id : slot->occupants) {
*list->Append() = Vehicle::Get(id);
list->push_back(Vehicle::Get(id));
}
}
break;
@@ -202,13 +202,13 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
case VL_SINGLE_VEH: {
v = Vehicle::GetIfValid(vli.index);
if (v != NULL) *list->Append() = v;
if (v != NULL) list->push_back(v);
break;
}
default: return false;
}
list->Compact();
list->shrink_to_fit();
return true;
}