OpenTTD

Functions | Variables
storage_sl.cpp File Reference

Code handling saving and loading of persistent storages. More...

`#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. More...
static void | Save_PSAC ()
| Save persistent storage data. More...

## 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.

## Function Documentation

## ◆ Load_PSAC()

static void Load_PSAC | ( |  | ) |
| static

Load persistent storage data.

Definition at line 26 of file storage_sl.cpp.

References SlIterateArray().

## ◆ Save_PSAC()

static void Save_PSAC | ( |  | ) |
| static

Save persistent storage data.

Definition at line 38 of file storage_sl.cpp.

## Variable Documentation

## ◆ _persistent_storage_chunk_handlers

const ChunkHandler _persistent_storage_chunk_handlers[]

Initial value:
= {
{ 'PSAC', Save_PSAC, Load_PSAC, NULL, NULL, CH_ARRAY | CH_LAST},
}
Load_PSAC
static void Load_PSAC()
Load persistent storage data.
Definition: storage_sl.cpp:26
Save_PSAC
static void Save_PSAC()
Save persistent storage data.
Definition: storage_sl.cpp:38
CH_LAST
Last chunk in this array.
Definition: saveload.h:104

Chunk handler for persistent storages.

## ◆ _storage_desc

const SaveLoad _storage_desc[]
| static

Initial value:
= {
SLE_CONDVAR(PersistentStorage, grfid, SLE_UINT32, 6, SL_MAX_VERSION),
SLE_CONDARR(PersistentStorage, storage, SLE_UINT32, 16, 161, SL_MAX_VERSION),
}
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:246
PersistentStorage
Class for pooled persistent storage of data.
Definition: newgrf_storage.h:223
SL_MAX_VERSION
#define SL_MAX_VERSION
Highest possible savegame version.
Definition: saveload.h:96
SLE_CONDARR
#define SLE_CONDARR(base, variable, type, length, from, to)
Storage of an array in some savegame versions.
Definition: saveload.h:267

Description of the data to save and load in PersistentStorage.

Definition at line 19 of file storage_sl.cpp.