diff options
author | rtk0c <[email protected]> | 2022-04-18 20:59:31 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-04-18 20:59:31 -0700 |
commit | 7f871b04470766f0f5266cf949b65a54b7a6f79e (patch) | |
tree | 541b316fb564ffe12885586131a6ccd17662f662 /source/Sprite.cpp | |
parent | 7af9992ca81c699bc1cf05eb691e284bf424f050 (diff) |
Changeset: 10 Add Uid for IresObject
Diffstat (limited to 'source/Sprite.cpp')
-rw-r--r-- | source/Sprite.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/Sprite.cpp b/source/Sprite.cpp index 6cd575e..d539452 100644 --- a/source/Sprite.cpp +++ b/source/Sprite.cpp @@ -70,12 +70,15 @@ void IresSpriteFiles::InvalidateInstance() { } void IresSpriteFiles::Write(rapidjson::Value& value, rapidjson::Document& root) const { + IresObject::Write(value, root); value.AddMember("Sprites", rapidjson::WriteVectorPrimitives(root, spriteFiles.begin(), spriteFiles.end()), root.GetAllocator()); } void IresSpriteFiles::Read(const rapidjson::Value& value) { InvalidateInstance(); + IresObject::Read(value); + auto rvFileList = rapidjson::GetProperty(value, rapidjson::kArrayType, "Sprites"sv); if (!rvFileList) return; spriteFiles.clear(); @@ -259,6 +262,7 @@ void IresSpritesheet::ShowEditor(EditorInstance& editor) { } void IresSpritesheet::Write(rapidjson::Value& value, rapidjson::Document& root) const { + IresObject::Write(value, root); value.AddMember("SpriteSheet", spritesheetFile, root.GetAllocator()); value.AddMember("WSplit", sheetWSplit, root.GetAllocator()); value.AddMember("HSplit", sheetHSplit, root.GetAllocator()); @@ -269,6 +273,8 @@ void IresSpritesheet::Write(rapidjson::Value& value, rapidjson::Document& root) void IresSpritesheet::Read(const rapidjson::Value& value) { InvalidateInstance(); + + IresObject::Read(value); BRUSSEL_JSON_GET(value, "SpriteSheet", std::string, spritesheetFile, return ); BRUSSEL_JSON_GET(value, "WSplit", int, sheetWSplit, return ); BRUSSEL_JSON_GET(value, "HSplit", int, sheetHSplit, return ); |