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

@@ -97,7 +97,7 @@ void AssetsCache::Init()
stream->Read(tmp1);
#endif
if (flags & AssetsCacheFlags::RelativePaths && e.Info.Path.HasChars())
if (EnumHasAnyFlags(flags, AssetsCacheFlags::RelativePaths) && e.Info.Path.HasChars())
{
// Convert to absolute path
e.Info.Path = Globals::StartupFolder / e.Info.Path;
@@ -125,7 +125,7 @@ void AssetsCache::Init()
String mappedPath;
stream->ReadString(&mappedPath, i + 73);
if (flags & AssetsCacheFlags::RelativePaths && mappedPath.HasChars())
if (EnumHasAnyFlags(flags, AssetsCacheFlags::RelativePaths) && mappedPath.HasChars())
{
// Convert to absolute path
mappedPath = Globals::StartupFolder / mappedPath;