OpenTTD Source: src/saveload/storage_sl.cpp File Reference

OpenTTD Source 1.11.0-RC1

Functions | Variables
storage_sl.cpp File Reference
`#include "../stdafx.h"`
`#include "../newgrf_storage.h"`
`#include "saveload.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
static void | Load_PSAC ()
| Load persistent storage data.
static void | Save_PSAC ()
| Save persistent storage data.

## Variables
static const SaveLoad | _storage_desc []
| Description of the data to save and load in PersistentStorage. More...
const ChunkHandler | _persistent_storage_chunk_handlers []
| Chunk handler for persistent storages. More...

## Detailed Description

Code handling saving and loading of persistent storages.

Definition in file storage_sl.cpp.

## Variable Documentation

## ◆ _persistent_storage_chunk_handlers

const ChunkHandler _persistent_storage_chunk_handlers[]

Initial value:
= {
{ 'PSAC', Save_PSAC, Load_PSAC, nullptr, nullptr, CH_ARRAY | CH_LAST},
}

Chunk handler for persistent storages.

## ◆ _storage_desc

const SaveLoad _storage_desc[]
| static

Initial value:
= {
SLE_CONDVAR(PersistentStorage, grfid, SLE_UINT32, SLV_6, SL_MAX_VERSION),
SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 16, SLV_161, SLV_EXTEND_PERSISTENT_STORAGE),
SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 256, SLV_EXTEND_PERSISTENT_STORAGE, SL_MAX_VERSION),
}

Description of the data to save and load in PersistentStorage.

Definition at line 17 of file storage_sl.cpp.

Referenced by Load_PSAC().

SLE_CONDARR
#define SLE_CONDARR(base, variable, type, length, from, to)
Storage of an array in some savegame versions.
Definition: saveload.h:572
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:551
CH_LAST
@ CH_LAST
Last chunk in this array.
Definition: saveload.h:410
SLV_EXTEND_PERSISTENT_STORAGE
@ SLV_EXTEND_PERSISTENT_STORAGE
201 PR#6885 Extend NewGRF persistent storages.
Definition: saveload.h:285
SLV_161
@ SLV_161
161 22567
Definition: saveload.h:236
PersistentStorage
Class for pooled persistent storage of data.
Definition: newgrf_storage.h:221
Load_PSAC
static void Load_PSAC()
Load persistent storage data.
Definition: storage_sl.cpp:25
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:328
SLV_6
@ SLV_6
6.0 1721 6.1 1768
Definition: saveload.h:46
Save_PSAC
static void Save_PSAC()
Save persistent storage data.
Definition: storage_sl.cpp:37