OpenTTD Source 20241224-master-gee860a5c8e
subsidy_sl.cpp File Reference

Code handling saving and loading of subsidies. More...

#include "../stdafx.h"
#include "saveload.h"
#include "compat/subsidy_sl_compat.h"
#include "../subsidy_base.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  SUBSChunkHandler
 

Functions

const ChunkHandlerTable _subsidy_chunk_handlers (subsidy_chunk_handlers)
 

Variables

static const SaveLoad _subsidies_desc []
 
static const SUBSChunkHandler SUBS
 
static const ChunkHandlerRef subsidy_chunk_handlers []
 

Detailed Description

Code handling saving and loading of subsidies.

Definition in file subsidy_sl.cpp.

Variable Documentation

◆ _subsidies_desc

const SaveLoad _subsidies_desc[]
static
Initial value:
= {
SLE_VAR(Subsidy, cargo_type, SLE_UINT8),
SLE_CONDVAR(Subsidy, remaining, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_CUSTOM_SUBSIDY_DURATION),
SLE_CONDVAR(Subsidy, awarded, SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVAR(Subsidy, src_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVAR(Subsidy, dst_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVAR(Subsidy, src, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
SLE_CONDVAR(Subsidy, src, SLE_UINT16, SLV_5, SL_MAX_VERSION),
SLE_CONDVAR(Subsidy, dst, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
SLE_CONDVAR(Subsidy, dst, SLE_UINT16, SLV_5, SL_MAX_VERSION),
}
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
@ SLV_CUSTOM_SUBSIDY_DURATION
292 PR#9081 Configurable subsidy duration.
Definition saveload.h:330
@ SLV_125
125 17113
Definition saveload.h:193
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
@ SLV_5
5.0 1429 5.1 1440 5.2 1525 0.3.6
Definition saveload.h:43
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Struct about subsidies, offered and awarded.

Definition at line 19 of file subsidy_sl.cpp.

◆ SUBS

const SUBSChunkHandler SUBS
static

Definition at line 57 of file subsidy_sl.cpp.

◆ subsidy_chunk_handlers

const ChunkHandlerRef subsidy_chunk_handlers[]
static
Initial value:
= {
SUBS,
}

Definition at line 58 of file subsidy_sl.cpp.