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

Method draw

src/modules/maps/src/eepp/maps/mapobjectlayer.cpp:29–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void 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
64void MapObjectLayer::update( const Time& dt ) {
65 for ( ObjList::iterator it = mObjects.begin(); it != mObjects.end(); ++it ) {

Callers

nothing calls this directly

Calls 13

getBlankTileTextureMethod · 0.80
getShowBlockedMethod · 0.80
isBlockedMethod · 0.80
drawExMethod · 0.80
pushMatrixMethod · 0.45
translatefMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getPositionMethod · 0.45
getWidthMethod · 0.45
getSizeMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected