this should be OK: display some default info when no save exist

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2133 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hyperiris 2009-02-07 17:31:35 +00:00
parent d4c9a8a5fc
commit d5bcb81872
3 changed files with 35 additions and 61 deletions

View File

@ -94,11 +94,6 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage)
bool bool
CBannerLoaderGC::GetName(std::string _rName[]) CBannerLoaderGC::GetName(std::string _rName[])
{ {
for (int i = 0; i < 6; i++)
{
_rName[i] = "no name";
}
bool returnCode = false; bool returnCode = false;
if (!IsValid()) if (!IsValid())
@ -143,7 +138,7 @@ CBannerLoaderGC::GetName(std::string _rName[])
bool bool
CBannerLoaderGC::GetCompany(std::string& _rCompany) CBannerLoaderGC::GetCompany(std::string& _rCompany)
{ {
_rCompany = "invalid images"; _rCompany = "N/A";
if (!IsValid()) if (!IsValid())
{ {
@ -164,11 +159,6 @@ CBannerLoaderGC::GetCompany(std::string& _rCompany)
bool bool
CBannerLoaderGC::GetDescription(std::string* _rDescription) CBannerLoaderGC::GetDescription(std::string* _rDescription)
{ {
for (int i = 0; i< 6; i++)
{
_rDescription[i] = "";
}
bool returnCode = false; bool returnCode = false;
if (!IsValid()) if (!IsValid())

View File

@ -73,53 +73,42 @@ CBannerLoaderWii::IsValid()
bool bool
CBannerLoaderWii::GetBanner(u32* _pBannerImage) CBannerLoaderWii::GetBanner(u32* _pBannerImage)
{ {
if (!IsValid()) if (IsValid())
{ {
return false; SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile;
}
SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile; static u32 Buffer[192 * 64];
decode5A3image(Buffer, (u16*)pBanner->m_BannerTexture, 192, 64);
static u32 Buffer[192 * 64]; // ugly scaling :)
decode5A3image(Buffer, (u16*)pBanner->m_BannerTexture, 192, 64); for (int y=0; y<32; y++)
// ugly scaling :)
for (int y=0; y<32; y++)
{
for (int x=0; x<96; x++)
{ {
_pBannerImage[y*96+x] = Buffer[(y*192*2)+(x*2)]; for (int x=0; x<96; x++)
} {
_pBannerImage[y*96+x] = Buffer[(y*192*2)+(x*2)];
}
}
} }
return true; return true;
} }
bool bool
CBannerLoaderWii::GetName(std::string* _rName) CBannerLoaderWii::GetName(std::string* _rName)
{ {
for (int i = 0; i < 6; i++) if (IsValid())
{ {
_rName[i] = "no name"; // find Banner type
} SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile;
if (!IsValid()) std::string name;
{ if (CopyBeUnicodeToString(name, pBanner->m_Comment[0], WII_BANNER_COMMENT_SIZE))
return false;
}
// find Banner type
SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile;
std::string name;
if (CopyBeUnicodeToString(name, pBanner->m_Comment[0], WII_BANNER_COMMENT_SIZE))
{
for (int i = 0; i < 6; i++)
{ {
_rName[i] = name; for (int i = 0; i < 6; i++)
} {
return true; _rName[i] = name;
}
return true;
}
} }
return false; return false;
} }
@ -136,27 +125,20 @@ CBannerLoaderWii::GetCompany(std::string& _rCompany)
bool bool
CBannerLoaderWii::GetDescription(std::string* _rDescription) CBannerLoaderWii::GetDescription(std::string* _rDescription)
{ {
for (int i = 0; i< 6; i++) if (IsValid())
{ {
_rDescription[i] = ""; // find Banner type
} SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile;
if (!IsValid()) std::string description;
{ if (CopyBeUnicodeToString(description, pBanner->m_Comment[1], WII_BANNER_COMMENT_SIZE))
return false;
}
// find Banner type
SWiiBanner* pBanner = (SWiiBanner*)m_pBannerFile;
std::string description;
if (CopyBeUnicodeToString(description, pBanner->m_Comment[1], WII_BANNER_COMMENT_SIZE))
{
for (int i = 0; i< 6; i++)
{ {
_rDescription[i] = description; for (int i = 0; i< 6; i++)
{
_rDescription[i] = description;
}
return true;
} }
return true;
} }
return false; return false;
} }

View File

@ -59,6 +59,8 @@ GameListItem::GameListItem(const std::string& _rFileName)
if (pVolume != NULL) if (pVolume != NULL)
{ {
m_Name[0] = _rFileName; m_Name[0] = _rFileName;
m_Company = "N/A";
m_Description[0] = "No Description";
m_Country = pVolume->GetCountry(); m_Country = pVolume->GetCountry();
m_FileSize = File::GetSize(_rFileName.c_str()); m_FileSize = File::GetSize(_rFileName.c_str());
m_VolumeSize = pVolume->GetSize(); m_VolumeSize = pVolume->GetSize();