From: kramm Date: Mon, 22 Oct 2001 15:57:10 +0000 (+0000) Subject: * ShapeSetEnd now resets the bit count X-Git-Tag: release-0-0-2~25 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=60e30cf9af6734e9461e33f051822b6f2b070e06;p=swftools.git * ShapeSetEnd now resets the bit count * fixed ShapeSetLine function --- diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c index c09f30d..d1366ff 100644 --- a/lib/modules/swfshape.c +++ b/lib/modules/swfshape.c @@ -438,6 +438,7 @@ int ShapeSetAll(LPTAG t,LPSHAPE s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1) int ShapeSetEnd(LPTAG t) { if (!t) return -1; SetBits(t,0,6); + ResetBitcount(t); return 0; } @@ -446,10 +447,10 @@ int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y) if (!t) return -1; SetBits(t,3,2); // Straight Edge - if ((!s)||(s->px!=x)||(s->py!=y)) + if ((!s)||((x!=0)&&(y!=0))) { b = CountBits(x,2); b = CountBits(y,b); - SetBits(t,b-2,4); + SetBits(t, b>=2 ? b-2 : 0, 4); SetBits(t,1,1); SetBits(t,x,b); SetBits(t,y,b); @@ -460,16 +461,16 @@ int ShapeSetLine(LPTAG t,LPSHAPE s,S32 x,S32 y) return 0; } - if (s->px==x) + if (x==0) { b = CountBits(y,2); - SetBits(t,b-2,4); + SetBits(t, b>=2 ? b-2 : 0, 4); SetBits(t,1,2); SetBits(t,y,b); s->py += y; } else { b = CountBits(x,2); - SetBits(t,b-2,4); + SetBits(t, b>=2 ? b-2 : 0, 4); SetBits(t,0,2); SetBits(t,x,b); s->px += x;