OpenTTD Source 20241224-master-gee860a5c8e
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.

Function Documentation

◆ SaveReal_GSDT()

static void SaveReal_GSDT ( int  )
static

Definition at line 35 of file game_sl.cpp.

Variable Documentation

◆ _current_data

◆ _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:1241
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition saveload.h:1109
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition saveload.h:1046
@ 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_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),
}
#define SLEG_SSTR(name, variable, type)
Storage of a global std::string in every savegame version.
Definition saveload.h:1211
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition saveload.h:1186

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.

◆ GSDT

const GSDTChunkHandler GSDT
static

Definition at line 196 of file game_sl.cpp.

◆ GSTR

const GSTRChunkHandler GSTR
static

Definition at line 195 of file game_sl.cpp.