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

Method Save

trinity/Tr2HostBitmap.cpp:445–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445bool Tr2HostBitmap::Save( const wchar_t* path )
446{
447 CCP_STATS_ZONE( __FUNCTION__ );
448
449 if( !IsValid() )
450 {
451 CCP_LOGWARN( "Tr2HostBitmap::Save not a valid bitmap" );
452 return false;
453 }
454
455 Be::Clsid resFileClsid( "blue", "ResFile" );
456 IResFilePtr stream( resFileClsid );
457 if( !( stream->FileExistsW( path ) ? stream->OpenW( path, false ) : stream->CreateW( path ) ) )
458 {
459 CCP_LOGWARN( "Tr2HostBitmap::Save failed to open Blue stream (%S)", path );
460 return false;
461 }
462 ON_BLOCK_EXIT( [&] { stream->Close(); } );
463
464 return ImageIO::SaveImage( path, *this, *stream );
465}
466
467bool Tr2HostBitmap::SaveAsync( const wchar_t* path )
468{

Callers 1

PythonSaveFunction · 0.45

Calls 1

IsValidFunction · 0.70

Tested by

no test coverage detected