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

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

#include "../stdafx.h"
#include "saveload.h"
#include "compat/industry_sl_compat.h"
#include "../industry.h"
#include "newgrf_sl.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

class  SlIndustryAccepted
 
class  SlIndustryProducedHistory
 
class  SlIndustryProduced
 
struct  INDYChunkHandler
 
struct  IIDSChunkHandler
 
struct  TIDSChunkHandler
 
struct  IBLDChunkHandler
 Industry builder. More...
 
struct  ITBLChunkHandler
 Industry-type build data. More...
 

Functions

const ChunkHandlerTable _industry_chunk_handlers (industry_chunk_handlers)
 

Variables

static OldPersistentStorage _old_ind_persistent_storage
 
static const SaveLoad _industry_desc []
 
static const SaveLoad _industry_builder_desc []
 Description of the data to save and load in IndustryBuildData.
 
static const SaveLoad _industrytype_builder_desc []
 Description of the data to save and load in IndustryTypeBuildData.
 
static const INDYChunkHandler INDY
 
static const IIDSChunkHandler IIDS
 
static const TIDSChunkHandler TIDS
 
static const IBLDChunkHandler IBLD
 
static const ITBLChunkHandler ITBL
 
static const ChunkHandlerRef industry_chunk_handlers []
 

Detailed Description

Code handling saving and loading of industries.

Definition in file industry_sl.cpp.

Variable Documentation

◆ _industry_builder_desc

const SaveLoad _industry_builder_desc[]
static
Initial value:
= {
SLEG_VAR("wanted_inds", _industry_builder.wanted_inds, SLE_UINT32),
}
IndustryBuildData _industry_builder
In-game manager of industries.
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition saveload.h:1186
uint32_t wanted_inds
Number of wanted industries (bits 31-16), and a fraction (bits 15-0).
Definition industry.h:295

Description of the data to save and load in IndustryBuildData.

Definition at line 252 of file industry_sl.cpp.

Referenced by IBLDChunkHandler::Load(), and IBLDChunkHandler::Save().

◆ _industry_desc

const SaveLoad _industry_desc[]
static

Definition at line 113 of file industry_sl.cpp.

◆ _industrytype_builder_desc

const SaveLoad _industrytype_builder_desc[]
static
Initial value:
= {
SLE_VAR(IndustryTypeBuildData, probability, SLE_UINT32),
SLE_VAR(IndustryTypeBuildData, min_number, SLE_UINT8),
SLE_VAR(IndustryTypeBuildData, target_count, SLE_UINT16),
SLE_VAR(IndustryTypeBuildData, max_wait, SLE_UINT16),
SLE_VAR(IndustryTypeBuildData, wait_count, SLE_UINT16),
}
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Data for managing the number of industries of a single industry type.
Definition industry.h:278

Description of the data to save and load in IndustryTypeBuildData.

Definition at line 279 of file industry_sl.cpp.

Referenced by ITBLChunkHandler::Load(), and ITBLChunkHandler::Save().

◆ _old_ind_persistent_storage

OldPersistentStorage _old_ind_persistent_storage
static

Definition at line 20 of file industry_sl.cpp.

◆ IBLD

const IBLDChunkHandler IBLD
static

Definition at line 319 of file industry_sl.cpp.

◆ IIDS

const IIDSChunkHandler IIDS
static

Definition at line 317 of file industry_sl.cpp.

◆ industry_chunk_handlers

const ChunkHandlerRef industry_chunk_handlers[]
static
Initial value:
= {
INDY,
IIDS,
TIDS,
IBLD,
ITBL,
}

Definition at line 321 of file industry_sl.cpp.

◆ INDY

const INDYChunkHandler INDY
static

Definition at line 316 of file industry_sl.cpp.

◆ ITBL

const ITBLChunkHandler ITBL
static

Definition at line 320 of file industry_sl.cpp.

◆ TIDS

const TIDSChunkHandler TIDS
static

Definition at line 318 of file industry_sl.cpp.