OpenTTD Source 20241224-master-gf74b0cf984
|
Code handling saving and loading of link graphs. More...
#include "../stdafx.h"
#include "saveload.h"
#include "compat/linkgraph_sl_compat.h"
#include "../linkgraph/linkgraph.h"
#include "../linkgraph/linkgraphjob.h"
#include "../linkgraph/linkgraphschedule.h"
#include "../network/network.h"
#include "../settings_internal.h"
#include "../settings_table.h"
#include "../safeguards.h"
Go to the source code of this file.
Data Structures | |
class | SlLinkgraphEdge |
class | SlLinkgraphNode |
class | SlLinkgraphJobProxy |
Proxy to reuse LinkGraph to save/load a LinkGraphJob. More... | |
struct | LGRPChunkHandler |
All link graphs. More... | |
struct | LGRJChunkHandler |
All link graph jobs. More... | |
struct | LGRSChunkHandler |
Link graph schedule. More... | |
Typedefs | |
typedef LinkGraph::BaseNode | Node |
typedef LinkGraph::BaseEdge | Edge |
Functions | |
SaveLoadTable | GetLinkGraphDesc () |
Get a SaveLoad array for a link graph. | |
SaveLoadTable | GetLinkGraphJobDesc () |
Get a SaveLoad array for a link graph job. | |
SaveLoadTable | GetLinkGraphScheduleDesc () |
Get a SaveLoad array for the link graph schedule. | |
void | AfterLoadLinkGraphs () |
Spawn the threads for running link graph calculations. | |
const ChunkHandlerTable | _linkgraph_chunk_handlers (linkgraph_chunk_handlers) |
Variables | |
static uint16_t | _num_nodes |
static LinkGraph * | _linkgraph |
Contains the current linkgraph being saved/loaded. | |
static NodeID | _linkgraph_from |
Contains the current "from" node being saved/loaded. | |
static const LGRPChunkHandler | LGRP |
static const LGRJChunkHandler | LGRJ |
static const LGRSChunkHandler | LGRS |
static const ChunkHandlerRef | linkgraph_chunk_handlers [] |
Code handling saving and loading of link graphs.
Definition in file linkgraph_sl.cpp.
typedef LinkGraph::BaseEdge Edge |
Definition at line 25 of file linkgraph_sl.cpp.
typedef LinkGraph::BaseNode Node |
Definition at line 24 of file linkgraph_sl.cpp.
void AfterLoadLinkGraphs | ( | ) |
Spawn the threads for running link graph calculations.
Has to be done after loading as the cargo classes might have changed.
Definition at line 232 of file linkgraph_sl.cpp.
References _network_server, _networking, AfterLoad_LinkGraphPauseControl(), SpecializedStation< Station, false >::GetIfValid(), LinkGraphJob::Graph(), LinkGraphSchedule::instance, IsSavegameVersionBefore(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_link_graph_job_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_link_graph_pool >::Iterate(), LinkGraph::Size(), SLV_191, LinkGraphSchedule::SpawnAll(), and BaseStation::xy.
Referenced by AfterLoadGame().
SaveLoadTable GetLinkGraphDesc | ( | ) |
Get a SaveLoad array for a link graph.
Definition at line 136 of file linkgraph_sl.cpp.
Referenced by SlLinkgraphJobProxy::GetDescription(), LGRPChunkHandler::Load(), and LGRPChunkHandler::Save().
SaveLoadTable GetLinkGraphJobDesc | ( | ) |
Get a SaveLoad array for a link graph job.
The settings struct is derived from the global settings saveload array. The exact entries are calculated when the function is called the first time. It's necessary to keep a copy of the settings for each link graph job so that you can change the settings while in-game and still not mess with current link graph runs. Of course the settings have to be saved and loaded, too, to avoid desyncs.
Definition at line 180 of file linkgraph_sl.cpp.
Referenced by LGRJChunkHandler::Load(), and LGRJChunkHandler::Save().
SaveLoadTable GetLinkGraphScheduleDesc | ( | ) |
Get a SaveLoad array for the link graph schedule.
Definition at line 219 of file linkgraph_sl.cpp.
Referenced by LGRSChunkHandler::FixPointers(), LGRSChunkHandler::Load(), and LGRSChunkHandler::Save().
|
static |
Contains the current linkgraph being saved/loaded.
Definition at line 28 of file linkgraph_sl.cpp.
|
static |
Contains the current "from" node being saved/loaded.
Definition at line 29 of file linkgraph_sl.cpp.
|
static |
Definition at line 27 of file linkgraph_sl.cpp.
|
static |
Definition at line 344 of file linkgraph_sl.cpp.
|
static |
Definition at line 343 of file linkgraph_sl.cpp.
|
static |
Definition at line 345 of file linkgraph_sl.cpp.
|
static |
Definition at line 346 of file linkgraph_sl.cpp.