| 27 | } |
| 28 | |
| 29 | void MapObjectLayer::draw( const Vector2f& Offset ) { |
| 30 | if ( Offset != mOffset ) |
| 31 | mOffset = Offset; |
| 32 | |
| 33 | GlobalBatchRenderer::instance()->draw(); |
| 34 | |
| 35 | ObjList::iterator it; |
| 36 | |
| 37 | GLi->pushMatrix(); |
| 38 | GLi->translatef( mOffset.x, mOffset.y, 0.0f ); |
| 39 | |
| 40 | for ( it = mObjects.begin(); it != mObjects.end(); ++it ) { |
| 41 | ( *it )->draw(); |
| 42 | } |
| 43 | |
| 44 | Texture* Tex = mMap->getBlankTileTexture(); |
| 45 | |
| 46 | if ( mMap->getShowBlocked() && NULL != Tex ) { |
| 47 | Color Col( 255, 0, 0, 200 ); |
| 48 | |
| 49 | for ( it = mObjects.begin(); it != mObjects.end(); ++it ) { |
| 50 | GameObject* Obj = ( *it ); |
| 51 | |
| 52 | if ( Obj->isBlocked() ) { |
| 53 | Tex->drawEx( Obj->getPosition().x, Obj->getPosition().y, Obj->getSize().getWidth(), |
| 54 | Obj->getSize().getHeight(), 0, Vector2f::One, Col, Col, Col, Col ); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | GlobalBatchRenderer::instance()->draw(); |
| 60 | |
| 61 | GLi->popMatrix(); |
| 62 | } |
| 63 | |
| 64 | void MapObjectLayer::update( const Time& dt ) { |
| 65 | for ( ObjList::iterator it = mObjects.begin(); it != mObjects.end(); ++it ) { |
nothing calls this directly
no test coverage detected