Declaration of functions used in more save/load files. More...
#include "../company_manager_face.h"
#include "../order_base.h"
#include "../engine_type.h"
#include "saveload.h"
Go to the source code of this file.
Functions | |
void | InitializeOldNames () |
Initialize the old names table memory. | |
StringID | RemapOldStringID (StringID s) |
Remap a string ID from the old format to the new format. | |
char * | CopyFromOldName (StringID id) |
Copy and convert old custom names to UTF-8. | |
void | ResetOldNames () |
Free the memory of the old names array. | |
void | MoveBuoysToWaypoints () |
Perform all steps to upgrade from the old station buoys to the new version that uses waypoints. | |
void | MoveWaypointsToBaseStations () |
Perform all steps to upgrade from the old waypoints to the new version that uses station. | |
const SaveLoad * | GetBaseStationDescription () |
Get the base station description to be used for SL_ST_INCLUDE. | |
void | AfterLoadVehicles (bool part_of_load) |
Called after load to update coordinates. | |
void | AfterLoadStations () |
void | AfterLoadRoadStops () |
(Re)building of road stop caches after loading a savegame. | |
void | AfterLoadLabelMaps () |
void | UpdateHousesAndTowns () |
Check and update town and house values. | |
void | UpdateOldAircraft () |
need to be called to load aircraft from old version | |
void | SaveViewportBeforeSaveGame () |
void | ResetViewportAfterLoadGame () |
void | ConvertOldMultiheadToNew () |
Converts all trains to the new subtype format introduced in savegame 16.2 It also links multiheaded engines or make them forget they are multiheaded if no suitable partner is found. | |
void | ConnectMultiheadedTrains () |
Engine * | GetTempDataEngine (EngineID index) |
void | CopyTempEngineData () |
Copy data from temporary engine array into the real engine pool. | |
CompanyManagerFace | ConvertFromOldCompanyManagerFace (uint32 face) |
Converts an old company manager's face format to the new company manager's face format. | |
Order | UnpackOldOrder (uint16 packed) |
Unpacks a order from savegames made with TTD(Patch). | |
Variables | |
int32 | _saved_scrollpos_x |
int32 | _saved_scrollpos_y |
ZoomLevelByte | _saved_scrollpos_zoom |
SavegameType | _savegame_type |
type of savegame we are loading | |
uint32 | _ttdp_version |
version of TTDP savegame (if applicable) |
Declaration of functions used in more save/load files.
Definition in file saveload_internal.h.
void AfterLoadVehicles | ( | bool | part_of_load | ) |
Called after load to update coordinates.
So we can set the previous and first pointers while loading.
For instantiating the shared vehicle chain.
Definition at line 241 of file vehicle_sl.cpp.
References _settings_game, Vehicle::AddToShared(), AIR_HELICOPTER, GroundVehicle< T, Type >::CargoChanged(), CheckValidVehicles(), Train::ConsistChanged(), Vehicle::cur_image, Vehicle::cur_speed, Vehicle::direction, EF_ROAD_TRAM, Vehicle::fill_percent_te_id, Vehicle::First(), OrderList::first, Vehicle::first, GroundVehicleCache::first_engine, SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedVehicle< Ship, VEH_SHIP >::From(), SpecializedVehicle< RoadVehicle, Type >::From(), SpecializedVehicle< Train, Type >::From(), OrderList::GetFirstSharedVehicle(), Vehicle::GetGroundVehicleCache(), Vehicle::GetImage(), HasBit(), OrderList::Initialize(), Train::IsEngine(), Train::IsFreeWagon(), Train::IsFrontEngine(), Vehicle::IsGroundVehicle(), RoadVehicle::IsRoadVehFront(), IsSavegameVersionBefore(), Vehicle::list, Vehicle::Next(), Vehicle::next_shared, Vehicle::NextShared(), Vehicle::old, Vehicle::Previous(), Vehicle::previous, Vehicle::previous_shared, Vehicle::PreviousShared(), ROADTYPE_ROAD, ROADTYPE_TRAM, RoadTypeToRoadTypes(), VehicleSettings::roadveh_acceleration_model, Vehicle::subtype, BaseVehicle::type, UpdateAircraftCache(), Vehicle::UpdateDeltaXY(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, GameSettings::vehicle, VehicleMove(), Vehicle::vehstatus, and VS_STOPPED.
Referenced by ReloadNewGRFData().
CompanyManagerFace ConvertFromOldCompanyManagerFace | ( | uint32 | face | ) |
Converts an old company manager's face format to the new company manager's face format.
Meaning of the bits in the old face (some bits are used in several times):
face | the face in the old format |
Definition at line 39 of file company_sl.cpp.
References ClampU(), ETHNICITY_BLACK, GB(), GE_WF, GE_WM, GENDER_FEMALE, HasBit(), max(), ScaleCompanyManagerFaceValue(), SetBit(), and SetCompanyManagerFaceBits().
char* CopyFromOldName | ( | StringID | id | ) |
Copy and convert old custom names to UTF-8.
They were all stored in a 512 by 32 (200 by 24 for TTO) long string array and are now stored with stations, waypoints and other places with names.
id | the StringID of the custom name to clone. |
Definition at line 54 of file strings_sl.cpp.
References _old_name_array, _savegame_type, GB(), IsSavegameVersionBefore(), lastof, SGT_TTO, Utf8CharLen(), and Utf8Encode().
Referenced by WriteValue().
const SaveLoad* GetBaseStationDescription | ( | ) |
Get the base station description to be used for SL_ST_INCLUDE.
Definition at line 373 of file station_sl.cpp.
void MoveBuoysToWaypoints | ( | ) |
Perform all steps to upgrade from the old station buoys to the new version that uses waypoints.
This includes some old saveload mechanics.
Definition at line 40 of file station_sl.cpp.
References BaseStation::build_date, Vehicle::current_order, BaseStation::delete_ctr, FACIL_DOCK, BaseStation::facilities, OrderList::GetFirstOrder(), OrderList::GetFirstSharedVehicle(), GetStationIndex(), HVOT_WAYPOINT, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, IsBuoyTile(), IsInsideBS(), BaseStation::name, Order::next, BaseStation::owner, OWNER_NONE, BaseStation::rect, BaseStation::string_id, BaseStation::town, Waypoint::town_cn, BaseVehicle::type, UpdateWaypointOrder(), VEH_SHIP, and BaseStation::xy.
void MoveWaypointsToBaseStations | ( | ) |
Perform all steps to upgrade from the old waypoints to the new version that uses station.
This includes some old saveload mechanics.
Definition at line 65 of file waypoint_sl.cpp.
References _m, AllocateSpecToStation(), SmallVector< T, S >::Begin(), BaseStation::build_date, Vehicle::current_order, BaseStation::delete_ctr, SmallVector< T, S >::End(), FACIL_TRAIN, BaseStation::facilities, GB(), NewGRFClass< Tspec, Tid, Tmax >::Get(), NewGRFClass< Tspec, Tid, Tmax >::GetCount(), OrderList::GetFirstOrder(), OrderList::GetFirstSharedVehicle(), GetRailTileType(), GetRailType(), GetTileOwner(), StationSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, HasBit(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, IsSavegameVersionBefore(), IsTileType(), GRFFilePropsBase< Tcnt >::local_id, Tile::m2, Tile::m3, Tile::m4, MakeRailWaypoint(), MP_RAILWAY, BaseStation::name, Order::next, BaseStation::owner, BaseStation::rect, SmallVector< T, S >::Reset(), SetCustomStationSpecIndex(), SetRailStationReservation(), STAT_CLASS_WAYP, BaseStation::string_id, BaseStation::town, Waypoint::town_cn, BaseVehicle::type, UpdateWaypointOrder(), and VEH_TRAIN.
Remap a string ID from the old format to the new format.
s | StringID that requires remapping |
Definition at line 23 of file strings_sl.cpp.
References IsInsideMM().
Referenced by SlSaveLoadConv().
void ResetOldNames | ( | ) |
Free the memory of the old names array.
Should be called once the old names have all been converted.
Definition at line 103 of file strings_sl.cpp.
References _old_name_array.
Order UnpackOldOrder | ( | uint16 | packed | ) |
Unpacks a order from savegames made with TTD(Patch).
packed | packed order |
Definition at line 86 of file order_sl.cpp.
References Order::IsType(), Order::MakeDummy(), and UnpackVersion4Order().
void UpdateHousesAndTowns | ( | ) |
Check and update town and house values.
Checked are the HouseIDs. Updated are the town population the number of houses per town, the town radius and the max passengers of the town.
Definition at line 28 of file town_sl.cpp.
References HouseSpec::building_flags, GetCleanHouseType(), GetHouseNorthPart(), OverrideManagerBase::GetSubstituteID(), IncreaseBuildingCount(), IsHouseCompleted(), IsTileType(), MapSize(), MP_HOUSE, HouseSpec::population, SetHouseType(), and TileDiffXY().
Referenced by ReloadNewGRFData().