--------------------------------------------------------------------------
| 498 | |
| 499 | //-------------------------------------------------------------------------- |
| 500 | void GBitmap::chopTopMips(U32 mipsToChop) |
| 501 | { |
| 502 | U32 scalePower = getMin(mipsToChop, getNumMipLevels() - 1); |
| 503 | U32 newMipCount = getNumMipLevels() - scalePower; |
| 504 | |
| 505 | U32 realWidth = getMax((U32)1, getWidth() >> scalePower); |
| 506 | U32 realHeight = getMax((U32)1, getHeight() >> scalePower); |
| 507 | |
| 508 | U8 *destBits = mBits; |
| 509 | |
| 510 | U32 destOffsets[c_maxMipLevels]; |
| 511 | |
| 512 | for (U32 i = scalePower; i<mNumMipLevels; i++) |
| 513 | { |
| 514 | // Copy to the new bitmap... |
| 515 | dMemcpy(destBits, |
| 516 | getWritableBits(i), |
| 517 | getSurfaceSize(i)); |
| 518 | |
| 519 | destOffsets[i - scalePower] = destBits - mBits; |
| 520 | destBits += getSurfaceSize(i); |
| 521 | } |
| 522 | |
| 523 | dMemcpy(mMipLevelOffsets, destOffsets, sizeof(destOffsets)); |
| 524 | |
| 525 | mWidth = realWidth; |
| 526 | mHeight = realHeight; |
| 527 | mByteSize = destBits - mBits; |
| 528 | mNumMipLevels = newMipCount; |
| 529 | } |
| 530 | |
| 531 | //-------------------------------------------------------------------------- |
| 532 | void GBitmap::extrudeMipLevelsDetail() |
no test coverage detected