1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-01 19:11:22 +00:00

CompressedBSAFile::FileRecord::isCompressed implementation simplified.

Double space in CompressedBSAFile::FileRecord::getSizeWithoutCompressionFlag removed.
This commit is contained in:
Azdul 2019-01-19 14:41:17 +01:00
parent a8c1c4315c
commit 7880e6f761

View file

@ -61,12 +61,15 @@ bool CompressedBSAFile::FileRecord::isValid() const
bool CompressedBSAFile::FileRecord::isCompressed(bool bsaCompressedByDefault) const bool CompressedBSAFile::FileRecord::isCompressed(bool bsaCompressedByDefault) const
{ {
bool compressionFlagEnabled = ((size & sCompressedFlag) == sCompressedFlag); bool recordCompressionFlagEnabled = ((size & sCompressedFlag) == sCompressedFlag);
if (bsaCompressedByDefault) { //record is compressed when:
return !compressionFlagEnabled; //- bsaCompressedByDefault flag is set and 30th bit is NOT set, or
} //- bsaCompressedByDefault flag is NOT set and 30th bit is set
return compressionFlagEnabled; //record is NOT compressed when:
//- bsaCompressedByDefault flag is NOT set and 30th bit is NOT set, or
//- bsaCompressedByDefault flag is set and 30th bit is set
return (bsaCompressedByDefault != recordCompressionFlagEnabled);
} }
std::uint32_t CompressedBSAFile::FileRecord::getSizeWithoutCompressionFlag() const { std::uint32_t CompressedBSAFile::FileRecord::getSizeWithoutCompressionFlag() const {