mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cocos2d-x] Closes #580, temporary storage of color was wrong in SkeletonRenderer
This commit is contained in:
parent
18d7229b5d
commit
c8b72e382f
@ -153,7 +153,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
_skeleton->b = nodeColor.b / (float)255;
|
||||
_skeleton->a = getDisplayedOpacity() / (float)255;
|
||||
|
||||
Color4B color;
|
||||
Color4F color;
|
||||
AttachmentVertices* attachmentVertices = nullptr;
|
||||
for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) {
|
||||
spSlot* slot = _skeleton->drawOrder[i];
|
||||
@ -190,11 +190,16 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
|
||||
color.g *= _skeleton->g * slot->g * multiplier;
|
||||
color.b *= _skeleton->b * slot->b * multiplier;
|
||||
|
||||
|
||||
|
||||
for (int v = 0, w = 0, vn = attachmentVertices->_triangles->vertCount; v < vn; ++v, w += 2) {
|
||||
V3F_C4B_T2F* vertex = attachmentVertices->_triangles->verts + v;
|
||||
vertex->vertices.x = _worldVertices[w];
|
||||
vertex->vertices.y = _worldVertices[w + 1];
|
||||
vertex->colors = color;
|
||||
vertex->colors.r = (GLubyte)color.r;
|
||||
vertex->colors.g = (GLubyte)color.g;
|
||||
vertex->colors.b = (GLubyte)color.b;
|
||||
vertex->colors.a = (GLubyte)color.a;
|
||||
}
|
||||
|
||||
BlendFunc blendFunc;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user