return reader->pos;
}
+SWF* swf_OpenSWF(char*filename)
+{
+ int fi = open(filename, O_RDONLY|O_BINARY);
+ if(fi<0) {
+ fprintf(stderr, "Failed to open %s\n", filename);
+ return 0;
+ }
+ SWF* swf = rfx_alloc(sizeof(SWF));
+ swf_ReadSWF(fi, swf);
+ close(fi);
+ return swf;
+}
+
int swf_ReadSWF(int handle, SWF * swf)
{
reader_t reader;
t = swf->firstTag;
frameCount = 0;
- len += WriteExtraTags(swf, 0);
+ if(swf->firstTag && !no_extra_tags) {
+ len += WriteExtraTags(swf, 0);
+ }
while(t) {
len += swf_WriteTag(-1,t);
if(t->id == ST_DEFINESPRITE && !swf_IsFolded(t)) inSprite++;
return -1;
}
- if(!no_extra_tags) {
+ if(swf->firstTag && !no_extra_tags) {
WriteExtraTags(swf, writer);
}
t = swf->firstTag;