OpenTTD Source  20241108-master-g80f628063a
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 []
 
GameStrings_current_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.

Variable Documentation

◆ _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),
}
#define SLEG_STRUCTLIST(name, handler)
Storage of a list of structs in every savegame version.
Definition: saveload.h:1205
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:1074
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition: saveload.h:1019
@ 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
First savegame version.
Definition: saveload.h:31
Container for the raw (unencoded) language strings of a language.
Definition: game_text.hpp:37

Definition at line 149 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),
}
#define SLEG_SSTR(name, variable, type)
Storage of a global std::string in every savegame version.
Definition: saveload.h:1175
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition: saveload.h:1151

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 197 of file game_sl.cpp.