X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfshape.c;h=024041b53efddb6cc22da53fdeadbf30a9c8a4ed;hb=5c59d829bdc0d6a15bfc28a664c6d309a7e80edb;hp=4642cffab0d39c6e9ac98cfa79f9ec074ba00148;hpb=3568c643744cdce9ab08aaaf009badfbba1d59ba;p=swftools.git diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c index 4642cff..024041b 100644 --- a/lib/modules/swfshape.c +++ b/lib/modules/swfshape.c @@ -552,8 +552,8 @@ SHAPELINE* swf_ParseShapeData(U8*data, int bits, int fillbits, int linebits) } if(flags&1) { //move int n = swf_GetBits(tag, 5); - x = swf_GetBits(tag, n); //x - y = swf_GetBits(tag, n); //y + x = swf_GetSBits(tag, n); //x + y = swf_GetSBits(tag, n); //y lines->next = (SHAPELINE*)malloc(sizeof(SHAPELINE)); lines = lines->next; @@ -570,7 +570,6 @@ SHAPELINE* swf_ParseShapeData(U8*data, int bits, int fillbits, int linebits) flags = swf_GetBits(tag, 1); if(flags) { //straight edge int n = swf_GetBits(tag, 4) + 2; - int x=0,y=0; if(swf_GetBits(tag, 1)) { //line flag x += swf_GetSBits(tag, n); //delta x y += swf_GetSBits(tag, n); //delta y @@ -626,7 +625,8 @@ SRECT swf_GetShapeBoundingBox(SHAPELINE*shape) r.xmin = r.ymin = SCOORD_MAX; r.xmax = r.ymax = SCOORD_MIN; if(!shape) { - fprintf(stderr, "rfxswf: Warning: empty Shape\n"); + memset(&r, 0, sizeof(SRECT)); + return r; } while(shape) { if(shape->x < r.xmin) r.xmin = shape->x; @@ -677,20 +677,112 @@ SHAPE2* swf_ShapeToShape2(SHAPE*shape) { return shape2; }; -SHAPE2* parseDefineShape(TAG*tag) +/*LINESTYLE* parseFillStyleArray(TAG*tag) +{ + U16 count; + int t; + int num=0; + if(tag->id == ST_DEFINESHAPE) + num = 1; + else if(tag->id == ST_DEFINESHAPE2) + num = 2; + else if(tag->id == ST_DEFINESHAPE3) + num = 3; + else return 0; + + count = swf_GetU8(tag); + if(count == 0xff && num>1) // defineshape2,3 only + count = swf_GetU16(tag); + + for(t=0;t=3?1:0); + } + else if(type == 0x40 || type == 0x41) + { + swf_ResetReadBits(tag); + // we made it. + if(tag->data[tag->pos] != 0xff || + tag->data[tag->pos+1] != 0xff) + //(callback)(tag, tag->pos, callback_data); + + swf_GetU16(tag); + swf_ResetReadBits(tag); + swf_GetMatrix(tag, NULL); + swf_GetMatrix(tag, NULL); + } + else { + fprintf(stderr, "rfxswf:swftools.c Unknown fillstyle:0x%02x\n",type); + } + } + swf_ResetReadBits(tag); + count = swf_GetU8(tag); // line style array + if(count == 0xff) + count = swf_GetU16(tag); + for(t=0;tid == ST_DEFINESHAPE) num = 1; else if(tag->id == ST_DEFINESHAPE2) num = 2; else if(tag->id == ST_DEFINESHAPE3) num = 3; - /* todo */ - fprintf(stderr, "Not implemented yet!\n"); - exit(1); + else return 0; + + swf_GetU16(); + + shape = (SHAPE2*)malloc(sizeof(SHAPE2)); + +// LINESTYLE * linestyles; +// int numlinestyles; +// FILLSTYLE* fillstyles; +// int numfillstyles; +// struct _SHAPELINE * lines; +// SRECT* bbox; // may be NULL + + swf_GetRect(); + swf_ResetReadBits(t); + fill = (U16)swf_GetBits(t,4); + line = (U16)swf_GetBits(t,4); + + swf_Get + + + + + + return 0; -} +}*/ SHAPE* swf_Shape2ToShape(SHAPE2*shape)