mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-01-18 23:41:42 +00:00
Skip some common SWF tags (FileAttributes, Metadata and SetBackgroundColor) instead of failing to load a SWF file if any of them are encountered.
This commit is contained in:
parent
a1776a22d0
commit
adf2b63e88
3 changed files with 37 additions and 0 deletions
|
@ -389,6 +389,9 @@ private:
|
|||
bool LoadSWF( const char* fullpath );
|
||||
bool LoadBinary( const char* bfilename, ID_TIME_T sourceTime );
|
||||
void WriteBinary( const char* bfilename );
|
||||
void FileAttributes( idSWFBitStream& bitstream );
|
||||
void Metadata( idSWFBitStream& bitstream );
|
||||
void SetBackgroundColor( idSWFBitStream& bitstream );
|
||||
|
||||
//----------------------------------
|
||||
// SWF_Shapes.cpp
|
||||
|
|
|
@ -526,3 +526,34 @@ void idSWF::WriteBinary( const char* bfilename )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
idSWF::FileAttributes
|
||||
Extra data that won't fit in a SWF header
|
||||
===================
|
||||
*/
|
||||
void idSWF::FileAttributes( idSWFBitStream& bitstream )
|
||||
{
|
||||
bitstream.Seek( 5 ); // 5 booleans
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
idSWF::Metadata
|
||||
===================
|
||||
*/
|
||||
void idSWF::Metadata( idSWFBitStream& bitstream )
|
||||
{
|
||||
bitstream.ReadString(); // XML string
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
idSWF::SetBackgroundColor
|
||||
===================
|
||||
*/
|
||||
void idSWF::SetBackgroundColor( idSWFBitStream& bitstream )
|
||||
{
|
||||
bitstream.Seek( 4 ); // int
|
||||
}
|
||||
|
|
|
@ -105,6 +105,9 @@ void idSWFSprite::Load( idSWFBitStream& bitstream, bool parseDictionary )
|
|||
switch( tag )
|
||||
{
|
||||
#define HANDLE_SWF_TAG( x ) case Tag_##x: swf->x( tagStream ); break;
|
||||
HANDLE_SWF_TAG( FileAttributes );
|
||||
HANDLE_SWF_TAG( Metadata );
|
||||
HANDLE_SWF_TAG( SetBackgroundColor );
|
||||
HANDLE_SWF_TAG( JPEGTables );
|
||||
HANDLE_SWF_TAG( DefineBits );
|
||||
HANDLE_SWF_TAG( DefineBitsJPEG2 );
|
||||
|
|
Loading…
Reference in a new issue