mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
binary json format introduced + specification
This commit is contained in:
parent
faa581a928
commit
3837cdcf95
13 changed files with 649 additions and 326 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue