File diff r26193:4bc7915a2156 → r26194:f7347205838e
src/saveload/gamelog_sl.cpp
Show inline comments
 
@@ -8,18 +8,21 @@
 
/** @file gamelog_sl.cpp Code handling saving and loading of gamelog data */
 

	
 
#include "../stdafx.h"
 

	
 
#include "saveload.h"
 
#include "compat/gamelog_sl_compat.h"
 
#include "extended_ver_sl.h"
 

	
 
#include "../gamelog_internal.h"
 
#include "../fios.h"
 

	
 
#include "../safeguards.h"
 

	
 
extern bool _sl_is_ext_version;
 
extern std::string _sl_xv_version_label;
 

	
 
class SlGamelogMode : public DefaultSaveLoadHandler<SlGamelogMode, LoggedChange> {
 
public:
 
	inline static const SaveLoad description[] = {
 
		SLE_VAR(LoggedChange, mode.mode,         SLE_UINT8),
 
		SLE_VAR(LoggedChange, mode.landscape,    SLE_UINT8),
 
@@ -58,12 +61,17 @@ public:
 
	}
 

	
 
	void Load(LoggedChange *lc) const override
 
	{
 
		if (lc->ct != GLCT_REVISION) return;
 
		SlObject(lc, this->GetLoadDescription());
 
		// update revision
 
		if (!_sl_is_ext_version)
 
		{
 
			_sl_xv_version_label = lc->revision.text;
 
		}
 
	}
 

	
 
	void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
 
};
 

	
 
class SlGamelogOldver : public DefaultSaveLoadHandler<SlGamelogOldver, LoggedChange> {
 
@@ -395,17 +403,19 @@ struct GLOGChunkHandler : ChunkHandler {
 
		}
 
	}
 

	
 
	void Load() const override
 
	{
 
		this->LoadCommon(_gamelog_action, _gamelog_actions);
 
		SlXvCheckSpecialSavegameVersionsB();
 
	}
 

	
 
	void LoadCheck(size_t) const override
 
	{
 
		this->LoadCommon(_load_check_data.gamelog_action, _load_check_data.gamelog_actions);
 
		SlXvCheckSpecialSavegameVersionsB();
 
	}
 
};
 

	
 
static const GLOGChunkHandler GLOG;
 
static const ChunkHandlerRef gamelog_chunk_handlers[] = {
 
	GLOG,