+/* untested */
+void swf_Relocate2(SWF*swf, int*id2id)
+{
+ TAG*tag;
+ tag = swf->firstTag;
+ while(tag) {
+ if(swf_isDefiningTag(tag)) {
+ int id = swf_GetDefineID(tag);
+ id = id2id[id];
+ if(id>=0) {
+ swf_SetDefineID(tag, id);
+ }
+ }
+ int num = swf_GetNumUsedIDs(tag);
+ if(num) {
+ int *ptr;
+ int t;
+ ptr = rfx_alloc(sizeof(int)*num);
+ swf_GetUsedIDs(tag, ptr);
+ for(t=0;t<num;t++) {
+ int id = GET16(&tag->data[ptr[t]]);
+ id = id2id[id];
+ if(id>=0) {
+ PUT16(&tag->data[ptr[t]], id);
+ }
+ }
+ }
+ }
+}
+