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

Method drawFast

src/eepp/graphics/texture.cpp:657–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale,
658 const Color& Color, const BlendMode& Blend, const Float& width,
659 const Float& height ) {
660 Float w = 0.f != width ? width : (Float)getImageWidth();
661 Float h = 0.f != height ? height : (Float)getImageHeight();
662
663 auto sBR = GlobalBatchRenderer::instance();
664 sBR->setTexture( this );
665 sBR->setBlendMode( Blend );
666
667 sBR->quadsBegin();
668 sBR->quadsSetColor( Color );
669
670 if ( getClampMode() == ClampMode::ClampRepeat ) {
671 Float iw = (Float)getImageWidth();
672 Float ih = (Float)getImageHeight();
673 sBR->quadsSetTexCoordFree( 0, 0, 0, height / ih, width / iw, height / ih, width / iw, 0 );
674 }
675
676 sBR->batchQuadEx( x, y, w, h, Angle, Scale );
677
678 sBR->drawOpt();
679}
680
681void Texture::drawEx( Float x, Float y, Float width, Float height, const Float& Angle,
682 const Vector2f& Scale, const Color& Color0, const Color& Color1,

Callers 1

screen2Method · 0.80

Calls 10

getImageWidthFunction · 0.85
getImageHeightFunction · 0.85
getClampModeFunction · 0.85
quadsBeginMethod · 0.80
quadsSetColorMethod · 0.80
quadsSetTexCoordFreeMethod · 0.80
batchQuadExMethod · 0.80
drawOptMethod · 0.80
setTextureMethod · 0.45
setBlendModeMethod · 0.45

Tested by 1

screen2Method · 0.64