From: boehme <boehme>
Date: Sun, 11 Nov 2001 13:30:05 +0000 (+0000)
Subject: minor fixes: swf_SetBits(), cleanup shape struct, fixed dumpfont
X-Git-Tag: release-0-1-2~21
X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=b3ae7bccfb9f4ed16e26631fee072fa011f9847e;p=swftools.git

minor fixes: swf_SetBits(), cleanup shape struct, fixed dumpfont
---

diff --git a/TODO b/TODO
index c21ecb2..2ce1d6a 100644
--- a/TODO
+++ b/TODO
@@ -34,6 +34,4 @@ rfxswf-lib:
       s/GetDataSizePtr/GetTagLenPtr/g
       s/ObjectPlace/ObjectSet/g
       (s/GetFrameNo/GetTagFrameNo/g ?)
-    * swfshape.c: the shape parameter is mostly unused. so are px, py.
-    * swf_SetBits() crashes if the tag has no data allocated yet.
   
diff --git a/lib/example/dumpfont.c b/lib/example/dumpfont.c
index c6669bb..1481ed6 100644
--- a/lib/example/dumpfont.c
+++ b/lib/example/dumpfont.c
@@ -68,7 +68,7 @@ void DumpFont(SWFFONT * f,char * name)
   printf("  f->glyph    = (SWFGLYPH*)malloc(sizeof(SWFGLYPH)*%d);\n",f->numchars);
   printf("  f->glyph2ascii = (U16*)malloc(sizeof(U16)*%d);\n",f->numchars);
   printf("  f->ascii2glyph = (int*)malloc(sizeof(int)*%d);\n",f->maxascii);
-  printf("  memset(f->ascii2glyph, -1, sizeof(int)*%d)\n\n", f->maxascii);
+  printf("  memset(f->ascii2glyph, -1, sizeof(int)*%d);\n\n", f->maxascii);
 
   for (i=0;i<f->numchars;i++)
     if (f->glyph[i].shape)
diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c
index 4f41406..921eaba 100644
--- a/lib/modules/swfshape.c
+++ b/lib/modules/swfshape.c
@@ -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);
@@ -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;
 }
 
diff --git a/lib/rfxswf.c b/lib/rfxswf.c
index d0f776b..f40d719 100644
--- a/lib/rfxswf.c
+++ b/lib/rfxswf.c
@@ -498,7 +498,6 @@ TAG * swf_InsertTag(TAG * after,U16 id)     // updates frames, if nescessary
   if (t)
   { memset(t,0x00,sizeof(TAG));
     t->id = id;
-    t->writeBit = 0x80;
     
     if (after)
     { t->frame = after->frame;
diff --git a/lib/rfxswf.h b/lib/rfxswf.h
index 4736513..a860b77 100644
--- a/lib/rfxswf.h
+++ b/lib/rfxswf.h
@@ -250,20 +250,17 @@ typedef struct _SHAPE           // NEVER access a Shape-Struct directly !
   { LINESTYLE * data;
     U16         n;
   } linestyle;
-                  // note: changes of shape structure
-  struct                  // lead to incompatible .efont formats
+                  
+  struct                    
   { FILLSTYLE * data;
     U16         n;
   } fillstyle;
-
-  S32           px;
-  S32           py;
-  
+ 
   struct
   { U16         fill;
     U16         line;
   } bits;
-  
+  				// used by Get/SetSimpleShape and glyph handling
   U8 *          data;
   U32           bitlen;         // length of data in bits
 } SHAPE, * LPSHAPE;