2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:07:41 +00:00

ANCS fixes and cleanup

This commit is contained in:
Jack Andersen
2015-08-08 13:24:17 -10:00
parent e0bf3a7024
commit 2d18e95a91
11 changed files with 155 additions and 638 deletions

View File

@@ -139,43 +139,5 @@ void STRG::write(Athena::io::IStreamWriter& writer) const
}
}
bool STRG::readAngelScript(const AngelScript::asIScriptModule& in)
{
return false;
}
void STRG::writeAngelScript(std::ofstream& out) const
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> wconv;
for (const std::pair<FourCC, std::vector<std::wstring>>& lang : langs)
{
out << "STRG::Language " << lang.first.toString() << "({";
bool comma = false;
unsigned idx = 0;
for (const std::wstring& str : lang.second)
{
if (comma)
out << ",";
out << "\n/* " << idx++ << " */ \"";
out << wconv.to_bytes(str);
out << "\"";
comma = true;
}
out << "\n});\n";
}
out << "STRG::Names NAMES({";
bool comma = false;
for (const std::pair<std::string, int32_t>& name : names)
{
if (comma)
out << ",";
out << "\n ";
comma = true;
out << "{\"" << name.first << "\", " << name.second << "}";
}
out << "\n});\n";
}
}
}