git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2462 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2009-02-28 01:59:09 +00:00
parent cbd5345696
commit 9ecd025107

View File

@ -75,10 +75,10 @@ CNANDContentLoader::~CNANDContentLoader()
SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index) SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index)
{ {
for (size_t i=0; i<m_TitleMetaContent.size(); i++) for (size_t i=0; i<m_Content.size(); i++)
{ {
if (m_TitleMetaContent[i].m_Index == _Index) if (m_Content[i].m_Index == _Index)
return &m_TitleMetaContent[i]; return &m_Content[i];
} }
return NULL; return NULL;
} }
@ -89,13 +89,9 @@ bool CNANDContentLoader::CreateFromWAD(const std::string& _rName)
if (pReader == NULL) if (pReader == NULL)
return false; return false;
if (!ParseWAD(*pReader)) bool Result = ParseWAD(*pReader);
{
delete pReader; delete pReader;
return false; return Result;
}
delete pReader;
return true;
} }
bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath) bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
@ -117,11 +113,11 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
m_BootIndex = Common::swap16(pTMD + 0x01e0); m_BootIndex = Common::swap16(pTMD + 0x01e0);
m_TitleID = Common::swap64(pTMD + 0x018C); m_TitleID = Common::swap64(pTMD + 0x018C);
m_TitleMetaContent.resize(numEntries); m_Content.resize(numEntries);
for (u32 i = 0; i < numEntries; i++) for (u32 i = 0; i < numEntries; i++)
{ {
SNANDContent& rContent = m_TitleMetaContent[i]; SNANDContent& rContent = m_Content[i];
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i); rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i); rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
@ -224,11 +220,11 @@ bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u
u8* p = pDataApp; u8* p = pDataApp;
m_TitleMetaContent.resize(numEntries); m_Content.resize(numEntries);
for (u32 i=0; i<numEntries; i++) for (u32 i=0; i<numEntries; i++)
{ {
SNANDContent& rContent = m_TitleMetaContent[i]; SNANDContent& rContent = m_Content[i];
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i); rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i); rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);