summaryrefslogtreecommitdiff
path: root/src/saveload/animated_tile_sl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/animated_tile_sl.cpp')
-rw-r--r--src/saveload/animated_tile_sl.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp
index 2e0666d4a..50fe05df2 100644
--- a/src/saveload/animated_tile_sl.cpp
+++ b/src/saveload/animated_tile_sl.cpp
@@ -8,12 +8,14 @@
/** @file animated_tile_sl.cpp Code handling saving and loading of animated tiles */
#include "../stdafx.h"
+
+#include "saveload.h"
+#include "compat/animated_tile_sl_compat.h"
+
#include "../tile_type.h"
#include "../core/alloc_func.hpp"
#include "../core/smallvec_type.hpp"
-#include "saveload.h"
-
#include "../safeguards.h"
extern std::vector<TileIndex> _animated_tiles;
@@ -27,6 +29,8 @@ static const SaveLoad _animated_tile_desc[] = {
*/
static void Save_ANIT()
{
+ SlTableHeader(_animated_tile_desc);
+
SlSetArrayIndex(0);
SlGlobList(_animated_tile_desc);
}
@@ -57,17 +61,15 @@ static void Load_ANIT()
return;
}
+ const std::vector<SaveLoad> slt = SlCompatTableHeader(_animated_tile_desc, _animated_tile_sl_compat);
+
if (SlIterateArray() == -1) return;
- SlGlobList(_animated_tile_desc);
+ SlGlobList(slt);
if (SlIterateArray() != -1) SlErrorCorrupt("Too many ANIT entries");
}
-/**
- * "Definition" imported by the saveload code to be able to load and save
- * the animated tile table.
- */
static const ChunkHandler animated_tile_chunk_handlers[] = {
- { 'ANIT', Save_ANIT, Load_ANIT, nullptr, nullptr, CH_ARRAY },
+ { 'ANIT', Save_ANIT, Load_ANIT, nullptr, nullptr, CH_TABLE },
};
extern const ChunkHandlerTable _animated_tile_chunk_handlers(animated_tile_chunk_handlers);