MCPcopy Create free account
hub / github.com/carbonengine/trinity / DoLoad

Method DoLoad

trinity/Tr2AtlasTexture.cpp:185–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185BlueAsyncRes::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
207bool Tr2AtlasTexture::DoPrepare()
208{

Callers

nothing calls this directly

Calls 1

resetMethod · 0.80

Tested by

no test coverage detected