minor fixes: swf_SetBits(), cleanup shape struct, fixed dumpfont
[swftools.git] / lib / modules / swfshape.c
index f107f92..921eaba 100644 (file)
@@ -54,7 +54,7 @@ int swf_GetSimpleShape(TAG * t,SHAPE * * s) // without Linestyle/Fillstyle Recor
   if (FAILED(swf_ShapeNew(s))) return -1;
   sh = s[0];
 
-  swf_ResetBitmask(t); 
+  swf_ResetReadBits(t); 
   sh->bits.fill = (U16)swf_GetBits(t,4);
   sh->bits.line = (U16)swf_GetBits(t,4);
   bitl = 0; end = 0; pos = swf_GetTagPos(t);
@@ -144,13 +144,13 @@ int swf_SetSimpleShape(TAG * t,SHAPE * s) // without Linestyle/Fillstyle Record
   l = (s->bitlen+7)/8;
 
   if (t)
-  { swf_ResetBitcount(t);
+  { swf_ResetWriteBits(t);
 
     swf_SetBits(t,s->bits.fill,4);
     swf_SetBits(t,s->bits.line,4);
     swf_SetBlock(t,s->data,l);
 
-    swf_ResetBitcount(t);
+    swf_ResetWriteBits(t);
   }
   return l+1;
 }
@@ -231,7 +231,7 @@ int swf_ShapeCountBits(SHAPE * s,U8 * fbits,U8 * lbits)
 
 int swf_SetShapeBits(TAG * t,SHAPE * s)
 { if ((!t)||(!s)) return -1;
-  swf_ResetBitcount(t);
+  swf_ResetWriteBits(t);
   swf_SetBits(t,s->bits.fill,4);
   swf_SetBits(t,s->bits.line,4);
   return 0;
@@ -385,10 +385,6 @@ int swf_ShapeSetMove(TAG * t,SHAPE * s,S32 x,S32 y)
   swf_SetBits(t,x,b);
   swf_SetBits(t,y,b);
 
-  if (s)
-  { s->px = x;
-    s->py = y;
-  }
   return 0;
 }
 
@@ -426,8 +422,6 @@ int swf_ShapeSetAll(TAG * t,SHAPE * s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1)
   swf_SetBits(t,b,5);
   swf_SetBits(t,x,b);
   swf_SetBits(t,y,b);
-  s->px = x;
-  s->py = y;
 
   if (fill0) swf_SetBits(t,fill0,s->bits.fill);
   if (fill1) swf_SetBits(t,fill1,s->bits.fill);
@@ -439,7 +433,7 @@ int swf_ShapeSetAll(TAG * t,SHAPE * s,S32 x,S32 y,U16 line,U16 fill0,U16 fill1)
 int swf_ShapeSetEnd(TAG * t)
 { if (!t) return -1;
   swf_SetBits(t,0,6);
-  swf_ResetBitcount(t);
+  swf_ResetWriteBits(t);
   return 0;
 }
 
@@ -456,10 +450,6 @@ int swf_ShapeSetLine(TAG * t,SHAPE * s,S32 x,S32 y)
     swf_SetBits(t,1,1);
     swf_SetBits(t,x,b);
     swf_SetBits(t,y,b);
-    if (s)
-    { s->px += x;
-      s->py += y;
-    }
     return 0;
   }
 
@@ -470,8 +460,7 @@ int swf_ShapeSetLine(TAG * t,SHAPE * s,S32 x,S32 y)
     swf_SetBits(t, b-2, 4);
     swf_SetBits(t,1,2);
     swf_SetBits(t,y,b);
-    s->py += y;
-  }
+  } 
   else
   { b = swf_CountBits(x,2);
     if(b<2) 
@@ -479,7 +468,6 @@ int swf_ShapeSetLine(TAG * t,SHAPE * s,S32 x,S32 y)
     swf_SetBits(t, b-2, 4);
     swf_SetBits(t,0,2);
     swf_SetBits(t,x,b);
-    s->px += x;
   }
   return 0;
 }
@@ -501,10 +489,6 @@ int swf_ShapeSetCurve(TAG * t,SHAPE * s,S32 x,S32 y,S32 ax,S32 ay)
   swf_SetBits(t,ax,b);
   swf_SetBits(t,ay,b);
 
-  if (s)
-  { s->px += x+ax;
-    s->py += y+ay;
-  }
   return 0;
 }