| 127 | } |
| 128 | |
| 129 | void DrawBatch::AllocIndexed(int vtxCount, int idxCount, void** verticesOut, uint16** indicesOut, uint16* idxOfsOut) |
| 130 | { |
| 131 | bool fits = (idxCount + mIdxIdx <= mAllocatedIndices) && (vtxCount + mVtxIdx <= mAllocatedVertices); |
| 132 | if ((mRenderState != gBFApp->mRenderDevice->mCurRenderState) || (!fits)) |
| 133 | { |
| 134 | if ((mVtxIdx > 0) || (!fits)) |
| 135 | { |
| 136 | DrawBatch* nextBatch = AllocateChainedBatch(vtxCount, idxCount); |
| 137 | return nextBatch->AllocIndexed(vtxCount, idxCount, verticesOut, indicesOut, idxOfsOut); |
| 138 | } |
| 139 | |
| 140 | mRenderState = gBFApp->mRenderDevice->mCurRenderState; |
| 141 | } |
| 142 | |
| 143 | *verticesOut = (uint8*)mVertices + (mVtxIdx * mVtxSize); |
| 144 | *indicesOut = mIndices + mIdxIdx; |
| 145 | *idxOfsOut = mVtxIdx; |
| 146 | |
| 147 | mVtxIdx += vtxCount; |
| 148 | mIdxIdx += idxCount; |
| 149 | } |
| 150 | |
| 151 | // |
| 152 |
no outgoing calls
no test coverage detected