minor fixes: swf_SetBits(), cleanup shape struct, fixed dumpfont
authorboehme <boehme>
Sun, 11 Nov 2001 13:30:05 +0000 (13:30 +0000)
committerboehme <boehme>
Sun, 11 Nov 2001 13:30:05 +0000 (13:30 +0000)
TODO
lib/example/dumpfont.c
lib/modules/swfshape.c
lib/rfxswf.c
lib/rfxswf.h

diff --git a/TODO b/TODO
index c21ecb2..2ce1d6a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -34,6 +34,4 @@ rfxswf-lib:
       s/GetDataSizePtr/GetTagLenPtr/g
       s/ObjectPlace/ObjectSet/g
       (s/GetFrameNo/GetTagFrameNo/g ?)
       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.
   
   
index c6669bb..1481ed6 100644 (file)
@@ -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("  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)
 
   for (i=0;i<f->numchars;i++)
     if (f->glyph[i].shape)
index 4f41406..921eaba 100644 (file)
@@ -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);
 
   swf_SetBits(t,x,b);
   swf_SetBits(t,y,b);
 
-  if (s)
-  { s->px = x;
-    s->py = y;
-  }
   return 0;
 }
 
   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);
   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);
 
   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);
     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;
   }
 
     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);
     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) 
   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);
     swf_SetBits(t, b-2, 4);
     swf_SetBits(t,0,2);
     swf_SetBits(t,x,b);
-    s->px += x;
   }
   return 0;
 }
   }
   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);
 
   swf_SetBits(t,ax,b);
   swf_SetBits(t,ay,b);
 
-  if (s)
-  { s->px += x+ax;
-    s->py += y+ay;
-  }
   return 0;
 }
 
   return 0;
 }
 
index d0f776b..f40d719 100644 (file)
@@ -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;
   if (t)
   { memset(t,0x00,sizeof(TAG));
     t->id = id;
-    t->writeBit = 0x80;
     
     if (after)
     { t->frame = after->frame;
     
     if (after)
     { t->frame = after->frame;
index 4736513..a860b77 100644 (file)
@@ -250,20 +250,17 @@ typedef struct _SHAPE           // NEVER access a Shape-Struct directly !
   { LINESTYLE * data;
     U16         n;
   } linestyle;
   { LINESTYLE * data;
     U16         n;
   } linestyle;
-                  // note: changes of shape structure
-  struct                  // lead to incompatible .efont formats
+                  
+  struct                    
   { FILLSTYLE * data;
     U16         n;
   } fillstyle;
   { FILLSTYLE * data;
     U16         n;
   } fillstyle;
-
-  S32           px;
-  S32           py;
-  
   struct
   { U16         fill;
     U16         line;
   } bits;
   struct
   { U16         fill;
     U16         line;
   } bits;
-  
+                               // used by Get/SetSimpleShape and glyph handling
   U8 *          data;
   U32           bitlen;         // length of data in bits
 } SHAPE, * LPSHAPE;
   U8 *          data;
   U32           bitlen;         // length of data in bits
 } SHAPE, * LPSHAPE;