| 66 | } |
| 67 | |
| 68 | Tr2LightProfileRes::LoadingResult Tr2LightProfileRes::DoLoad() |
| 69 | { |
| 70 | if( !m_dataStream ) |
| 71 | { |
| 72 | return LR_FAILED; |
| 73 | } |
| 74 | if( IsIesExtension( m_path.c_str() ) ) |
| 75 | { |
| 76 | return ParseIes() ? LR_SUCCESS : LR_FAILED; |
| 77 | } |
| 78 | |
| 79 | auto result = ImageIO::ReadImage( *m_dataStream, ImageIO::LoadParameters( m_path.c_str() ), m_bitmap ); |
| 80 | if( !result ) |
| 81 | { |
| 82 | CCP_LOGWARN( "Tr2LightProfileRes: error reading '%S' - %s", GetPath(), result.GetErrorMessage().c_str() ); |
| 83 | return LR_FAILED; |
| 84 | } |
| 85 | if( !IsCompatibleBitmap( m_bitmap ) ) |
| 86 | { |
| 87 | CCP_LOGWARN( "Tr2LightProfileRes: bitmap '%S' contains an uncompatible lightmap. The lightmap needs to be %ux1 texture with format R16F", GetPath(), PROFILE_LIGHTMAP_SIZE ); |
| 88 | m_bitmap.Destroy(); |
| 89 | return LR_FAILED; |
| 90 | } |
| 91 | |
| 92 | return LR_SUCCESS; |
| 93 | } |
| 94 | |
| 95 | bool Tr2LightProfileRes::DoPrepare() |
| 96 | { |
nothing calls this directly
no test coverage detected