mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-15 01:07:58 -05:00
Write null memory at end of t6 fastfiles like the original linker does because the game's reader needs it for some reason
This commit is contained in:
17
src/ZoneWriting/Writing/Steps/StepAlign.cpp
Normal file
17
src/ZoneWriting/Writing/Steps/StepAlign.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "StepAlign.h"
|
||||
|
||||
StepAlign::StepAlign(const size_t alignTo, const uint8_t alignValue)
|
||||
: m_align_to(alignTo),
|
||||
m_align_value(alignValue)
|
||||
{
|
||||
}
|
||||
|
||||
void StepAlign::PerformStep(ZoneWriter* zoneWriter, IWritingStream* stream)
|
||||
{
|
||||
const auto pos = stream->Pos();
|
||||
const auto targetPos = (pos + m_align_to - 1) / m_align_to * m_align_to;
|
||||
const auto valueCount = static_cast<size_t>(targetPos - pos);
|
||||
|
||||
for(auto i = 0u; i < valueCount; i++)
|
||||
stream->Write(&m_align_value, sizeof(m_align_value));
|
||||
}
|
Reference in New Issue
Block a user