binary json format introduced + specification
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "WorldFiles.h"
|
||||
|
||||
#include "rle.h"
|
||||
#include "binary_io.h"
|
||||
#include "../window/Camera.h"
|
||||
#include "../content/Content.h"
|
||||
#include "../objects/Player.h"
|
||||
@@ -477,7 +476,7 @@ void WorldFiles::writeIndices(const ContentIndices* indices) {
|
||||
items.put(def->name);
|
||||
}
|
||||
|
||||
files::write_string(getIndicesFile(), json::stringify(&root, true, " "));
|
||||
files::write_json(getIndicesFile(), &root);
|
||||
}
|
||||
|
||||
void WorldFiles::writeWorldInfo(const World* world) {
|
||||
@@ -494,7 +493,7 @@ void WorldFiles::writeWorldInfo(const World* world) {
|
||||
timeobj.put("day-time", world->daytime);
|
||||
timeobj.put("day-time-speed", world->daytimeSpeed);
|
||||
|
||||
files::write_string(getWorldFile(), json::stringify(&root, true, " "));
|
||||
files::write_json(getWorldFile(), &root);
|
||||
}
|
||||
|
||||
bool WorldFiles::readWorldInfo(World* world) {
|
||||
@@ -540,7 +539,7 @@ void WorldFiles::writePlayer(Player* player){
|
||||
root.put("flight", player->flight);
|
||||
root.put("noclip", player->noclip);
|
||||
|
||||
files::write_string(getPlayerFile(), json::stringify(&root, true, " "));
|
||||
files::write_json(getPlayerFile(), &root);
|
||||
}
|
||||
|
||||
bool WorldFiles::readPlayer(Player* player) {
|
||||
|
||||
Reference in New Issue
Block a user