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

Method batchQuadFreeEx

src/eepp/graphics/batchrenderer.cpp:475–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void BatchRenderer::batchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1,
476 const Float& y1, const Float& x2, const Float& y2,
477 const Float& x3, const Float& y3, const Float& Angle,
478 const Float& Scale ) {
479 if ( mNumVertex + ( GLi->quadsSupported() ? 3 : 5 ) >= mVertexSize )
480 return;
481
482 Quad2f mQ;
483 Vector2f QCenter;
484 mQ.V[0].x = x0;
485 mQ.V[1].x = x1;
486 mQ.V[2].x = x2;
487 mQ.V[3].x = x3;
488 mQ.V[0].y = y0;
489 mQ.V[1].y = y1;
490 mQ.V[2].y = y2;
491 mQ.V[3].y = y3;
492
493 if ( Angle != 0 || Scale != 1.0f ) {
494 QCenter = mQ.getCenter();
495 mQ.rotate( Angle, QCenter );
496 mQ.scale( Scale, QCenter );
497 }
498
499 setDrawMode( PRIMITIVE_QUADS, mForceBlendMode );
500
501 if ( GLi->quadsSupported() ) {
502 mTVertex = &mVertex[mNumVertex];
503 mTVertex->pos.x = mQ[0].x;
504 mTVertex->pos.y = mQ[0].y;
505 mTVertex->tex = mTexCoord[0];
506 mTVertex->color = mVerColor[0];
507
508 mTVertex = &mVertex[mNumVertex + 1];
509 mTVertex->pos.x = mQ[1].x;
510 mTVertex->pos.y = mQ[1].y;
511 mTVertex->tex = mTexCoord[1];
512 mTVertex->color = mVerColor[1];
513
514 mTVertex = &mVertex[mNumVertex + 2];
515 mTVertex->pos.x = mQ[2].x;
516 mTVertex->pos.y = mQ[2].y;
517 mTVertex->tex = mTexCoord[2];
518 mTVertex->color = mVerColor[2];
519
520 mTVertex = &mVertex[mNumVertex + 3];
521 mTVertex->pos.x = mQ[3].x;
522 mTVertex->pos.y = mQ[3].y;
523 mTVertex->tex = mTexCoord[3];
524 mTVertex->color = mVerColor[3];
525
526 addVertices( 4 );
527 } else {
528 mTVertex = &mVertex[mNumVertex];
529 mTVertex->pos.x = mQ[1].x;
530 mTVertex->pos.y = mQ[1].y;
531 mTVertex->tex = mTexCoord[1];
532 mTVertex->color = mVerColor[1];

Callers 2

drawMethod · 0.80
drawQuadExMethod · 0.80

Calls 3

getCenterMethod · 0.45
rotateMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected