X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc.c;h=57f26f40437d1d73d9366e3909641976c5e62e84;hb=607c5dadd6089768b618cc99346de1b37a2c46f1;hp=2c23d95cd065b803a23ccc5e6cca6b247680a08d;hpb=6955bfe4fd7cd92489d8f8be792bb232f35768bd;p=swftools.git diff --git a/src/swfc.c b/src/swfc.c index 2c23d95..57f26f4 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -618,6 +618,7 @@ static void s_endSprite() currentdepth = stack[stackpos].olddepth; instances = stack[stackpos].oldinstances; + tag = swf_InsertTag(tag, ST_SHOWFRAME); tag = swf_InsertTag(tag, ST_END); tag = stack[stackpos].tag; @@ -796,7 +797,7 @@ void s_box(char*name, int width, int height, RGBA color, int linewidth, char*tex tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); if(linewidth) - ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); + ls1 = swf_ShapeAddLineStyle(s,linewidth>=20?linewidth-20:0,&color); if(texture) fs1 = addFillStyle(s, &r2, texture); @@ -819,37 +820,6 @@ void s_box(char*name, int width, int height, RGBA color, int linewidth, char*tex incrementid(); } -void swf_RecodeShapeData(U8*data, int bitlen, int in_bits_fill, int in_bits_line, - U8**destdata, U32*destbitlen, int out_bits_fill, int out_bits_line) -{ - SHAPE2 s2; - SHAPE s; - SHAPELINE*line; - memset(&s2, 0, sizeof(s2)); - s2.lines = swf_ParseShapeData(data, bitlen, in_bits_fill, in_bits_line); - s2.numfillstyles = out_bits_fill?1<<(out_bits_fill-1):0; - s2.numlinestyles = out_bits_line?1<<(out_bits_line-1):0; - s2.fillstyles = rfx_calloc(sizeof(FILLSTYLE)*s2.numfillstyles); - s2.linestyles = rfx_calloc(sizeof(LINESTYLE)*s2.numlinestyles); - - line = s2.lines; - while(line) { - if(line->fillstyle0 > s2.numfillstyles) line->fillstyle0 = 0; - if(line->fillstyle1 > s2.numfillstyles) line->fillstyle1 = 0; - if(line->linestyle > s2.numlinestyles) line->linestyle = 0; - line = line->next; - } - - swf_Shape2ToShape(&s2,&s); - - free(s2.fillstyles); - free(s2.linestyles); - free(s.fillstyle.data); - free(s.linestyle.data); - *destdata = s.data; - *destbitlen = s.bitlen; -} - void s_filled(char*name, char*outlinename, RGBA color, int linewidth, char*texture) { SRECT rect,r2; @@ -865,7 +835,7 @@ void s_filled(char*name, char*outlinename, RGBA color, int linewidth, char*textu tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); if(linewidth) - ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); + ls1 = swf_ShapeAddLineStyle(s,linewidth>=20?linewidth-20:0,&color); if(texture) fs1 = addFillStyle(s, &r2, texture); @@ -900,7 +870,7 @@ void s_circle(char*name, int r, RGBA color, int linewidth, char*texture) tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); if(linewidth) - ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); + ls1 = swf_ShapeAddLineStyle(s,linewidth>=20?linewidth-20:0,&color); if(texture) fs1 = addFillStyle(s, &r2, texture); swf_SetU16(tag,id); @@ -1141,6 +1111,12 @@ void s_sound(char*name, char*filename) samples = (U16*)wav2.data; numsamples = wav2.size/2; free(wav.data); +#ifdef WORDS_BIGENDIAN + /* swap bytes */ + for(t=0;t>8)&0xff | (samples[t]<<8)&0xff00; + } +#endif } tag = swf_InsertTag(tag, ST_DEFINESOUND); @@ -1668,8 +1644,8 @@ int parseTwip(char*str) if(*s<'0' || *s>'9') syntaxerror("Not a coordinate: \"%s\"", str); } - if(l>2 || (l==2 && (dot[1]!='0' || dot[1]!='5'))) { - warning("precision loss: %s converted to twip", str); + if(l>2 || (l==2 && (dot[1]!='0' && dot[1]!='5'))) { + warning("precision loss: %s converted to twip: %s", str, dot); dot[2] = 0; l=2; } @@ -2778,7 +2754,7 @@ static map_t parseArguments(char*command, char*pattern) } } if(pos==len) { - syntaxerror("don't know what to do with \"%s\". (All parameters for .%s already set)", text, command); + syntaxerror("Illegal argument \"%s\" to .%s", text, command); } } #if 0//def DEBUG