@@ -234,9 +234,12 @@ proto._uploadRegionAttachmentData = function(attachment, slot, premultipliedAlph
234
234
nodeB = nodeColor . b ,
235
235
nodeA = this . _displayedOpacity ;
236
236
// 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);"
238
238
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 ;
240
243
241
244
var wt = this . _worldTransform ,
242
245
wa = wt . a , wb = wt . b , wc = wt . c , wd = wt . d ,
@@ -248,32 +251,32 @@ proto._uploadRegionAttachmentData = function(attachment, slot, premultipliedAlph
248
251
// using two angles : (0, 1, 2) & (0, 2, 3)
249
252
for ( var i = 0 ; i < 6 ; i ++ ) {
250
253
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 ] ;
253
256
var x = vx * wa + vy * wc + wx ,
254
257
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 ;
259
262
var color = ( ( a << 24 ) | ( b << 16 ) | ( g << 8 ) | r ) ;
260
263
f32buffer [ offset ] = x ;
261
264
f32buffer [ offset + 1 ] = y ;
262
265
f32buffer [ offset + 2 ] = z ;
263
266
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 ] ;
266
269
offset += 6 ;
267
270
}
268
271
269
272
if ( this . _node . _debugSlots ) {
270
273
// return the quad points info if debug slot enabled
271
274
var VERTEX = spine . RegionAttachment ;
272
275
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 ] )
277
280
] ;
278
281
}
279
282
} ;
@@ -285,6 +288,7 @@ proto._uploadMeshAttachmentData = function(attachment, slot, premultipliedAlpha,
285
288
z = this . _node . vertexZ ;
286
289
// get the vertex data
287
290
// 3.5 var vertices = attachment.updateWorldVertices(slot, premultipliedAlpha);
291
+ // FIXME, NOT USED THIS FUNCTION?
288
292
var verticesLength = attachment . worldVerticesLength ;
289
293
var vertices = spine . Utils . setArraySize ( new Array ( ) , verticesLength , 0 ) ;
290
294
attachment . computeWorldVertices ( slot , 0 , verticesLength , vertices , 0 , 2 ) ;
0 commit comments