mirror of
https://github.com/holub/mame
synced 2025-05-03 13:06:47 +03:00
Copy/paste some code from Windows OSD to get SDL going again - sorry if this is dirty
This commit is contained in:
parent
bc43490a4c
commit
173dcfaaa5
@ -245,9 +245,8 @@ static void output_oslog(const running_machine &machine, const char *buffer)
|
||||
//============================================================
|
||||
|
||||
sdl_osd_interface::sdl_osd_interface(sdl_options &options)
|
||||
: osd_common_t(options), m_options(options)
|
||||
: osd_common_t(options), m_options(options), m_watchdog(nullptr), m_sliders(nullptr)
|
||||
{
|
||||
m_watchdog = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -92,6 +92,15 @@ bool sdl_osd_interface::video_init()
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// get_slider_list
|
||||
//============================================================
|
||||
|
||||
slider_state *sdl_osd_interface::get_slider_list()
|
||||
{
|
||||
return m_sliders;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// video_exit
|
||||
//============================================================
|
||||
|
@ -285,6 +285,50 @@ static void sdlwindow_sync(void)
|
||||
}
|
||||
|
||||
|
||||
void sdl_osd_interface::update_slider_list()
|
||||
{
|
||||
for (sdl_window_info *window = sdl_window_list; window != nullptr; window = window->m_next)
|
||||
{
|
||||
// check if any window has dirty sliders
|
||||
if (&window->renderer() && window->renderer().sliders_dirty())
|
||||
{
|
||||
build_slider_list();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sdl_osd_interface::build_slider_list()
|
||||
{
|
||||
m_sliders = nullptr;
|
||||
slider_state* full_list = nullptr;
|
||||
slider_state* curr = nullptr;
|
||||
for (sdl_window_info *window = sdl_window_list; window != nullptr; window = window->m_next)
|
||||
{
|
||||
// take the sliders of the first window
|
||||
slider_state* window_sliders = window->renderer().get_slider_list();
|
||||
if (window_sliders == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (full_list == nullptr)
|
||||
{
|
||||
full_list = curr = window_sliders;
|
||||
}
|
||||
else
|
||||
{
|
||||
curr->next = window_sliders;
|
||||
}
|
||||
|
||||
while (curr->next != nullptr) {
|
||||
curr = curr->next;
|
||||
}
|
||||
}
|
||||
|
||||
m_sliders = full_list;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// sdlwindow_exit
|
||||
// (main thread)
|
||||
|
Loading…
Reference in New Issue
Block a user