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/slider.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/osd/modules/render/bgfx/slider.h') diff --git a/src/osd/modules/render/bgfx/slider.h b/src/osd/modules/render/bgfx/slider.h index eb352af9c73..8ab9129c434 100644 --- a/src/osd/modules/render/bgfx/slider.h +++ b/src/osd/modules/render/bgfx/slider.h @@ -43,7 +43,7 @@ public: SLIDER_SCREEN_TYPE_ANY = SLIDER_SCREEN_TYPE_RASTER | SLIDER_SCREEN_TYPE_VECTOR | SLIDER_SCREEN_TYPE_LCD }; - bgfx_slider(running_machine& machine, std::string name, int32_t min, int32_t def, int32_t max, int32_t step, slider_type type, screen_type screen, float scale, std::string format, std::string description, std::vector& strings); + bgfx_slider(running_machine& machine, std::string name, float min, float def, float max, float step, slider_type type, screen_type screen, std::string format, std::string description, std::vector& strings); ~bgfx_slider(); int32_t update(std::string *str, int32_t newval); @@ -60,16 +60,15 @@ public: protected: slider_state* create_core_slider(running_machine &machine); - int32_t as_int() const { return int32_t(floor(m_value + 0.5f)); } + int32_t as_int() const { return int32_t(floor(m_value / m_step + 0.5f)); } std::string m_name; - int32_t m_min; - int32_t m_default; - int32_t m_max; - int32_t m_step; + float m_min; + float m_default; + float m_max; + float m_step; slider_type m_type; screen_type m_screen_type; - float m_scale; std::string m_format; std::string m_description; std::vector m_strings; -- cgit v1.2.3-70-g09d2