svnno****@sourc*****
svnno****@sourc*****
2011年 3月 8日 (火) 09:42:55 JST
Revision: 396 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=396 Author: yoya Date: 2011-03-08 09:42:55 +0900 (Tue, 08 Mar 2011) Log Message: ----------- refcid の get,replace API を追加 (PlaceObject2 のに対応) Modified Paths: -------------- trunk/src/swf_tag.c trunk/src/swf_tag.h -------------- next part -------------- Modified: trunk/src/swf_tag.c =================================================================== --- trunk/src/swf_tag.c 2011-03-08 00:42:19 UTC (rev 395) +++ trunk/src/swf_tag.c 2011-03-08 00:42:55 UTC (rev 396) @@ -293,6 +293,38 @@ return 1; // no cid tag } +int +swf_tag_get_refcid(swf_tag_t *tag) { + if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2 + swf_tag_place_detail_t *swf_tag_place; + if (! tag->detail) { + swf_tag_create_input_detail(tag, NULL); + } + swf_tag_place = tag->detail; + return swf_tag_place->character_id; + } + return -1; // no cid tag +} + +int +swf_tag_replace_refcid(swf_tag_t *tag, int cid) { +// fprintf(stderr, "XXX: swf_tag_replace_refcid(tag(code=%d), cid(%d))\n", tag->tag, cid); + if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2 + swf_tag_place_detail_t *swf_tag_place; + if (! tag->detail) { + swf_tag_create_input_detail(tag, NULL); + } +// fprintf(stderr, "XXX: swf_tag_create_input_detail(tag, NULL)\n"); + swf_tag_place = tag->detail; + swf_tag_place->character_id = cid; + } + if (tag->data) { + free(tag->data); + tag->data = NULL; + } + return 0; // always 0; +} + /* bitmap */ int Modified: trunk/src/swf_tag.h =================================================================== --- trunk/src/swf_tag.h 2011-03-08 00:42:19 UTC (rev 395) +++ trunk/src/swf_tag.h 2011-03-08 00:42:55 UTC (rev 396) @@ -51,6 +51,9 @@ extern int swf_tag_get_cid(swf_tag_t *tag); extern int swf_tag_replace_cid(swf_tag_t *tag, int cid); +extern int swf_tag_get_refcid(swf_tag_t *tag); +extern int swf_tag_replace_refcid(swf_tag_t *tag, int cid); + /* image */ extern int swf_tag_get_bitmap_size(swf_tag_t *tag,