- TAG_list_t*tags = a->tags;
- abc_asset_list_t*deps = a->dependencies;
- while(deps) {
- tag = write_asset(tag, deps->abc_asset, written);
- deps = deps->next;
- }
- while(tags) {
- tag = write_tag(tag, tags->TAG, written);
- tags = tags->next;
+ if(!dict_contains(written, a)) {
+ dict_put(written, a, 0);
+ a->id = (*currentid)++;
+ asset_tag_list_t*tags = a->tags;
+
+ while(tags) {
+ asset_tag_t*t = tags->asset_tag;
+ int i;
+ for(i=0;i<t->num_deps;i++) {
+ asset_dependency_t*dep = &t->deps[i];
+ tag = write_asset(tag, dep->asset, written, currentid);
+ PUT16(&t->tag->data[dep->patch_pos], dep->asset->id);
+ }
+ swf_SetDefineID(t->tag, a->id);
+ tag = write_tag(tag, t->tag);
+ tags = tags->next;
+ }