Codestyle adjustments #3343

This commit is contained in:
Wojtek Figat
2025-08-24 13:46:53 +02:00
parent 4bd8ce37ac
commit df6f8fd8ae
3 changed files with 15 additions and 22 deletions

View File

@@ -60,27 +60,22 @@ void LargeWorlds::UpdateOrigin(Vector3& origin, const Vector3& position)
}
}
bool LayersMask::HasLayer(const StringView& layerName)
bool LayersMask::HasLayer(const StringView& layerName) const
{
return HasLayer(Level::GetLayerIndex(layerName));
}
LayersMask LayersMask::GetMask(StringView layerNames[])
LayersMask LayersMask::GetMask(Span<StringView> layerNames)
{
LayersMask mask(0);
if (layerNames == nullptr)
return mask;
for (int i = 0; i < layerNames->Length(); i++)
for (StringView& layerName : layerNames)
{
StringView& layerName = layerNames[i];
// Ignore blank entries
if (layerName.Length() == 0)
continue;
int index = Level::GetLayerIndex(layerName);
if (index != -1 && !mask.HasLayer(index))
{
mask.Mask |= static_cast<uint32>(1 << index);
}
int32 index = Level::GetLayerIndex(layerName);
if (index != -1)
mask.Mask |= (uint32)(1 << index);
}
return mask;
}