From f80ff018913eb689e89a6fc50ceb78d132754a8c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 6 Feb 2016 13:47:21 +0100 Subject: MAME related settings are saved on request only (nw) --- src/lib/util/options.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/lib/util/options.cpp') diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index d7ab454d063..830721127ac 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -58,7 +58,8 @@ core_options::entry::entry(const char *name, const char *description, UINT32 fla m_seqid(0), m_error_reported(false), m_priority(OPTION_PRIORITY_DEFAULT), - m_description(description) + m_description(description), + m_changed(false) { // copy in the name(s) as appropriate if (name != nullptr) @@ -614,6 +615,16 @@ bool core_options::exists(const char *name) const return (m_entrymap.find(name) != m_entrymap.end()); } +//------------------------------------------------- +// is_changed - return if option have been marked +// changed +//------------------------------------------------- + +bool core_options::is_changed(const char *name) const +{ + auto curentry = m_entrymap.find(name); + return (curentry != m_entrymap.end()) ? curentry->second->is_changed() : false; +} //------------------------------------------------- // set_value - set the raw option value //------------------------------------------------- @@ -656,6 +667,16 @@ void core_options::set_flag(const char *name, UINT32 mask, UINT32 flag) curentry->second->set_flag(mask, flag); } +void core_options::mark_changed(const char* name) +{ + // find the entry first + auto curentry = m_entrymap.find(name); + if (curentry == m_entrymap.end()) + { + return; + } + curentry->second->mark_changed(); +} //------------------------------------------------- // reset - reset the options state, removing -- cgit v1.2.3-70-g09d2