| 628 | } |
| 629 | |
| 630 | BF_EXPORT void BF_CALLTYPE Gfx_DrawTextureSegment(TextureSegment* textureSegment, float a, float b, float c, float d, float tx, float ty, float z, uint32 color, int pixelSnapping) |
| 631 | { |
| 632 | DrawLayer* drawLayer = gBFApp->mRenderDevice->mCurDrawLayer; |
| 633 | drawLayer->SetTexture(0, textureSegment->mTexture); |
| 634 | DefaultVertex3D* v = (DefaultVertex3D*)drawLayer->AllocStrip(4); |
| 635 | |
| 636 | if ((pixelSnapping == 1) || |
| 637 | ((pixelSnapping == 2) && (a == 1.0f) && (b == 0) && (c == 0) && (d == 1.0f))) |
| 638 | { |
| 639 | tx = (float) (int) (tx + 100000) - 100000; |
| 640 | ty = (float) (int) (ty + 100000) - 100000; |
| 641 | } |
| 642 | |
| 643 | a *= textureSegment->mScaleX; |
| 644 | b *= textureSegment->mScaleX; |
| 645 | c *= textureSegment->mScaleY; |
| 646 | d *= textureSegment->mScaleY; |
| 647 | |
| 648 | v[0].Set(tx, ty, z, textureSegment->mU1, textureSegment->mV1, color); |
| 649 | v[1].Set(tx + a, ty + b, z, textureSegment->mU2, textureSegment->mV1, color); |
| 650 | v[2].Set(tx + c, ty + d, z, textureSegment->mU1, textureSegment->mV2, color); |
| 651 | v[3].Set(tx + (a + c), ty + (b + d), z, textureSegment->mU2, textureSegment->mV2, color); |
| 652 | |
| 653 | gPixelsDrawn += (int)((a + b) * (c + d)); |
| 654 | } |
| 655 | |
| 656 | static TextureSegment* gCurTextureSegment = NULL; |
| 657 | static DefaultVertex3D* gCurAllocVertices = NULL; |
nothing calls this directly
no test coverage detected