From 659874cb6567baa964b381b19aaca51fc2f7aa40 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Sun, 9 Jun 2024 22:05:42 -0500 Subject: [PATCH] FEAT: Update land flag representation in ESMTool --- apps/esmtool/labels.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index 83b4a486e1..3d64563923 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -766,18 +767,16 @@ std::string enchantmentFlags(int flags) std::string landFlags(std::uint32_t flags) { std::string properties; - // The ESM component says that this first four bits are used, but - // only the first three bits are used as far as I can tell. - // There's also no enumeration of the bit in the ESM component. if (flags == 0) properties += "[None] "; - if (flags & 0x00000001) - properties += "Unknown1 "; - if (flags & 0x00000004) - properties += "Unknown3 "; - if (flags & 0x00000002) - properties += "Unknown2 "; - if (flags & 0xFFFFFFF8) + if (flags & ESM::Land::Flag_HeightsNormals) + properties += "HeightsNormals "; + if (flags & ESM::Land::Flag_Colors) + properties += "Colors "; + if (flags & ESM::Land::Flag_Textures) + properties += "Textures "; + int unused = 0xFFFFFFFF ^ (ESM::Land::Flag_HeightsNormals | ESM::Land::Flag_Colors | ESM::Land::Flag_Textures); + if (flags & unused) properties += "Invalid "; properties += Misc::StringUtils::format("(0x%08X)", flags); return properties;