svnno****@sourc*****
svnno****@sourc*****
2011年 3月 9日 (水) 01:14:06 JST
Revision: 401 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=401 Author: yoya Date: 2011-03-09 01:14:06 +0900 (Wed, 09 Mar 2011) Log Message: ----------- CID renum の書き換え対象 Defineタグを増やした Modified Paths: -------------- trunk/src/swf_tag.c -------------- next part -------------- Modified: trunk/src/swf_tag.c =================================================================== --- trunk/src/swf_tag.c 2011-03-08 13:16:19 UTC (rev 400) +++ trunk/src/swf_tag.c 2011-03-08 16:14:06 UTC (rev 401) @@ -270,12 +270,35 @@ int swf_tag_get_cid(swf_tag_t *tag) { swf_tag_info_t *tag_info; - tag_info = get_swf_tag_info(tag->tag); + int tag_no = tag->tag; + tag_info = get_swf_tag_info(tag_no); if (tag_info && tag_info->detail_handler) { swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); if (detail_handler->get_cid) { return detail_handler->get_cid(tag); } + } else { + int cid; + switch (tag_no) { + case 7: // DefineButton + case 10: // DefineFont + case 11: // DefineText + case 13: // DefineFontInfo + case 14: // DefineSound + case 17: // DefineButtonSound + case 33: // DefineText2 + case 34: // DefineButton2 + case 39: // DefineSprite /////////////// + case 46: // DefineMorphShape + case 48: // DefineFont2 + case 88: // DefineFontName + if (tag->data) { + return GetUShortLE(tag->data); + } + break; + default: + ; + } } return -1; // no cid tag } @@ -283,12 +306,34 @@ int swf_tag_replace_cid(swf_tag_t *tag, int cid) { swf_tag_info_t *tag_info; - tag_info = get_swf_tag_info(tag->tag); + int tag_no = tag->tag; + tag_info = get_swf_tag_info(tag_no); if (tag_info && tag_info->detail_handler) { swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); if (detail_handler->replace_cid) { return detail_handler->replace_cid(tag, cid); } + } else { + switch (tag_no) { + case 7: // DefineButton + case 10: // DefineFont + case 11: // DefineText + case 13: // DefineFontInfo + case 14: // DefineSound + case 17: // DefineButtonSound + case 33: // DefineText2 + case 34: // DefineButton2 + case 39: // DefineSprite /////////////// + case 46: // DefineMorphShape + case 48: // DefineFont2 + case 88: // DefineFontName + if (tag->data) { + return PutUShortLE(tag->data, cid); + } + break; + default: + ; + } } return 1; // no cid tag }