summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-08-22 21:26:38 +0200
committerGitHub <noreply@github.com>2017-08-22 21:26:38 +0200
commit232b81999aaa85632799bcd7498f655a91e1c7bc (patch)
treef50e5075d77e843591de0dbe76b7554c77ed8ed2 /Source/Core
parentb13d7f9d473b875493530a50237b2b5b13050da0 (diff)
parent061da1300a67833b75b41db247729844b4ab6cd0 (diff)
Merge pull request #5961 from ligfx/gamefilebanner
GameFile: handle missing banners in UI instead
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/Config/InfoWidget.cpp7
-rw-r--r--Source/Core/DolphinQt2/GameList/GameFile.cpp3
-rw-r--r--Source/Core/DolphinQt2/GameList/GameListModel.cpp2
3 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt2/Config/InfoWidget.cpp b/Source/Core/DolphinQt2/Config/InfoWidget.cpp
index 55fd9896e7..c71648805e 100644
--- a/Source/Core/DolphinQt2/Config/InfoWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/InfoWidget.cpp
@@ -69,7 +69,6 @@ QGroupBox* InfoWidget::CreateBannerDetails()
m_long_maker = CreateValueDisplay();
m_description = new QTextEdit();
m_description->setReadOnly(true);
- QWidget* banner = CreateBannerGraphic();
CreateLanguageSelector();
layout->addRow(tr("Show Language:"), m_language_selector);
@@ -85,7 +84,11 @@ QGroupBox* InfoWidget::CreateBannerDetails()
{
layout->addRow(tr("Name:"), m_long_name);
}
- layout->addRow(tr("Banner:"), banner);
+
+ if (!m_game.GetBanner().isNull())
+ {
+ layout->addRow(tr("Banner:"), CreateBannerGraphic());
+ }
group->setLayout(layout);
return group;
diff --git a/Source/Core/DolphinQt2/GameList/GameFile.cpp b/Source/Core/DolphinQt2/GameList/GameFile.cpp
index 9797dcb31a..9e4e0f1dc2 100644
--- a/Source/Core/DolphinQt2/GameList/GameFile.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameFile.cpp
@@ -99,8 +99,6 @@ void GameFile::ReadBanner(const DiscIO::Volume& volume)
if (!banner.isNull())
m_banner = QPixmap::fromImage(banner);
- else
- m_banner = Resources::GetMisc(Resources::BANNER_MISSING);
}
bool GameFile::LoadFileInfo(const QString& path)
@@ -197,7 +195,6 @@ bool GameFile::TryLoadElfDol()
m_country = DiscIO::Country::COUNTRY_UNKNOWN;
m_blob_type = DiscIO::BlobType::DIRECTORY;
m_raw_size = m_size;
- m_banner = Resources::GetMisc(Resources::BANNER_MISSING);
m_rating = 0;
return true;
diff --git a/Source/Core/DolphinQt2/GameList/GameListModel.cpp b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
index f23ab586db..01fb41c176 100644
--- a/Source/Core/DolphinQt2/GameList/GameListModel.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
@@ -63,6 +63,8 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
// GameCube banners are 96x32, but Wii banners are 192x64.
// TODO: use custom banners from rom directory like DolphinWX?
QPixmap banner = game->GetBanner();
+ if (banner.isNull())
+ banner = Resources::GetMisc(Resources::BANNER_MISSING);
banner.setDevicePixelRatio(std::max(banner.width() / GAMECUBE_BANNER_SIZE.width(),
banner.height() / GAMECUBE_BANNER_SIZE.height()));
return banner;