diff options
author | 2013-02-27 21:41:49 +0000 | |
---|---|---|
committer | 2013-02-27 21:41:49 +0000 | |
commit | 3dd335f46d5427a4f4a46045f09fec12d61b02cc (patch) | |
tree | a3f8bd464ecc690ee245cb75cd170ae0043f23ec /src/lib/util | |
parent | afdbe5c65193f944ac4af55e1b8d0d99fbe768bc (diff) |
(MESS) Be a bit more fine-grained in when to mark slot options as internal. (nw)
Diffstat (limited to 'src/lib/util')
-rw-r--r-- | src/lib/util/options.c | 17 | ||||
-rw-r--r-- | src/lib/util/options.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c index d89ef85190a..78cab4f08cf 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -153,6 +153,12 @@ void core_options::entry::set_default_value(const char *defvalue) } +void core_options::entry::set_flag(UINT32 mask, UINT32 flag) +{ + m_flags = ( m_flags & mask ) | flag; +} + + //------------------------------------------------- // revert - revert back to our default if we are // at or below the given priority @@ -641,6 +647,17 @@ bool core_options::set_value(const char *name, float value, int priority, astrin } +void core_options::set_flag(const char *name, UINT32 mask, UINT32 flag) +{ + // find the entry first + entry *curentry = m_entrymap.find(name); + if ( curentry == NULL ) + { + return; + } + curentry->set_flag(mask, flag); +} + //------------------------------------------------- // reset - reset the options state, removing // everything diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 28e478afb73..452bd5dbac1 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -122,6 +122,7 @@ public: // setters void set_value(const char *newvalue, int priority); void set_default_value(const char *defvalue); + void set_flag(UINT32 mask, UINT32 flag); void revert(int priority); private: @@ -186,6 +187,7 @@ public: bool set_value(const char *name, const char *value, int priority, astring &error_string); bool set_value(const char *name, int value, int priority, astring &error_string); bool set_value(const char *name, float value, int priority, astring &error_string); + void set_flag(const char *name, UINT32 mask, UINT32 flags); // misc static const char *unadorned(int x = 0) { return s_option_unadorned[MIN(x, MAX_UNADORNED_OPTIONS)]; } |