Copy/paste some code from Windows OSD to get SDL going again - sorry if this is dirty

This commit is contained in:
Vas Crabb 2016-03-24 05:00:05 +11:00
parent bc43490a4c
commit 173dcfaaa5
3 changed files with 54 additions and 2 deletions

View File

@ -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;
}

View File

@ -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
//============================================================

View File

@ -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)