git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ab40f5d
)
flash9 tags implementation
author
kramm
<kramm>
Sun, 9 Dec 2007 09:44:33 +0000
(09:44 +0000)
committer
kramm
<kramm>
Sun, 9 Dec 2007 09:44:33 +0000
(09:44 +0000)
lib/devices/swf.c
patch
|
blob
|
history
lib/modules/swfdump.c
patch
|
blob
|
history
lib/modules/swftools.c
patch
|
blob
|
history
lib/rfxswf.c
patch
|
blob
|
history
lib/rfxswf.h
patch
|
blob
|
history
src/swfdump.c
patch
|
blob
|
history
diff --git
a/lib/devices/swf.c
b/lib/devices/swf.c
index
d0ac1c4
..
872d0a9
100644
(file)
--- a/
lib/devices/swf.c
+++ b/
lib/devices/swf.c
@@
-853,7
+853,7
@@
void swf_endframe(gfxdevice_t*dev)
if(!i->pagefinished)
endpage(dev);
if(!i->pagefinished)
endpage(dev);
- if(i->config_insertstoptag) {
+ if( (i->swf->fileVersion <= 8) && (i->config_insertstoptag) ) {
ActionTAG*atag=0;
atag = action_Stop(atag);
atag = action_End(atag);
ActionTAG*atag=0;
atag = action_Stop(atag);
atag = action_End(atag);
@@
-1174,7
+1174,6
@@
void wipeSWF(SWF*swf)
}
}
}
}
-
void swfoutput_finalize(gfxdevice_t*dev)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
void swfoutput_finalize(gfxdevice_t*dev)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
@@
-1251,6
+1250,10
@@
void swfoutput_finalize(gfxdevice_t*dev)
i->swf->compressed = 1;
}
i->swf->compressed = 1;
}
+ /* Initialize AVM2 if it is a Flash9 file */
+ if(i->config_flashversion>=9 && i->config_insertstoptag) {
+ AVM2_InsertStops(i->swf);
+ }
// if(i->config_reordertags)
// swf_Optimize(i->swf);
}
// if(i->config_reordertags)
// swf_Optimize(i->swf);
}
diff --git
a/lib/modules/swfdump.c
b/lib/modules/swfdump.c
index
0773f1f
..
b2a6698
100644
(file)
--- a/
lib/modules/swfdump.c
+++ b/
lib/modules/swfdump.c
@@
-145,6
+145,8
@@
char* swf_TagGetName(TAG*tag)
return "DEFINEEDITTEXT";
case ST_DOACTION:
return "DOACTION";
return "DEFINEEDITTEXT";
case ST_DOACTION:
return "DOACTION";
+ case ST_DOABC:
+ return "DOABC";
case ST_DEFINEFONTINFO:
return "DEFINEFONTINFO";
case ST_DEFINESOUND:
case ST_DEFINEFONTINFO:
return "DEFINEFONTINFO";
case ST_DEFINESOUND:
@@
-205,6
+207,10
@@
char* swf_TagGetName(TAG*tag)
return "EXTERNALFONT";
case ST_EXPORTASSETS:
return "EXPORTASSETS";
return "EXTERNALFONT";
case ST_EXPORTASSETS:
return "EXPORTASSETS";
+ case ST_SYMBOLCLASS:
+ return "SYMBOLCLASS";
+ case ST_DEFINEBINARY:
+ return "DEFINEBINARY";
case ST_IMPORTASSETS:
return "IMPORTASSETS";
case ST_ENABLEDEBUGGER:
case ST_IMPORTASSETS:
return "IMPORTASSETS";
case ST_ENABLEDEBUGGER:
diff --git
a/lib/modules/swftools.c
b/lib/modules/swftools.c
index
6c37762
..
f763897
100644
(file)
--- a/
lib/modules/swftools.c
+++ b/
lib/modules/swftools.c
@@
-241,6
+241,7
@@
static int swf_definingtagids[] =
ST_DEFINEBUTTON2,
ST_DEFINESOUND,
ST_DEFINEVIDEOSTREAM,
ST_DEFINEBUTTON2,
ST_DEFINESOUND,
ST_DEFINEVIDEOSTREAM,
+ ST_DEFINEBINARY,
-1
};
-1
};
@@
-253,6
+254,7
@@
static int swf_spritetagids[] =
ST_REMOVEOBJECT,
ST_REMOVEOBJECT2,
ST_DOACTION,
ST_REMOVEOBJECT,
ST_REMOVEOBJECT2,
ST_DOACTION,
+ ST_DOABC,
ST_STARTSOUND,
ST_FRAMELABEL,
ST_SOUNDSTREAMHEAD,
ST_STARTSOUND,
ST_FRAMELABEL,
ST_SOUNDSTREAMHEAD,
@@
-604,6
+606,7
@@
void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v
case ST_FREECHARACTER: /* unusual tags, which all start with an ID */
case ST_NAMECHARACTER:
case ST_FREECHARACTER: /* unusual tags, which all start with an ID */
case ST_NAMECHARACTER:
+ case ST_DEFINEBINARY:
case ST_GENERATORTEXT:
callback(tag, tag->pos + base, callback_data);
break;
case ST_GENERATORTEXT:
callback(tag, tag->pos + base, callback_data);
break;
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
a6071c4
..
adbdc5a
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-1314,7
+1314,7
@@
int swf_WriteSWF2(writer_t*writer, SWF * swf) // Writes SWF to file, return
if(swf->fileVersion >= 9) {
if (swf->firstTag && swf->firstTag->id != ST_FILEATTRIBUTES)
{
if(swf->fileVersion >= 9) {
if (swf->firstTag && swf->firstTag->id != ST_FILEATTRIBUTES)
{
- U32 flags = 0x8; // | 128 = usenetwork, | 8 = hasmetadata
+ U32 flags = 0x8; // | 128 = usenetwork, | 16 = Actionscript3 | 8 = hasmetadata
swf_SetU32(swf_InsertTagBefore(swf, swf->firstTag,ST_FILEATTRIBUTES),flags);
}
}
swf_SetU32(swf_InsertTagBefore(swf, swf->firstTag,ST_FILEATTRIBUTES),flags);
}
}
@@
-1532,6
+1532,7
@@
void swf_FreeTags(SWF * swf) // Frees all malloc'ed memory for t
#include "modules/swfcgi.c"
#include "modules/swfbits.c"
#include "modules/swfaction.c"
#include "modules/swfcgi.c"
#include "modules/swfbits.c"
#include "modules/swfaction.c"
+#include "modules/swfabc.c"
#include "modules/swfsound.c"
#include "modules/swfdraw.c"
#include "modules/swfrender.c"
#include "modules/swfsound.c"
#include "modules/swfdraw.c"
#include "modules/swfrender.c"
diff --git
a/lib/rfxswf.h
b/lib/rfxswf.h
index
d33c268
..
67046f2
100644
(file)
--- a/
lib/rfxswf.h
+++ b/
lib/rfxswf.h
@@
-326,11
+326,14
@@
SRECT swf_TurnRect(SRECT r, MATRIX* m);
#define ST_DEFINEFONTALIGNZONES 73 /* version 8 */
#define ST_CSMTEXTSETTINGS 74 /* version 8 */
#define ST_DEFINEFONT3 75 /* version 8 */
#define ST_DEFINEFONTALIGNZONES 73 /* version 8 */
#define ST_CSMTEXTSETTINGS 74 /* version 8 */
#define ST_DEFINEFONT3 75 /* version 8 */
+#define ST_SYMBOLCLASS 76 /* version 9 */
#define ST_METADATA 77 /* version 8 */
#define ST_DEFINESCALINGGRID 78 /* version 8 */
#define ST_METADATA 77 /* version 8 */
#define ST_DEFINESCALINGGRID 78 /* version 8 */
+#define ST_DOABC 82 /* version 9 */
#define ST_DEFINESHAPE4 83 /* version 8 */
#define ST_DEFINEMORPHSHAPE2 84 /* version 8 */
#define ST_SCENEDESCRIPTION 86 /* version 9 */
#define ST_DEFINESHAPE4 83 /* version 8 */
#define ST_DEFINEMORPHSHAPE2 84 /* version 8 */
#define ST_SCENEDESCRIPTION 86 /* version 9 */
+#define ST_DEFINEBINARY 87 /* version 9 */
/* custom tags- only valid for swftools */
#define ST_REFLEX 777 /* to identify generator software */
/* custom tags- only valid for swftools */
#define ST_REFLEX 777 /* to identify generator software */
@@
-1062,6
+1065,8
@@
void swf_SetFilter(TAG*tag, FILTER*f);
FILTER*swf_GetFilter(TAG*tag);
FILTER*swf_NewFilter(U8 type);
FILTER*swf_GetFilter(TAG*tag);
FILTER*swf_NewFilter(U8 type);
+void AVM2_InsertStops(SWF*swf);
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
diff --git
a/src/swfdump.c
b/src/swfdump.c
index
1793ba0
..
35dc77e
100644
(file)
--- a/
src/swfdump.c
+++ b/
src/swfdump.c
@@
-1281,7
+1281,7
@@
int main (int argc,char ** argv)
if(tag->len)
dumperror("End Tag not empty");
}
if(tag->len)
dumperror("End Tag not empty");
}
- else if(tag->id == ST_EXPORTASSETS) {
+ else if(tag->id == ST_EXPORTASSETS || tag->id == ST_SYMBOLCLASS) {
handleExportAssets(tag, myprefix);
}
else if(tag->id == ST_DOACTION && action) {
handleExportAssets(tag, myprefix);
}
else if(tag->id == ST_DOACTION && action) {