SkyPortal-plugin/Source/SkyPortal/Private/SkyPortalFigure.cpp
2024-09-29 17:43:07 +02:00

57 lines
1.4 KiB
C++

#pragma once
#include "SkyPortalFigure.h"
UFigureData::UFigureData()
{
ClearData();
GenerationID = EVariantIDGeneration::UNKNOW;
}
int32 UFigureData::GetFigureID()
{
if (ID == 0) {
int16_t OutFigureID = 0;
// The figure ID is stored in Block 1 of Sector 0 (i.e., data[1]), bytes 0 and 1 (16-bit integer, little-endian)
OutFigureID = decryptedData[1][0] | // Least significant byte
(data[1][1] << 8); // Most significant byte, shifted left by 8 bits
ID = OutFigureID;// Return the 16-bit figure ID
return OutFigureID;
}
else { return ID; }
/*
// Variant ID is stored in Block 0, bytes 4 to 5 (16-bit integer, little-endian)
OutVariantID = (DataBlock.blockdata[0][5] << 8) |
DataBlock.blockdata[0][4];
*/
};
int32 UFigureData::GetVariantID() {
int16_t OutFigureID = 0;
// The figure ID is stored in Block 1 of Sector 0 (i.e., data[1]), bytes 0 and 1 (16-bit integer, little-endian)
OutFigureID = decryptedData[1][0] | // Least significant byte
(data[1][1] << 8); // Most significant byte, shifted left by 8 bits
VariantID = OutFigureID;// Return the 16-bit figure ID
return OutFigureID;
}
EVariantIDGeneration UFigureData::GetGeneration()
{
return static_cast<EVariantIDGeneration>(VariantID);
}
void UFigureData::ClearData()
{
}
bool UFigureData::Dump(bool decrypted, FString filePath)
{
return true;
}