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

Method create

Engine/source/gfx/bitmap/ddsLoader.cpp:794–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792//------------------------------------------------------------------------------
793
794template<> void *Resource<DDSFile>::create( const Torque::Path &path )
795{
796#ifdef TORQUE_DEBUG_RES_MANAGER
797 Con::printf( "Resource<DDSFile>::create - [%s]", path.getFullPath().c_str() );
798#endif
799
800 FileStream stream;
801
802 stream.open( path.getFullPath(), Torque::FS::File::Read );
803
804 if ( stream.getStatus() != Stream::Ok )
805 return NULL;
806
807 DDSFile *retDDS = new DDSFile;
808
809 if( !retDDS->read( stream, DDSFile::smDropMipCount ) )
810 {
811 delete retDDS;
812 return NULL;
813 }
814 else
815 {
816 // Set source file name
817 retDDS->mSourcePath = path;
818 retDDS->mCacheString = Torque::Path::Join( path.getRoot(), ':', path.getPath() );
819 retDDS->mCacheString = Torque::Path::Join( retDDS->mCacheString, '/', path.getFileName() );
820 }
821
822 return retDDS;
823}
824
825template<> ResourceBase::Signature Resource<DDSFile>::signature()
826{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected