mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
UI: makes dolphin displays japanese region games' names and their descriptions.
only work on windows and asian language support installed. (without fonts and codepages, we can not display text, I'm sure). BTW, I only test on GC games, I've no Wii games now, and .\User\Cache directory must be cleared to work (delete all cached files) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1972 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -47,16 +47,22 @@ CBannerLoaderGC::CBannerLoaderGC(DiscIO::IFileSystem& _rFileSystem)
|
||||
if (FileSize > 0)
|
||||
{
|
||||
m_pBannerFile = new u8[FileSize];
|
||||
_rFileSystem.ReadFile("opening.bnr", m_pBannerFile, FileSize);
|
||||
m_IsValid = true;
|
||||
if (m_pBannerFile)
|
||||
{
|
||||
_rFileSystem.ReadFile("opening.bnr", m_pBannerFile, FileSize);
|
||||
m_IsValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CBannerLoaderGC::~CBannerLoaderGC()
|
||||
{
|
||||
delete [] m_pBannerFile;
|
||||
m_pBannerFile = NULL;
|
||||
if (m_pBannerFile)
|
||||
{
|
||||
delete [] m_pBannerFile;
|
||||
m_pBannerFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -83,23 +89,38 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage)
|
||||
|
||||
|
||||
bool
|
||||
CBannerLoaderGC::GetName(std::string& _rName, int language)
|
||||
CBannerLoaderGC::GetName(std::string& _rName, DiscIO::IVolume::ECountry language)
|
||||
{
|
||||
_rName = "invalid image";
|
||||
_rName = "no name";
|
||||
|
||||
bool returnCode = false;
|
||||
|
||||
if (!IsValid())
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
|
||||
|
||||
if (!CopyToStringAndCheck(_rName, language != 0 ? pBanner->comment[0].shortTitle : pBanner->comment[0].longTitle))
|
||||
// find Banner type
|
||||
if (DiscIO::IVolume::COUNTRY_JAP == language)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
DVDBanner* pBanner = (DVDBanner*)m_pBannerFile;
|
||||
|
||||
return(true);
|
||||
// dunno, if dolphin using unicode, it will be better = =;
|
||||
if (CopySJISToString(_rName, pBanner->comment.shortTitle))
|
||||
{
|
||||
returnCode = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
|
||||
|
||||
if (CopyToStringAndCheck(_rName, pBanner->comment[0].shortTitle))//language != 0 ? pBanner->comment[0].shortTitle : pBanner->comment[0].longTitle))
|
||||
{
|
||||
returnCode = true;
|
||||
}
|
||||
}
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
|
||||
@ -125,23 +146,38 @@ CBannerLoaderGC::GetCompany(std::string& _rCompany)
|
||||
|
||||
|
||||
bool
|
||||
CBannerLoaderGC::GetDescription(std::string& _rDescription)
|
||||
CBannerLoaderGC::GetDescription(std::string& _rDescription, DiscIO::IVolume::ECountry language)
|
||||
{
|
||||
_rDescription = "invalid images";
|
||||
_rDescription = "";
|
||||
|
||||
bool returnCode = false;
|
||||
|
||||
if (!IsValid())
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
|
||||
|
||||
if (!CopyToStringAndCheck(_rDescription, pBanner->comment[0].comment))
|
||||
// find Banner type
|
||||
if (DiscIO::IVolume::COUNTRY_JAP == language)
|
||||
{
|
||||
_rDescription = "";
|
||||
}
|
||||
DVDBanner* pBanner = (DVDBanner*)m_pBannerFile;
|
||||
|
||||
return(true);
|
||||
// dunno, if dolphin using unicode, it will be better = =;
|
||||
if (CopySJISToString(_rDescription, pBanner->comment.comment))
|
||||
{
|
||||
returnCode = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
|
||||
|
||||
if (CopyToStringAndCheck(_rDescription, pBanner->comment[0].comment))
|
||||
{
|
||||
returnCode = true;
|
||||
}
|
||||
}
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user