mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-12-27 12:31:50 +00:00
chore: rename iw4 zone constants for zone version
This commit is contained in:
@@ -16,8 +16,8 @@ namespace IW4
|
||||
static constexpr const char* MAGIC_SIGNED_OAT = "ABff0100";
|
||||
static constexpr const char* MAGIC_UNSIGNED = "IWffu100";
|
||||
static constexpr const char* MAGIC_IW4X = "IW4x";
|
||||
static constexpr int ZONE_VERSION = 276;
|
||||
static constexpr int IW4X_ZONE_VERSION = 3;
|
||||
static constexpr int ZONE_VERSION_PC = 276;
|
||||
static constexpr int ZONE_VERSION_IW4x = 3;
|
||||
static constexpr int ZONE_VERSION_XENON = 269;
|
||||
|
||||
static_assert(std::char_traits<char>::length(MAGIC_SIGNED_INFINITY_WARD) == sizeof(ZoneHeader::m_magic));
|
||||
|
||||
@@ -48,12 +48,12 @@ namespace
|
||||
std::optional<ZoneLoaderInspectionResultIW4> InspectZoneHeaderIw4(const ZoneHeader& header)
|
||||
{
|
||||
|
||||
if (endianness::FromLittleEndian(header.m_version) == ZoneConstants::ZONE_VERSION)
|
||||
if (endianness::FromLittleEndian(header.m_version) == ZoneConstants::ZONE_VERSION_PC)
|
||||
{
|
||||
if (!memcmp(header.m_magic, ZoneConstants::MAGIC_IW4X, std::char_traits<char>::length(ZoneConstants::MAGIC_IW4X)))
|
||||
{
|
||||
if (*reinterpret_cast<const uint32_t*>(&header.m_magic[std::char_traits<char>::length(ZoneConstants::MAGIC_IW4X)])
|
||||
== ZoneConstants::IW4X_ZONE_VERSION)
|
||||
== ZoneConstants::ZONE_VERSION_IW4x)
|
||||
{
|
||||
return ZoneLoaderInspectionResultIW4{
|
||||
.m_generic_result =
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace
|
||||
ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial)
|
||||
{
|
||||
ZoneHeader header{};
|
||||
header.m_version = ZoneConstants::ZONE_VERSION;
|
||||
header.m_version = ZoneConstants::ZONE_VERSION_PC;
|
||||
|
||||
if (isSecure)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user