XML data layer: pugixml (external/pugixml, v1.15), a format-neutral DataNode API for every loader, DataFormat=auto|json|xml (default xml), KAGE's archive file system ported (index once, four unpackers, the original's mount order) so --resources can point at an install's resources/ with no import step, the original XML .anm2 loader beside Anm2Ed JSON, mods' own XML; 72 goldens identical from converted resources and from the install

This commit is contained in:
shweet committed 2026-11-24 05:57:54 -05:00
1 parent 74322af121
commit 6d8a43775d
52 files changed
+1513 -909

No files matched your search

+1 -8
View File
@@ -123,13 +123,6 @@ void Menu_SpecialSeeds::LoadGraphics()
specialSeedsSprite.Load(SEEDS_MENU_ANM2, GRAPHICS_LOAD);
}
// Whether a node has an attribute at all, even an empty one.
static bool node_has_attr(DataNode node, std::string_view name)
{
std::string_view value;
return node["attrs"][name].get(value) == simdjson::SUCCESS;
}
// The first child of a node with a tag, or the node itself when there is none.
static DataNode node_child_find(DataNode node, std::string_view tag)
{
@@ -170,7 +163,7 @@ void Menu_SpecialSeeds::entries_load()
std::string implemented(node_attr(node, IMPLEMENTED_ATTR));
int id = std::atoi(std::string(node_attr(node, "id")).c_str());
bool isKnown = id >= 0 && id < SPECIAL_SEED_COUNT;
bool isImplemented = !node_has_attr(node, IMPLEMENTED_ATTR) ||
bool isImplemented = !node_attr_find(node, IMPLEMENTED_ATTR) ||
std::ranges::count(IMPLEMENTED_TRUE, implemented) || std::atoi(implemented.c_str());
if (isImplemented && isKnown && data.specialSeeds[id])