From: Sandro S. <st...@us...> - 2009-03-27 14:23:29
|
Update of /cvsroot/ming/ming/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4274/util Modified Files: outputscript.c outputtxt.c parser.c swftypes.h Log Message: When parsing a LINESTYLEARRAY don't bother remembering *how* the line style count was encoded, but just figure out that count and print it. Update refs accordingly. Index: parser.c =================================================================== RCS file: /cvsroot/ming/ming/util/parser.c,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** parser.c 8 Oct 2008 09:23:20 -0000 1.92 --- parser.c 27 Mar 2009 14:23:12 -0000 1.93 *************** *** 640,650 **** int count, i; ! linestyle->LineStyleCount = readUInt8 (f); ! count = linestyle->LineStyleCount; ! if (linestyle->LineStyleCount == 0xff) { ! linestyle->LineStyleCountExtended = readUInt16 (f); ! count = linestyle->LineStyleCountExtended; } if(level == 4) { --- 640,650 ---- int count, i; ! count = readUInt8 (f); ! if (count == 0xff) { ! count = readUInt16(f); } + linestyle->LineStyleCount = count; + if(level == 4) { Index: outputscript.c =================================================================== RCS file: /cvsroot/ming/ming/util/outputscript.c,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** outputscript.c 27 Mar 2009 12:50:51 -0000 1.81 --- outputscript.c 27 Mar 2009 14:23:12 -0000 1.82 *************** *** 157,160 **** --- 157,161 ---- {SWF_DEFINESHAPE2, outputSWF_DEFINESHAPE2}, {SWF_DEFINESHAPE3, outputSWF_DEFINESHAPE3}, + {SWF_DEFINESHAPE4, outputSWF_DEFINESHAPE4}, {SWF_DEFINESOUND, outputSWF_DEFINESOUND}, {SWF_DEFINESPRITE, outputSWF_DEFINESPRITE}, *************** *** 573,578 **** int i, count; ! count = (linestylearray->LineStyleCount != 0xff) ? ! linestylearray->LineStyleCount : linestylearray->LineStyleCountExtended; printf ("" COMMSTART "%d linestyles(s)" COMMEND "\n", count); --- 574,578 ---- int i, count; ! count = linestylearray->LineStyleCount; printf ("" COMMSTART "%d linestyles(s)" COMMEND "\n", count); *************** *** 1234,1237 **** --- 1234,1256 ---- void + outputSWF_DEFINESHAPE4 (SWF_Parserstruct * pblock) + { + char name[32]; + OUT_BEGIN (SWF_DEFINESHAPE4); + sprintf (name, "character%d", sblock->ShapeID); + + printf ("\n" COMMSTART " Shape %d (TYPE=4, RECT=%d,%d %d,%d)" COMMEND "\n", sblock->ShapeID, + (int)sblock->ShapeBounds.Xmin,(int)sblock->ShapeBounds.Xmax,(int)sblock->ShapeBounds.Ymin,(int)sblock->ShapeBounds.Ymax); + printf ("%s();\n", newobj (name, "Shape")); + /* There doesn't seem to be a way to use this in the API + * it is calculated internal to teh shape object, but I'm not + * sure it will come up with the same answer. + outputSWF_RECT(&sblock->ShapeBounds); + */ + outputSWF_SHAPEWITHSTYLE_new (&sblock->Shapes, 4, name, &sblock->ShapeBounds); + + } + + void outputSWF_DEFINESOUND (SWF_Parserstruct * pblock) { Index: swftypes.h =================================================================== RCS file: /cvsroot/ming/ming/util/swftypes.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** swftypes.h 24 Mar 2009 09:34:36 -0000 1.57 --- swftypes.h 27 Mar 2009 14:23:12 -0000 1.58 *************** *** 832,837 **** typedef struct SWF_LINESTYLEARRAY { ! UI8 LineStyleCount; ! UI16 LineStyleCountExtended; SWF_LINESTYLE *LineStyles; SWF_LINESTYLE2 *LineStyles2; --- 832,836 ---- typedef struct SWF_LINESTYLEARRAY { ! UI16 LineStyleCount; SWF_LINESTYLE *LineStyles; SWF_LINESTYLE2 *LineStyles2; Index: outputtxt.c =================================================================== RCS file: /cvsroot/ming/ming/util/outputtxt.c,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** outputtxt.c 24 Mar 2009 09:39:16 -0000 1.94 --- outputtxt.c 27 Mar 2009 14:23:12 -0000 1.95 *************** *** 567,578 **** int count, i; _iprintf (" LineStyleArray: "); ! _iprintf (" LineStyleCount: %6d ", linestylearray->LineStyleCount); ! _iprintf (" LineStyleCountExtended: %6d\n", ! linestylearray->LineStyleCountExtended); ! count = ! (linestylearray->LineStyleCount != ! 0xff) ? linestylearray->LineStyleCount : linestylearray-> ! LineStyleCountExtended; for (i = 0; i < count; i++) { --- 567,575 ---- int count, i; + count = linestylearray->LineStyleCount; + _iprintf (" LineStyleArray: "); ! _iprintf (" LineStyleCount: %d\n", count); ! for (i = 0; i < count; i++) { |