@@ -234,9 +234,12 @@ proto._uploadRegionAttachmentData = function(attachment, slot, premultipliedAlph
234234 nodeB = nodeColor . b ,
235235 nodeA = this . _displayedOpacity ;
236236 // 3.5 var vertices = attachment.updateWorldVertices(slot, premultipliedAlpha);
237- // FIXME: lose premultipliedAlpha?
237+ // FIXME: lose premultipliedAlpha? alpha impl innner, "vertices, 0, 8);" -> "vertices, 0, 2);"
238238 var vertices = spine . Utils . setArraySize ( new Array ( ) , 8 , 0 ) ;
239- attachment . computeWorldVertices ( slot . bone , vertices , 0 , 8 ) ;
239+ attachment . computeWorldVertices ( slot . bone , vertices , 0 , 2 ) ;
240+
241+ var uvs = attachment . uvs ;
242+ var color = attachment . color ;
240243
241244 var wt = this . _worldTransform ,
242245 wa = wt . a , wb = wt . b , wc = wt . c , wd = wt . d ,
@@ -248,32 +251,32 @@ proto._uploadRegionAttachmentData = function(attachment, slot, premultipliedAlph
248251 // using two angles : (0, 1, 2) & (0, 2, 3)
249252 for ( var i = 0 ; i < 6 ; i ++ ) {
250253 var srcIdx = i < 4 ? i % 3 : i - 2 ;
251- var vx = vertices [ srcIdx * 8 ] ,
252- vy = vertices [ srcIdx * 8 + 1 ] ;
254+ var vx = vertices [ srcIdx * 2 ] ,
255+ vy = vertices [ srcIdx * 2 + 1 ] ;
253256 var x = vx * wa + vy * wc + wx ,
254257 y = vx * wb + vy * wd + wy ;
255- var r = vertices [ srcIdx * 8 + 2 ] * nodeR ,
256- g = vertices [ srcIdx * 8 + 3 ] * nodeG ,
257- b = vertices [ srcIdx * 8 + 4 ] * nodeB ,
258- a = vertices [ srcIdx * 8 + 5 ] * nodeA ;
258+ var r = color . r * nodeR ,
259+ g = color . g * nodeG ,
260+ b = color . b * nodeB ,
261+ a = color . a * nodeA ;
259262 var color = ( ( a << 24 ) | ( b << 16 ) | ( g << 8 ) | r ) ;
260263 f32buffer [ offset ] = x ;
261264 f32buffer [ offset + 1 ] = y ;
262265 f32buffer [ offset + 2 ] = z ;
263266 ui32buffer [ offset + 3 ] = color ;
264- f32buffer [ offset + 4 ] = vertices [ srcIdx * 8 + 6 ] ;
265- f32buffer [ offset + 5 ] = vertices [ srcIdx * 8 + 7 ] ;
267+ f32buffer [ offset + 4 ] = uvs [ srcIdx * 2 ] ;
268+ f32buffer [ offset + 5 ] = uvs [ srcIdx * 2 + 1 ] ;
266269 offset += 6 ;
267270 }
268271
269272 if ( this . _node . _debugSlots ) {
270273 // return the quad points info if debug slot enabled
271274 var VERTEX = spine . RegionAttachment ;
272275 return [
273- cc . p ( vertices [ VERTEX . X1 ] , vertices [ VERTEX . Y1 ] ) ,
274- cc . p ( vertices [ VERTEX . X2 ] , vertices [ VERTEX . Y2 ] ) ,
275- cc . p ( vertices [ VERTEX . X3 ] , vertices [ VERTEX . Y3 ] ) ,
276- cc . p ( vertices [ VERTEX . X4 ] , vertices [ VERTEX . Y4 ] )
276+ cc . p ( vertices [ VERTEX . OX1 ] , vertices [ VERTEX . OY1 ] ) ,
277+ cc . p ( vertices [ VERTEX . OX2 ] , vertices [ VERTEX . OY2 ] ) ,
278+ cc . p ( vertices [ VERTEX . OX3 ] , vertices [ VERTEX . OY3 ] ) ,
279+ cc . p ( vertices [ VERTEX . OX4 ] , vertices [ VERTEX . OY4 ] )
277280 ] ;
278281 }
279282} ;
@@ -285,6 +288,7 @@ proto._uploadMeshAttachmentData = function(attachment, slot, premultipliedAlpha,
285288 z = this . _node . vertexZ ;
286289 // get the vertex data
287290 // 3.5 var vertices = attachment.updateWorldVertices(slot, premultipliedAlpha);
291+ // FIXME, NOT USED THIS FUNCTION?
288292 var verticesLength = attachment . worldVerticesLength ;
289293 var vertices = spine . Utils . setArraySize ( new Array ( ) , verticesLength , 0 ) ;
290294 attachment . computeWorldVertices ( slot , 0 , verticesLength , vertices , 0 , 2 ) ;
0 commit comments