mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
CompressedBSAFile::FileRecord::isCompressed implementation simplified.
Double space in CompressedBSAFile::FileRecord::getSizeWithoutCompressionFlag removed.
This commit is contained in:
parent
a8c1c4315c
commit
7880e6f761
@ -61,16 +61,19 @@ bool CompressedBSAFile::FileRecord::isValid() const
|
||||
|
||||
bool CompressedBSAFile::FileRecord::isCompressed(bool bsaCompressedByDefault) const
|
||||
{
|
||||
bool compressionFlagEnabled = ((size & sCompressedFlag) == sCompressedFlag);
|
||||
bool recordCompressionFlagEnabled = ((size & sCompressedFlag) == sCompressedFlag);
|
||||
|
||||
if (bsaCompressedByDefault) {
|
||||
return !compressionFlagEnabled;
|
||||
}
|
||||
return compressionFlagEnabled;
|
||||
//record is compressed when:
|
||||
//- bsaCompressedByDefault flag is set and 30th bit is NOT set, or
|
||||
//- bsaCompressedByDefault flag is NOT set and 30th bit is set
|
||||
//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 {
|
||||
return size & (~sCompressedFlag);
|
||||
return size & (~sCompressedFlag);
|
||||
}
|
||||
|
||||
void CompressedBSAFile::getBZString(std::string& str, std::istream& filestream)
|
||||
|
Loading…
x
Reference in New Issue
Block a user