diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-27 14:42:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-27 14:42:14 +0200 |
commit | edb014053ebd3256b3bce16d8d5ac6479d905a2e (patch) | |
tree | 0194c62a27ea31ed8594af93f71ae7b0f2374ca3 /editor | |
parent | 0c468a802bd6c41bf57bd674cb9f44157a3af155 (diff) |
kill serializing the world for now
Diffstat (limited to 'editor')
-rw-r--r-- | editor/json.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/editor/json.cpp b/editor/json.cpp index 7a64b207..f3317d5e 100644 --- a/editor/json.cpp +++ b/editor/json.cpp @@ -8,8 +8,15 @@ namespace floormat { -#define save_dir "../save" +#define FM_SAVE_BINARY + +#ifdef FM_SAVE_BINARY +#define quicksave_file save_dir "/" "quicksave.dat" +#else #define quicksave_file save_dir "/" "quicksave.json" +#endif + +#define save_dir "../save" #define quicksave_tmp quicksave_file ".tmp" namespace Path = Corrade::Utility::Path; @@ -35,7 +42,13 @@ void app::do_quicksave() if (Path::exists(quicksave_tmp)) Path::remove(quicksave_tmp); fputs("quicksave...", stderr); fflush(stderr); +#if 0 +#ifdef FM_SAVE_BINARY + json_helper::to_binary(world, quicksave_tmp); +#else json_helper::to_json(world, quicksave_tmp); +#endif +#endif Path::move(quicksave_tmp, quicksave_file); fputs(" done\n", stderr); fflush(stderr); } @@ -50,7 +63,13 @@ void app::do_quickload() } auto& world = M->world(); fputs("quickload...", stderr); fflush(stderr); +#if 0 +#ifdef FM_SAVE_BINARY + world = json_helper::from_binary<struct world>(quicksave_file); +#else world = json_helper::from_json<struct world>(quicksave_file); +#endif +#endif fputs(" done\n", stderr); fflush(stderr); } |