refactor: implement base x64 fastfile loading for iw4

This commit is contained in:
Jan
2025-05-03 17:31:17 +01:00
parent 78d8fba6f8
commit 03ccede91c
43 changed files with 1025 additions and 331 deletions

View File

@ -10,17 +10,20 @@ namespace
StepLoadZoneContent(std::function<std::unique_ptr<IContentLoadingEntryPoint>(ZoneInputStream&)> entryPointFactory,
const unsigned pointerBitCount,
const unsigned offsetBlockBitCount,
const block_t insertBlock)
const block_t insertBlock,
MemoryManager& memory)
: m_entry_point_factory(std::move(entryPointFactory)),
m_pointer_bit_count(pointerBitCount),
m_offset_block_bit_count(offsetBlockBitCount),
m_insert_block(insertBlock)
m_insert_block(insertBlock),
m_memory(memory)
{
}
void PerformStep(ZoneLoader& zoneLoader, ILoadingStream& stream) override
{
const auto inputStream = ZoneInputStream::Create(m_pointer_bit_count, m_offset_block_bit_count, zoneLoader.m_blocks, m_insert_block, stream);
const auto inputStream =
ZoneInputStream::Create(m_pointer_bit_count, m_offset_block_bit_count, zoneLoader.m_blocks, m_insert_block, stream, m_memory);
const auto entryPoint = m_entry_point_factory(*inputStream);
assert(entryPoint);
@ -33,6 +36,7 @@ namespace
unsigned m_pointer_bit_count;
unsigned m_offset_block_bit_count;
block_t m_insert_block;
MemoryManager& m_memory;
};
} // namespace
@ -41,8 +45,9 @@ namespace step
std::unique_ptr<ILoadingStep> CreateStepLoadZoneContent(std::function<std::unique_ptr<IContentLoadingEntryPoint>(ZoneInputStream&)> entryPointFactory,
const unsigned pointerBitCount,
const unsigned offsetBlockBitCount,
const block_t insertBlock)
const block_t insertBlock,
MemoryManager& memory)
{
return std::make_unique<StepLoadZoneContent>(std::move(entryPointFactory), pointerBitCount, offsetBlockBitCount, insertBlock);
return std::make_unique<StepLoadZoneContent>(std::move(entryPointFactory), pointerBitCount, offsetBlockBitCount, insertBlock, memory);
}
} // namespace step