diff options
Diffstat (limited to 'src/emu/render.cpp')
-rw-r--r-- | src/emu/render.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 7e2ad4c2ca1..0e28f3c0494 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1402,6 +1402,7 @@ render_primitive_list &render_target::get_primitives() { render_primitive *prim = list.alloc(render_primitive::QUAD); set_render_bounds_xy(&prim->bounds, 0.0f, 0.0f, (float)m_width, (float)m_height); + prim->full_bounds = prim->bounds; set_render_color(&prim->color, 1.0f, 1.0f, 1.0f, 1.0f); prim->texture.base = nullptr; prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA); @@ -1411,6 +1412,7 @@ render_primitive_list &render_target::get_primitives() { prim = list.alloc(render_primitive::QUAD); set_render_bounds_xy(&prim->bounds, 1.0f, 1.0f, (float)(m_width - 1), (float)(m_height - 1)); + prim->full_bounds = prim->bounds; set_render_color(&prim->color, 1.0f, 0.0f, 0.0f, 0.0f); prim->texture.base = nullptr; prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA); @@ -1855,6 +1857,9 @@ void render_target::add_container_primitives(render_primitive_list &list, const prim->color.b = container_xform.color.b * curitem.color().b; prim->color.a = container_xform.color.a * curitem.color().a; + // copy unclipped bounds + prim->full_bounds = prim->bounds; + // now switch off the type bool clipped = true; switch (curitem.type()) @@ -1917,7 +1922,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); // apply the final orientation from the quad flags and then build up the final flags - prim->flags = (curitem.flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) + prim->flags |= (curitem.flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) | PRIMFLAG_TEXORIENT(finalorient) | PRIMFLAG_TEXFORMAT(curitem.texture()->format()); prim->flags |= blendmode != -1 @@ -1977,7 +1982,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); // apply the final orientation from the quad flags and then build up the final flags - prim->flags = (curitem.flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) + prim->flags |= (curitem.flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) | PRIMFLAG_TEXORIENT(finalorient); prim->flags |= blendmode != -1 ? PRIMFLAG_BLENDMODE(blendmode) @@ -1986,7 +1991,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const else { // set the basic flags - prim->flags = (curitem.flags() & ~PRIMFLAG_BLENDMODE_MASK) + prim->flags |= (curitem.flags() & ~PRIMFLAG_BLENDMODE_MASK) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA); // apply clipping @@ -2008,22 +2013,23 @@ void render_target::add_container_primitives(render_primitive_list &list, const // allocate a primitive render_primitive *prim = list.alloc(render_primitive::QUAD); set_render_bounds_wh(&prim->bounds, xform.xoffs, xform.yoffs, xform.xscale, xform.yscale); + prim->full_bounds = prim->bounds; prim->color = container_xform.color; width = render_round_nearest(prim->bounds.x1) - render_round_nearest(prim->bounds.x0); height = render_round_nearest(prim->bounds.y1) - render_round_nearest(prim->bounds.y0); container.overlay()->get_scaled( - (container_xform.orientation & ORIENTATION_SWAP_XY) ? height : width, - (container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, prim->texture, list); + (container_xform.orientation & ORIENTATION_SWAP_XY) ? height : width, + (container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, prim->texture, list); // determine UV coordinates prim->texcoords = oriented_texcoords[container_xform.orientation]; // set the flags and add it to the list - prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) | - PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) | - PRIMFLAG_TEXFORMAT(container.overlay()->format()) | - PRIMFLAG_TEXSHADE(1); + prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) + | PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) + | PRIMFLAG_TEXFORMAT(container.overlay()->format()) + | PRIMFLAG_TEXSHADE(1); list.append_or_return(*prim, false); } @@ -2057,6 +2063,7 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob INT32 width = render_round_nearest(xform.xscale); INT32 height = render_round_nearest(xform.yscale); set_render_bounds_wh(&prim->bounds, render_round_nearest(xform.xoffs), render_round_nearest(xform.yoffs), (float) width, (float) height); + prim->full_bounds = prim->bounds; if (xform.orientation & ORIENTATION_SWAP_XY) std::swap(width, height); width = std::min(width, m_maxtexwidth); @@ -2511,6 +2518,7 @@ void render_target::add_clear_extents(render_primitive_list &list) { render_primitive *prim = list.alloc(render_primitive::QUAD); set_render_bounds_xy(&prim->bounds, (float)x0, (float)y0, (float)x1, (float)y1); + prim->full_bounds = prim->bounds; set_render_color(&prim->color, 1.0f, 0.0f, 0.0f, 0.0f); prim->texture.base = nullptr; prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA); |