mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
SWF export
This commit is contained in:
parent
9c58fdf6f9
commit
b952f3c594
2 changed files with 69 additions and 0 deletions
|
@ -387,15 +387,22 @@ private:
|
|||
friend class idSWFSprite;
|
||||
friend class idSWFSpriteInstance;
|
||||
|
||||
// RB begin
|
||||
bool LoadSWF( const char* fullpath );
|
||||
void WriteSWF( const char* filename );
|
||||
|
||||
bool LoadBinary( const char* bfilename, ID_TIME_T sourceTime );
|
||||
void WriteBinary( const char* bfilename );
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
void FileAttributes( idSWFBitStream& bitstream );
|
||||
void Metadata( idSWFBitStream& bitstream );
|
||||
void SetBackgroundColor( idSWFBitStream& bitstream );
|
||||
=======
|
||||
// RB begin
|
||||
=======
|
||||
|
||||
>>>>>>> 534d415... SWF export
|
||||
void LoadXML( const char* filename );
|
||||
void WriteXML( const char* filename );
|
||||
// RB end
|
||||
|
|
|
@ -139,6 +139,68 @@ bool idSWF::LoadSWF( const char* fullpath )
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
idSWF::WriteSWF
|
||||
|
||||
RB: bring .bswf back to .swf
|
||||
===================
|
||||
*/
|
||||
void idSWF::WriteSWF( const char* fullpath )
|
||||
{
|
||||
idFileLocal file( fileSystem->OpenFileWrite( filename, "fs_basepath" ) );
|
||||
if( file == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
swfHeader_t header;
|
||||
header.W = 'W';
|
||||
header.S = 'S';
|
||||
header.version = 9;
|
||||
header.compression == 'F';
|
||||
|
||||
file->Write( &header, sizeof( header ) );
|
||||
|
||||
|
||||
// TODO
|
||||
/*
|
||||
swfRect_t frameSize;
|
||||
bitstream.ReadRect( frameSize );
|
||||
|
||||
if( !frameSize.tl.Compare( vec2_zero ) )
|
||||
{
|
||||
idLib::Warning( "Invalid frameSize top left" );
|
||||
Mem_Free( fileData );
|
||||
return false;
|
||||
}
|
||||
|
||||
frameWidth = frameSize.br.x;
|
||||
frameHeight = frameSize.br.y;
|
||||
frameRate = bitstream.ReadU16();
|
||||
|
||||
// parse everything
|
||||
mainsprite->Load( bitstream, true );
|
||||
|
||||
// now that all images have been loaded, write out the combined image
|
||||
idStr atlasFileName = "generated/";
|
||||
atlasFileName += fullpath;
|
||||
atlasFileName.SetFileExtension( ".tga" );
|
||||
|
||||
WriteSwfImageAtlas( atlasFileName );
|
||||
|
||||
Mem_Free( fileData );
|
||||
*/
|
||||
|
||||
// add Tag_End
|
||||
|
||||
// go back and write filesize into header
|
||||
uint32 fileSize = file->Length();
|
||||
|
||||
file->Seek( offsetof( swfHeader_t, fileLength ), FS_SEEK_SET );
|
||||
file->WriteBig( fileSize );
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
idSWF::LoadBinary
|
||||
|
|
Loading…
Reference in a new issue