mirror of
https://github.com/holub/mame
synced 2025-07-01 08:18:59 +03:00
SDL: Driver accel (draw13.c) now supports "-filter", i.e. bilinear
filtering. [Couriersud]
This commit is contained in:
parent
8da5cfa3dd
commit
dc4705d91f
@ -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.w = round_nearest(prim->bounds.x1 - prim->bounds.x0);
|
||||||
target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0);
|
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);
|
SDL_SetTextureBlendMode(m_texture_id, m_sdl_blendmode);
|
||||||
set_coloralphamode(m_texture_id, &prim->color);
|
set_coloralphamode(m_texture_id, &prim->color);
|
||||||
SDL_RenderCopy(m_renderer, m_texture_id, NULL, &target_rect);
|
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
|
else
|
||||||
osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
|
osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
|
||||||
|
|
||||||
|
/* 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user