mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
game name and description WIP: cache all 6 languages, so we don't need refresh cache after we changes language.
move some WIN32 code to CGameListCtrl. nakee, please check linux build, sorry I've not enough time to setup a linux dev environment. and, who can read German helps me to test game name and description display, thanks. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2090 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -94,55 +94,6 @@ bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char*
|
||||
return(bResult);
|
||||
}
|
||||
|
||||
bool IBannerLoader::CopySJISToString( std::string& _rDestination, const char* _src )
|
||||
{
|
||||
bool returnCode = false;
|
||||
#ifdef WIN32
|
||||
// HyperIris: because dolphin using "Use Multi-Byte Character Set",
|
||||
// we must convert the SJIS chars to unicode then to our windows local by hand
|
||||
u32 unicodeNameSize = MultiByteToWideChar(932, MB_PRECOMPOSED,
|
||||
_src, (int)strlen(_src), NULL, NULL);
|
||||
if (unicodeNameSize > 0)
|
||||
{
|
||||
u16* pUnicodeStrBuffer = new u16[unicodeNameSize + 1];
|
||||
if (pUnicodeStrBuffer)
|
||||
{
|
||||
memset(pUnicodeStrBuffer, 0, (unicodeNameSize + 1) * sizeof(u16));
|
||||
if (MultiByteToWideChar(932, MB_PRECOMPOSED,
|
||||
_src, (int)strlen(_src),
|
||||
(LPWSTR)pUnicodeStrBuffer, unicodeNameSize))
|
||||
{
|
||||
u32 ansiNameSize = WideCharToMultiByte(CP_ACP, 0,
|
||||
(LPCWSTR)pUnicodeStrBuffer, unicodeNameSize,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (ansiNameSize > 0)
|
||||
{
|
||||
char* pAnsiStrBuffer = new char[ansiNameSize + 1];
|
||||
if (pAnsiStrBuffer)
|
||||
{
|
||||
memset(pAnsiStrBuffer, 0, (ansiNameSize + 1) * sizeof(char));
|
||||
if (WideCharToMultiByte(CP_ACP, 0,
|
||||
(LPCWSTR)pUnicodeStrBuffer, unicodeNameSize,
|
||||
pAnsiStrBuffer, ansiNameSize, NULL, NULL))
|
||||
{
|
||||
_rDestination = pAnsiStrBuffer;
|
||||
returnCode = true;
|
||||
}
|
||||
delete pAnsiStrBuffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete pUnicodeStrBuffer;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// not implement other than windows
|
||||
_rDestination = _src;
|
||||
returnCode = true;
|
||||
#endif
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
bool IBannerLoader::CopyUnicodeToString( std::string& _rDestination, const u16* _src )
|
||||
{
|
||||
bool returnCode = false;
|
||||
@ -172,7 +123,7 @@ bool IBannerLoader::CopyUnicodeToString( std::string& _rDestination, const u16*
|
||||
#else
|
||||
// FIXME: Horribly broke on non win32
|
||||
// _rDestination = _src;
|
||||
returnCode = true;
|
||||
returnCode = false;
|
||||
#endif
|
||||
return returnCode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user