diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java index 53cfc419b3..92085ea204 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java @@ -38,6 +38,8 @@ public enum BooleanSetting implements AbstractBooleanSetting MAIN_RECURSIVE_ISO_PATHS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GENERAL, "RecursiveISOPaths", false), + MAIN_USE_GAME_COVERS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GENERAL, + "UseGameCovers", true), SYSCONF_SCREENSAVER(Settings.FILE_SYSCONF, "IPL", "SSV", false), SYSCONF_WIDESCREEN(Settings.FILE_SYSCONF, "IPL", "AR", true), diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index f3855edc84..410c9acd5f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -224,7 +224,6 @@ public final class SettingsFragmentPresenter sl.add(new SubmenuSetting(R.string.advanced_submenu, MenuTag.CONFIG_ADVANCED)); sl.add(new SubmenuSetting(R.string.log_submenu, MenuTag.CONFIG_LOG)); sl.add(new SubmenuSetting(R.string.debug_submenu, MenuTag.DEBUG)); - sl.add(new HeaderSetting(R.string.gametdb_thanks, 0)); } private void addGeneralSettings(ArrayList sl) @@ -247,6 +246,8 @@ public final class SettingsFragmentPresenter R.string.panic_handlers_description)); sl.add(new CheckBoxSetting(BooleanSetting.MAIN_OSD_MESSAGES, R.string.osd_messages, R.string.osd_messages_description)); + sl.add(new CheckBoxSetting(BooleanSetting.MAIN_USE_GAME_COVERS, R.string.download_game_covers, + 0)); } private void addAudioSettings(ArrayList sl) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PicassoUtils.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PicassoUtils.java index 07d51fd466..429480e34e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PicassoUtils.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/PicassoUtils.java @@ -10,6 +10,7 @@ import com.squareup.picasso.Callback; import com.squareup.picasso.Picasso; import org.dolphinemu.dolphinemu.R; +import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting; import org.dolphinemu.dolphinemu.model.GameFile; import java.io.File; @@ -62,7 +63,7 @@ public class PicassoUtils } // GameTDB has a pretty close to complete collection for US/EN covers. First pass at getting // the cover will be by the disk's region, second will be the US cover, and third EN. - else + else if (BooleanSetting.MAIN_USE_GAME_COVERS.getBooleanGlobal()) { Picasso.get() .load(CoverHelper.buildGameTDBUrl(gameFile, CoverHelper.getRegion(gameFile))) @@ -136,5 +137,16 @@ public class PicassoUtils } }); } + else + { + Picasso.get() + .load(R.drawable.no_banner) + .noFade() + .noPlaceholder() + .fit() + .centerInside() + .config(Bitmap.Config.ARGB_8888) + .into(imageView); + } } } diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 6e92780e04..459ba566e9 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -158,7 +158,6 @@ Some touch controls will require additional tweaking if played in portrait Enable usage statistics reporting If authorized, Dolphin can collect data on its performance, feature usage, and configuration, as well as data on your system\'s hardware and operating system.\n\nNo private data is ever collected. This data helps us understand how people and emulated games use Dolphin and prioritize our efforts. It also helps us identify rare configurations that are causing bugs, performance and stability issues. This authorization can be revoked at any time through Dolphin\'s settings. - Thanks to GameTDB.com for providing GameCube and Wii covers! Interface @@ -166,6 +165,7 @@ Show a message box when a potentially serious error has occurred. Disabling this may avoid annoying and non-fatal messages, but it may result in major crashes having no explanation at all. Show On-Screen Display Messages Display messages over the emulation screen area. These messages include memory card writes, video backend and CPU information, and JIT cache clearing. + Download Game Covers from GameTDB.com Audio diff --git a/Source/Core/Core/Config/UISettings.cpp b/Source/Core/Core/Config/UISettings.cpp index bdd61b1d1e..60d33033ca 100644 --- a/Source/Core/Core/Config/UISettings.cpp +++ b/Source/Core/Core/Config/UISettings.cpp @@ -9,7 +9,11 @@ namespace Config // UI.General const Info MAIN_USE_DISCORD_PRESENCE{{System::Main, "General", "UseDiscordPresence"}, true}; +#ifdef ANDROID +const Info MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, true}; +#else const Info MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, false}; +#endif const Info MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true}; const Info MAIN_RECURSIVE_ISO_PATHS{{System::Main, "General", "RecursiveISOPaths"}, false}; diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 102075e510..a169ef0f66 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -52,6 +52,17 @@ namespace UICommon namespace { const std::string EMPTY_STRING; + +bool UseGameCovers() +{ +#ifdef ANDROID + // Android has its own code for handling covers, written completely in Java. + // It's best if we disable the C++ cover code on Android to avoid duplicated data and such. + return false; +#else + return Config::Get(Config::MAIN_USE_GAME_COVERS); +#endif +} } // Anonymous namespace DiscIO::Language GameFile::GetConfigLanguage() const @@ -169,7 +180,7 @@ bool GameFile::IsValid() const bool GameFile::CustomCoverChanged() { - if (!m_custom_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_custom_cover.buffer.empty() || !UseGameCovers()) return false; std::string path, name; @@ -196,7 +207,7 @@ bool GameFile::CustomCoverChanged() void GameFile::DownloadDefaultCover() { - if (!m_default_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_default_cover.buffer.empty() || !UseGameCovers()) return; const auto cover_path = File::GetUserPath(D_COVERCACHE_IDX) + DIR_SEP; @@ -262,7 +273,7 @@ void GameFile::DownloadDefaultCover() bool GameFile::DefaultCoverChanged() { - if (!m_default_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_default_cover.buffer.empty() || !UseGameCovers()) return false; const auto cover_path = File::GetUserPath(D_COVERCACHE_IDX) + DIR_SEP;