From ed872d1bd2a8c50086c1fe4f97420a065f249eb1 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 20 Dec 2020 15:28:27 +1100 Subject: Fix some oversights and emergent behaviour with view selection. Exposed the "native snapview" option on the video manager. Trying to use presence of a single view is a poor proxy that breaks with multi-screen systems. Allow rotation to be changed for native snapshot views, and disable the zoom to screen area control when it has no effect on the selected view. Treat an empty string identically to "auto" for view selectction. Previously this was being used for prefix matching so it would force the first view. (This caused the bad snapshot view selection. It had been relying on "internal" not being a common view name prefix so it fell through to automatic selection, but when changed to an empty string it forced the first view.) Documented "auto" as well as "native" for the -snapview option and changed the default to auto rather than an empty string for consistency with the -viewN options. Added [w]string_view handlers to the stuff that's instantiated in strformat.cpp since we'll be increasingly using them. Cleaned up and updated some documentation. --- src/emu/render.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/emu/render.cpp') diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 6b9a1e76f18..68c840f89a6 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1061,8 +1061,8 @@ unsigned render_target::configured_view(const char *viewname, int targetindex, i { layout_view *view = nullptr; - // auto view just selects the nth view - if (strcmp(viewname, "auto") != 0) + // if it isn't "auto" or an empty string, try to match it as a view name prefix + if (viewname && *viewname && strcmp(viewname, "auto")) { // scan for a matching view name size_t const viewlen = strlen(viewname); @@ -3315,7 +3315,7 @@ void render_manager::config_load(config_type cfg_type, util::xml::data_node cons for (util::xml::data_node const *targetnode = parentnode->get_child("target"); targetnode; targetnode = targetnode->get_next_sibling("target")) { render_target *const target = target_by_index(targetnode->get_attribute_int("index", -1)); - if (target) + if (target && !target->hidden()) target->config_load(*targetnode); } -- cgit v1.2.3-70-g09d2