mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Reimplement custom PNG banners in game list
Fixes https://bugs.dolphin-emu.org/issues/10938 and makes PNG banners available in DolphinQt2 for the first time.
This commit is contained in:
@ -83,7 +83,7 @@ public:
|
||||
virtual std::map<Language, std::string> GetShortMakers() const { return {}; }
|
||||
virtual std::map<Language, std::string> GetLongMakers() const { return {}; }
|
||||
virtual std::map<Language, std::string> GetDescriptions() const { return {}; }
|
||||
virtual std::vector<u32> GetBanner(int* width, int* height) const = 0;
|
||||
virtual std::vector<u32> GetBanner(u32* width, u32* height) const = 0;
|
||||
std::string GetApploaderDate() const { return GetApploaderDate(GetGamePartition()); }
|
||||
virtual std::string GetApploaderDate(const Partition& partition) const = 0;
|
||||
// 0 is the first disc, 1 is the second disc
|
||||
|
@ -150,7 +150,7 @@ std::map<Language, std::string> VolumeGC::GetDescriptions() const
|
||||
return m_converted_banner->descriptions;
|
||||
}
|
||||
|
||||
std::vector<u32> VolumeGC::GetBanner(int* width, int* height) const
|
||||
std::vector<u32> VolumeGC::GetBanner(u32* width, u32* height) const
|
||||
{
|
||||
*width = m_converted_banner->image_width;
|
||||
*height = m_converted_banner->image_height;
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
std::map<Language, std::string> GetShortMakers() const override;
|
||||
std::map<Language, std::string> GetLongMakers() const override;
|
||||
std::map<Language, std::string> GetDescriptions() const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
std::vector<u32> GetBanner(u32* width, u32* height) const override;
|
||||
std::string GetApploaderDate(const Partition& partition = PARTITION_NONE) const override;
|
||||
std::optional<u8> GetDiscNumber(const Partition& partition = PARTITION_NONE) const override;
|
||||
|
||||
@ -54,8 +54,8 @@ public:
|
||||
u64 GetRawSize() const override;
|
||||
|
||||
private:
|
||||
static const int GC_BANNER_WIDTH = 96;
|
||||
static const int GC_BANNER_HEIGHT = 32;
|
||||
static const u32 GC_BANNER_WIDTH = 96;
|
||||
static const u32 GC_BANNER_HEIGHT = 32;
|
||||
|
||||
struct GCBannerInformation
|
||||
{
|
||||
@ -89,8 +89,8 @@ private:
|
||||
std::map<Language, std::string> descriptions;
|
||||
|
||||
std::vector<u32> image_buffer;
|
||||
int image_height = 0;
|
||||
int image_width = 0;
|
||||
u32 image_height = 0;
|
||||
u32 image_width = 0;
|
||||
};
|
||||
|
||||
ConvertedGCBanner LoadBannerFile() const;
|
||||
|
@ -144,7 +144,7 @@ std::map<Language, std::string> VolumeWAD::GetLongNames() const
|
||||
return ReadWiiNames(names);
|
||||
}
|
||||
|
||||
std::vector<u32> VolumeWAD::GetBanner(int* width, int* height) const
|
||||
std::vector<u32> VolumeWAD::GetBanner(u32* width, u32* height) const
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
return "";
|
||||
}
|
||||
std::map<Language, std::string> GetLongNames() const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
std::vector<u32> GetBanner(u32* width, u32* height) const override;
|
||||
std::string GetApploaderDate(const Partition& partition = PARTITION_NONE) const override
|
||||
{
|
||||
return "";
|
||||
|
@ -308,7 +308,7 @@ std::map<Language, std::string> VolumeWii::GetLongNames() const
|
||||
return ReadWiiNames(names);
|
||||
}
|
||||
|
||||
std::vector<u32> VolumeWii::GetBanner(int* width, int* height) const
|
||||
std::vector<u32> VolumeWii::GetBanner(u32* width, u32* height) const
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
std::optional<u16> GetRevision(const Partition& partition) const override;
|
||||
std::string GetInternalName(const Partition& partition) const override;
|
||||
std::map<Language, std::string> GetLongNames() const override;
|
||||
std::vector<u32> GetBanner(int* width, int* height) const override;
|
||||
std::vector<u32> GetBanner(u32* width, u32* height) const override;
|
||||
std::string GetApploaderDate(const Partition& partition) const override;
|
||||
std::optional<u8> GetDiscNumber(const Partition& partition) const override;
|
||||
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
constexpr unsigned int BANNER_WIDTH = 192;
|
||||
constexpr unsigned int BANNER_HEIGHT = 64;
|
||||
constexpr unsigned int BANNER_SIZE = BANNER_WIDTH * BANNER_HEIGHT * 2;
|
||||
constexpr u32 BANNER_WIDTH = 192;
|
||||
constexpr u32 BANNER_HEIGHT = 64;
|
||||
constexpr u32 BANNER_SIZE = BANNER_WIDTH * BANNER_HEIGHT * 2;
|
||||
|
||||
constexpr unsigned int ICON_WIDTH = 48;
|
||||
constexpr unsigned int ICON_HEIGHT = 48;
|
||||
constexpr unsigned int ICON_SIZE = ICON_WIDTH * ICON_HEIGHT * 2;
|
||||
constexpr u32 ICON_WIDTH = 48;
|
||||
constexpr u32 ICON_HEIGHT = 48;
|
||||
constexpr u32 ICON_SIZE = ICON_WIDTH * ICON_HEIGHT * 2;
|
||||
|
||||
WiiSaveBanner::WiiSaveBanner(u64 title_id)
|
||||
: WiiSaveBanner(Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT) +
|
||||
@ -55,7 +55,7 @@ std::string WiiSaveBanner::GetDescription() const
|
||||
return UTF16BEToUTF8(m_header.description, ArraySize(m_header.description));
|
||||
}
|
||||
|
||||
std::vector<u32> WiiSaveBanner::GetBanner(int* width, int* height) const
|
||||
std::vector<u32> WiiSaveBanner::GetBanner(u32* width, u32* height) const
|
||||
{
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
@ -22,7 +22,7 @@ public:
|
||||
std::string GetName() const;
|
||||
std::string GetDescription() const;
|
||||
|
||||
std::vector<u32> GetBanner(int* width, int* height) const;
|
||||
std::vector<u32> GetBanner(u32* width, u32* height) const;
|
||||
|
||||
private:
|
||||
struct Header
|
||||
|
Reference in New Issue
Block a user