From 6f88168dcdba862f163f166f7f382f6f167feb43 Mon Sep 17 00:00:00 2001 From: Luke Ingram Date: Thu, 13 Nov 2025 14:28:50 -0400 Subject: [PATCH] [cpp] Fixes and closes #2886. The user submitted code that fixes the incorrect tinting on spine-cpp 4.2. I tested this fix using spine-glfw to confirm the existence of the issue and the fix. --- spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp index ce7ed255f..6eacd3ecd 100644 --- a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp @@ -453,16 +453,11 @@ void RGB2Timeline::apply(Skeleton &skeleton, float lastTime, float time, Vector< } default: { r = getBezierValue(time, i, RGB2Timeline::R, curveType - RGB2Timeline::BEZIER); - g = getBezierValue(time, i, RGB2Timeline::G, - curveType + RGB2Timeline::BEZIER_SIZE - RGB2Timeline::BEZIER); - b = getBezierValue(time, i, RGB2Timeline::B, - curveType + RGB2Timeline::BEZIER_SIZE * 2 - RGB2Timeline::BEZIER); - r2 = getBezierValue(time, i, RGB2Timeline::R2, - curveType + RGB2Timeline::BEZIER_SIZE * 4 - RGB2Timeline::BEZIER); - g2 = getBezierValue(time, i, RGB2Timeline::G2, - curveType + RGB2Timeline::BEZIER_SIZE * 5 - RGB2Timeline::BEZIER); - b2 = getBezierValue(time, i, RGB2Timeline::B2, - curveType + RGB2Timeline::BEZIER_SIZE * 6 - RGB2Timeline::BEZIER); + g = getBezierValue(time, i, RGB2Timeline::G, curveType + RGB2Timeline::BEZIER_SIZE - RGB2Timeline::BEZIER); + b = getBezierValue(time, i, RGB2Timeline::B, curveType + RGB2Timeline::BEZIER_SIZE * 2 - RGB2Timeline::BEZIER); + r2 = getBezierValue(time, i, RGB2Timeline::R2, curveType + RGB2Timeline::BEZIER_SIZE * 3 - RGB2Timeline::BEZIER); + g2 = getBezierValue(time, i, RGB2Timeline::G2, curveType + RGB2Timeline::BEZIER_SIZE * 4 - RGB2Timeline::BEZIER); + b2 = getBezierValue(time, i, RGB2Timeline::B2, curveType + RGB2Timeline::BEZIER_SIZE * 5 - RGB2Timeline::BEZIER); } } Color &light = slot->_color, &dark = slot->_darkColor;