mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Prepaired SWF images export
This commit is contained in:
parent
54b2753025
commit
edd5ccb9b9
1 changed files with 27 additions and 10 deletions
|
@ -195,20 +195,15 @@ idSWF::idSWF( const char* filename_, idSoundWorld* soundWorld_ )
|
|||
WriteXML( xmlFileName );
|
||||
}
|
||||
|
||||
if( swf_exportSWF.GetBool() )
|
||||
{
|
||||
idStr swfFileName = "generated/";
|
||||
swfFileName += filename;
|
||||
swfFileName.SetFileExtension( ".swf" );
|
||||
|
||||
WriteSWF( swfFileName );
|
||||
}
|
||||
|
||||
idStr atlasFileName = binaryFileName;
|
||||
atlasFileName.SetFileExtension( ".tga" );
|
||||
atlasMaterial = declManager->FindMaterial( atlasFileName );
|
||||
|
||||
if( swf_exportAtlas.GetBool() )
|
||||
byte* atlasExportImageRGBA = NULL;
|
||||
int atlasExportImageWidth = 0;
|
||||
int atlasExportImageHeight = 0;
|
||||
|
||||
if( swf_exportAtlas.GetBool() || swf_exportSWF.GetBool() )
|
||||
{
|
||||
idStrStatic< MAX_OSPATH > generatedName = atlasFileName;
|
||||
generatedName.StripFileExtension();
|
||||
|
@ -306,8 +301,30 @@ idSWF::idSWF( const char* filename_, idSoundWorld* soundWorld_ )
|
|||
atlasFileNameExport.SetFileExtension( ".png" );
|
||||
|
||||
R_WritePNG( atlasFileNameExport, rgba.Ptr(), 4, img.width, img.height, true, "fs_basepath" );
|
||||
|
||||
if( swf_exportSWF.GetBool() )
|
||||
{
|
||||
atlasExportImageWidth = img.width;
|
||||
atlasExportImageHeight = img.height;
|
||||
atlasExportImageRGBA = ( byte* ) Mem_Alloc( rgba.Size(), TAG_TEMP );
|
||||
memcpy( atlasExportImageRGBA, rgba.Ptr(), rgba.Size() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( swf_exportSWF.GetBool() )
|
||||
{
|
||||
idStr swfFileName = "generated/";
|
||||
swfFileName += filename;
|
||||
swfFileName.SetFileExtension( ".swf" );
|
||||
|
||||
WriteSWF( swfFileName );
|
||||
}
|
||||
|
||||
if( atlasExportImageRGBA != NULL )
|
||||
{
|
||||
Mem_Free( atlasExportImageRGBA );
|
||||
atlasExportImageRGBA = NULL;
|
||||
}
|
||||
// RB end
|
||||
|
||||
|
|
Loading…
Reference in a new issue