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

OpenTTD Source 1.11.0-RC1

Functions | Variables
misc_sl.cpp File Reference
`#include "../stdafx.h"`
`#include "../date_func.h"`
`#include "../zoom_func.h"`
`#include "../window_gui.h"`
`#include "../window_func.h"`
`#include "../viewport_func.h"`
`#include "../gfx_func.h"`
`#include "../core/random_func.hpp"`
`#include "../fios.h"`
`#include "saveload.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
void | SaveViewportBeforeSaveGame ()
void | ResetViewportAfterLoadGame ()
static void | SaveLoad_DATE ()
static void | Check_DATE ()
static void | SaveLoad_VIEW ()

## Variables
TileIndex | _cur_tileloop_tile
uint16 | _disaster_delay
| Delay counter for considering the next disaster.
byte | _trees_tick_ctr
| Determines when to consider building more trees.
int | _saved_scrollpos_x
int | _saved_scrollpos_y
ZoomLevel | _saved_scrollpos_zoom
byte | _age_cargo_skip_counter
| Skip aging of cargo? Used before savegame version 162.
static const SaveLoadGlobVarList | _date_desc []
static const SaveLoadGlobVarList | _date_check_desc []
static const SaveLoadGlobVarList | _view_desc []
const ChunkHandler | _misc_chunk_handlers []

## Detailed Description

Saving and loading of things that didn't fit anywhere else

Definition in file misc_sl.cpp.

## Variable Documentation

## ◆ _date_check_desc

const SaveLoadGlobVarList _date_check_desc[]
| static

Initial value:
= {
SLEG_CONDVAR(_load_check_data.current_date, SLE_FILE_U16 | SLE_VAR_I32, SL_MIN_VERSION, SLV_31),
SLEG_CONDVAR(_load_check_data.current_date, SLE_INT32, SLV_31, SL_MAX_VERSION),
SLE_NULL(2),
SLE_NULL(2),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_157),
SLE_CONDNULL(1, SL_MIN_VERSION, SLV_162),
SLE_CONDNULL(1, SL_MIN_VERSION, SLV_46),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_6),
SLE_CONDNULL(4, SLV_6, SL_MAX_VERSION),
SLE_NULL(2),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_120),
SLE_NULL(4),
SLE_NULL(4),
SLE_CONDNULL(1, SL_MIN_VERSION, SLV_10),
SLE_CONDNULL(4, SLV_10, SLV_120),
SLE_NULL(1),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_109),
SLE_CONDNULL(4, SLV_109, SL_MAX_VERSION),
SLE_NULL(1),
SLE_CONDNULL(1, SLV_4, SL_MAX_VERSION),
SLE_CONDNULL(4, SLV_11, SLV_120),
}

Definition at line 96 of file misc_sl.cpp.

## ◆ _date_desc

const SaveLoadGlobVarList _date_desc[]
| static

Initial value:
= {
SLEG_CONDVAR(_date, SLE_FILE_U16 | SLE_VAR_I32, SL_MIN_VERSION, SLV_31),
SLEG_CONDVAR(_date, SLE_INT32, SLV_31, SL_MAX_VERSION),
SLEG_VAR(_date_fract, SLE_UINT16),
SLEG_VAR(_tick_counter, SLE_UINT16),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_157),
SLEG_CONDVAR(_age_cargo_skip_counter, SLE_UINT8, SL_MIN_VERSION, SLV_162),
SLE_CONDNULL(1, SL_MIN_VERSION, SLV_46),
SLEG_CONDVAR(_cur_tileloop_tile, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_6),
SLEG_CONDVAR(_cur_tileloop_tile, SLE_UINT32, SLV_6, SL_MAX_VERSION),
SLEG_VAR(_disaster_delay, SLE_UINT16),
SLE_CONDNULL(2, SL_MIN_VERSION, SLV_120),
SLEG_VAR(_random.state[0], SLE_UINT32),
SLEG_VAR(_random.state[1], SLE_UINT32),
SLE_CONDNULL(1, SL_MIN_VERSION, SLV_10),
SLE_CONDNULL(4, SLV_10, SLV_120),
SLEG_VAR(_cur_company_tick_index, SLE_FILE_U8 | SLE_VAR_U32),
SLEG_CONDVAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_109),
SLEG_CONDVAR(_next_competitor_start, SLE_UINT32, SLV_109, SL_MAX_VERSION),
SLEG_VAR(_trees_tick_ctr, SLE_UINT8),
SLEG_CONDVAR(_pause_mode, SLE_UINT8, SLV_4, SL_MAX_VERSION),
SLE_CONDNULL(4, SLV_11, SLV_120),
}

Definition at line 71 of file misc_sl.cpp.

## ◆ _misc_chunk_handlers

const ChunkHandler _misc_chunk_handlers[]

Initial value:
= {
{ 'DATE', SaveLoad_DATE, SaveLoad_DATE, nullptr, Check_DATE, CH_RIFF},
{ 'VIEW', SaveLoad_VIEW, SaveLoad_VIEW, nullptr, nullptr, CH_RIFF | CH_LAST},
}

## ◆ _view_desc

const SaveLoadGlobVarList _view_desc[]
| static

Initial value:
= {
SLEG_CONDVAR(_saved_scrollpos_x, SLE_FILE_I16 | SLE_VAR_I32, SL_MIN_VERSION, SLV_6),
SLEG_CONDVAR(_saved_scrollpos_x, SLE_INT32, SLV_6, SL_MAX_VERSION),
SLEG_CONDVAR(_saved_scrollpos_y, SLE_FILE_I16 | SLE_VAR_I32, SL_MIN_VERSION, SLV_6),
SLEG_CONDVAR(_saved_scrollpos_y, SLE_INT32, SLV_6, SL_MAX_VERSION),
SLEG_VAR(_saved_scrollpos_zoom, SLE_UINT8),
}

Definition at line 137 of file misc_sl.cpp.

SLV_162
@ SLV_162
162 22713
Definition: saveload.h:237
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
_date_fract
DateFract _date_fract
Fractional part of the day.
Definition: date.cpp:29
_load_check_data
LoadCheckData _load_check_data
Data loaded from save during SL_LOAD_CHECK.
Definition: fios_gui.cpp:38
SLV_157
@ SLV_157
157 21862
Definition: saveload.h:231
CH_LAST
@ CH_LAST
Last chunk in this array.
Definition: saveload.h:410
_random
Randomizer _random
Random used in the game state calculations.
Definition: random_func.cpp:25
SLE_NULL
#define SLE_NULL(length)
Empty space in every savegame version.
Definition: saveload.h:669
SLEG_CONDVAR
#define SLEG_CONDVAR(variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:707
SLE_CONDNULL
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
Definition: saveload.h:677
SLV_10
@ SLV_10
10.0 2030
Definition: saveload.h:52
_date
Date _date
Current date in days (day counter)
Definition: date.cpp:28
SLV_31
@ SLV_31
31 5999
Definition: saveload.h:80
SLV_11
@ SLV_11
11.0 2033 11.1 2041
Definition: saveload.h:53
_trees_tick_ctr
byte _trees_tick_ctr
Determines when to consider building more trees.
Definition: tree_cmd.cpp:52
_pause_mode
PauseMode _pause_mode
The current pause mode.
Definition: gfx.cpp:47
SLV_46
@ SLV_46
46 8705
Definition: saveload.h:98
SLV_109
@ SLV_109
109 15075
Definition: saveload.h:173
_tick_counter
uint16 _tick_counter
Ever incrementing (and sometimes wrapping) tick counter for setting off various events.
Definition: date.cpp:30
SLV_120
@ SLV_120
120 16439
Definition: saveload.h:187
Randomizer::state
uint32 state[2]
The state of the randomizer.
Definition: random_func.hpp:23
_cur_company_tick_index
uint _cur_company_tick_index
used to generate a name for one company that doesn't have a name yet per tick
Definition: company_cmd.cpp:51
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:328
SLEG_VAR
#define SLEG_VAR(variable, type)
Storage of a global variable in every savegame version.
Definition: saveload.h:761
_next_competitor_start
uint _next_competitor_start
the number of ticks before the next AI is started
Definition: company_cmd.cpp:50
_disaster_delay
uint16 _disaster_delay
Delay counter for considering the next disaster.
Definition: disaster_vehicle.cpp:54
SLV_6
@ SLV_6
6.0 1721 6.1 1768
Definition: saveload.h:46
_age_cargo_skip_counter
byte _age_cargo_skip_counter
Skip aging of cargo? Used before savegame version 162.
Definition: misc_sl.cpp:69
SLV_4
@ SLV_4
4.0 1 4.1 122 0.3.3, 0.3.4 4.2 1222 0.3.5 4.3 1417 4.4 1426
Definition: saveload.h:37