Remove URDE_BINARY_CONFIGS (all yaml now)

This commit is contained in:
Jack Andersen 2016-03-04 19:51:18 -10:00
parent cd1a00e610
commit aff7ec5b27
5 changed files with 0 additions and 61 deletions

View File

@ -2,20 +2,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ./../Runtime)
add_subdirectory(locale) add_subdirectory(locale)
add_subdirectory(icons) 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_Space.cpp Space.hpp)
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp) atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
atdna(atdna_ModelViewer.cpp ModelViewer.hpp) atdna(atdna_ModelViewer.cpp ModelViewer.hpp)

View File

@ -72,15 +72,6 @@ bool ProjectManager::openProject(const hecl::SystemString& path)
return false; 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")); hecl::ProjectPath urdeSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml"));
FILE* fp = hecl::Fopen(urdeSpacesPath.getAbsolutePath().c_str(), _S("r")); 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); m_vm.SetupEditorView(r);
#endif
IndexMP1Resources(); IndexMP1Resources();
m_vm.BuildTestPART(m_objStore); m_vm.BuildTestPART(m_objStore);
m_vm.m_mainWindow->setTitle(m_proj->getProjectRootPath().getLastComponent()); m_vm.m_mainWindow->setTitle(m_proj->getProjectRootPath().getLastComponent());
@ -141,18 +130,6 @@ bool ProjectManager::saveProject()
if (!m_proj) if (!m_proj)
return false; 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")); hecl::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~urde_spaces.yaml"));
FILE* fp = hecl::Fopen(oldSpacesPath.getAbsolutePath().c_str(), _S("w")); FILE* fp = hecl::Fopen(oldSpacesPath.getAbsolutePath().c_str(), _S("w"));
if (!fp) if (!fp)
@ -170,8 +147,6 @@ bool ProjectManager::saveProject()
hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml")); hecl::ProjectPath newSpacesPath(*m_proj, _S(".hecl/urde_spaces.yaml"));
#endif
hecl::Unlink(newSpacesPath.getAbsolutePath().c_str()); hecl::Unlink(newSpacesPath.getAbsolutePath().c_str());
hecl::Rename(oldSpacesPath.getAbsolutePath().c_str(), hecl::Rename(oldSpacesPath.getAbsolutePath().c_str(),
newSpacesPath.getAbsolutePath().c_str()); newSpacesPath.getAbsolutePath().c_str());

View File

@ -10,13 +10,8 @@ namespace urde
{ {
class ViewManager; class ViewManager;
#ifdef URDE_BINARY_CONFIGS
using ConfigReader = athena::io::IStreamReader;
using ConfigWriter = athena::io::IStreamWriter;
#else
using ConfigReader = athena::io::YAMLDocReader; using ConfigReader = athena::io::YAMLDocReader;
using ConfigWriter = athena::io::YAMLDocWriter; using ConfigWriter = athena::io::YAMLDocWriter;
#endif
class ProjectManager class ProjectManager
{ {

View File

@ -226,21 +226,13 @@ void Space::saveState(athena::io::YAMLDocWriter& w) const
Space* Space::NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r) 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")); Class cls = Class(r.readUint32("class"));
#endif
return BuildNewSpace(vm, cls, parent, r); return BuildNewSpace(vm, cls, parent, r);
} }
RootSpace* Space::NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r) RootSpace* Space::NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r)
{ {
#ifdef URDE_BINARY_CONFIGS
Class cls = Class(r.readUint32Big());
#else
Class cls = Class(r.readUint32("class")); Class cls = Class(r.readUint32("class"));
#endif
if (cls != Class::RootSpace) if (cls != Class::RootSpace)
return nullptr; return nullptr;
return new RootSpace(vm, r); return new RootSpace(vm, r);

View File

@ -172,13 +172,9 @@ public:
: RootSpace(vm) : RootSpace(vm)
{ {
m_state.read(r); m_state.read(r);
#ifdef URDE_BINARY_CONFIGS
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
#else
r.enterSubRecord("spaceTree"); r.enterSubRecord("spaceTree");
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r)); m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
r.leaveSubRecord(); r.leaveSubRecord();
#endif
} }
void think() void think()
@ -251,17 +247,12 @@ public:
: SplitSpace(vm, parent, specter::SplitView::Axis::Horizontal) : SplitSpace(vm, parent, specter::SplitView::Axis::Horizontal)
{ {
m_state.read(r); 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"); r.enterSubRecord("slot0");
m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r)); m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r));
r.leaveSubRecord(); r.leaveSubRecord();
r.enterSubRecord("slot1"); r.enterSubRecord("slot1");
m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r)); m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r));
r.leaveSubRecord(); r.leaveSubRecord();
#endif
reloadState(); reloadState();
} }