mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 07:44:38 +01:00
Move SawyerCoding from util into core, and into its own namespace
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
#include "core/FileStream.h"
|
||||
#include "core/Memory.hpp"
|
||||
#include "core/Path.hpp"
|
||||
#include "core/SawyerCoding.h"
|
||||
#include "core/String.hpp"
|
||||
#include "park/ParkFile.h"
|
||||
#include "rct12/SawyerChunkReader.h"
|
||||
#include "rct2/RCT2.h"
|
||||
#include "scenario/Scenario.h"
|
||||
#include "util/SawyerCoding.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
@@ -135,7 +135,7 @@ static bool TryClassifyAsS4(OpenRCT2::IStream* stream, ClassifiedFileInfo* resul
|
||||
size_t dataLength = static_cast<size_t>(stream->GetLength());
|
||||
auto data = stream->ReadArray<uint8_t>(dataLength);
|
||||
stream->SetPosition(originalPosition);
|
||||
int32_t fileTypeVersion = SawyerCodingDetectFileType(data.get(), dataLength);
|
||||
int32_t fileTypeVersion = SawyerCoding::DetectFileType(data.get(), dataLength);
|
||||
|
||||
int32_t type = fileTypeVersion & FILE_TYPE_MASK;
|
||||
int32_t version = fileTypeVersion & FILE_VERSION_MASK;
|
||||
@@ -173,11 +173,11 @@ static bool TryClassifyAsTD4_TD6(OpenRCT2::IStream* stream, ClassifiedFileInfo*
|
||||
auto data = stream->ReadArray<uint8_t>(dataLength);
|
||||
stream->SetPosition(originalPosition);
|
||||
|
||||
if (SawyerCodingValidateTrackChecksum(data.get(), dataLength))
|
||||
if (SawyerCoding::ValidateTrackChecksum(data.get(), dataLength))
|
||||
{
|
||||
std::unique_ptr<uint8_t, decltype(&Memory::Free<uint8_t>)> td6data(
|
||||
Memory::Allocate<uint8_t>(0x10000), &Memory::Free<uint8_t>);
|
||||
size_t td6len = SawyerCodingDecodeTD6(data.get(), td6data.get(), dataLength);
|
||||
size_t td6len = SawyerCoding::DecodeTD6(data.get(), td6data.get(), dataLength);
|
||||
if (td6data != nullptr && td6len >= 8)
|
||||
{
|
||||
uint8_t version = (td6data.get()[7] >> 2) & 3;
|
||||
|
||||
Reference in New Issue
Block a user