3434 as the private API may change with little or no warning.
3535 */
3636
37+ // Helper. Converts an array of numbers into an array of vectors(x,y)
38+ cc . __convertVerts = function ( verts ) {
39+ var ret = [ ] ;
40+ for ( var i = 0 ; i < verts . length / 2 ; i ++ ) {
41+ ret [ i ] = { x :verts [ i * 2 ] , y :verts [ i * 2 + 1 ] } ;
42+ }
43+ return ret ;
44+ } ;
45+
3746cc . ColorForBody = function ( body ) {
3847 if ( body . isRogue ( ) || body . isSleeping ( ) ) {
3948 return cc . c4f ( 0.5 , 0.5 , 0.5 , 0.5 ) ;
@@ -57,7 +66,7 @@ cc.DrawShape = function (shape, renderer) {
5766 break ;
5867 case cp . PolyShape . prototype . collisionCode :
5968 var line = cc . c4f ( color . r , color . g , color . b , cc . lerp ( color . a , 1.0 , 0.5 ) ) ;
60- this . drawPolyWithVerts ( shape . tVerts , shape . getNumVerts ( ) , color , 1.0 , line ) ;
69+ this . drawPoly ( cc . __convertVerts ( shape . tVerts ) , color , 1.0 , line ) ;
6170 break ;
6271 default :
6372 cc . Assert ( false , "Bad assertion in DrawShape()" ) ;
@@ -153,4 +162,5 @@ cc.PhysicsDebugNode.debugNodeForCPSpace = function (space) {
153162 return null ;
154163} ;
155164
156- cc . PhysicsDebugNode . create = cc . PhysicsDebugNode . debugNodeForCPSpace ;
165+ cc . PhysicsDebugNode . create = cc . PhysicsDebugNode . debugNodeForCPSpace ;
166+
0 commit comments