Merge pull request #5961 from ligfx/gamefilebanner

GameFile: handle missing banners in UI instead
This commit is contained in:
Leo Lam
2017-08-22 21:26:38 +02:00
committed by GitHub
3 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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;