1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Use SawyerChunkReader instead of SawyerEncoding

This commit is contained in:
Ted John
2017-02-05 12:18:07 +00:00
parent 7ab2723936
commit 5eee31f69a
5 changed files with 38 additions and 37 deletions

View File

@@ -16,7 +16,7 @@
#include "core/FileStream.hpp"
#include "FileClassifier.h"
#include "rct12/SawyerEncoding.h"
#include "rct12/SawyerChunkReader.h"
extern "C"
{
@@ -71,9 +71,10 @@ bool TryClassifyFile(IStream * stream, ClassifiedFile * result)
static bool TryClassifyAsS6(IStream * stream, ClassifiedFile * result)
{
rct_s6_header s6Header;
if (SawyerEncoding::TryReadChunk(&s6Header, stream))
try
{
auto chunkReader = SawyerChunkReader(stream);
auto s6Header = chunkReader.ReadChunkAs<rct_s6_header>();
if (s6Header.type == S6_TYPE_SAVEDGAME)
{
result->Type = FILE_TYPE::SAVED_GAME;
@@ -85,7 +86,9 @@ static bool TryClassifyAsS6(IStream * stream, ClassifiedFile * result)
result->Version = s6Header.version;
return true;
}
catch (Exception)
{
}
return false;
}