Refactor enum flags with __underlying_type and new EnumHasAnyFlags/EnumHasAllFlags

Fixes #832
Closes #886
This commit is contained in:
Wojtek Figat
2023-01-15 12:44:39 +01:00
parent 810f7fb803
commit f127bbebe1
101 changed files with 424 additions and 414 deletions

View File

@@ -116,7 +116,7 @@ Font* FontAsset::CreateFont(int32 size)
FontAsset* FontAsset::GetBold()
{
ScopeLock lock(Locker);
if (_options.Flags & FontFlags::Bold)
if (EnumHasAnyFlags(_options.Flags, FontFlags::Bold))
return this;
if (!_virtualBold)
{
@@ -132,7 +132,7 @@ FontAsset* FontAsset::GetBold()
FontAsset* FontAsset::GetItalic()
{
ScopeLock lock(Locker);
if (_options.Flags & FontFlags::Italic)
if (EnumHasAnyFlags(_options.Flags, FontFlags::Italic))
return this;
if (!_virtualItalic)
{