MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / write

Method write

Engine/source/gfx/bitmap/ddsLoader.cpp:715–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715bool 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
749void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file)
750{

Callers 2

writeHeaderMethod · 0.45
writeNextMipMethod · 0.45

Calls 4

errorfFunction · 0.85
writeNextMipMethod · 0.80
lastMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected