1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Refactoring of serialization versioning handling

- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
This commit is contained in:
Ivan Savenko
2024-01-20 20:34:51 +02:00
parent 6b760089a4
commit 0c07384293
129 changed files with 498 additions and 473 deletions

View File

@@ -161,7 +161,7 @@ CMapOverviewWidget::CMapOverviewWidget(CMapOverview& parent):
std::unique_ptr<CMap> campaignMap = nullptr;
if(p.tabType != ESelectionScreen::newGame && config["variables"]["mapPreviewForSaves"].Bool())
{
CLoadFile lf(*CResourceHandler::get()->getResourceName(ResourcePath(p.resource.getName(), EResType::SAVEGAME)), MINIMAL_SERIALIZATION_VERSION);
CLoadFile lf(*CResourceHandler::get()->getResourceName(ResourcePath(p.resource.getName(), EResType::SAVEGAME)), ESerializationVersion::MINIMAL);
lf.checkMagicBytes(SAVEGAME_MAGIC);
auto mapHeader = std::make_unique<CMapHeader>();