mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Merge large parts of nakeee's "Soap" branch into trunk, after fixing a few crash bugs in FileUtil.cpp.
Not really anything interesting, just some better comments, some slightly more portable/cleaner code in places. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2459 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -67,10 +67,10 @@ CNANDContentLoader::CNANDContentLoader(const std::string& _rName)
|
||||
|
||||
SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index)
|
||||
{
|
||||
for (size_t i=0; i<m_TileMetaContent.size(); i++)
|
||||
for (size_t i=0; i<m_TitleMetaContent.size(); i++)
|
||||
{
|
||||
if (m_TileMetaContent[i].m_Index == _Index)
|
||||
return &m_TileMetaContent[i];
|
||||
if (m_TitleMetaContent[i].m_Index == _Index)
|
||||
return &m_TitleMetaContent[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -79,7 +79,7 @@ bool CNANDContentLoader::CreateFromWAD(const std::string& _rName)
|
||||
{
|
||||
DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str());
|
||||
if (pReader == NULL)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
if (!ParseWAD(*pReader))
|
||||
{
|
||||
@ -89,6 +89,7 @@ bool CNANDContentLoader::CreateFromWAD(const std::string& _rName)
|
||||
delete pReader;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
|
||||
{
|
||||
std::string TMDFileName(_rPath);
|
||||
@ -108,12 +109,11 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
|
||||
m_BootIndex = Common::swap16(pTMD + 0x01e0);
|
||||
m_TitleID = Common::swap64(pTMD + 0x018C);
|
||||
|
||||
m_TitleMetaContent.resize(numEntries);
|
||||
|
||||
m_TileMetaContent.resize(numEntries);
|
||||
|
||||
for (u32 i=0; i<numEntries; i++)
|
||||
for (u32 i = 0; i < numEntries; i++)
|
||||
{
|
||||
SNANDContent& rContent = m_TileMetaContent[i];
|
||||
SNANDContent& rContent = m_TitleMetaContent[i];
|
||||
|
||||
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
|
||||
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
|
||||
@ -216,11 +216,11 @@ bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u
|
||||
|
||||
u8* p = pDataApp;
|
||||
|
||||
m_TileMetaContent.resize(numEntries);
|
||||
m_TitleMetaContent.resize(numEntries);
|
||||
|
||||
for (u32 i=0; i<numEntries; i++)
|
||||
{
|
||||
SNANDContent& rContent = m_TileMetaContent[i];
|
||||
SNANDContent& rContent = m_TitleMetaContent[i];
|
||||
|
||||
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
|
||||
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
|
||||
|
Reference in New Issue
Block a user