mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-10-08 08:33:28 +00:00
DiscIO: Fix extra tabs in the banner loader headers
This commit is contained in:
parent
91da031220
commit
d800b5fb74
@ -17,23 +17,20 @@ class IVolume;
|
|||||||
|
|
||||||
class IBannerLoader
|
class IBannerLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
IBannerLoader()
|
||||||
|
{}
|
||||||
|
|
||||||
IBannerLoader()
|
virtual ~IBannerLoader()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
virtual bool IsValid() = 0;
|
||||||
|
|
||||||
virtual ~IBannerLoader()
|
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) = 0;
|
||||||
{}
|
|
||||||
|
|
||||||
|
virtual std::vector<std::string> GetNames() = 0;
|
||||||
virtual bool IsValid() = 0;
|
virtual std::string GetCompany() = 0;
|
||||||
|
virtual std::vector<std::string> GetDescriptions() = 0;
|
||||||
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) = 0;
|
|
||||||
|
|
||||||
virtual std::vector<std::string> GetNames() = 0;
|
|
||||||
virtual std::string GetCompany() = 0;
|
|
||||||
virtual std::vector<std::string> GetDescriptions() = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IBannerLoader* CreateBannerLoader(DiscIO::IFileSystem& _rFileSystem, DiscIO::IVolume *pVolume);
|
IBannerLoader* CreateBannerLoader(DiscIO::IFileSystem& _rFileSystem, DiscIO::IVolume *pVolume);
|
||||||
|
@ -22,70 +22,70 @@ class IFileSystem;
|
|||||||
class CBannerLoaderGC
|
class CBannerLoaderGC
|
||||||
: public IBannerLoader
|
: public IBannerLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CBannerLoaderGC(DiscIO::IFileSystem& _rFileSystem, DiscIO::IVolume* volume);
|
CBannerLoaderGC(DiscIO::IFileSystem& _rFileSystem, DiscIO::IVolume* volume);
|
||||||
virtual ~CBannerLoaderGC();
|
virtual ~CBannerLoaderGC();
|
||||||
|
|
||||||
virtual bool IsValid() override;
|
virtual bool IsValid() override;
|
||||||
|
|
||||||
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) override;
|
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) override;
|
||||||
|
|
||||||
virtual std::vector<std::string> GetNames() override;
|
virtual std::vector<std::string> GetNames() override;
|
||||||
virtual std::string GetCompany() override;
|
virtual std::string GetCompany() override;
|
||||||
virtual std::vector<std::string> GetDescriptions() override;
|
virtual std::vector<std::string> GetDescriptions() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
DVD_BANNER_WIDTH = 96,
|
DVD_BANNER_WIDTH = 96,
|
||||||
DVD_BANNER_HEIGHT = 32
|
DVD_BANNER_HEIGHT = 32
|
||||||
};
|
};
|
||||||
|
|
||||||
enum BANNER_TYPE
|
enum BANNER_TYPE
|
||||||
{
|
{
|
||||||
BANNER_UNKNOWN,
|
BANNER_UNKNOWN,
|
||||||
BANNER_BNR1,
|
BANNER_BNR1,
|
||||||
BANNER_BNR2,
|
BANNER_BNR2,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Banner Comment
|
// Banner Comment
|
||||||
struct DVDBannerComment
|
struct DVDBannerComment
|
||||||
{
|
{
|
||||||
char shortTitle[32]; // Short game title shown in IPL menu
|
char shortTitle[32]; // Short game title shown in IPL menu
|
||||||
char shortMaker[32]; // Short developer, publisher names shown in IPL menu
|
char shortMaker[32]; // Short developer, publisher names shown in IPL menu
|
||||||
char longTitle[64]; // Long game title shown in IPL game start screen
|
char longTitle[64]; // Long game title shown in IPL game start screen
|
||||||
char longMaker[64]; // Long developer, publisher names shown in IPL game start screen
|
char longMaker[64]; // Long developer, publisher names shown in IPL game start screen
|
||||||
char comment[128]; // Game description shown in IPL game start screen in two lines.
|
char comment[128]; // Game description shown in IPL game start screen in two lines.
|
||||||
};
|
};
|
||||||
|
|
||||||
// "opening.bnr" file format for EU console
|
// "opening.bnr" file format for EU console
|
||||||
struct DVDBanner
|
struct DVDBanner
|
||||||
{
|
{
|
||||||
u32 id; // 'BNR2'
|
u32 id; // 'BNR2'
|
||||||
u32 padding[7];
|
u32 padding[7];
|
||||||
u16 image[DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT]; // RGB5A3 96x32 texture image
|
u16 image[DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT]; // RGB5A3 96x32 texture image
|
||||||
DVDBannerComment comment[6]; // Comments in six languages (only 1 for BNR1 type)
|
DVDBannerComment comment[6]; // Comments in six languages (only 1 for BNR1 type)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u32 BNR1_SIZE = sizeof(DVDBanner) - sizeof(DVDBannerComment) * 5;
|
static const u32 BNR1_SIZE = sizeof(DVDBanner) - sizeof(DVDBannerComment) * 5;
|
||||||
static const u32 BNR2_SIZE = sizeof(DVDBanner);
|
static const u32 BNR2_SIZE = sizeof(DVDBanner);
|
||||||
|
|
||||||
template <u32 N>
|
template <u32 N>
|
||||||
std::string GetDecodedString(const char (&data)[N])
|
std::string GetDecodedString(const char (&data)[N])
|
||||||
{
|
{
|
||||||
auto const string_decoder = CVolumeGC::GetStringDecoder(m_country);
|
auto const string_decoder = CVolumeGC::GetStringDecoder(m_country);
|
||||||
|
|
||||||
// strnlen to trim NULLs
|
// strnlen to trim NULLs
|
||||||
return string_decoder(std::string(data, strnlen(data, sizeof(data))));
|
return string_decoder(std::string(data, strnlen(data, sizeof(data))));
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* m_pBannerFile;
|
u8* m_pBannerFile;
|
||||||
bool m_IsValid;
|
bool m_IsValid;
|
||||||
BANNER_TYPE m_BNRType;
|
BANNER_TYPE m_BNRType;
|
||||||
|
|
||||||
BANNER_TYPE getBannerType();
|
BANNER_TYPE getBannerType();
|
||||||
|
|
||||||
DiscIO::IVolume::ECountry const m_country;
|
DiscIO::IVolume::ECountry const m_country;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -18,54 +18,52 @@ class IVolume;
|
|||||||
class CBannerLoaderWii
|
class CBannerLoaderWii
|
||||||
: public IBannerLoader
|
: public IBannerLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CBannerLoaderWii(DiscIO::IVolume *pVolume);
|
||||||
|
|
||||||
CBannerLoaderWii(DiscIO::IVolume *pVolume);
|
virtual ~CBannerLoaderWii();
|
||||||
|
|
||||||
virtual ~CBannerLoaderWii();
|
virtual bool IsValid() override;
|
||||||
|
|
||||||
virtual bool IsValid() override;
|
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) override;
|
||||||
|
|
||||||
virtual std::vector<u32> GetBanner(int* pWidth, int* pHeight) override;
|
virtual std::vector<std::string> GetNames() override;
|
||||||
|
virtual std::string GetCompany() override;
|
||||||
|
virtual std::vector<std::string> GetDescriptions() override;
|
||||||
|
|
||||||
virtual std::vector<std::string> GetNames() override;
|
private:
|
||||||
virtual std::string GetCompany() override;
|
enum
|
||||||
virtual std::vector<std::string> GetDescriptions() override;
|
{
|
||||||
|
TEXTURE_SIZE = 192 * 64 * 2,
|
||||||
|
ICON_SIZE = 48 * 48 * 2,
|
||||||
|
COMMENT_SIZE = 32
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
enum CommentIndex
|
||||||
|
{
|
||||||
|
NAME_IDX,
|
||||||
|
DESC_IDX
|
||||||
|
};
|
||||||
|
|
||||||
enum
|
struct SWiiBanner
|
||||||
{
|
{
|
||||||
TEXTURE_SIZE = 192 * 64 * 2,
|
u32 ID;
|
||||||
ICON_SIZE = 48 * 48 * 2,
|
|
||||||
COMMENT_SIZE = 32
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CommentIndex
|
u32 m_Flag;
|
||||||
{
|
u16 m_Speed;
|
||||||
NAME_IDX,
|
u8 m_Unknown[22];
|
||||||
DESC_IDX
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SWiiBanner
|
// Not null terminated!
|
||||||
{
|
u16 m_Comment[2][COMMENT_SIZE];
|
||||||
u32 ID;
|
u8 m_BannerTexture[TEXTURE_SIZE];
|
||||||
|
u8 m_IconTexture[8][ICON_SIZE];
|
||||||
|
} ;
|
||||||
|
|
||||||
u32 m_Flag;
|
u8* m_pBannerFile;
|
||||||
u16 m_Speed;
|
|
||||||
u8 m_Unknown[22];
|
|
||||||
|
|
||||||
// Not null terminated!
|
bool m_IsValid;
|
||||||
u16 m_Comment[2][COMMENT_SIZE];
|
|
||||||
u8 m_BannerTexture[TEXTURE_SIZE];
|
|
||||||
u8 m_IconTexture[8][ICON_SIZE];
|
|
||||||
} ;
|
|
||||||
|
|
||||||
u8* m_pBannerFile;
|
bool GetStringFromComments(const CommentIndex index, std::string& s);
|
||||||
|
|
||||||
bool m_IsValid;
|
|
||||||
|
|
||||||
bool GetStringFromComments(const CommentIndex index, std::string& s);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user