From dc4705d91f51dc5db059c6a39613191ab2d1c20a Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 6 Jan 2015 23:08:26 +0100 Subject: SDL: Driver accel (draw13.c) now supports "-filter", i.e. bilinear filtering. [Couriersud] --- src/osd/sdl/draw13.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c index b165ca411b6..57b21f8f02e 100644 --- a/src/osd/sdl/draw13.c +++ b/src/osd/sdl/draw13.c @@ -389,17 +389,6 @@ void texture_info::render_quad(const render_primitive *prim, const int x, const target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0); target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0); -#if 0 - // no longer supported in SDL2 - if ((PRIMFLAG_GET_SCREENTEX(prim->m_flags)) && video_config.filter) - { - SDL_SetTextureScaleMode(texture->m_texture_id, DRAW2_SCALEMODE_BEST); - } - else - { - SDL_SetTextureScaleMode(texture->m_texture_id, DRAW2_SCALEMODE_NEAREST); - } -#endif SDL_SetTextureBlendMode(m_texture_id, m_sdl_blendmode); set_coloralphamode(m_texture_id, &prim->color); SDL_RenderCopy(m_renderer, m_texture_id, NULL, &target_rect); @@ -528,6 +517,19 @@ int drawsdl2_init(running_machine &machine, sdl_draw_info *callbacks) else osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : ""); + /* Enable bilinear filtering in case it is supported. + * This applies to all texture operations. However, artwort is pre-scaled + * and thus shouldn't be affected. + */ + if (video_config.filter) + { + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); + } + else + { + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0"); + } + return 0; } -- cgit v1.2.3