| 677 | } |
| 678 | |
| 679 | BF_EXPORT void BF_CALLTYPE Gfx_DrawQuads(TextureSegment* textureSegment, DefaultVertex3D* vertices, int vtxCount) |
| 680 | { |
| 681 | /*for (int vtxIdx = 0; vtxIdx < vtxCount; vtxIdx += 4) |
| 682 | { |
| 683 | Vertex3D* v = gBFApp->mRenderDevice->mCurDrawLayer->AllocStrip(textureSegment->mTexture, drawType != 0, 4); |
| 684 | |
| 685 | v[0] = vertices[vtxIdx]; |
| 686 | v[1] = vertices[vtxIdx + 1]; |
| 687 | v[2] = vertices[vtxIdx + 2]; |
| 688 | v[3] = vertices[vtxIdx + 3]; |
| 689 | } |
| 690 | |
| 691 | return;*/ |
| 692 | |
| 693 | DrawLayer* drawLayer = gBFApp->mRenderDevice->mCurDrawLayer; |
| 694 | drawLayer->SetTexture(0, textureSegment->mTexture); |
| 695 | |
| 696 | DefaultVertex3D* vtxInPtr = vertices; |
| 697 | |
| 698 | int curIdx = 0; |
| 699 | while (curIdx < vtxCount) |
| 700 | { |
| 701 | //int batchSize = std::min(128, vtxCount - curIdx); |
| 702 | int batchSize = std::min(16*1024, vtxCount - curIdx); |
| 703 | |
| 704 | uint16 idxOfs; |
| 705 | DefaultVertex3D* vtxPtr; |
| 706 | uint16* idxPtr; |
| 707 | gBFApp->mRenderDevice->mCurDrawLayer->AllocIndexed(batchSize, batchSize * 6 / 4, (void**)&vtxPtr, &idxPtr, &idxOfs); |
| 708 | |
| 709 | for (int vtxIdx = 0; vtxIdx < batchSize; vtxIdx += 4) |
| 710 | { |
| 711 | *(vtxPtr++) = *(vtxInPtr++); |
| 712 | *(vtxPtr++) = *(vtxInPtr++); |
| 713 | *(vtxPtr++) = *(vtxInPtr++); |
| 714 | *(vtxPtr++) = *(vtxInPtr++); |
| 715 | |
| 716 | *(idxPtr++) = idxOfs; |
| 717 | *(idxPtr++) = idxOfs + 1; |
| 718 | *(idxPtr++) = idxOfs + 2; |
| 719 | |
| 720 | *(idxPtr++) = idxOfs + 1; |
| 721 | *(idxPtr++) = idxOfs + 2; |
| 722 | *(idxPtr++) = idxOfs + 3; |
| 723 | |
| 724 | /*int curIdxIdx = idxPtr - gBFApp->mRenderDevice->mCurDrawLayer->mDrawBatchList.mTail->mIndices; |
| 725 | BF_ASSERT(curIdxIdx <= gBFApp->mRenderDevice->mCurDrawLayer->mDrawBatchList.mTail->mAllocatedIndices); |
| 726 | int curVtxIdx = vtxPtr - gBFApp->mRenderDevice->mCurDrawLayer->mDrawBatchList.mTail->mVertices; |
| 727 | BF_ASSERT(curVtxIdx <= gBFApp->mRenderDevice->mCurDrawLayer->mDrawBatchList.mTail->mAllocatedVertices);*/ |
| 728 | |
| 729 | idxOfs += 4; |
| 730 | } |
| 731 | |
| 732 | curIdx += batchSize; |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | BF_EXPORT void BF_CALLTYPE Gfx_DrawIndexedVertices(int vertexSize, void* vtxData, int vtxCount, uint16* idxData, int idxCount) |
nothing calls this directly
no test coverage detected