diff options
-rw-r--r-- | src/emu/render.cpp | 49 | ||||
-rw-r--r-- | src/emu/render.h | 2 | ||||
-rw-r--r-- | src/mame/drivers/segas32.cpp | 4 | ||||
-rw-r--r-- | src/mame/mess.flt | 1 |
4 files changed, 42 insertions, 14 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 2a6bd7e4760..f8cc9529f42 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1376,7 +1376,7 @@ render_primitive_list &render_target::get_primitives() // if there is no associated element, it must be a screen element if (curitem.screen() != nullptr) - add_container_primitives(list, item_xform, curitem.screen()->container(), blendmode); + add_container_primitives(list, root_xform, item_xform, curitem.screen()->container(), blendmode); else add_element_primitives(list, item_xform, *curitem.element(), curitem.state(), blendmode); } @@ -1418,7 +1418,7 @@ render_primitive_list &render_target::get_primitives() ui_xform.no_center = true; // add UI elements - add_container_primitives(list, ui_xform, debug, BLENDMODE_ALPHA); + add_container_primitives(list, root_xform, ui_xform, debug, BLENDMODE_ALPHA); } // process the UI if we are the UI target @@ -1435,7 +1435,7 @@ render_primitive_list &render_target::get_primitives() ui_xform.no_center = false; // add UI elements - add_container_primitives(list, ui_xform, m_manager.ui_container(), BLENDMODE_ALPHA); + add_container_primitives(list, root_xform, ui_xform, m_manager.ui_container(), BLENDMODE_ALPHA); } // optimize the list before handing it off @@ -1745,7 +1745,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename) // based on the container //------------------------------------------------- -void render_target::add_container_primitives(render_primitive_list &list, const object_transform &xform, render_container &container, int blendmode) +void render_target::add_container_primitives(render_primitive_list &list, const object_transform &root_xform, const object_transform &xform, render_container &container, int blendmode) { // first update the palette for the container, if it is dirty container.update_palette(); @@ -1758,6 +1758,16 @@ void render_target::add_container_primitives(render_primitive_list &list, const cliprect.y1 = xform.yoffs + xform.yscale; sect_render_bounds(&cliprect, &m_bounds); + float root_xoffs = root_xform.xoffs + abs(root_xform.xscale - xform.xscale) * 0.5f; + float root_yoffs = root_xform.yoffs + abs(root_xform.yscale - xform.yscale) * 0.5f; + + render_bounds root_cliprect; + root_cliprect.x0 = root_xoffs; + root_cliprect.y0 = root_yoffs; + root_cliprect.x1 = root_xoffs + root_xform.xscale; + root_cliprect.y1 = root_yoffs + root_xform.yscale; + sect_render_bounds(&root_cliprect, &m_bounds); + // compute the container transform object_transform container_xform; container_xform.orientation = orientation_add(container.orientation(), xform.orientation); @@ -1797,22 +1807,32 @@ void render_target::add_container_primitives(render_primitive_list &list, const render_bounds bounds = curitem.bounds(); apply_orientation(bounds, container_xform.orientation); + float xscale = container_xform.xscale; + float yscale = container_xform.yscale; + float xoffs = container_xform.xoffs; + float yoffs = container_xform.yoffs; + if (!m_transform_container && PRIMFLAG_GET_VECTOR(curitem.flags())) + { + xoffs = root_xoffs; + yoffs = root_yoffs; + } + // allocate the primitive and set the transformed bounds/color data render_primitive *prim = list.alloc(render_primitive::INVALID); prim->container = &container; /* pass the container along for access to user_settings */ - prim->bounds.x0 = render_round_nearest(container_xform.xoffs + bounds.x0 * container_xform.xscale); - prim->bounds.y0 = render_round_nearest(container_xform.yoffs + bounds.y0 * container_xform.yscale); + prim->bounds.x0 = render_round_nearest(xoffs + bounds.x0 * xscale); + prim->bounds.y0 = render_round_nearest(yoffs + bounds.y0 * yscale); if (curitem.internal() & INTERNAL_FLAG_CHAR) { - prim->bounds.x1 = prim->bounds.x0 + render_round_nearest((bounds.x1 - bounds.x0) * container_xform.xscale); - prim->bounds.y1 = prim->bounds.y0 + render_round_nearest((bounds.y1 - bounds.y0) * container_xform.yscale); + prim->bounds.x1 = prim->bounds.x0 + render_round_nearest((bounds.x1 - bounds.x0) * xscale); + prim->bounds.y1 = prim->bounds.y0 + render_round_nearest((bounds.y1 - bounds.y0) * yscale); } else { - prim->bounds.x1 = render_round_nearest(container_xform.xoffs + bounds.x1 * container_xform.xscale); - prim->bounds.y1 = render_round_nearest(container_xform.yoffs + bounds.y1 * container_xform.yscale); + prim->bounds.x1 = render_round_nearest(xoffs + bounds.x1 * xscale); + prim->bounds.y1 = render_round_nearest(yoffs + bounds.y1 * yscale); } // compute the color of the primitive @@ -1841,7 +1861,14 @@ void render_target::add_container_primitives(render_primitive_list &list, const prim->flags |= curitem.flags(); // clip the primitive - clipped = render_clip_line(&prim->bounds, &cliprect); + if (!m_transform_container && PRIMFLAG_GET_VECTOR(curitem.flags())) + { + clipped = render_clip_line(&prim->bounds, &root_cliprect); + } + else + { + clipped = render_clip_line(&prim->bounds, &cliprect); + } break; case CONTAINER_ITEM_QUAD: diff --git a/src/emu/render.h b/src/emu/render.h index ccc0c5f6cd7..731830a767f 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -979,7 +979,7 @@ private: void load_layout_files(const internal_layout *layoutfile, bool singlefile); bool load_layout_file(const char *dirname, const char *filename); bool load_layout_file(const char *dirname, const internal_layout *layout_data); - void add_container_primitives(render_primitive_list &list, const object_transform &xform, render_container &container, int blendmode); + void add_container_primitives(render_primitive_list &list, const object_transform &root_xform, const object_transform &xform, render_container &container, int blendmode); void add_element_primitives(render_primitive_list &list, const object_transform &xform, layout_element &element, int state, int blendmode); bool map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask); diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp index 8330600a67e..251f99639a1 100644 --- a/src/mame/drivers/segas32.cpp +++ b/src/mame/drivers/segas32.cpp @@ -4986,8 +4986,8 @@ void segas32_state::radm_sw2_output( int which, UINT16 data ) { if (which == 0) { - machine().output().set_value("Wiper_lamp", BIT(data, 0)); - machine().output().set_value("Lights_lamp", BIT(data, 1)); + machine().output().set_value("Lights_lamp", BIT(data, 0)); + machine().output().set_value("Wiper_lamp", BIT(data, 1)); } } diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 668c05c1187..e3dddf83677 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -19,6 +19,7 @@ advision.cpp aim65.cpp aim65_40.cpp alesis.cpp +alesis_qs.cpp alphasma.cpp alphatro.cpp altair.cpp |