MCPcopy Create free account
hub / github.com/SpartanJ/eepp / draw

Method draw

src/modules/maps/src/eepp/maps/tilemaplayer.cpp:21–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void 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
61void TileMapLayer::update( const Time& dt ) {
62 Vector2i start = mMap->getStartTile();

Callers

nothing calls this directly

Calls 6

getBlankTileTextureMethod · 0.80
getShowBlockedMethod · 0.80
isBlockedMethod · 0.80
pushMatrixMethod · 0.45
translatefMethod · 0.45
popMatrixMethod · 0.45

Tested by

no test coverage detected