2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

Add binary config option to CMake

This commit is contained in:
Jack Andersen
2016-01-04 18:20:45 -10:00
parent 769a20d9dc
commit 0cd46f7b0a
2 changed files with 19 additions and 6 deletions

View File

@@ -122,12 +122,15 @@ bool ProjectManager::saveProject()
return false;
#ifdef RUDE_BINARY_CONFIGS
HECL::ProjectPath rudeSpacesPath(*m_proj, _S(".hecl/rude_spaces.bin"));
Athena::io::FileReader r(rudeSpacesPath.getAbsolutePath(), 32 * 1024, false);
if (r.hasError())
HECL::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~rude_spaces.bin"));
Athena::io::FileWriter w(oldSpacesPath.getAbsolutePath(), true, false);
if (w.hasError())
return false;
m_vm.SetupEditorView(r);
m_vm.SaveEditorView(w);
w.close();
HECL::ProjectPath newSpacesPath(*m_proj, _S(".hecl/rude_spaces.bin"));
#else
HECL::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~rude_spaces.yaml"));
@@ -155,12 +158,12 @@ bool ProjectManager::saveProject()
HECL::ProjectPath newSpacesPath(*m_proj, _S(".hecl/rude_spaces.yaml"));
#endif
HECL::Unlink(newSpacesPath.getAbsolutePath().c_str());
HECL::Rename(oldSpacesPath.getAbsolutePath().c_str(),
newSpacesPath.getAbsolutePath().c_str());
#endif
return true;
}