diff options
author | 2016-04-22 19:32:35 +0200 | |
---|---|---|
committer | 2016-04-22 19:32:35 +0200 | |
commit | b681e5dc2bd9972a1dd1bc34eee8d61e3791bfe5 (patch) | |
tree | 85fe33988a1bfbb848eeee5ee26c2046509b3329 /src/osd/modules/render/bgfx/statereader.cpp | |
parent | 9167349e5e54379054ec042e3d102c3bbae6e521 (diff) |
Simplified min, max, default and step value handling for chain configuration
- min, max, default and step are now floating points without an addition scale factor
Diffstat (limited to 'src/osd/modules/render/bgfx/statereader.cpp')
-rw-r--r-- | src/osd/modules/render/bgfx/statereader.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp index 91f3bd539bd..0f43ad71b09 100644 --- a/src/osd/modules/render/bgfx/statereader.cpp +++ b/src/osd/modules/render/bgfx/statereader.cpp @@ -97,6 +97,15 @@ int state_reader::get_int(const Value& value, const std::string name, const int return default_value; } +float state_reader::get_float(const Value& value, const std::string name, const float default_value) +{ + if (value.HasMember(name.c_str())) + { + return (float)value[name.c_str()].GetDouble(); + } + return default_value; +} + void state_reader::get_float(const Value& value, const std::string name, float* out, float* default_value, int count) { if (value.HasMember(name.c_str())) |