| 768 | } |
| 769 | |
| 770 | void DDSFile::SurfaceData::readNextMip(DDSFile *dds, Stream &s, U32 height, U32 width, U32 mipLevel, bool skip) |
| 771 | { |
| 772 | U32 size = dds->getSurfaceSize(height, width, mipLevel); |
| 773 | |
| 774 | // If we're skipping this mip then seek forward. |
| 775 | if ( skip ) |
| 776 | s.setPosition( s.getPosition() + size ); |
| 777 | else |
| 778 | { |
| 779 | mMips.push_back(new U8[size]); |
| 780 | if(!s.read(size, mMips.last())) |
| 781 | Con::errorf("DDSFile::SurfaceData::addNextMip - failed to read mip!"); |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | void DDSFile::SurfaceData::writeNextMip(DDSFile *dds, Stream &s, U32 height, U32 width, U32 mipLevel) |
| 786 | { |
no test coverage detected