summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/GameList/GameFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinQt/GameList/GameFile.cpp')
-rw-r--r--Source/Core/DolphinQt/GameList/GameFile.cpp25
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++)
{