| 19 | } |
| 20 | |
| 21 | void TileMapLayer::draw( const Vector2f& Offset ) { |
| 22 | GlobalBatchRenderer::instance()->draw(); |
| 23 | |
| 24 | GLi->pushMatrix(); |
| 25 | GLi->translatef( mOffset.x, mOffset.y, 0.0f ); |
| 26 | |
| 27 | Vector2i start = mMap->getStartTile(); |
| 28 | Vector2i end = mMap->getEndTile(); |
| 29 | |
| 30 | for ( Int32 x = start.x; x < end.x; x++ ) { |
| 31 | for ( Int32 y = start.y; y < end.y; y++ ) { |
| 32 | mCurTile.x = x; |
| 33 | mCurTile.y = y; |
| 34 | |
| 35 | if ( NULL != mTiles[x][y] ) { |
| 36 | mTiles[x][y]->draw(); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | Texture* Tex = mMap->getBlankTileTexture(); |
| 42 | |
| 43 | if ( mMap->getShowBlocked() && NULL != Tex ) { |
| 44 | for ( Int32 x = start.x; x < end.x; x++ ) { |
| 45 | for ( Int32 y = start.y; y < end.y; y++ ) { |
| 46 | if ( NULL != mTiles[x][y] ) { |
| 47 | if ( mTiles[x][y]->isBlocked() ) { |
| 48 | Tex->draw( x * mMap->getTileSize().x, y * mMap->getTileSize().y, 0, |
| 49 | Vector2f::One, Color( 255, 0, 0, 200 ) ); |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | GlobalBatchRenderer::instance()->draw(); |
| 57 | |
| 58 | GLi->popMatrix(); |
| 59 | } |
| 60 | |
| 61 | void TileMapLayer::update( const Time& dt ) { |
| 62 | Vector2i start = mMap->getStartTile(); |
nothing calls this directly
no test coverage detected