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

OpenTTD Source 15.0-RC2

Data Structures | Functions | Variables
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()

static 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

The currently loaded game strings.

Definition at line 308 of file game_text.cpp.

Referenced by GetGameStringName(), GetGameStringParams(), GetGameStringPtr(), GSTRChunkHandler::Load(), ReconsiderGameScriptLanguage(), RegisterGameTranslation(), and GSTRChunkHandler::Save().

## ◆ _game_language_desc

const SaveLoad _game_language_desc[]
| static

Initial value:
= {
SLE_SSTR(LanguageStrings, language, SLE_STR),
SLEG_CONDVAR("count", _game_saveload_strings, SLE_UINT32, SL_MIN_VERSION, SLV_SAVELOAD_LIST_LENGTH),
SLEG_STRUCTLIST("strings", SlGameLanguageString),
}
SlGameLanguageString
Definition game_sl.cpp:121
SLEG_STRUCTLIST
#define SLEG_STRUCTLIST(name, handler)
Storage of a list of structs in every savegame version.
Definition saveload.h:1256
SLEG_CONDVAR
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition saveload.h:1124
SLE_SSTR
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition saveload.h:1061
SLV_SAVELOAD_LIST_LENGTH
@ SLV_SAVELOAD_LIST_LENGTH
293 PR#9374 Consistency in list length with SL_STRUCT / SL_STRUCTLIST / SL_DEQUE / SL_REFLIST.
Definition saveload.h:331
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
LanguageStrings
Container for the raw (unencoded) language strings of a language.
Definition game_text.hpp:40

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:
= {
SLEG_SSTR("name", _game_saveload_name, SLE_STR),
SLEG_SSTR("settings", _game_saveload_settings, SLE_STR),
SLEG_VAR("version", _game_saveload_version, SLE_UINT32),
}
SLEG_SSTR
#define SLEG_SSTR(name, variable, type)
Storage of a global std::string in every savegame version.
Definition saveload.h:1226
SLEG_VAR
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition saveload.h:1201

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.