}
}
+void swf_FoldAllTags(TAG*tag)
+{
+ SWF swf;
+ memset(&swf, 0, sizeof(swf));
+ swf.firstTag = tag;
+ swf_FoldAll(&swf);
+}
+
void swf_UnFoldAll(SWF*swf)
{
TAG*tag = swf->firstTag;
int frameCount=0;
struct writer_t zwriter;
int fileSize = 0;
+ int inSprite = 0;
if (!swf) return -1;
t = swf->firstTag;
frameCount = 0;
- while(t)
- { len += swf_WriteTag(-1, t);
- if (t->id==ST_SHOWFRAME) frameCount++;
- t = swf_NextTag(t);
+ while(t) {
+ len += swf_WriteTag(-1,t);
+ if(t->id == ST_DEFINESPRITE) inSprite++;
+ else if(t->id == ST_END && inSprite) inSprite--;
+ else if(t->id == ST_SHOWFRAME && !inSprite) frameCount++;
+ t = swf_NextTag(t);
}
{ TAG t1;