diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2021-01-04 23:09:05 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2021-01-04 23:09:05 -0500 |
commit | 7989b4ca46d339efc8fee611b306697d230e6012 (patch) | |
tree | 77c4f0e27201d6edc38ea0d8e46565bfeaeb2cb1 /src/osd/modules/render | |
parent | 403f7a099af070e5a5eca1c7742d01933c94a774 (diff) |
osdwindow.cpp: Centralize basic functions; de-virtualize various getters
Diffstat (limited to 'src/osd/modules/render')
-rw-r--r-- | src/osd/modules/render/bgfx/view.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/render/drawbgfx.cpp | 30 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/osd/modules/render/bgfx/view.cpp b/src/osd/modules/render/bgfx/view.cpp index 893aa77c143..4385500edb1 100644 --- a/src/osd/modules/render/bgfx/view.cpp +++ b/src/osd/modules/render/bgfx/view.cpp @@ -13,7 +13,7 @@ void bgfx_view::update() { std::shared_ptr<osd_window> win = m_renderer->assert_window(); - const uint32_t window_index = win->m_index; + const uint32_t window_index = win->index(); const uint32_t width = m_renderer->get_window_width(window_index); const uint32_t height = m_renderer->get_window_height(window_index); diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 39f11a26d37..7f0cd3d5936 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -234,9 +234,9 @@ int renderer_bgfx::create() // create renderer std::shared_ptr<osd_window> win = assert_window(); osd_dim wdim = win->get_size(); - m_width[win->m_index] = wdim.width(); - m_height[win->m_index] = wdim.height(); - if (win->m_index == 0) + m_width[win->index()] = wdim.width(); + m_height[win->index()] = wdim.height(); + if (win->index() == 0) { if (!s_window_set) { @@ -303,7 +303,7 @@ int renderer_bgfx::create() printf("Unknown backend type '%s', going with auto-detection\n", backend.c_str()); } bgfx::init(init); - bgfx::reset(m_width[win->m_index], m_height[win->m_index], video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE); + bgfx::reset(m_width[win->index()], m_height[win->index()], video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE); // Enable debug text. bgfx::setDebug(m_options.bgfx_debug() ? BGFX_DEBUG_STATS : BGFX_DEBUG_TEXT); m_dimensions = osd_dim(m_width[0], m_height[0]); @@ -315,18 +315,18 @@ int renderer_bgfx::create() m_shaders = new shader_manager(m_options); m_effects = new effect_manager(m_options, *m_shaders); - if (win->m_index != 0) + if (win->index() != 0) { #ifdef OSD_WINDOWS - m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast<win_window_info>(win)->platform_window(), m_width[win->m_index], m_height[win->m_index]); + m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast<win_window_info>(win)->platform_window(), m_width[win->index()], m_height[win->index()]); #elif defined(OSD_UWP) - m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast<uwp_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]); + m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast<uwp_window_info>(win)->platform_window()), m_width[win->index()], m_height[win->index()]); #elif defined(OSD_MAC) - m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast<mac_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]); + m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast<mac_window_info>(win)->platform_window()), m_width[win->index()], m_height[win->index()]); #else - m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(std::dynamic_pointer_cast<sdl_window_info>(win)->platform_window()), m_width[win->m_index], m_height[win->m_index]); + m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(std::dynamic_pointer_cast<sdl_window_info>(win)->platform_window()), m_width[win->index()], m_height[win->index()]); #endif - bgfx::touch(win->m_index); + bgfx::touch(win->index()); if (m_ortho_view) { m_ortho_view->set_backbuffer(m_framebuffer); @@ -350,7 +350,7 @@ int renderer_bgfx::create() fatalerror("BGFX: Unable to load required shaders. Please check and reinstall the %s folder\n", m_options.bgfx_path()); } - m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->m_index, *this); + m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->index(), *this); m_sliders_dirty = true; uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT; @@ -372,7 +372,7 @@ void renderer_bgfx::record() { std::shared_ptr<osd_window> win = assert_window(); - if (win->m_index > 0) + if (win->index() > 0) { return; } @@ -840,7 +840,7 @@ int renderer_bgfx::draw(int update) { std::shared_ptr<osd_window> win = assert_window(); - int window_index = win->m_index; + int window_index = win->index(); m_seen_views.clear(); if (m_ortho_view) { @@ -972,7 +972,7 @@ void renderer_bgfx::update_recording() void renderer_bgfx::add_audio_to_recording(const int16_t *buffer, int samples_this_frame) { std::shared_ptr<osd_window> win = assert_window(); - if (m_avi_writer != nullptr && m_avi_writer->recording() && win->m_index == 0) + if (m_avi_writer != nullptr && m_avi_writer->recording() && win->index() == 0) { m_avi_writer->audio_frame(buffer, samples_this_frame); } @@ -982,7 +982,7 @@ bool renderer_bgfx::update_dimensions() { std::shared_ptr<osd_window> win = assert_window(); - const uint32_t window_index = win->m_index; + const uint32_t window_index = win->index(); const uint32_t width = m_width[window_index]; const uint32_t height = m_height[window_index]; |