| 713 | } |
| 714 | |
| 715 | bool DDSFile::write( Stream &s ) |
| 716 | { |
| 717 | if(!writeHeader(s)) |
| 718 | { |
| 719 | Con::errorf("DDSFile::write - error writing header!"); |
| 720 | return false; |
| 721 | } |
| 722 | |
| 723 | // At this point we know what sort of image we contain. So we should |
| 724 | // allocate some buffers, and read it in. |
| 725 | |
| 726 | // How many surfaces are we talking about? |
| 727 | if(mFlags.test(CubeMapFlag)) |
| 728 | { |
| 729 | // Do something with cubemaps. |
| 730 | } |
| 731 | else if (mFlags.test(VolumeFlag)) |
| 732 | { |
| 733 | // Do something with volume |
| 734 | } |
| 735 | else |
| 736 | { |
| 737 | // It's a plain old texture. |
| 738 | |
| 739 | // Load however many mips there are. |
| 740 | for ( S32 i = 0; i < mMipMapCount; i++ ) |
| 741 | mSurfaces.last()->writeNextMip(this, s, mHeight, mWidth, i); |
| 742 | |
| 743 | // Ok, we're done. |
| 744 | } |
| 745 | |
| 746 | return true; |
| 747 | } |
| 748 | |
| 749 | void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file) |
| 750 | { |
no test coverage detected