aboutsummaryrefslogtreecommitdiff
path: root/source/Sprite.cpp
diff options
context:
space:
mode:
authorhnOsmium0001 <[email protected]>2022-04-18 20:18:09 -0700
committerhnOsmium0001 <[email protected]>2022-04-18 20:59:31 -0700
commitf77e73c01a15426bcc6e3d7fe5826d2a741fed38 (patch)
tree91330f87041a2b8a484b06a3c747a12370bd7034 /source/Sprite.cpp
parent4b57fe1fb1401bab9439a639bd842ca61386fe22 (diff)
Add Uid for IresObject
Diffstat (limited to 'source/Sprite.cpp')
-rw-r--r--source/Sprite.cpp6
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 );