[cpp] fix wrong RGB2 creation using json (#2885)

This commit is contained in:
Byeong Gwan 2025-10-01 22:43:33 +09:00 committed by GitHub
parent fb6624fe8e
commit 3653540558
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1064,14 +1064,14 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
}
timelines.add(timeline);
} else if (strcmp(timelineMap->_name, "rgb2") == 0) {
RGBA2Timeline *timeline = new (__FILE__, __LINE__) RGBA2Timeline(frames, frames * 6, slotIndex);
RGB2Timeline *timeline = new (__FILE__, __LINE__) RGB2Timeline(frames, frames * 6, slotIndex);
keyMap = timelineMap->_child;
float time = Json::getFloat(keyMap, "time", 0);
toColor(color, Json::getString(keyMap, "light", 0), false);
toColor(color2, Json::getString(keyMap, "dark", 0), false);
for (frame = 0, bezier = 0;; ++frame) {
timeline->setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);
timeline->setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);
nextMap = keyMap->_next;
if (!nextMap) {
// timeline.shrink(); // BOZO