summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/VolumeWad.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-03-02 19:46:55 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-03-02 20:00:36 -0600
commit6c8adf6130b32a0ffc113f4ce30f70b9d5994f10 (patch)
treedd0ef27543036f38b29a336682adbc3624ae8996 /Source/Core/DiscIO/Src/VolumeWad.cpp
parent2b1af36900bcb13102690bd862246b9cc3b7d541 (diff)
Eliminate the wstring game name.
Some cleanup throughout related code. (try to make logic in ISOFile understandable by a human) Encode strings in UTF-8 rather than somehow trying to determine the encoding in the GUI code. Non-windows OSes temporarily broken.
Diffstat (limited to 'Source/Core/DiscIO/Src/VolumeWad.cpp')
-rw-r--r--Source/Core/DiscIO/Src/VolumeWad.cpp48
1 files changed, 8 insertions, 40 deletions
diff --git a/Source/Core/DiscIO/Src/VolumeWad.cpp b/Source/Core/DiscIO/Src/VolumeWad.cpp
index 2f9f0ef961..72788f1017 100644
--- a/Source/Core/DiscIO/Src/VolumeWad.cpp
+++ b/Source/Core/DiscIO/Src/VolumeWad.cpp
@@ -107,13 +107,15 @@ bool CVolumeWAD::GetTitleID(u8* _pBuffer) const
return true;
}
-bool CVolumeWAD::GetWName(std::vector<std::wstring>& _rwNames) const
+std::vector<std::string> CVolumeWAD::GetNames() const
{
- u32 footer_size;
+ std::vector<std::string> names;
+ return names;
+ u32 footer_size;
if (!Read(0x1C, 4, (u8*)&footer_size))
{
- return false;
+ return names;
}
//Japanese, English, German, French, Spanish, Italian, Dutch, unknown, unknown, Korean
@@ -126,7 +128,7 @@ bool CVolumeWAD::GetWName(std::vector<std::wstring>& _rwNames) const
if (!Read(0x9C + (i*84) + OpeningBnrOffset, 84, (u8*)&temp) || Common::swap32(footer_size) < 0xF1
|| !temp[0])
{
- _rwNames.push_back(L"");
+ names.push_back("");
continue;
}
for (int j = 0; j < 42; ++j)
@@ -141,44 +143,10 @@ bool CVolumeWAD::GetWName(std::vector<std::wstring>& _rwNames) const
out_temp.push_back(t);
}
- _rwNames.push_back(out_temp);
- }
- return true;
-}
-
-std::string CVolumeWAD::GetName() const
-{
- u32 footer_size;
-
- if (!Read(0x1C, 4, (u8*)&footer_size))
- return "";
-
-
- //Japanese, English, German, French, Spanish, Italian, Dutch, unknown, unknown, Korean
-
- // Offset to the english title
- char temp[84];
- if (!Read(0xF1 + OpeningBnrOffset, 84, (u8*)&temp) || Common::swap32(footer_size) < 0xF1 ||
- !Common::swap16(temp[0]))
- return "";
-
- // Remove the null bytes due to 16bit char length
- std::string out_temp;
- for (unsigned int i = 0; i < sizeof(temp); i+=2)
- {
- // Replace null chars with a single space per null section
- if (temp[i] == '\0' && i > 0)
- {
- if (out_temp.at(out_temp.size()-1) != ' ')
- out_temp.push_back(' ');
- }
- else
- out_temp.push_back(temp[i]);
+ names.push_back(UTF16ToUTF8(out_temp));
}
- // Make it a null terminated string
- out_temp.replace(out_temp.end()-1, out_temp.end(), 1, '\0');
- return out_temp;
+ return names;
}
u64 CVolumeWAD::GetSize() const