From c19669e3813ee15529c7b112e24cc96e8411b39a Mon Sep 17 00:00:00 2001 From: emb <> Date: Thu, 22 Oct 2015 20:55:32 -0500 Subject: [PATCH] Suport new mame xml format (changed "game" to "machine"). --- RetroFE/Source/Database/MetadataDatabase.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RetroFE/Source/Database/MetadataDatabase.cpp b/RetroFE/Source/Database/MetadataDatabase.cpp index 80a93b1..19453f1 100644 --- a/RetroFE/Source/Database/MetadataDatabase.cpp +++ b/RetroFE/Source/Database/MetadataDatabase.cpp @@ -417,7 +417,14 @@ bool MetadataDatabase::importMamelist(std::string filename, std::string collecti } sqlite3_exec(handle, "BEGIN IMMEDIATE TRANSACTION;", NULL, NULL, &error); - for (rapidxml::xml_node<> * game = rootNode->first_node("game"); game; game = game->next_sibling()) + std::string gameNodeName = "game"; + + // support new mame formats + if(rootNode->first_node(gameNodeName.c_str()) == NULL) { + gameNodeName = "machine"; + } + + for (rapidxml::xml_node<> * game = rootNode->first_node(gameNodeName.c_str()); game; game = game->next_sibling()) { rapidxml::xml_attribute<> *nameNode = game->first_attribute("name"); rapidxml::xml_attribute<> *cloneOfXml = game->first_attribute("cloneof");