diff --git a/src/logic/pakfile.cpp b/src/logic/pakfile.cpp index 2fa7fe4..846f8d6 100644 --- a/src/logic/pakfile.cpp +++ b/src/logic/pakfile.cpp @@ -160,7 +160,7 @@ void CPakFileBuilder::AddStreamingDataEntry(PakStreamSetEntry_s& block, const ui if (paddedSize > block.dataSize) { const size_t paddingRemainder = paddedSize - block.dataSize; - out.SeekPut(paddingRemainder, std::ios::cur); + out.Pad(paddingRemainder); } size_t& nextOffsetCounter = isMandatory ? m_nextMandatoryStarpakOffset : m_nextOptionalStarpakOffset; @@ -868,10 +868,5 @@ void CPakFileBuilder::BuildFromMap(const string& mapPath) Log("Written pak file \"%s\" with %zu assets, totaling %zd bytes.\n", m_pakFilePath.c_str(), GetAssetCount(), totalPakSize); - // if we had pages which we ended up padding out to match the alignment, - // then we need to seek back to the end of the file; SeekPut only writes - // up to len if we either write after it again, or close the stream when - // the SeekPut cursor is at that location. - out.SeekPut(totalPakSize); out.Close(); } diff --git a/src/logic/pakpage.cpp b/src/logic/pakpage.cpp index 1487425..5e9eab8 100644 --- a/src/logic/pakpage.cpp +++ b/src/logic/pakpage.cpp @@ -356,7 +356,7 @@ void CPakPageBuilder::WritePageData(BinaryIO& out) const // - pad out the previous asset to align our current asset. // - pad out the current asset to its full aligned size. // - pad out the page to its full aligned size. - out.SeekPut(lump.size, std::ios::cur); + out.Pad(lump.size); } } }