| 183 | } |
| 184 | |
| 185 | BlueAsyncRes::LoadingResult Tr2AtlasTexture::DoLoad() |
| 186 | { |
| 187 | if( !m_dataStream ) |
| 188 | { |
| 189 | return LR_FAILED; |
| 190 | } |
| 191 | |
| 192 | m_loadedBitmap.reset( CCP_NEW( "Tr2AtlasTexture::m_loadedBitmap" ) ImageIO::HostBitmap ); |
| 193 | |
| 194 | ImageIO::Result result = ImageIO::ReadImage( *m_dataStream, ImageIO::LoadParameters( m_path.c_str() ), *m_loadedBitmap ); |
| 195 | |
| 196 | if( result ) |
| 197 | { |
| 198 | m_loadedBitmap->ConvertFormat( PIXEL_FORMAT_B8G8R8A8_UNORM ); |
| 199 | } |
| 200 | else |
| 201 | { |
| 202 | CCP_LOGWARN( "Tr2AtlasTexture: failed to load '%S' - %s", m_path.c_str(), result.GetErrorMessage().c_str() ); |
| 203 | } |
| 204 | return result ? LR_SUCCESS : LR_FAILED; |
| 205 | } |
| 206 | |
| 207 | bool Tr2AtlasTexture::DoPrepare() |
| 208 | { |