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

Method create

Engine/source/gfx/bitmap/ddsFile.cpp:607–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605//------------------------------------------------------------------------------
606
607template<> void *Resource<DDSFile>::create( const Torque::Path &path )
608{
609#ifdef TORQUE_DEBUG_RES_MANAGER
610 Con::printf( "Resource<DDSFile>::create - [%s]", path.getFullPath().c_str() );
611#endif
612
613 FileStream stream;
614
615 stream.open( path.getFullPath(), Torque::FS::File::Read );
616
617 if ( stream.getStatus() != Stream::Ok )
618 return NULL;
619
620 DDSFile *retDDS = new DDSFile;
621
622 if( !retDDS->read( stream, DDSFile::smDropMipCount ) )
623 {
624 delete retDDS;
625 return NULL;
626 }
627 else
628 {
629 // Set source file name
630 retDDS->mSourcePath = path;
631 retDDS->mCacheString = Torque::Path::Join( path.getRoot(), ':', path.getPath() );
632 retDDS->mCacheString = Torque::Path::Join( retDDS->mCacheString, '/', path.getFileName() );
633 }
634
635 return retDDS;
636}
637
638template<> ResourceBase::Signature Resource<DDSFile>::signature()
639{

Callers

nothing calls this directly

Calls 8

printfFunction · 0.85
getFileNameMethod · 0.80
openMethod · 0.65
c_strMethod · 0.45
getStatusMethod · 0.45
readMethod · 0.45
getRootMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected