| 605 | //------------------------------------------------------------------------------ |
| 606 | |
| 607 | template<> 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 | |
| 638 | template<> ResourceBase::Signature Resource<DDSFile>::signature() |
| 639 | { |