| 52 | } |
| 53 | |
| 54 | void ShapePoly::draw( Space* space ) { |
| 55 | #ifdef PHYSICS_RENDERER_ENABLED |
| 56 | cpPolyShape* poly = (cpPolyShape*)mShape; |
| 57 | |
| 58 | BatchRenderer* BR = GlobalBatchRenderer::instance(); |
| 59 | |
| 60 | BR->setTexture( NULL ); |
| 61 | |
| 62 | Color Col = colorForShape( (cpShape*)poly, space->getSpace() ); |
| 63 | |
| 64 | if ( !poly->CP_PRIVATE( shape ).sensor ) { |
| 65 | if ( 4 != poly->CP_PRIVATE( numVerts ) ) { |
| 66 | BR->pointsBegin(); |
| 67 | BR->polygonSetColor( Col ); |
| 68 | |
| 69 | for ( int i = 0; i < poly->CP_PRIVATE( numVerts ); i++ ) { |
| 70 | BR->batchPolygonByPoint( poly->CP_PRIVATE( tVerts )[i].x, |
| 71 | poly->CP_PRIVATE( tVerts )[i].y ); |
| 72 | } |
| 73 | } else { |
| 74 | BR->quadsBegin(); |
| 75 | BR->quadsSetColor( Col ); |
| 76 | |
| 77 | BR->batchQuadFreeEx( poly->CP_PRIVATE( tVerts )[0].x, poly->CP_PRIVATE( tVerts )[0].y, |
| 78 | poly->CP_PRIVATE( tVerts )[1].x, poly->CP_PRIVATE( tVerts )[1].y, |
| 79 | poly->CP_PRIVATE( tVerts )[2].x, poly->CP_PRIVATE( tVerts )[2].y, |
| 80 | poly->CP_PRIVATE( tVerts )[3].x, poly->CP_PRIVATE( tVerts )[3].y ); |
| 81 | } |
| 82 | |
| 83 | BR->drawOpt(); |
| 84 | } |
| 85 | |
| 86 | #endif |
| 87 | } |
| 88 | |
| 89 | void ShapePoly::drawBorder( Space* space ) { |
| 90 | #ifdef PHYSICS_RENDERER_ENABLED |
no test coverage detected