Save states: Fixed serializer class to avoid breaking save states every time a new value need to be added

This commit is contained in:
Sour 2019-04-04 20:58:20 -04:00
parent 42379b26d1
commit a36708fe7b
3 changed files with 4 additions and 4 deletions

View file

@ -124,7 +124,7 @@ bool SaveStateManager::LoadState(istream &stream, bool hashCheckRequired)
}
stream.read((char*)&fileFormatVersion, sizeof(fileFormatVersion));
if(fileFormatVersion < 1) {
if(fileFormatVersion < 2) {
MessageManager::DisplayMessage("SaveStates", "SaveStateIncompatibleVersion");
return false;
} else {

View file

@ -14,7 +14,7 @@ private:
string GetStateFilepath(int stateIndex);
public:
static constexpr uint32_t FileFormatVersion = 1;
static constexpr uint32_t FileFormatVersion = 2;
SaveStateManager(shared_ptr<Console> console);

View file

@ -196,9 +196,9 @@ void Serializer::RecursiveStream(T &value, T2&... args)
template<typename... T>
void Serializer::Stream(T&... args)
{
//StreamStartBlock();
StreamStartBlock();
RecursiveStream(args...);
//StreamEndBlock();
StreamEndBlock();
}
template<typename T>