Load a 2d texture.
| 812 | |
| 813 | // Load a 2d texture. |
| 814 | static bool LoadTexture( QDataStream & s, const DDSHeader & header, QImage & img ) |
| 815 | { |
| 816 | // Create dst image. |
| 817 | img = QImage( header.width, header.height, QImage::Format_RGB32 ); |
| 818 | |
| 819 | // Read image. |
| 820 | DDSType type = GetType( header ); |
| 821 | |
| 822 | // Enable alpha buffer for transparent or DDS images. |
| 823 | if( HasAlpha( header ) || type >= DDS_DXT1 ) { |
| 824 | img = img.convertToFormat( QImage::Format_ARGB32 ); |
| 825 | } |
| 826 | |
| 827 | TextureLoader loader = GetTextureLoader( type ); |
| 828 | if( loader == NULL ) { |
| 829 | return false; |
| 830 | } |
| 831 | |
| 832 | return loader( s, header, img ); |
| 833 | } |
| 834 | |
| 835 | |
| 836 | static int FaceOffset( const DDSHeader & header ) |
no test coverage detected