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

Method write

Engine/source/gfx/bitmap/ddsFile.cpp:525–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525bool 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
562void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file)
563{

Callers 8

_compileShaderMethod · 0.45
_saveCompiledOutputMethod · 0.45
writeHeaderMethod · 0.45
writeNextMipMethod · 0.45
saveFunction · 0.45
pngWriteDataFnFunction · 0.45
sWriteBMPFunction · 0.45
jpegWriteDataFnFunction · 0.45

Calls 4

writeNextMipMethod · 0.80
errorfFunction · 0.50
testMethod · 0.45
lastMethod · 0.45

Tested by

no test coverage detected