| 780 | } |
| 781 | |
| 782 | bool DDSFile::decompressToGBitmap(GBitmap *dest) |
| 783 | { |
| 784 | // TBD: do we support other formats? |
| 785 | if (mFormat != GFXFormatBC1 && mFormat != GFXFormatBC2 && mFormat != GFXFormatBC3) |
| 786 | return false; |
| 787 | |
| 788 | dest->allocateBitmapWithMips(getWidth(), getHeight(), getMipLevels(), GFXFormatR8G8B8A8); |
| 789 | |
| 790 | // Decompress and copy mips... |
| 791 | |
| 792 | U32 numMips = getMipLevels(); |
| 793 | |
| 794 | for (U32 i = 0; i < numMips; i++) |
| 795 | { |
| 796 | U8 *addr = dest->getAddress(0, 0, i); |
| 797 | const U8 *mipBuffer = mSurfaces[0]->mMips[i]; |
| 798 | ImageUtil::decompress(mipBuffer, addr, getWidth(i), getHeight(i), mFormat); |
| 799 | |
| 800 | } |
| 801 | |
| 802 | return true; |
| 803 | } |
| 804 | |
| 805 | DefineEngineFunction( getActiveDDSFiles, S32, (),, |
| 806 | "Returns the count of active DDSs files in memory.\n" |
no test coverage detected