diff options
| author | JosJuice <josjuice@gmail.com> | 2015-12-03 17:29:59 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2015-12-03 17:29:59 +0100 |
| commit | a0cd753060fb8b2701c4e1733cc56da4523f852c (patch) | |
| tree | c458ee7ffc253bed518343bd3ec59cddf5e2bc52 /Source/Core/DolphinQt/GameList/GameFile.cpp | |
| parent | a5904b522d4bb73e24e8d453566cc1cdcd1b7ccb (diff) | |
Don't read from volume when reloading Wii banners
Should make loading cached Wii games that lack banners slightly faster.
Diffstat (limited to 'Source/Core/DolphinQt/GameList/GameFile.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/GameList/GameFile.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp index 44c68ffd8d..66b4c26005 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt/GameList/GameFile.cpp @@ -24,7 +24,7 @@ #include "DolphinQt/GameList/GameFile.h" -static const u32 CACHE_REVISION = 0x00D; // Last changed in PR 3097 +static const u32 CACHE_REVISION = 0x00E; // Last changed in PR 3309 static const u32 DATASTREAM_REVISION = 15; // Introduced in Qt 5.2 static QMap<DiscIO::IVolume::ELanguage, QString> ConvertLocalizedStrings(std::map<DiscIO::IVolume::ELanguage, std::string> strings) @@ -84,13 +84,11 @@ GameFile::GameFile(const QString& fileName) // if a banner has become available after the cache was made. if (m_banner.isNull()) { - std::unique_ptr<DiscIO::IVolume> volume(DiscIO::CreateVolumeFromFilename(fileName.toStdString())); - if (volume != nullptr) - { - ReadBanner(*volume); - if (!m_banner.isNull()) - SaveToCache(); - } + int width, height; + std::vector<u32> buffer = DiscIO::IVolume::GetWiiBanner(&width, &height, m_title_id); + ReadBanner(buffer, width, height); + if (!m_banner.isNull()) + SaveToCache(); } } else @@ -112,10 +110,13 @@ GameFile::GameFile(const QString& fileName) m_volume_size = volume->GetSize(); m_unique_id = QString::fromStdString(volume->GetUniqueID()); + volume->GetTitleID(&m_title_id); m_disc_number = volume->GetDiscNumber(); m_revision = volume->GetRevision(); - ReadBanner(*volume); + int width, height; + std::vector<u32> buffer = volume->GetBanner(&width, &height); + ReadBanner(buffer, width, height); m_valid = true; SaveToCache(); @@ -188,6 +189,7 @@ bool GameFile::LoadFromCache() >> descriptions >> m_company >> m_unique_id + >> m_title_id >> blob_type >> m_file_size >> m_volume_size @@ -231,6 +233,7 @@ void GameFile::SaveToCache() << CastLocalizedStrings<u8>(m_descriptions) << m_company << m_unique_id + << m_title_id << (u32)m_blob_type << m_file_size << m_volume_size @@ -267,10 +270,8 @@ QString GameFile::CreateCacheFilename() const } // Outputs to m_banner -void GameFile::ReadBanner(const DiscIO::IVolume& volume) +void GameFile::ReadBanner(const std::vector<u32>& buffer, int width, int height) { - int width, height; - std::vector<u32> buffer = volume.GetBanner(&width, &height); QImage banner(width, height, QImage::Format_RGB888); for (int i = 0; i < width * height; i++) { |
