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

Method draw

src/modules/maps/src/eepp/maps/tilemap.cpp:210–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210void TileMap::draw() {
211 GlobalBatchRenderer::instance()->draw();
212
213 if ( getClippedArea() ) {
214 GLi->getClippingMask()->clipPlaneEnable( mScreenPos.x, mScreenPos.y, mViewSize.x,
215 mViewSize.y );
216 }
217
218 if ( getDrawBackground() ) {
219 Primitives P;
220
221 Uint8 Alpha = static_cast<Uint8>( (Float)mBackColor.a * ( (Float)mBackAlpha / 255.f ) );
222
223 P.setColor( Color( mBackColor.r, mBackColor.g, mBackColor.b, Alpha ) );
224 P.drawRectangle(
225 Rectf( Vector2f( mScreenPos.x, mScreenPos.y ), Sizef( mViewSize.x, mViewSize.y ) ), 0.f,
226 Vector2f::One );
227 P.setColor( Color( 255, 255, 255, 255 ) );
228 }
229
230 GLi->pushMatrix();
231 GLi->translatef( ( Float ) static_cast<Int32>( mScreenPos.x + mOffset.x ),
232 ( Float ) static_cast<Int32>( mScreenPos.y + mOffset.y ), 0 );
233 GLi->scalef( mScale, mScale, 0 );
234
235 gridDraw();
236
237 for ( Uint32 i = 0; i < mLayerCount; i++ ) {
238 if ( mLayers[i]->isVisible() )
239 mLayers[i]->draw();
240 }
241
242 mouseOverDraw();
243
244 if ( mDrawCb )
245 mDrawCb();
246
247 GlobalBatchRenderer::instance()->draw();
248
249 GLi->popMatrix();
250
251 if ( getClippedArea() ) {
252 GLi->getClippingMask()->clipPlaneDisable();
253 }
254}
255
256void TileMap::mouseOverDraw() {
257 if ( !getDrawTileOver() || NULL == mTileTex )

Callers 2

mouseOverDrawMethod · 0.45
gridDrawMethod · 0.45

Calls 10

clipPlaneEnableMethod · 0.80
getClippingMaskMethod · 0.80
clipPlaneDisableMethod · 0.80
setColorMethod · 0.45
drawRectangleMethod · 0.45
pushMatrixMethod · 0.45
translatefMethod · 0.45
scalefMethod · 0.45
isVisibleMethod · 0.45
popMatrixMethod · 0.45

Tested by

no test coverage detected