diff options
author | 2023-01-08 05:06:50 +1100 | |
---|---|---|
committer | 2023-01-08 05:06:50 +1100 | |
commit | c4f62ccb59574ed11024d10634c9e579374ba4d1 (patch) | |
tree | beb97aec6000b60424ce9c03d5574066e45cc89f /src/emu/config.cpp | |
parent | bd87008722cc33b2adc83dc4611afc2e4eccb294 (diff) |
bgfx: Save values of most sliders per-system.
Diffstat (limited to 'src/emu/config.cpp')
-rw-r--r-- | src/emu/config.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/emu/config.cpp b/src/emu/config.cpp index a7d1218abe0..8e9423415ee 100644 --- a/src/emu/config.cpp +++ b/src/emu/config.cpp @@ -307,16 +307,21 @@ bool configuration_manager::save_xml(emu_file &file, config_type which_type) systemnode->set_attribute("name", (which_type == config_type::DEFAULT) ? "default" : machine().system().name); // loop over all registrants and call their save function + util::xml::data_node *curnode = nullptr; for (auto const &type : m_typelist) { - util::xml::data_node *const curnode = systemnode->add_child(type.first.c_str(), nullptr); + if (!curnode || (type.first != curnode->get_name())) + curnode = systemnode->add_child(type.first.c_str(), nullptr); if (!curnode) return false; type.second.save(which_type, curnode); // if nothing was added, just nuke the node if (!curnode->get_value() && !curnode->get_first_child() && !curnode->count_attributes()) + { curnode->delete_node(); + curnode = nullptr; + } } // restore unhandled settings |