| 523 | } |
| 524 | |
| 525 | bool DDSFile::write( Stream &s ) |
| 526 | { |
| 527 | if(!writeHeader(s)) |
| 528 | { |
| 529 | Con::errorf("DDSFile::write - error writing header!"); |
| 530 | return false; |
| 531 | } |
| 532 | |
| 533 | // How many surfaces are we talking about? |
| 534 | if(mFlags.test(CubeMapFlag)) |
| 535 | { |
| 536 | // Do something with cubemaps. |
| 537 | for (U32 cubeFace = 0; cubeFace < Cubemap_Surface_Count; cubeFace++) |
| 538 | { |
| 539 | // write the mips |
| 540 | for (S32 i = 0; i < mMipMapCount; i++) |
| 541 | mSurfaces[cubeFace]->writeNextMip(this, s, mHeight, mWidth, i); |
| 542 | } |
| 543 | } |
| 544 | else if (mFlags.test(VolumeFlag)) |
| 545 | { |
| 546 | // Do something with volume |
| 547 | } |
| 548 | else |
| 549 | { |
| 550 | // It's a plain old texture. |
| 551 | |
| 552 | // Load however many mips there are. |
| 553 | for ( S32 i = 0; i < mMipMapCount; i++ ) |
| 554 | mSurfaces.last()->writeNextMip(this, s, mHeight, mWidth, i); |
| 555 | |
| 556 | // Ok, we're done. |
| 557 | } |
| 558 | |
| 559 | return true; |
| 560 | } |
| 561 | |
| 562 | void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file) |
| 563 | { |
no test coverage detected