cleanup: merge handling of ntsc/pal games in gamelist/isoproperties

This commit is contained in:
LPFaint99 2011-12-20 02:19:46 -08:00
parent e4c4602d9e
commit 8f6c25a5aa
2 changed files with 15 additions and 27 deletions

View File

@ -434,7 +434,6 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
// company: 0x007030 // company: 0x007030
int ImageIndex = -1; int ImageIndex = -1;
wxCSConv WindowsCP1252(wxFontMapper::GetEncodingName(wxFONTENCODING_CP1252));
#ifdef _WIN32 #ifdef _WIN32
wxCSConv SJISConv(*(wxCSConv*)wxConvCurrent); wxCSConv SJISConv(*(wxCSConv*)wxConvCurrent);
static bool validCP932 = ::IsValidCodePage(932) != 0; static bool validCP932 = ::IsValidCodePage(932) != 0;
@ -477,7 +476,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
// On Wii we show the description instead as the company string is empty // On Wii we show the description instead as the company string is empty
if (rISOFile.GetPlatform() == GameListItem::GAMECUBE_DISC) if (rISOFile.GetPlatform() == GameListItem::GAMECUBE_DISC)
company = rISOFile.GetCompany().c_str(); company = rISOFile.GetCompany().c_str();
int SelectedLanguage = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
switch (rISOFile.GetCountry()) switch (rISOFile.GetCountry())
{ {
case DiscIO::IVolume::COUNTRY_TAIWAN: case DiscIO::IVolume::COUNTRY_TAIWAN:
@ -493,28 +492,24 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
} }
break; break;
case DiscIO::IVolume::COUNTRY_USA: case DiscIO::IVolume::COUNTRY_USA:
rISOFile.GetName(wname); SelectedLanguage = 0;
SetItem(_Index, COLUMN_TITLE,
wxString(rISOFile.GetName(0).c_str(), WindowsCP1252), -1);
m_gameList.append(StringFromFormat("%s (U)\n", rISOFile.GetName(0).c_str()));
SetItem(_Index, COLUMN_NOTES,
wxString(company.size() ?
company.c_str() : rISOFile.GetDescription(0).c_str(), WindowsCP1252), -1);
break;
default: default:
rISOFile.GetName(wname, SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage); {
wxCSConv WindowsCP1252(wxFontMapper::GetEncodingName(wxFONTENCODING_CP1252));
rISOFile.GetName(wname, SelectedLanguage);
SetItem(_Index, COLUMN_TITLE, SetItem(_Index, COLUMN_TITLE,
wxString( wxString(
rISOFile.GetName(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage).c_str(), WindowsCP1252), rISOFile.GetName(SelectedLanguage).c_str(), WindowsCP1252),
-1); -1);
m_gameList.append(StringFromFormat("%s (E)\n", m_gameList.append(StringFromFormat("%s (%c)\n",
rISOFile.GetName(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage).c_str())); rISOFile.GetName(SelectedLanguage).c_str(), (rISOFile.GetCountry() == DiscIO::IVolume::COUNTRY_USA)?'U':'E'));
SetItem(_Index, COLUMN_NOTES, SetItem(_Index, COLUMN_NOTES,
wxString(company.size() ? wxString(company.size() ?
company.c_str() : company.c_str() :
rISOFile.GetDescription(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage).c_str(), WindowsCP1252), rISOFile.GetDescription(SelectedLanguage).c_str(), WindowsCP1252),
-1); -1);
}
break; break;
} }

View File

@ -1266,7 +1266,6 @@ void CISOProperties::ChangeBannerDetails(int lang)
comment, comment,
maker; maker;
wxCSConv WindowsCP1252(wxFontMapper::GetEncodingName(wxFONTENCODING_CP1252));
#ifdef _WIN32 #ifdef _WIN32
wxCSConv SJISConv(*(wxCSConv*)wxConvCurrent); wxCSConv SJISConv(*(wxCSConv*)wxConvCurrent);
static bool validCP932 = ::IsValidCodePage(932) != 0; static bool validCP932 = ::IsValidCodePage(932) != 0;
@ -1298,15 +1297,10 @@ void CISOProperties::ChangeBannerDetails(int lang)
maker = wxString(OpenGameListItem->GetCompany().c_str(), SJISConv); maker = wxString(OpenGameListItem->GetCompany().c_str(), SJISConv);
break; break;
case DiscIO::IVolume::COUNTRY_USA: case DiscIO::IVolume::COUNTRY_USA:
if (OpenGameListItem->GetName(wname)) lang = 0;
shortName = wname;
else
shortName = wxString(OpenGameListItem->GetName(0).c_str(), WindowsCP1252);
if ((comment = OpenGameListItem->GetDescription()).size() == 0)
comment = wxString(OpenGameListItem->GetDescription(0).c_str(), WindowsCP1252);
maker = wxString(OpenGameListItem->GetCompany().c_str(), WindowsCP1252);
break;
default: default:
{
wxCSConv WindowsCP1252(wxFontMapper::GetEncodingName(wxFONTENCODING_CP1252));
if (OpenGameListItem->GetName(wname, lang)) if (OpenGameListItem->GetName(wname, lang))
shortName = wname; shortName = wname;
else else
@ -1314,8 +1308,7 @@ void CISOProperties::ChangeBannerDetails(int lang)
if ((comment = OpenGameListItem->GetDescription()).size() == 0) if ((comment = OpenGameListItem->GetDescription()).size() == 0)
comment = wxString(OpenGameListItem->GetDescription(lang).c_str(), WindowsCP1252); comment = wxString(OpenGameListItem->GetDescription(lang).c_str(), WindowsCP1252);
maker = wxString(OpenGameListItem->GetCompany().c_str(), WindowsCP1252); maker = wxString(OpenGameListItem->GetCompany().c_str(), WindowsCP1252);
break; }
break; break;
} }
// Updates the informations shown in the window // Updates the informations shown in the window