mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-30 21:32:42 +00:00
Move outside the condition + fix bug: missing offset
This commit is contained in:
parent
d73ab7ef6f
commit
78251a2bb1
@ -635,11 +635,11 @@ namespace Bsa
|
|||||||
// append chunks
|
// append chunks
|
||||||
for (const auto& c : fileRecord.texturesChunks)
|
for (const auto& c : fileRecord.texturesChunks)
|
||||||
{
|
{
|
||||||
|
Files::IStreamPtr streamPtr = Files::openConstrainedFileStream(mFilepath, c.offset, c.packedSize);
|
||||||
|
std::istream* fileStream = streamPtr.get();
|
||||||
|
|
||||||
if (c.packedSize != 0)
|
if (c.packedSize != 0)
|
||||||
{
|
{
|
||||||
Files::IStreamPtr streamPtr = Files::openConstrainedFileStream(mFilepath, c.offset, c.packedSize);
|
|
||||||
std::istream* fileStream = streamPtr.get();
|
|
||||||
|
|
||||||
boost::iostreams::filtering_streambuf<boost::iostreams::input> inputStreamBuf;
|
boost::iostreams::filtering_streambuf<boost::iostreams::input> inputStreamBuf;
|
||||||
inputStreamBuf.push(boost::iostreams::zlib_decompressor());
|
inputStreamBuf.push(boost::iostreams::zlib_decompressor());
|
||||||
inputStreamBuf.push(*fileStream);
|
inputStreamBuf.push(*fileStream);
|
||||||
@ -650,9 +650,7 @@ namespace Bsa
|
|||||||
// uncompressed chunk
|
// uncompressed chunk
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Files::IStreamPtr streamPtr = Files::openConstrainedFileStream(mFilepath, c.offset, c.packedSize);
|
fileStream->read(memoryStreamPtr->getRawData() + offset, c.size);
|
||||||
std::istream* fileStream = streamPtr.get();
|
|
||||||
fileStream->read(memoryStreamPtr->getRawData(), c.size);
|
|
||||||
}
|
}
|
||||||
offset += c.size;
|
offset += c.size;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user