mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +03:00
emu/rendersw.hxx: Get rid of obsolete overly specific blend function.
This commit is contained in:
parent
1c50756b3a
commit
bb305af46e
@ -823,103 +823,6 @@ private:
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// 16-BIT YUY RASTERIZERS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw_quad_yuy16_none - perform
|
||||
// rasterization of a 16bpp YUY image
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_quad_yuy16_none(render_primitive const &prim, PixelType *dstdata, u32 pitch, quad_setup_data const &setup)
|
||||
{
|
||||
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
PixelType *dest = dstdata + y * pitch + setup.startx;
|
||||
s32 curu = setup.startu + (y - setup.starty) * setup.dudy;
|
||||
s32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
|
||||
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
*dest++ = source32_to_dest(pix);
|
||||
curu += setup.dudx;
|
||||
curv += setup.dvdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (is_opaque(prim.color.a))
|
||||
{
|
||||
// coloring-only case
|
||||
|
||||
// clamp R,G,B to 0-256 range
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b, 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
PixelType *dest = dstdata + y * pitch + setup.startx;
|
||||
s32 curu = setup.startu + (y - setup.starty) * setup.dudy;
|
||||
s32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
|
||||
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const r = (source32_r(pix) * sr) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
curv += setup.dvdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!is_transparent(prim.color.a))
|
||||
{
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const invsa = u32(std::clamp(256.0f * (1.0f - prim.color.a), 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
PixelType *dest = dstdata + y * pitch + setup.startx;
|
||||
s32 curu = setup.startu + (y - setup.starty) * setup.dudy;
|
||||
s32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
|
||||
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
curv += setup.dvdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// 32-BIT RGB QUAD RASTERIZERS
|
||||
//**************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user