From b681e5dc2bd9972a1dd1bc34eee8d61e3791bfe5 Mon Sep 17 00:00:00 2001 From: ImJezze Date: Fri, 22 Apr 2016 19:32:35 +0200 Subject: 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 --- src/osd/modules/render/bgfx/statereader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/osd/modules/render/bgfx/statereader.cpp') 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())) -- cgit v1.2.3-70-g09d2