swf_DeleteTag now takes two arguments
authorkramm <kramm>
Sun, 27 Jul 2008 09:37:01 +0000 (09:37 +0000)
committerkramm <kramm>
Sun, 27 Jul 2008 09:37:01 +0000 (09:37 +0000)
lib/modules/swfbits.c
lib/modules/swfdraw.c
lib/modules/swfrender.c
lib/modules/swftools.c
lib/python/tag.c
lib/python/taglist.c
lib/python/tags.c

index 4510c48..220fff4 100644 (file)
@@ -1185,13 +1185,13 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali
        tag1->prev = tag;
        if(tag) tag->next = tag1;
        tag = tag1;
-       swf_DeleteTag(tag2);
+       swf_DeleteTag(0, tag2);
     } else {
        /* use the jpeg version- it's smaller */
        tag2->prev = tag;
        if(tag) tag->next = tag2;
        tag = tag2;
-       swf_DeleteTag(tag1);
+       swf_DeleteTag(0, tag1);
     }
     return tag;
 }
@@ -1260,7 +1260,7 @@ void swf_RemoveJPEGTables(SWF * swf)
     }
     if (swf->firstTag == tables_tag)
        swf->firstTag = tables_tag->next;
-    swf_DeleteTag(tables_tag);
+    swf_DeleteTag(swf, tables_tag);
 }
 
 typedef struct scale_lookup {
index c718b18..333fdb9 100644 (file)
@@ -179,7 +179,7 @@ static void swf_ShapeDrawerClear(drawer_t*draw)
 {
     SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal;
     if(sdraw->tagfree) {
-       swf_DeleteTag(sdraw->tag);
+       swf_DeleteTag(0, sdraw->tag);
        sdraw->tag = 0;
     }
     swf_ShapeFree(sdraw->shape);
index 9683622..8cb04c8 100644 (file)
@@ -23,6 +23,9 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "../rfxswf.h"
 
 /* one bit flag: */
 #define clip_type 0
@@ -362,7 +365,7 @@ void swf_Render_Delete(RENDERBUF*dest)
 
     /* delete line buffers */
     for(y=0;y<i->height2;y++) {
-        swf_DeleteTag(i->lines[y].points);
+        swf_DeleteTag(0, i->lines[y].points);
         i->lines[y].points = 0;
     }
 
index e7e03f6..426ea41 100644 (file)
@@ -686,7 +686,7 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v
                /* I never saw recursive sprites, but they are (theoretically) 
                   possible, so better add base here again */
                enumerateUsedIDs(tag2, tag->pos + base, callback, callback_data);
-               swf_DeleteTag(tag2);
+               swf_DeleteTag(0, tag2);
                swf_GetBlock(tag, NULL, len);
            }
        } 
@@ -1268,9 +1268,7 @@ void swf_Optimize(SWF*swf)
                /* we found two identical tags- remap one
                   of them */
                 remap[id] = swf_GetDefineID(tag2);
-                swf_DeleteTag(tag);
-                if(tag == swf->firstTag)
-                    swf->firstTag = next;
+                swf_DeleteTag(swf, tag);
             }
         } else if(swf_isPseudoDefiningTag(tag)) {
             int id = swf_GetDefineID(tag);
@@ -1278,9 +1276,7 @@ void swf_Optimize(SWF*swf)
                 /* if this tag was remapped, we don't
                    need the helper tag anymore. Discard
                    it. */
-                swf_DeleteTag(tag);
-                if(tag == swf->firstTag)
-                    swf->firstTag = next;
+                swf_DeleteTag(swf, tag);
             }
         }
 
index bae858d..f495499 100644 (file)
@@ -83,7 +83,7 @@ static void tag_dealloc(PyObject * self)
        tag->internals.data = 0;
     }
     if(tag->internals.tag) {
-       swf_DeleteTag(tag->internals.tag);
+       swf_DeleteTag(0, tag->internals.tag);
        tag->internals.tag = 0;
     }
     Py_DECREF(tag->internals.tagmap);
@@ -229,7 +229,7 @@ static int tag_setattr(PyObject * _self, char* a, PyObject * o)
     /* a setattr will almost certainly change the tag data,
        so delete the tag */
     if(self->internals.tag) {
-       swf_DeleteTag(self->internals.tag);
+       swf_DeleteTag(0, self->internals.tag);
        self->internals.tag = 0;
     }
     if(self->internals.setattr) {
index f6a0932..0a30c08 100644 (file)
@@ -45,7 +45,7 @@ PyObject * taglist_new2(TAG*tag)
     while(t) {len++;last=t;t=t->next;}
 
     if(last && last->id==ST_END) {
-       swf_DeleteTag(last); last = 0;
+       swf_DeleteTag(0, last); last = 0;
        len--;
        if(len==0) tag = 0;
     }
index 0ff6b32..7fe35a4 100644 (file)
@@ -106,7 +106,7 @@ static int po_parse(tag_internals_t*self)
     SWFPLACEOBJECT* swfpo = malloc(sizeof(SWFPLACEOBJECT));
     swf_GetPlaceObject(self->tag, swfpo);
     i->po = swfpo;
-    swf_DeleteTag(self->tag);self->tag = 0;
+    swf_DeleteTag(0, self->tag);self->tag = 0;
        
     if(i->po->id) {
        i->character = tagmap_id2obj(self->tagmap, i->po->id);
@@ -420,7 +420,7 @@ static int sprite_setattr(tag_internals_t*self,char*a, PyObject*obj)
 {
     sprite_internal_t*si = (sprite_internal_t*)self->data;
     if(self->tag) {
-       swf_DeleteTag(self->tag);
+       swf_DeleteTag(0, self->tag);
        self->tag = 0;
     }
     if(!strcmp(a, "tags")) {
@@ -573,7 +573,7 @@ static int image_parse(tag_internals_t*self)
     i->isindexed = 0;
     i->islossless = 1;
 
-    swf_DeleteTag(self->tag);self->tag = 0;
+    swf_DeleteTag(0, self->tag);self->tag = 0;
     return 1;
 }
 static int imagetag_getWidth(PyObject* self)
@@ -684,7 +684,7 @@ static int shape_parse(tag_internals_t*self)
     SHAPE2* shape2 = malloc(sizeof(SHAPE2));
     swf_ParseDefineShape(self->tag, shape2);
     i->shape2 = shape2;
-    swf_DeleteTag(self->tag);self->tag = 0;
+    swf_DeleteTag(0, self->tag);self->tag = 0;
     return 1;
 }
 static void shape_dealloc(tag_internals_t*self)