mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
Implemented .elf and .dol support in gamelist
Fixed a TON of structuring, formatting. removed README.txt files from themes at MaJoR's request Added platform icon for ELFs/DOLs
This commit is contained in:
@ -66,10 +66,12 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
, m_emu_state(0)
|
||||
, m_FileSize(0)
|
||||
, m_Revision(0)
|
||||
, m_Country(DiscIO::IVolume::COUNTRY_UNKNOWN)
|
||||
, m_Valid(false)
|
||||
, m_BlobCompressed(false)
|
||||
, m_ImageWidth(0)
|
||||
, m_ImageHeight(0)
|
||||
, m_disc_number(0)
|
||||
{
|
||||
if (LoadFromCache())
|
||||
{
|
||||
@ -129,6 +131,13 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
ini.GetIfExists("EmuState", "EmulationIssues", &m_issues);
|
||||
}
|
||||
|
||||
if (!IsValid() && IsElfOrDol())
|
||||
{
|
||||
m_Valid = true;
|
||||
m_FileSize = File::GetSize(_rFileName);
|
||||
m_Platform = DiscIO::IVolume::ELF_DOL;
|
||||
}
|
||||
|
||||
if (!m_pImage.empty())
|
||||
{
|
||||
wxImage Image(m_ImageWidth, m_ImageHeight, &m_pImage[0], true);
|
||||
@ -238,8 +247,11 @@ std::string GameListItem::GetName() const
|
||||
std::string name = GetName(SConfig::GetInstance().GetCurrentLanguage(wii));
|
||||
if (name.empty())
|
||||
{
|
||||
std::string ext;
|
||||
|
||||
// No usable name, return filename (better than nothing)
|
||||
SplitPath(GetFileName(), nullptr, &name, nullptr);
|
||||
SplitPath(GetFileName(), nullptr, &name, &ext);
|
||||
return name + ext;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
@ -283,3 +295,18 @@ const std::string GameListItem::GetWiiFSPath() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool GameListItem::IsElfOrDol() const
|
||||
{
|
||||
const std::string name = GetName();
|
||||
const size_t pos = name.rfind('.');
|
||||
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
std::string ext = name.substr(pos);
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
|
||||
|
||||
return ext == ".elf" ||
|
||||
ext == ".dol";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user