mirror of https://github.com/OpenTTD/OpenTTD
Codefix: Use bitset .None() or .Any() instead of comparing against an empty bitset. (#14327)
parent
8f10f9fb5a
commit
2e78c24ba3
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ static ZoomLevels LoadSpriteV2(SpriteLoader::SpriteCollection &sprite, SpriteFil
|
|||
|
||||
uint8_t zoom = file.ReadByte();
|
||||
|
||||
bool is_wanted_colour_depth = (colour != SpriteComponents{} && (load_32bpp ? colour != SpriteComponent::Palette : colour == SpriteComponent::Palette));
|
||||
bool is_wanted_colour_depth = (colour.Any() && (load_32bpp ? colour != SpriteComponent::Palette : colour == SpriteComponent::Palette));
|
||||
bool is_wanted_zoom_lvl;
|
||||
|
||||
if (sprite_type != SpriteType::MapGen) {
|
||||
|
|
|
@ -229,7 +229,7 @@ RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const
|
|||
*/
|
||||
void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
|
||||
{
|
||||
if (this->facilities == StationFacilities{}) {
|
||||
if (this->facilities.None()) {
|
||||
this->MoveSign(facil_xy);
|
||||
this->random_bits = Random();
|
||||
}
|
||||
|
|
|
@ -1454,7 +1454,7 @@ struct StationViewWindow : public Window {
|
|||
this->SetWidgetLoweredState(WID_SV_CLOSE_AIRPORT, st->facilities.Test(StationFacility::Airport) && st->airport.blocks.Test(AirportBlock::AirportClosed));
|
||||
|
||||
extern const Station *_viewport_highlight_station;
|
||||
this->SetWidgetDisabledState(WID_SV_CATCHMENT, st->facilities == StationFacilities{});
|
||||
this->SetWidgetDisabledState(WID_SV_CATCHMENT, st->facilities.None());
|
||||
this->SetWidgetLoweredState(WID_SV_CATCHMENT, _viewport_highlight_station == st);
|
||||
|
||||
this->DrawWidgets();
|
||||
|
|
Loading…
Reference in New Issue