diff options
Diffstat (limited to 'src/osd/modules/render/bgfx/chain.cpp')
-rw-r--r-- | src/osd/modules/render/bgfx/chain.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp index 3cc6e022573..aa1c3739dbe 100644 --- a/src/osd/modules/render/bgfx/chain.cpp +++ b/src/osd/modules/render/bgfx/chain.cpp @@ -21,9 +21,10 @@ #include "chain.h" -bgfx_chain::bgfx_chain(std::string name, std::string author, target_manager& targets, std::vector<bgfx_slider*> sliders, std::vector<bgfx_parameter*> params, std::vector<bgfx_chain_entry*> entries, std::vector<bgfx_target*> target_list, std::uint32_t screen_index) +bgfx_chain::bgfx_chain(std::string name, std::string author, bool transform, target_manager& targets, std::vector<bgfx_slider*> sliders, std::vector<bgfx_parameter*> params, std::vector<bgfx_chain_entry*> entries, std::vector<bgfx_target*> target_list, std::uint32_t screen_index) : m_name(name) , m_author(author) + , m_transform(transform) , m_targets(targets) , m_sliders(sliders) , m_params(params) @@ -60,22 +61,34 @@ bgfx_chain::~bgfx_chain() void bgfx_chain::process(render_primitive* prim, int view, int screen, texture_manager& textures, osd_window& window, uint64_t blend) { + screen_device_iterator screen_iterator(window.machine().root_device()); + screen_device* screen_device = screen_iterator.first(); + for (int i = 0; i < screen; i++) + { + screen_device = screen_iterator.next(); + } + render_container &screen_container = screen_device->container(); + int current_view = view; uint16_t screen_width(floor((prim->bounds.x1 - prim->bounds.x0) + 0.5f)); uint16_t screen_height(floor((prim->bounds.y1 - prim->bounds.y0) + 0.5f)); - uint32_t rotation_type = (window.target()->orientation() & ROT90) == ROT90 ? - 1 : (window.target()->orientation() & ROT180) == ROT180 ? - 2 : (window.target()->orientation() & ROT270) == ROT270 ? - 3 : 0; + uint32_t rotation_type = + (window.target()->orientation() & ROT90) == ROT90 ? 1 : + (window.target()->orientation() & ROT180) == ROT180 ? 2 : + (window.target()->orientation() & ROT270) == ROT270 ? 3 : 0; bool orientation_swap_xy = (window.machine().system().flags & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; - bool rotation_swap_xy = (window.target()->orientation() & ROT90) == ROT90 || (window.target()->orientation() & ROT270) == ROT270; + bool rotation_swap_xy = (window.target()->orientation() & ORIENTATION_SWAP_XY) == ORIENTATION_SWAP_XY; bool swap_xy = orientation_swap_xy ^ rotation_swap_xy; + float screen_scale_x = 1.0f / screen_container.xscale(); + float screen_scale_y = 1.0f / screen_container.yscale(); + float screen_offset_x = -screen_container.xoffset(); + float screen_offset_y = -screen_container.yoffset(); for (bgfx_chain_entry* entry : m_entries) { if (!entry->skip()) { - entry->submit(current_view, prim, textures, screen_width, screen_height, rotation_type, swap_xy, blend, screen); + entry->submit(current_view, prim, textures, screen_width, screen_height, screen_scale_x, screen_scale_y, screen_offset_x, screen_offset_y, rotation_type, swap_xy, blend, screen); current_view++; } } |