diff options
| author | JosJuice <josjuice@gmail.com> | 2015-04-09 17:44:53 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2015-04-23 08:14:39 +0200 |
| commit | 235ecfbed71986f0be2ecf469a10e1105dcb3c96 (patch) | |
| tree | 36427d6c1bedd2b695fc3bd68a66743d8c26e33f /Source/Core/DiscIO/VolumeGC.cpp | |
| parent | 87a63713f4f7c583545f23b75ed8395913c8e600 (diff) | |
Return GetNames languages, to avoid hardcoded language lists in callers
This makes the code cleaner and also leads to some user-visible changes:
The wx game properties will no longer let the user
select WAD languages that don't have any names.
The Qt game list will now display names using the languages
set in the configuration instead of always using
English for PAL GC games and Japanese for WADs.
If a WAD doesn't have a name in the user's preferred language,
English is now selected as a fallback before Japanese.
Diffstat (limited to 'Source/Core/DiscIO/VolumeGC.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeGC.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index 132a630cf0..272408011e 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include <cstddef> +#include <map> #include <memory> #include <string> #include <vector> @@ -92,15 +93,15 @@ int CVolumeGC::GetRevision() const return revision; } -std::vector<std::string> CVolumeGC::GetNames() const +std::map<IVolume::ELanguage, std::string> CVolumeGC::GetNames() const { - std::vector<std::string> names; + std::map<IVolume::ELanguage, std::string> names; auto const string_decoder = GetStringDecoder(GetCountry()); char name[0x60 + 1] = {}; if (m_pReader != nullptr && Read(0x20, 0x60, (u8*)name)) - names.push_back(string_decoder(name)); + names[IVolume::ELanguage::LANGUAGE_UNKNOWN] = string_decoder(name); return names; } |
