@@ -239,14 +239,18 @@ proto._uploadRegionAttachmentData = function(attachment, slot, premultipliedAlph
239
239
240
240
var uvs = attachment . uvs ;
241
241
242
+ // get the colors data
242
243
var skeleton = slot . bone . skeleton ;
243
244
var skeletonColor = skeleton . color ;
244
245
var slotColor = slot . color ;
245
246
var regionColor = attachment . color ;
246
247
var alpha = skeletonColor . a * slotColor . a * regionColor . a ;
247
248
var multiplier = premultipliedAlpha ? alpha : 1 ;
248
249
var colors = attachment . tempColor ;
249
- colors . set ( skeletonColor . r * slotColor . r * regionColor . r * multiplier , skeletonColor . g * slotColor . g * regionColor . g * multiplier , skeletonColor . b * slotColor . b * regionColor . b * multiplier , alpha ) ;
250
+ colors . set ( skeletonColor . r * slotColor . r * regionColor . r * multiplier ,
251
+ skeletonColor . g * slotColor . g * regionColor . g * multiplier ,
252
+ skeletonColor . b * slotColor . b * regionColor . b * multiplier ,
253
+ alpha ) ;
250
254
251
255
var wt = this . _worldTransform ,
252
256
wa = wt . a , wb = wt . b , wc = wt . c , wd = wt . d ,
@@ -294,11 +298,23 @@ proto._uploadMeshAttachmentData = function(attachment, slot, premultipliedAlpha,
294
298
wx = wt . tx , wy = wt . ty ,
295
299
z = this . _node . vertexZ ;
296
300
// get the vertex data
297
- // 3.5 var vertices = attachment.updateWorldVertices(slot, premultipliedAlpha);
298
- // FIXME, NOT USED THIS FUNCTION?
299
301
var verticesLength = attachment . worldVerticesLength ;
300
302
var vertices = spine . Utils . setArraySize ( new Array ( ) , verticesLength , 0 ) ;
301
303
attachment . computeWorldVertices ( slot , 0 , verticesLength , vertices , 0 , 2 ) ;
304
+
305
+ var uvs = attachment . uvs ;
306
+
307
+ // get the colors data
308
+ var skeleton = slot . bone . skeleton ;
309
+ var skeletonColor = skeleton . color , slotColor = slot . color , meshColor = attachment . color ;
310
+ var alpha = skeletonColor . a * slotColor . a * meshColor . a ;
311
+ var multiplier = premultipliedAlpha ? alpha : 1 ;
312
+ var colors = attachment . tempColor ;
313
+ colors . set ( skeletonColor . r * slotColor . r * meshColor . r * multiplier ,
314
+ skeletonColor . g * slotColor . g * meshColor . g * multiplier ,
315
+ skeletonColor . b * slotColor . b * meshColor . b * multiplier ,
316
+ alpha ) ;
317
+
302
318
var offset = vertexDataOffset ;
303
319
var nodeColor = this . _displayedColor ;
304
320
var nodeR = nodeColor . r ,
@@ -310,18 +326,18 @@ proto._uploadMeshAttachmentData = function(attachment, slot, premultipliedAlpha,
310
326
vy = vertices [ i + 1 ] ;
311
327
var x = vx * wa + vy * wb + wx ,
312
328
y = vx * wc + vy * wd + wy ;
313
- var r = vertices [ i + 2 ] * nodeR ,
314
- g = vertices [ i + 3 ] * nodeG ,
315
- b = vertices [ i + 4 ] * nodeB ,
316
- a = vertices [ i + 5 ] * nodeA ;
329
+ var r = colors . r * nodeR ,
330
+ g = colors . g * nodeG ,
331
+ b = colors . b * nodeB ,
332
+ a = colors . a * nodeA ;
317
333
var color = ( ( a << 24 ) | ( b << 16 ) | ( g << 8 ) | r ) ;
318
334
319
335
f32buffer [ offset ] = x ;
320
336
f32buffer [ offset + 1 ] = y ;
321
337
f32buffer [ offset + 2 ] = z ;
322
338
ui32buffer [ offset + 3 ] = color ;
323
- f32buffer [ offset + 4 ] = vertices [ i + 6 ] ;
324
- f32buffer [ offset + 5 ] = vertices [ i + 7 ] ;
339
+ f32buffer [ offset + 4 ] = uvs [ i ] ;
340
+ f32buffer [ offset + 5 ] = uvs [ i + 1 ] ;
325
341
offset += 6 ;
326
342
}
327
343
} ;
0 commit comments