mirror of https://github.com/AxioDL/metaforce.git
Remove URDE_BINARY_CONFIGS (all yaml now)
This commit is contained in:
parent
cd1a00e610
commit
aff7ec5b27
|
@ -2,20 +2,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ./../Runtime)
|
|||
add_subdirectory(locale)
|
||||
add_subdirectory(icons)
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
option(RUDE_BINARY_CONFIGS
|
||||
"Use binary Athena formats for serializing save data structures, rather than YAML"
|
||||
YES)
|
||||
else()
|
||||
option(RUDE_BINARY_CONFIGS
|
||||
"Use binary Athena formats for serializing save data structures, rather than YAML"
|
||||
NO)
|
||||
endif()
|
||||
|
||||
if(RUDE_BINARY_CONFIGS)
|
||||
add_definitions("-DURDE_BINARY_CONFIGS=1")
|
||||
endif()
|
||||
|
||||
atdna(atdna_Space.cpp Space.hpp)
|
||||
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
|
||||
atdna(atdna_ModelViewer.cpp ModelViewer.hpp)
|
||||
|
|
|
@ -72,15 +72,6 @@ bool ProjectManager::openProject(const hecl::SystemString& path)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
hecl::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin"));
|
||||
athena::io::FileReader r(urdeSpacesPath.getAbsolutePath(), 32 * 1024, false);
|
||||
if (r.hasError())
|
||||
goto makeDefault;
|
||||
|
||||
m_vm.SetupEditorView(r);
|
||||
|
||||
#else
|
||||
hecl::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml"));
|
||||
FILE* fp = hecl::Fopen(urdeSpacesPath.getAbsolutePath().c_str(), _S("r"));
|
||||
|
||||
|
@ -107,8 +98,6 @@ bool ProjectManager::openProject(const hecl::SystemString& path)
|
|||
|
||||
m_vm.SetupEditorView(r);
|
||||
|
||||
#endif
|
||||
|
||||
IndexMP1Resources();
|
||||
m_vm.BuildTestPART(m_objStore);
|
||||
m_vm.m_mainWindow->setTitle(m_proj->getProjectRootPath().getLastComponent());
|
||||
|
@ -141,18 +130,6 @@ bool ProjectManager::saveProject()
|
|||
if (!m_proj)
|
||||
return false;
|
||||
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
hecl::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.bin"));
|
||||
athena::io::FileWriter w(oldSpacesPath.getAbsolutePath(), true, false);
|
||||
if (w.hasError())
|
||||
return false;
|
||||
|
||||
m_vm.SaveEditorView(w);
|
||||
w.close();
|
||||
|
||||
hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.bin"));
|
||||
|
||||
#else
|
||||
hecl::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.yaml"));
|
||||
FILE* fp = hecl::Fopen(oldSpacesPath.getAbsolutePath().c_str(), _S("w"));
|
||||
if (!fp)
|
||||
|
@ -170,8 +147,6 @@ bool ProjectManager::saveProject()
|
|||
|
||||
hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml"));
|
||||
|
||||
#endif
|
||||
|
||||
hecl::Unlink(newSpacesPath.getAbsolutePath().c_str());
|
||||
hecl::Rename(oldSpacesPath.getAbsolutePath().c_str(),
|
||||
newSpacesPath.getAbsolutePath().c_str());
|
||||
|
|
|
@ -10,13 +10,8 @@ namespace urde
|
|||
{
|
||||
class ViewManager;
|
||||
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
using ConfigReader = athena::io::IStreamReader;
|
||||
using ConfigWriter = athena::io::IStreamWriter;
|
||||
#else
|
||||
using ConfigReader = athena::io::YAMLDocReader;
|
||||
using ConfigWriter = athena::io::YAMLDocWriter;
|
||||
#endif
|
||||
|
||||
class ProjectManager
|
||||
{
|
||||
|
|
|
@ -226,21 +226,13 @@ void Space::saveState(athena::io::YAMLDocWriter& w) const
|
|||
|
||||
Space* Space::NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r)
|
||||
{
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
Class cls = Class(r.readUint32Big());
|
||||
#else
|
||||
Class cls = Class(r.readUint32("class"));
|
||||
#endif
|
||||
return BuildNewSpace(vm, cls, parent, r);
|
||||
}
|
||||
|
||||
RootSpace* Space::NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r)
|
||||
{
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
Class cls = Class(r.readUint32Big());
|
||||
#else
|
||||
Class cls = Class(r.readUint32("class"));
|
||||
#endif
|
||||
if (cls != Class::RootSpace)
|
||||
return nullptr;
|
||||
return new RootSpace(vm, r);
|
||||
|
|
|
@ -172,13 +172,9 @@ public:
|
|||
: RootSpace(vm)
|
||||
{
|
||||
m_state.read(r);
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
#else
|
||||
r.enterSubRecord("spaceTree");
|
||||
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
#endif
|
||||
}
|
||||
|
||||
void think()
|
||||
|
@ -251,17 +247,12 @@ public:
|
|||
: SplitSpace(vm, parent, specter::SplitView::Axis::Horizontal)
|
||||
{
|
||||
m_state.read(r);
|
||||
#ifdef URDE_BINARY_CONFIGS
|
||||
m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
#else
|
||||
r.enterSubRecord("slot0");
|
||||
m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
r.enterSubRecord("slot1");
|
||||
m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
#endif
|
||||
reloadState();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue