|
OpenTTD Source 15.0-beta1
|
Code handling saving and loading of engines. More...
#include "../stdafx.h"#include "saveload.h"#include "compat/engine_sl_compat.h"#include "saveload_internal.h"#include "../engine_base.h"#include "../string_func.h"#include "../safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | ENGNChunkHandler |
| struct | ENGSChunkHandler |
| struct | EIDSChunkHandler |
Functions | |
| static Engine * | CallocEngine () |
| Allocate an Engine structure, but not using the pools. | |
| static void | FreeEngine (Engine *e) |
| Deallocate an Engine constructed by CallocEngine. | |
| Engine * | GetTempDataEngine (EngineID index) |
| void | CopyTempEngineData () |
| Copy data from temporary engine array into the real engine pool. | |
| void | ResetTempEngineData () |
| const ChunkHandlerTable | _engine_chunk_handlers (engine_chunk_handlers) |
Variables | |
| static const SaveLoad | _engine_desc [] |
| static std::vector< Engine * > | _temp_engine |
| static const SaveLoad | _engine_id_mapping_desc [] |
| Save and load the mapping between the engine id in the pool, and the grf file it came from. | |
| static const EIDSChunkHandler | EIDS |
| static const ENGNChunkHandler | ENGN |
| static const ENGSChunkHandler | ENGS |
| static const ChunkHandlerRef | engine_chunk_handlers [] |
Code handling saving and loading of engines.
Definition in file engine_sl.cpp.
|
static |
Allocate an Engine structure, but not using the pools.
The allocated Engine must be freed using FreeEngine;
Definition at line 51 of file engine_sl.cpp.
| void CopyTempEngineData | ( | ) |
Copy data from temporary engine array into the real engine pool.
Definition at line 121 of file engine_sl.cpp.
References Engine::age, Engine::company_avail, Engine::company_hidden, Engine::duration_phase_1, Engine::duration_phase_2, Engine::duration_phase_3, Engine::flags, Engine::intro_date, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Iterate(), Engine::name, Engine::preview_asked, Engine::preview_company, Engine::preview_wait, Engine::reliability, Engine::reliability_final, Engine::reliability_max, Engine::reliability_spd_dec, and Engine::reliability_start.
Referenced by AfterLoadGame().
|
static |
Deallocate an Engine constructed by CallocEngine.
| e | Engine to free. |
Definition at line 62 of file engine_sl.cpp.
References free().
Definition at line 70 of file engine_sl.cpp.
| void ResetTempEngineData | ( | ) |
Definition at line 149 of file engine_sl.cpp.
|
static |
Definition at line 21 of file engine_sl.cpp.
|
static |
Save and load the mapping between the engine id in the pool, and the grf file it came from.
Definition at line 178 of file engine_sl.cpp.
Referenced by EIDSChunkHandler::Load(), and EIDSChunkHandler::Save().
|
static |
Definition at line 44 of file engine_sl.cpp.
|
static |
Definition at line 229 of file engine_sl.cpp.
|
static |
Definition at line 232 of file engine_sl.cpp.
|
static |
Definition at line 230 of file engine_sl.cpp.
|
static |
Definition at line 231 of file engine_sl.cpp.