1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codefix: Use bitset .None() or .Any() instead of comparing against an empty bitset. (#14327)

This commit is contained in:
Peter Nelson
2025-06-04 07:31:44 +01:00
committed by GitHub
parent 8f10f9fb5a
commit 2e78c24ba3
4 changed files with 5 additions and 5 deletions

View File

@@ -604,11 +604,11 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
if (length > 0) {
uint8_t zoom = file.ReadByte();
length--;
if (colour != SpriteComponents{} && zoom == 0) { // ZoomLevel::Normal (normal zoom)
if (colour.Any() && zoom == 0) { // ZoomLevel::Normal (normal zoom)
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_1X_32BPP : SCCF_ALLOW_ZOOM_MIN_1X_PAL);
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_2X_32BPP : SCCF_ALLOW_ZOOM_MIN_2X_PAL);
}
if (colour != SpriteComponents{} && zoom == 2) { // ZoomLevel::In2x (2x zoomed in)
if (colour.Any() && zoom == 2) { // ZoomLevel::In2x (2x zoomed in)
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_2X_32BPP : SCCF_ALLOW_ZOOM_MIN_2X_PAL);
}
}