DolphinQt: Store GameFile banner as empty if missing
This commit is contained in:
parent
6d9711c02c
commit
8793f7c325
|
@ -22,7 +22,6 @@
|
||||||
#include "DiscIO/Filesystem.h"
|
#include "DiscIO/Filesystem.h"
|
||||||
|
|
||||||
#include "DolphinQt/GameList/GameFile.h"
|
#include "DolphinQt/GameList/GameFile.h"
|
||||||
#include "DolphinQt/Utils/Resources.h"
|
|
||||||
#include "DolphinQt/Utils/Utils.h"
|
#include "DolphinQt/Utils/Utils.h"
|
||||||
|
|
||||||
static const u32 CACHE_REVISION = 0x00A;
|
static const u32 CACHE_REVISION = 0x00A;
|
||||||
|
@ -72,12 +71,9 @@ static QString GetLanguageString(DiscIO::IVolume::ELanguage language, QMap<DiscI
|
||||||
GameFile::GameFile(const QString& fileName)
|
GameFile::GameFile(const QString& fileName)
|
||||||
: m_file_name(fileName)
|
: m_file_name(fileName)
|
||||||
{
|
{
|
||||||
bool hasBanner = false;
|
|
||||||
|
|
||||||
if (LoadFromCache())
|
if (LoadFromCache())
|
||||||
{
|
{
|
||||||
m_valid = true;
|
m_valid = true;
|
||||||
hasBanner = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -115,15 +111,13 @@ GameFile::GameFile(const QString& fileName)
|
||||||
(buffer[i] & 0x0000FF) >> 0));
|
(buffer[i] & 0x0000FF) >> 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_valid = true;
|
||||||
|
|
||||||
if (!banner.isNull())
|
if (!banner.isNull())
|
||||||
{
|
{
|
||||||
hasBanner = true;
|
|
||||||
m_banner = QPixmap::fromImage(banner);
|
m_banner = QPixmap::fromImage(banner);
|
||||||
}
|
|
||||||
|
|
||||||
m_valid = true;
|
|
||||||
if (hasBanner)
|
|
||||||
SaveToCache();
|
SaveToCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,9 +132,6 @@ GameFile::GameFile(const QString& fileName)
|
||||||
ini.GetIfExists("EmuState", "EmulationIssues", &issues_temp);
|
ini.GetIfExists("EmuState", "EmulationIssues", &issues_temp);
|
||||||
m_issues = QString::fromStdString(issues_temp);
|
m_issues = QString::fromStdString(issues_temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasBanner)
|
|
||||||
m_banner = Resources::GetPixmap(Resources::BANNER_MISSING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameFile::LoadFromCache()
|
bool GameFile::LoadFromCache()
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include "DiscIO/Volume.h"
|
#include "DiscIO/Volume.h"
|
||||||
#include "DiscIO/VolumeCreator.h"
|
#include "DiscIO/VolumeCreator.h"
|
||||||
|
|
||||||
|
#include "DolphinQt/Utils/Resources.h"
|
||||||
|
|
||||||
class GameFile final
|
class GameFile final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -39,7 +41,13 @@ public:
|
||||||
u64 GetVolumeSize() const { return m_volume_size; }
|
u64 GetVolumeSize() const { return m_volume_size; }
|
||||||
// 0 is the first disc, 1 is the second disc
|
// 0 is the first disc, 1 is the second disc
|
||||||
u8 GetDiscNumber() const { return m_disc_number; }
|
u8 GetDiscNumber() const { return m_disc_number; }
|
||||||
const QPixmap GetBitmap() const { return m_banner; }
|
const QPixmap GetBitmap() const
|
||||||
|
{
|
||||||
|
if (m_banner.isNull())
|
||||||
|
return Resources::GetPixmap(Resources::BANNER_MISSING);
|
||||||
|
|
||||||
|
return m_banner;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_file_name;
|
QString m_file_name;
|
||||||
|
|
Loading…
Reference in New Issue