OpenTTD Source  20240919-master-gdf0233f4c2
water_regions_sl.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #include "../stdafx.h"
11 
12 #include "saveload.h"
13 
14 #include "../safeguards.h"
15 
16 extern void SlSkipArray();
17 
18 /* Water Region savegame data is no longer used, but still needed for old savegames to load without errors. */
21  {}
22 
23  void Load() const override
24  {
25  SlTableHeader({});
26  SlSkipArray();
27  };
28 };
29 
30 static const WaterRegionChunkHandler WRGN;
31 static const ChunkHandlerRef water_region_chunk_handlers[] = { WRGN };
32 extern const ChunkHandlerTable _water_region_chunk_handlers(water_region_chunk_handlers);
ChunkHandlerRef
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
Definition: saveload.h:501
saveload.h
ChunkHandler
Handlers and description of chunk.
Definition: saveload.h:455
WaterRegionChunkHandler::Load
void Load() const override
Load the chunk.
Definition: water_regions_sl.cpp:23
SlSkipArray
void SlSkipArray()
Skip an array or sparse array.
Definition: saveload.cpp:700
CH_READONLY
@ CH_READONLY
Chunk is never saved.
Definition: saveload.h:451
WaterRegionChunkHandler
Definition: water_regions_sl.cpp:19
ChunkHandlerTable
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
Definition: saveload.h:504
SlTableHeader
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Definition: saveload.cpp:1750