ui: only warn about external artwork when it wasn't loaded (nw)

This commit is contained in:
hap 2020-06-13 21:04:52 +02:00
parent a3c65b6ce2
commit 18bd40b8ca
3 changed files with 31 additions and 16 deletions

View File

@ -906,6 +906,7 @@ template <typename T> render_target::render_target(render_manager &manager, T &&
, m_maxtexwidth(65536) , m_maxtexwidth(65536)
, m_maxtexheight(65536) , m_maxtexheight(65536)
, m_transform_container(true) , m_transform_container(true)
, m_external_artwork(false)
{ {
// determine the base layer configuration based on options // determine the base layer configuration based on options
m_base_layerconfig.set_zoom_to_screen(manager.machine().options().artwork_crop()); m_base_layerconfig.set_zoom_to_screen(manager.machine().options().artwork_crop());
@ -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) void render_target::load_additional_layout_files(const char *basename, bool have_artwork)
{ {
bool have_default = false; m_external_artwork = false;
bool have_override = false;
// if override_artwork defined, load that and skip artwork other than default // if override_artwork defined, load that and skip artwork other than default
const char *const override_art = m_manager.machine().options().override_artwork(); const char *const override_art = m_manager.machine().options().override_artwork();
if (override_art && *override_art) if (override_art && *override_art)
{ {
if (load_layout_file(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")) else if (load_layout_file(override_art, "default"))
have_override = true; m_external_artwork = true;
} }
const game_driver &system = m_manager.machine().system(); const game_driver &system = m_manager.machine().system();
// Skip if override_artwork has found artwork // Skip if override_artwork has found artwork
if (!have_override) if (!m_external_artwork)
{ {
// try to load a file based on the driver name // try to load a file based on the driver name
if (!load_layout_file(basename, system.name)) if (!load_layout_file(basename, system.name))
have_artwork |= load_layout_file(basename, "default"); m_external_artwork |= load_layout_file(basename, "default");
else else
have_artwork = true; m_external_artwork = true;
// if a default view has been specified, use that as a fallback // if a default view has been specified, use that as a fallback
bool have_default = false;
if (system.default_layout) if (system.default_layout)
have_default |= load_layout_file(nullptr, *system.default_layout); have_default |= load_layout_file(nullptr, *system.default_layout);
m_manager.machine().config().apply_default_layouts( 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) while (0 <= cloneof)
{ {
if (!load_layout_file(driver_list::driver(cloneof).name, driver_list::driver(cloneof).name)) 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 else
have_artwork = true; m_external_artwork = true;
// Check the parent of the parent to cover bios based artwork // Check the parent of the parent to cover bios based artwork
const game_driver &parent(driver_list::driver(cloneof)); const game_driver &parent(driver_list::driver(cloneof));
cloneof = driver_list::clone(parent); cloneof = driver_list::clone(parent);
} }
have_artwork |= m_external_artwork;
// Use fallback artwork if defined and no artwork has been found yet // Use fallback artwork if defined and no artwork has been found yet
if (!have_artwork) if (!have_artwork)
{ {

View File

@ -922,6 +922,7 @@ public:
render_layer_config layer_config() const { return m_layerconfig; } render_layer_config layer_config() const { return m_layerconfig; }
layout_view *current_view() const { return m_curview; } layout_view *current_view() const { return m_curview; }
int view() const { return view_index(*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 hidden() const { return ((m_flags & RENDER_CREATE_HIDDEN) != 0); }
bool is_ui_target() const; bool is_ui_target() const;
int index() const; int index() const;
@ -1038,6 +1039,7 @@ private:
s32 m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents 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, 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) // otherwise the respective render API will handle the transformation (scale, offset)
bool m_external_artwork; // external artwork was loaded (driver file or override)
}; };

View File

@ -104,6 +104,17 @@ machine_static_info::machine_static_info(const ui_options &options, machine_conf
local_ports.append(device, sink); 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) // unemulated trumps imperfect when aggregating (always be pessimistic)
m_imperfect_features &= ~m_unemulated_features; 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)) if ((machine_flags() & MACHINE_ERRORS) || ((unemulated_features() | imperfect_features()) & device_t::feature::PROTECTION))
return UI_RED_COLOR; 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; return UI_YELLOW_COLOR;
else else
return UI_GREEN_COLOR; return UI_GREEN_COLOR;
@ -238,11 +249,11 @@ std::string machine_info::warnings_string() const
// add one line per machine warning flag // add one line per machine warning flag
if (machine_flags() & ::machine_flags::NO_COCKTAIL) if (machine_flags() & ::machine_flags::NO_COCKTAIL)
buf << _("Screen flipping in cocktail mode is not supported.\n"); 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"); 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"); 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"); buf << _("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n");
// these are more severe warnings // these are more severe warnings