mirror of https://github.com/AxioDL/metaforce.git
Athena YAML refactor
This commit is contained in:
parent
67bb64e7dd
commit
f65e3d23b4
|
@ -1 +1 @@
|
||||||
Subproject commit b43c4af3a777d6baf43a6108764648e52f3b7ea6
|
Subproject commit cd9aa3eaf4904f2cbf5510a6f3a7c229f0020e34
|
|
@ -105,10 +105,9 @@ void CVarManager::deserialize(CVar* cvar)
|
||||||
filename += _S(".yaml");
|
filename += _S(".yaml");
|
||||||
if (hecl::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode))
|
if (hecl::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode))
|
||||||
return;
|
return;
|
||||||
FILE* f = hecl::Fopen(filename.c_str(), _S("rb"));
|
athena::io::FileReader reader(filename);
|
||||||
if (f)
|
if (reader.isOpen())
|
||||||
container.fromYAMLFile(f);
|
container.fromYAMLStream(reader);
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,10 +162,9 @@ void CVarManager::serialize()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
filename += _S(".yaml");
|
filename += _S(".yaml");
|
||||||
FILE* f = hecl::Fopen(filename.c_str(), _S("wb"));
|
athena::io::FileWriter writer(filename);
|
||||||
if (f)
|
if (writer.isOpen())
|
||||||
container.toYAMLFile(f);
|
container.toYAMLStream(writer);
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue