| 792 | //------------------------------------------------------------------------------ |
| 793 | |
| 794 | template<> 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 | |
| 825 | template<> ResourceBase::Signature Resource<DDSFile>::signature() |
| 826 | { |