OpenTTD Source
1.11.2
|
#include "../stdafx.h"
#include "../linkgraph/linkgraph.h"
#include "../linkgraph/linkgraphjob.h"
#include "../linkgraph/linkgraphschedule.h"
#include "../network/network.h"
#include "../settings_internal.h"
#include "saveload.h"
#include "../safeguards.h"
Go to the source code of this file.
Typedefs | |
typedef LinkGraph::BaseNode | Node |
typedef LinkGraph::BaseEdge | Edge |
Functions | |
const SettingDesc * | GetSettingDescription (uint index) |
const SaveLoad * | GetLinkGraphDesc () |
Get a SaveLoad array for a link graph. More... | |
const SaveLoad * | GetLinkGraphJobDesc () |
Get a SaveLoad array for a link graph job. More... | |
const SaveLoad * | GetLinkGraphScheduleDesc () |
Get a SaveLoad array for the link graph schedule. More... | |
void | SaveLoad_LinkGraph (LinkGraph &lg) |
Save/load a link graph. More... | |
static void | DoSave_LGRJ (LinkGraphJob *lgj) |
Save a link graph job. More... | |
static void | DoSave_LGRP (LinkGraph *lg) |
Save a link graph. More... | |
static void | Load_LGRP () |
Load all link graphs. | |
static void | Load_LGRJ () |
Load all link graph jobs. | |
static void | Load_LGRS () |
Load the link graph schedule. | |
void | AfterLoadLinkGraphs () |
Spawn the threads for running link graph calculations. More... | |
static void | Save_LGRP () |
Save all link graphs. | |
static void | Save_LGRJ () |
Save all link graph jobs. | |
static void | Save_LGRS () |
Save the link graph schedule. | |
static void | Ptrs_LGRS () |
Substitute pointers in link graph schedule. | |
Variables | |
static uint16 | _num_nodes |
static const SaveLoad | _node_desc [] |
SaveLoad desc for a link graph node. More... | |
static const SaveLoad | _edge_desc [] |
SaveLoad desc for a link graph edge. More... | |
const ChunkHandler | _linkgraph_chunk_handlers [] |
Code handling saving and loading of link graphs
Definition in 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 234 of file linkgraph_sl.cpp.
References _network_server, _networking, AfterLoad_LinkGraphPauseControl(), SpecializedStation< Station, false >::GetIfValid(), 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.
|
static |
Save a link graph job.
lgj | LinkGraphJob to be saved. |
Definition at line 165 of file linkgraph_sl.cpp.
References GetLinkGraphJobDesc(), and SlObject().
|
static |
Save a link graph.
lg | LinkGraph to be saved. |
Definition at line 177 of file linkgraph_sl.cpp.
const SaveLoad* GetLinkGraphDesc | ( | ) |
Get a SaveLoad array for a link graph.
Definition at line 31 of file linkgraph_sl.cpp.
References SLE_VAR.
const SaveLoad* 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 51 of file linkgraph_sl.cpp.
References SLE_VAR.
Referenced by DoSave_LGRJ().
const SaveLoad* GetLinkGraphScheduleDesc | ( | ) |
Get a SaveLoad array for the link graph schedule.
Definition at line 99 of file linkgraph_sl.cpp.
References REF_LINK_GRAPH, REF_LINK_GRAPH_JOB, SLE_END, and SLE_LST.
Referenced by Load_LGRS(), Ptrs_LGRS(), and Save_LGRS().
void SaveLoad_LinkGraph | ( | LinkGraph & | lg | ) |
Save/load a link graph.
lg | Link graph to be saved or loaded. |
Definition at line 140 of file linkgraph_sl.cpp.
References _edge_desc, _node_desc, LinkGraph::edges, IsSavegameVersionBefore(), LinkGraph::nodes, LinkGraph::Size(), SlObject(), and SLV_191.
|
static |
SaveLoad desc for a link graph edge.
Definition at line 126 of file linkgraph_sl.cpp.
Referenced by SaveLoad_LinkGraph().
const ChunkHandler _linkgraph_chunk_handlers[] |
|
static |
SaveLoad desc for a link graph node.
Definition at line 114 of file linkgraph_sl.cpp.
Referenced by SaveLoad_LinkGraph().