summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/inputpair.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-01-08 05:06:50 +1100
committer Vas Crabb <vas@vastheman.com>2023-01-08 05:06:50 +1100
commitc4f62ccb59574ed11024d10634c9e579374ba4d1 (patch)
treebeb97aec6000b60424ce9c03d5574066e45cc89f /src/osd/modules/render/bgfx/inputpair.cpp
parentbd87008722cc33b2adc83dc4611afc2e4eccb294 (diff)
bgfx: Save values of most sliders per-system.
Diffstat (limited to 'src/osd/modules/render/bgfx/inputpair.cpp')
-rw-r--r--src/osd/modules/render/bgfx/inputpair.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp
index 5f1324c2581..db12144e952 100644
--- a/src/osd/modules/render/bgfx/inputpair.cpp
+++ b/src/osd/modules/render/bgfx/inputpair.cpp
@@ -11,15 +11,18 @@
#include "inputpair.h"
-#include "../frontend/mame/ui/slider.h"
-
-#include "texture.h"
-#include "target.h"
-#include "effect.h"
-#include "uniform.h"
#include "chainmanager.h"
+#include "effect.h"
#include "slider.h"
#include "sliderdirtynotifier.h"
+#include "target.h"
+#include "texture.h"
+#include "uniform.h"
+
+#include "../frontend/mame/ui/slider.h"
+
+#include "util/strformat.h"
+
bgfx_input_pair::bgfx_input_pair(int index, std::string sampler, std::string texture, std::vector<std::string> available_textures, std::string selection, chain_manager& chains, uint32_t screen_index)
: m_index(index)
@@ -109,11 +112,11 @@ void bgfx_input_pair::create_selection_slider(uint32_t screen_index)
int32_t maxval = m_available_textures.size() - 1;
int32_t incval = 1;
- std::string description = "Window " + std::to_string(chains().window_index()) + ", Screen " + std::to_string(screen_index) + " " + m_selection + ":";
-
using namespace std::placeholders;
- m_slider_state = std::make_unique<slider_state>(std::move(description), minval, defval, maxval, incval,
- std::bind(&bgfx_input_pair::texture_changed, this, screen_index, _1, _2));
+ m_slider_state = std::make_unique<slider_state>(
+ util::string_format("Window %1$u, Screen %1$u %3$s", chains().window_index(), screen_index, m_selection),
+ minval, defval, maxval, incval,
+ std::bind(&bgfx_input_pair::texture_changed, this, screen_index, _1, _2));
ui::menu_item item(ui::menu_item_type::SLIDER, m_slider_state.get());
item.set_text(m_slider_state->description);
@@ -130,9 +133,7 @@ std::vector<ui::menu_item> bgfx_input_pair::get_slider_list()
std::vector<ui::menu_item> sliders;
if (!needs_sliders())
- {
return sliders;
- }
sliders.push_back(m_selection_slider);