Merge branch 'master' into jgrpp
Remove the viewport sign cache as this is now superseded by the kd tree implementation # Conflicts: # src/crashlog.cpp # src/lang/english.txt # src/misc.cpp # src/pathfinder/follow_track.hpp # src/pbs.cpp # src/rail_cmd.cpp # src/saveload/vehicle_sl.cpp # src/settings.cpp # src/settings_gui.cpp # src/ship_cmd.cpp # src/station.cpp # src/station_base.h # src/station_cmd.cpp # src/table/settings.ini # src/thread/thread_morphos.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/viewport.cpp # src/waypoint.cpp
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "../network/network_func.h"
|
||||
#include "../gfxinit.h"
|
||||
#include "../viewport_func.h"
|
||||
#include "../viewport_kdtree.h"
|
||||
#include "../industry.h"
|
||||
#include "../clear_map.h"
|
||||
#include "../vehicle_func.h"
|
||||
@@ -228,6 +229,7 @@ void UpdateAllVirtCoords()
|
||||
UpdateAllStationVirtCoords();
|
||||
UpdateAllSignVirtCoords();
|
||||
UpdateAllTownVirtCoords();
|
||||
RebuildViewportKdtree();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +294,6 @@ static void InitializeWindowsAndCaches()
|
||||
|
||||
GroupStatistics::UpdateAfterLoad();
|
||||
|
||||
Station::RecomputeIndustriesNearForAll();
|
||||
RebuildSubsidisedSourceAndDestinationCache();
|
||||
|
||||
/* Towns have a noise controlled number of airports system
|
||||
@@ -605,6 +606,12 @@ bool AfterLoadGame()
|
||||
GamelogTestRevision();
|
||||
GamelogTestMode();
|
||||
|
||||
RebuildTownKdtree();
|
||||
RebuildStationKdtree();
|
||||
/* This needs to be done even before conversion, because some conversions will destroy objects
|
||||
* that otherwise won't exist in the tree. */
|
||||
RebuildViewportKdtree();
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_98)) GamelogGRFAddList(_grfconfig);
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_119)) {
|
||||
@@ -3529,6 +3536,33 @@ bool AfterLoadGame()
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_TOWN_CARGOGEN)) {
|
||||
/* Ensure the original cargo generation mode is used */
|
||||
_settings_game.economy.town_cargogen_mode = TCGM_ORIGINAL;
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_SERVE_NEUTRAL_INDUSTRIES)) {
|
||||
/* Ensure the original neutral industry/station behaviour is used */
|
||||
_settings_game.station.serve_neutral_industries = true;
|
||||
|
||||
/* Link oil rigs to their industry and back. */
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
if (IsTileType(st->xy, MP_STATION) && IsOilRig(st->xy)) {
|
||||
/* Industry tile is always adjacent during construction by TileDiffXY(0, 1) */
|
||||
st->industry = Industry::GetByTile(st->xy + TileDiffXY(0, 1));
|
||||
st->industry->neutral_station = st;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Link neutral station back to industry, as this is not saved. */
|
||||
Industry *ind;
|
||||
FOR_ALL_INDUSTRIES(ind) if (ind->neutral_station != NULL) ind->neutral_station->industry = ind;
|
||||
}
|
||||
|
||||
/* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */
|
||||
Station::RecomputeCatchmentForAll();
|
||||
|
||||
/* Station acceptance is some kind of cache */
|
||||
if (IsSavegameVersionBefore(SLV_127)) {
|
||||
Station *st;
|
||||
|
Reference in New Issue
Block a user