OpenTTD Source 20260917-master-gec444f7315
game_sl.cpp File Reference

Handles the saveload part of the GameScripts. More...

#include "../stdafx.h"
#include "../debug.h"
#include "saveload.h"
#include "compat/game_sl_compat.h"
#include "../string_func.h"
#include "../game/game.hpp"
#include "../game/game_config.hpp"
#include "../network/network.h"
#include "../game/game_instance.hpp"
#include "../game/game_text.hpp"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  GSDTChunkHandler
class  SlGameLanguageString
struct  GSTRChunkHandler

Functions

static void SaveReal_GSDT (int)
const ChunkHandlerTable _game_chunk_handlers (game_chunk_handlers)

Variables

static std::string _game_saveload_name
static int _game_saveload_version
static std::string _game_saveload_settings
static const SaveLoad _game_script_desc []
std::shared_ptr< GameStrings > _current_gamestrings_data
 The currently loaded game strings.
static std::string _game_saveload_string
static uint32_t _game_saveload_strings
static const SaveLoad _game_language_desc []
static const GSTRChunkHandler GSTR
static const GSDTChunkHandler GSDT
static const ChunkHandlerRef game_chunk_handlers []

Detailed Description

Handles the saveload part of the GameScripts.

Definition in file game_sl.cpp.

Function Documentation

◆ SaveReal_GSDT()

void SaveReal_GSDT ( int )
static

Definition at line 35 of file game_sl.cpp.

Variable Documentation

◆ _current_gamestrings_data

std::shared_ptr<GameStrings> _current_gamestrings_data
extern

◆ _game_language_desc

const SaveLoad _game_language_desc[]
static
Initial value:
= {
}
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
Definition saveload.h:754
#define SLE_GLOBAL_ADDRESS(variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a global...
Definition saveload.h:761
@ MinVersion
First savegame version.
Definition saveload.h:37
@ SaveloadListLength
Saveload version: 293, GitHub pull request: 9374 Consistency in list length with SaveLoadType::Struc...
Definition saveload.h:337
Container for the raw (unencoded) language strings of a language.
Definition game_text.hpp:40
static SaveLoad StructList(std::string name, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a list of structs, optionally in some savegame versions.
Definition saveload.h:1103
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.
Definition saveload.h:926
static SaveLoad String(std::string name, AddressFunction< T > address_func, StringValidationSettings string_validation_settings={}, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a string in some savegame versions.
Definition saveload.h:977

Definition at line 149 of file game_sl.cpp.

◆ _game_saveload_name

std::string _game_saveload_name
static

Definition at line 25 of file game_sl.cpp.

◆ _game_saveload_settings

std::string _game_saveload_settings
static

Definition at line 27 of file game_sl.cpp.

◆ _game_saveload_string

std::string _game_saveload_string
static

Definition at line 118 of file game_sl.cpp.

◆ _game_saveload_strings

uint32_t _game_saveload_strings
static

Definition at line 119 of file game_sl.cpp.

◆ _game_saveload_version

int _game_saveload_version
static

Definition at line 26 of file game_sl.cpp.

◆ _game_script_desc

const SaveLoad _game_script_desc[]
static
Initial value:
= {
SaveLoad::String("name", SLE_GLOBAL_ADDRESS(_game_saveload_name)),
SaveLoad::String("settings", SLE_GLOBAL_ADDRESS(_game_saveload_settings)),
SaveLoad::Variable<VarFileType::U32>("version", SLE_GLOBAL_ADDRESS(_game_saveload_version)),
}

Definition at line 29 of file game_sl.cpp.

◆ game_chunk_handlers

const ChunkHandlerRef game_chunk_handlers[]
static
Initial value:
= {
GSTR,
GSDT,
}

Definition at line 195 of file game_sl.cpp.

◆ GSDT

const GSDTChunkHandler GSDT
static

Definition at line 194 of file game_sl.cpp.

◆ GSTR

const GSTRChunkHandler GSTR
static

Definition at line 193 of file game_sl.cpp.