summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2020-06-13 21:04:52 +0200
committer hap <happppp@users.noreply.github.com>2020-06-13 21:05:06 +0200
commit18bd40b8ca276f50e7fda2d1676c3c5338c009ac (patch)
tree1c19492bf0d6f27ded191773ae3d6dfd545e28f9
parenta3c65b6ce2b7401e24670601117d2d3d12e50840 (diff)
ui: only warn about external artwork when it wasn't loaded (nw)
-rw-r--r--src/emu/render.cpp26
-rw-r--r--src/emu/render.h2
-rw-r--r--src/frontend/mame/ui/info.cpp19
3 files changed, 31 insertions, 16 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 8501bdf99df..fb019544d6d 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -906,6 +906,7 @@ template <typename T> render_target::render_target(render_manager &manager, T &&
, m_maxtexwidth(65536)
, m_maxtexheight(65536)
, m_transform_container(true)
+ , m_external_artwork(false)
{
// determine the base layer configuration based on options
m_base_layerconfig.set_zoom_to_screen(manager.machine().options().artwork_crop());
@@ -1530,7 +1531,7 @@ void render_target::update_layer_config()
void render_target::load_layout_files(const internal_layout *layoutfile, bool singlefile)
{
- bool have_artwork = false;
+ bool have_artwork = false;
// if there's an explicit file, load that first
const std::string &basename = m_manager.machine().basename();
@@ -1544,7 +1545,7 @@ void render_target::load_layout_files(const internal_layout *layoutfile, bool si
void render_target::load_layout_files(util::xml::data_node const &rootnode, bool singlefile)
{
- bool have_artwork = false;
+ bool have_artwork = false;
// if there's an explicit file, load that first
const std::string &basename = m_manager.machine().basename();
@@ -1557,32 +1558,31 @@ void render_target::load_layout_files(util::xml::data_node const &rootnode, bool
void render_target::load_additional_layout_files(const char *basename, bool have_artwork)
{
- bool have_default = false;
- bool have_override = false;
+ m_external_artwork = false;
// if override_artwork defined, load that and skip artwork other than default
const char *const override_art = m_manager.machine().options().override_artwork();
if (override_art && *override_art)
{
if (load_layout_file(override_art, override_art))
- have_override = true;
+ m_external_artwork = true;
else if (load_layout_file(override_art, "default"))
- have_override = true;
+ m_external_artwork = true;
}
const game_driver &system = m_manager.machine().system();
// Skip if override_artwork has found artwork
- if (!have_override)
+ if (!m_external_artwork)
{
-
// try to load a file based on the driver name
if (!load_layout_file(basename, system.name))
- have_artwork |= load_layout_file(basename, "default");
+ m_external_artwork |= load_layout_file(basename, "default");
else
- have_artwork = true;
+ m_external_artwork = true;
// if a default view has been specified, use that as a fallback
+ bool have_default = false;
if (system.default_layout)
have_default |= load_layout_file(nullptr, *system.default_layout);
m_manager.machine().config().apply_default_layouts(
@@ -1594,15 +1594,17 @@ void render_target::load_additional_layout_files(const char *basename, bool have
while (0 <= cloneof)
{
if (!load_layout_file(driver_list::driver(cloneof).name, driver_list::driver(cloneof).name))
- have_artwork |= load_layout_file(driver_list::driver(cloneof).name, "default");
+ m_external_artwork |= load_layout_file(driver_list::driver(cloneof).name, "default");
else
- have_artwork = true;
+ m_external_artwork = true;
// Check the parent of the parent to cover bios based artwork
const game_driver &parent(driver_list::driver(cloneof));
cloneof = driver_list::clone(parent);
}
+ have_artwork |= m_external_artwork;
+
// Use fallback artwork if defined and no artwork has been found yet
if (!have_artwork)
{
diff --git a/src/emu/render.h b/src/emu/render.h
index ce4ea3c66df..0a59d7d894e 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -922,6 +922,7 @@ public:
render_layer_config layer_config() const { return m_layerconfig; }
layout_view *current_view() const { return m_curview; }
int view() const { return view_index(*m_curview); }
+ bool external_artwork() const { return m_external_artwork; }
bool hidden() const { return ((m_flags & RENDER_CREATE_HIDDEN) != 0); }
bool is_ui_target() const;
int index() const;
@@ -1038,6 +1039,7 @@ private:
s32 m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents
bool m_transform_container; // determines whether the screen container is transformed by the core renderer,
// otherwise the respective render API will handle the transformation (scale, offset)
+ bool m_external_artwork; // external artwork was loaded (driver file or override)
};
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 76b2f012731..4ed48005057 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -104,6 +104,17 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
local_ports.append(device, sink);
}
+ // suppress "requires external artwork" warning when external artwork was loaded
+ if (config.root_device().has_running_machine())
+ {
+ for (render_target *target = config.root_device().machine().render().first_target(); target != nullptr; target = target->next())
+ if (!target->hidden() && target->external_artwork())
+ {
+ m_flags &= ~::machine_flags::REQUIRES_ARTWORK;
+ break;
+ }
+ }
+
// unemulated trumps imperfect when aggregating (always be pessimistic)
m_imperfect_features &= ~m_unemulated_features;
@@ -136,7 +147,7 @@ rgb_t machine_static_info::status_color() const
{
if ((machine_flags() & MACHINE_ERRORS) || ((unemulated_features() | imperfect_features()) & device_t::feature::PROTECTION))
return UI_RED_COLOR;
- else if ((machine_flags() & MACHINE_WARNINGS) || unemulated_features() || imperfect_features())
+ else if ((machine_flags() & MACHINE_WARNINGS & ~::machine_flags::REQUIRES_ARTWORK) || unemulated_features() || imperfect_features())
return UI_YELLOW_COLOR;
else
return UI_GREEN_COLOR;
@@ -238,11 +249,11 @@ std::string machine_info::warnings_string() const
// add one line per machine warning flag
if (machine_flags() & ::machine_flags::NO_COCKTAIL)
buf << _("Screen flipping in cocktail mode is not supported.\n");
- if (machine_flags() & ::machine_flags::REQUIRES_ARTWORK) // check if external artwork is present before displaying this warning?
+ if (machine_flags() & ::machine_flags::REQUIRES_ARTWORK)
buf << _("This machine requires external artwork files.\n");
- if (machine_flags() & ::machine_flags::IS_INCOMPLETE )
+ if (machine_flags() & ::machine_flags::IS_INCOMPLETE)
buf << _("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n");
- if (machine_flags() & ::machine_flags::NO_SOUND_HW )
+ if (machine_flags() & ::machine_flags::NO_SOUND_HW)
buf << _("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n");
// these are more severe warnings