mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
Add header writing to IW4 ZoneWriterFactory
This commit is contained in:
parent
c9f88e5e93
commit
ca1329323b
@ -43,37 +43,36 @@ public:
|
|||||||
#undef XBLOCK_DEF
|
#undef XBLOCK_DEF
|
||||||
}
|
}
|
||||||
|
|
||||||
static ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial, const bool isEncrypted)
|
static ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial)
|
||||||
{
|
{
|
||||||
// ZoneHeader header{};
|
ZoneHeader header{};
|
||||||
// header.m_version = ZoneConstants::ZONE_VERSION;
|
header.m_version = ZoneConstants::ZONE_VERSION;
|
||||||
//
|
|
||||||
// if (isSecure)
|
if (isSecure)
|
||||||
// {
|
{
|
||||||
// if (isOfficial)
|
if (isOfficial)
|
||||||
// memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_TREYARCH, sizeof(ZoneHeader::m_magic));
|
memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_INFINITY_WARD, sizeof(ZoneHeader::m_magic));
|
||||||
// else
|
else
|
||||||
// memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_OAT, sizeof(ZoneHeader::m_magic));
|
memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_OAT, sizeof(ZoneHeader::m_magic));
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// if (isEncrypted)
|
memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, sizeof(ZoneHeader::m_magic));
|
||||||
// memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, sizeof(ZoneHeader::m_magic));
|
}
|
||||||
// else
|
|
||||||
// memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED_SERVER, sizeof(ZoneHeader::m_magic));
|
return header;
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return header;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<ZoneWriter> CreateWriter()
|
std::unique_ptr<ZoneWriter> CreateWriter()
|
||||||
{
|
{
|
||||||
// TODO Support signed fastfiles
|
// TODO Support signed fastfiles
|
||||||
bool isSecure = false;
|
bool isSecure = false;
|
||||||
bool isEncrypted = true;
|
|
||||||
|
|
||||||
SetupBlocks();
|
SetupBlocks();
|
||||||
|
|
||||||
|
// Write zone header
|
||||||
|
m_writer->AddWritingStep(std::make_unique<StepWriteZoneHeader>(CreateHeaderForParams(isSecure, false)));
|
||||||
|
|
||||||
// Return the fully setup zoneloader
|
// Return the fully setup zoneloader
|
||||||
return std::move(m_writer);
|
return std::move(m_writer);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user