diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c index ecdc24771ad..166d9910cde 100644 --- a/src/osd/sdl/draw13.c +++ b/src/osd/sdl/draw13.c @@ -200,7 +200,7 @@ static int drawsdl2_window_create(sdl_window_info *window, int width, int height static void drawsdl2_window_resize(sdl_window_info *window, int width, int height); static void drawsdl2_window_destroy(sdl_window_info *window); static int drawsdl2_window_draw(sdl_window_info *window, UINT32 dc, int update); -static render_primitive_list &drawsdl2_window_get_primitives(sdl_window_info *window); +static void drawsdl2_set_target_bounds(sdl_window_info *window); static void drawsdl2_destroy_all_textures(sdl_window_info *window); static void drawsdl2_window_clear(sdl_window_info *window); static int drawsdl2_xy_to_render_target(sdl_window_info *window, int x, int y, int *xt, int *yt); @@ -559,7 +559,7 @@ static void drawsdl2_attach(sdl_draw_info *info, sdl_window_info *window) // fill in the callbacks window->create = drawsdl2_window_create; window->resize = drawsdl2_window_resize; - window->get_primitives = drawsdl2_window_get_primitives; + window->set_target_bounds = drawsdl2_set_target_bounds; window->draw = drawsdl2_window_draw; window->destroy = drawsdl2_window_destroy; window->destroy_all_textures = drawsdl2_destroy_all_textures; @@ -687,18 +687,9 @@ static int drawsdl2_xy_to_render_target(sdl_window_info *window, int x, int y, i // drawsdl2_window_get_primitives //============================================================ -static render_primitive_list &drawsdl2_window_get_primitives(sdl_window_info *window) +static void drawsdl2_set_target_bounds(sdl_window_info *window) { - if ((!window->fullscreen()) || (video_config.switchres)) - { - window->blit_surface_size(window->width, window->height); - } - else - { - window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); - } window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); - return window->target->get_primitives(); } //============================================================ diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c index 61b4e04385f..e5fe87666d1 100644 --- a/src/osd/sdl/drawogl.c +++ b/src/osd/sdl/drawogl.c @@ -367,7 +367,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height) static void drawogl_window_resize(sdl_window_info *window, int width, int height); static void drawogl_window_destroy(sdl_window_info *window); static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update); -static render_primitive_list &drawogl_window_get_primitives(sdl_window_info *window); +static void drawogl_set_target_bounds(sdl_window_info *window); static void drawogl_destroy_all_textures(sdl_window_info *window); static void drawogl_window_clear(sdl_window_info *window); static int drawogl_xy_to_render_target(sdl_window_info *window, int x, int y, int *xt, int *yt); @@ -454,7 +454,7 @@ static void drawogl_attach(sdl_draw_info *info, sdl_window_info *window) // fill in the callbacks window->create = drawogl_window_create; window->resize = drawogl_window_resize; - window->get_primitives = drawogl_window_get_primitives; + window->set_target_bounds = drawogl_set_target_bounds; window->draw = drawogl_window_draw; window->destroy = drawogl_window_destroy; window->destroy_all_textures = drawogl_destroy_all_textures; @@ -840,18 +840,9 @@ static int drawogl_xy_to_render_target(sdl_window_info *window, int x, int y, in // drawogl_window_get_primitives //============================================================ -static render_primitive_list &drawogl_window_get_primitives(sdl_window_info *window) +static void drawogl_set_target_bounds(sdl_window_info *window) { - if ((!window->fullscreen()) || (video_config.switchres)) - { - window->blit_surface_size(window->width, window->height); - } - else - { - window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); - } window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); - return window->target->get_primitives(); } //============================================================ diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 591c97b16a3..fdfb05a45c8 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -105,7 +105,7 @@ static void drawsdl_attach(sdl_draw_info *info, sdl_window_info *window); static int drawsdl_window_create(sdl_window_info *window, int width, int height); static void drawsdl_window_resize(sdl_window_info *window, int width, int height); static void drawsdl_window_destroy(sdl_window_info *window); -static render_primitive_list &drawsdl_window_get_primitives(sdl_window_info *window); +static void drawsdl_set_target_bounds(sdl_window_info *window); static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update); static void drawsdl_destroy_all_textures(sdl_window_info *window); static void drawsdl_window_clear(sdl_window_info *window); @@ -221,7 +221,7 @@ static void drawsdl_attach(sdl_draw_info *info, sdl_window_info *window) // fill in the callbacks window->create = drawsdl_window_create; window->resize = drawsdl_window_resize; - window->get_primitives = drawsdl_window_get_primitives; + window->set_target_bounds = drawsdl_set_target_bounds; window->draw = drawsdl_window_draw; window->destroy = drawsdl_window_destroy; window->destroy_all_textures = drawsdl_destroy_all_textures; @@ -460,8 +460,7 @@ static int drawsdl_window_create(sdl_window_info *window, int width, int height) if (!found) { - osd_printf_verbose("window: Scale mode %s not supported!\n", sm->name); - window->machine().ui().popup_time(3, "Scale mode %s not supported!", sm->name); + fatalerror("window: Scale mode %s not supported!", sm->name); } } } @@ -618,26 +617,15 @@ static int drawsdl_xy_to_render_target(sdl_window_info *window, int x, int y, in // drawsdl_window_get_primitives //============================================================ -static render_primitive_list &drawsdl_window_get_primitives(sdl_window_info *window) +static void drawsdl_set_target_bounds(sdl_window_info *window) { sdl_info *sdl = (sdl_info *) window->dxdata; const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; - if ((!window->fullscreen()) || (video_config.switchres)) - { - window->blit_surface_size(window->width, window->height); - } - else - { - window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); - } - if (!sm->is_scale) window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); else window->target->set_bounds(sdl->hw_scale_width, sdl->hw_scale_height); - - return window->target->get_primitives(); } //============================================================ diff --git a/src/osd/sdl/sdlwork.c b/src/osd/sdl/sdlwork.c index 32fe3a8fe1e..a5d1a32644a 100644 --- a/src/osd/sdl/sdlwork.c +++ b/src/osd/sdl/sdlwork.c @@ -687,7 +687,7 @@ static void worker_thread_process(osd_work_queue *queue, work_thread_info *threa // loop until everything is processed while (true) { - osd_work_item *item; + osd_work_item *item = NULL; bool end_loop = false; @@ -767,4 +767,4 @@ bool queue_has_list_items(osd_work_queue *queue) osd_scalable_lock_release(queue->lock, lockslot); return has_list_items; } -#endif // SDLMAME_NOASM \ No newline at end of file +#endif // SDLMAME_NOASM diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c index 09b313fbbec..5a0233c13d4 100644 --- a/src/osd/sdl/window.c +++ b/src/osd/sdl/window.c @@ -109,8 +109,8 @@ struct worker_param { : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) { } - worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist) - : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) + worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list &alist) + : m_window(awindow), m_list(&alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) { } worker_param(sdl_window_info *awindow, int anew_width, int anew_height) @@ -980,8 +980,19 @@ void sdl_window_info::video_window_update(running_machine &machine) if (osd_event_wait(rendered_event, event_wait_ticks)) { + if ((!fullscreen()) || (video_config.switchres)) + { + blit_surface_size(width, height); + } + else + { + blit_surface_size(monitor()->center_width, monitor()->center_height); + } + // ensure the target bounds are up-to-date, and then get the primitives - render_primitive_list *primlist = &get_primitives(this); + set_target_bounds(this); + + render_primitive_list &primlist = target->get_primitives(); // and redraw now diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h index e8d96ef3d97..b33cd418ac0 100644 --- a/src/osd/sdl/window.h +++ b/src/osd/sdl/window.h @@ -94,7 +94,7 @@ struct sdl_window_info int (*create)(sdl_window_info *window, int width, int height); void (*resize)(sdl_window_info *window, int width, int height); int (*draw)(sdl_window_info *window, UINT32 dc, int update); - render_primitive_list &(*get_primitives)(sdl_window_info *window); + void (*set_target_bounds)(sdl_window_info *window); int (*xy_to_render_target)(sdl_window_info *window, int x, int y, int *xt, int *yt); void (*destroy_all_textures)(sdl_window_info *window); void (*destroy)(sdl_window_info *window);