for (tag=swf->tag_head ; tag ; tag=tag->next) {
ALLOC_INIT_ZVAL(data);
array_init(data);
- add_assoc_long(data, "tag", tag->tag);
- tag_info = get_swf_tag_info(tag->tag);
+ add_assoc_long(data, "code", tag->code);
+ tag_info = get_swf_tag_info(tag->code);
if (tag_info && tag_info->name) {
add_assoc_string_ex(data,
"tagName", sizeof("tagName"),
if (tag == NULL) {
RETURN_FALSE;
}
- tag_info = get_swf_tag_info(tag->tag);
+ tag_info = get_swf_tag_info(tag->code);
if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) {
RETURN_FALSE;
}
if (swf_tag_create_input_detail(tag, swf) == NULL) {
RETURN_FALSE; // can't create detail
}
- switch (tag->tag) {
+ switch (tag->code) {
swf_tag_jpeg_detail_t *tag_jpeg;
swf_tag_lossless_detail_t *tag_lossless;
swf_tag_edit_detail_t *tag_edit;
case 59: // DoInitAction
tag_action = tag->detail;
array_init(return_value);
- if (tag->tag == 59) { // DoInitAction
+ if (tag->code == 59) { // DoInitAction
add_assoc_long(return_value, "action_sprite", tag_action->action_sprite);
}
if (tag_action->action_record && tag_action->action_record_len) {
case 26: // PlaceObject2
tag_place = tag->detail;
array_init(return_value);
- if ((tag->tag == 4) || tag_place->flag_has_character) {
+ if ((tag->code == 4) || tag_place->flag_has_character) {
add_assoc_long(return_value, "character_id", tag_place->character_id);
}
add_assoc_long(return_value, "depth", tag_place->depth);
array_init(return_value);
i = 0;
for (tag = swf->tag_head ; tag ; tag=tag->next) {
- register int tag_code = tag->tag;
+ register int tag_code = tag->code;
if (isShapeTag(tag_code)) {
bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num);
if (bitmap_id_list) {
}
}
- if ((tag->tag != 2) && // ! DefineShape
+ if ((tag->code != 2) && // ! DefineShape
(fill_style_array->count == 255)) {
fill_style_array->count = bitstream_getbytesLE(bs, 2);
}
swf_tag_t *tag) {
int i;
int ret;
- if ((tag->tag == 2) || // DefineShape
- ((tag->tag > 2) && (fill_style_array->count < 255))) {
- // tag->tag == 2 の時は count == 255 でもここに来るように
+ if ((tag->code == 2) || // DefineShape
+ ((tag->code > 2) && (fill_style_array->count < 255))) {
+ // tag->code == 2 の時は count == 255 でもここに来るように
bitstream_putbyte(bs, fill_style_array->count);
} else {
bitstream_putbyte(bs, 255);
swf_tag_t *tag) {
fill_style_bitmap->bitmap_ref = bitstream_getbytesLE(bs, 2);
swf_matrix_parse(bs, &(fill_style_bitmap->bitmap_matrix));
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
swf_matrix_parse(bs, &(fill_style_bitmap->bitmap_matrix_morph));
}
return 0;
swf_tag_t *tag) {
bitstream_putbytesLE(bs, fill_style_bitmap->bitmap_ref, 2);
swf_matrix_build(bs, &(fill_style_bitmap->bitmap_matrix));
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
swf_matrix_build(bs, &(fill_style_bitmap->bitmap_matrix_morph));
}
return 0;
print_indent(indent_depth);
printf("bitmap_ref=%u\n", fill_style_bitmap->bitmap_ref);
swf_matrix_print(&(fill_style_bitmap->bitmap_matrix), indent_depth);
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
swf_matrix_print(&(fill_style_bitmap->bitmap_matrix_morph), indent_depth);
}
return 0;
swf_tag_t* tag) {
swf_matrix_parse(bs, &(fill_style_gradient->gradient_matrix));
// DefineMorphShape, DefineMorphShape2
- if (tag->tag == 46 || tag->tag == 84) {
+ if (tag->code == 46 || tag->code == 84) {
swf_matrix_parse(bs, &(fill_style_gradient->gradient_matrix_morph));
}
swf_gradient_parse(bs, &(fill_style_gradient->gradient), tag, fill_style_gradient->type);
swf_tag_t *tag) {
swf_matrix_build(bs, &(fill_style_gradient->gradient_matrix));
// DefineMorphShape, DefineMorphShape2
- if (tag->tag == 46 || tag->tag == 84) {
+ if (tag->code == 46 || tag->code == 84) {
swf_matrix_build(bs, &(fill_style_gradient->gradient_matrix_morph));
}
swf_gradient_build(bs, &(fill_style_gradient->gradient), tag, fill_style_gradient->type);
swf_matrix_print(&(fill_style_gradient->gradient_matrix),
indent_depth + 1);
// DefineMorphShape, DefineMorphShape2
- if (tag->tag == 46 || tag->tag == 84) {
+ if (tag->code == 46 || tag->code == 84) {
swf_matrix_print(&(fill_style_gradient->gradient_matrix_morph),
indent_depth + 1);
}
swf_fill_style_solid_parse(bitstream_t *bs,
swf_fill_style_solid_t *fill_style_solid,
swf_tag_t *tag) {
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
swf_rgba_parse(bs, &(fill_style_solid->rgba));
swf_rgba_parse(bs, &(fill_style_solid->rgba_morph));
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
swf_rgba_parse(bs, &(fill_style_solid->rgba));
} else {
swf_rgb_parse(bs, &(fill_style_solid->rgb));
swf_fill_style_solid_build(bitstream_t *bs,
swf_fill_style_solid_t *fill_style_solid,
swf_tag_t *tag) {
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
swf_rgba_build(bs, &(fill_style_solid->rgba));
swf_rgba_build(bs, &(fill_style_solid->rgba_morph));
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
swf_rgba_build(bs, &(fill_style_solid->rgba));
} else {
swf_rgb_build(bs, &(fill_style_solid->rgb));
) {
print_indent(indent_depth);
printf("fill_style_solid");
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2
printf(" #%02x%02x%02x(%02x) morph:#%02x%02x%02x(%02x)",
fill_style_solid->rgba.red,
fill_style_solid->rgba.green,
fill_style_solid->rgba_morph.green,
fill_style_solid->rgba_morph.blue,
fill_style_solid->rgba_morph.alpha);
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
printf(" #%02x%02x%02x(%02x)",
fill_style_solid->rgba.red,
fill_style_solid->rgba.green,
swf_tag_t *tag, int type) {
int i;
bitstream_align(bs);
- if (tag->tag == 83) { // DefineShape4
+ if (tag->code == 83) { // DefineShape4
gradient->spread_mode = bitstream_getbits(bs, 2);
gradient->interpolation_mode = bitstream_getbits(bs, 2);
gradient->count = bitstream_getbits(bs, 4);
swf_tag_t *tag, int type) {
int i;
bitstream_align(bs);
- if (tag->tag == 83) { // DefineShape4
+ if (tag->code == 83) { // DefineShape4
bitstream_putbits(bs, gradient->spread_mode, 2);
bitstream_putbits(bs, gradient->interpolation_mode, 2);
bitstream_putbits(bs, gradient->count, 4);
swf_gradient_print(swf_gradient_t *gradient, int indent_depth,
swf_tag_t *tag, int type) {
int i;
- if (tag->tag == 83) { // DefineShape4
+ if (tag->code == 83) { // DefineShape4
print_indent(indent_depth);
printf("spread_mode=%d interpolation_mode=%d count=%d\n",
gradient->spread_mode, gradient->interpolation_mode,
*bs, swf_gradient_record_t *gradient_record,
swf_tag_t *tag) {
int ret = 0;
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2
gradient_record->position = bitstream_getbyte(bs);
swf_rgba_parse(bs, &(gradient_record->rgba));
gradient_record->position_morph = bitstream_getbyte(bs);
ret = swf_rgba_parse(bs, &(gradient_record->rgba_morph));
- } else if (tag->tag == 32 || tag->tag == 83) {
+ } else if (tag->code == 32 || tag->code == 83) {
// DefineShape3 || DefineShape4
gradient_record->position = bitstream_getbyte(bs);
ret = swf_rgba_parse(bs, &(gradient_record->rgba));
swf_gradient_record_build(bitstream_t *bs,
swf_gradient_record_t *gradient_record,
swf_tag_t *tag) {
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2
bitstream_putbyte(bs, gradient_record->position);
swf_rgba_build(bs, &(gradient_record->rgba));
bitstream_putbyte(bs, gradient_record->position_morph);
swf_rgba_build(bs, &(gradient_record->rgba_morph));
- } else if (tag->tag == 32 || tag->tag == 83) {
+ } else if (tag->code == 32 || tag->code == 83) {
// DefineShape3 || DefineShape4
bitstream_putbyte(bs, gradient_record->position);
swf_rgba_build(bs, &(gradient_record->rgba));
fprintf(stderr, "swf_gradient_record_print: gradient_record == NULL\n");
return 1;
}
- if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2
+ if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2
print_indent(indent_depth);
printf("position=%d\n", gradient_record->position);
swf_rgba_print(&(gradient_record->rgba), indent_depth);
print_indent(indent_depth);
printf("position_morph=%d\n", gradient_record->position_morph);
swf_rgba_print(&(gradient_record->rgba_morph), indent_depth);
- } else if (tag->tag == 32 || tag->tag == 83) {
+ } else if (tag->code == 32 || tag->code == 83) {
// DefineShape3 || DefineShape4
print_indent(indent_depth);
printf("position=%d\n", gradient_record->position);
swf_line_style_parse(bitstream_t *bs, swf_line_style_t *line_style,
swf_tag_t *tag) {
int result;
- if (tag->tag == 46) { // DefineMorphShape
+ if (tag->code == 46) { // DefineMorphShape
result = bitstream_getbytesLE(bs, 2);
if (result == -1) {
return 1;
line_style->width_morph = bitstream_getbytesLE(bs, 2);
swf_rgba_parse(bs, &(line_style->rgba));
swf_rgba_parse(bs, &(line_style->rgba_morph));
- } else if (tag->tag == 83 || tag->tag == 84) {
+ } else if (tag->code == 83 || tag->code == 84) {
// DefineShape4 || DefineMorphShape2
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
line_style->width_morph = bitstream_getbytesLE(bs, 2);
}
result = bitstream_getbits(bs, 2);
swf_fill_style_parse(bs, &(line_style->fill_style), tag);
} else {
swf_rgba_parse(bs, &(line_style->rgba));
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
swf_rgba_parse(bs, &(line_style->rgba_morph));
}
}
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
result = bitstream_getbytesLE(bs, 2);
if (result == -1) {
return 1;
int
swf_line_style_build(bitstream_t *bs, swf_line_style_t *line_style,
swf_tag_t *tag) {
- if (tag->tag == 46) { // DefineMorphShape
+ if (tag->code == 46) { // DefineMorphShape
bitstream_putbytesLE(bs, line_style->width, 2);
bitstream_putbytesLE(bs, line_style->width_morph, 2);
swf_rgba_build(bs, &(line_style->rgba));
swf_rgba_build(bs, &(line_style->rgba_morph));
- } else if (tag->tag == 83 || tag->tag == 84) {
+ } else if (tag->code == 83 || tag->code == 84) {
// DefineShape4 || DefineMorphShape2
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
bitstream_putbytesLE(bs, line_style->width_morph, 2);
}
bitstream_putbits(bs, line_style->start_cap_style, 2);
swf_fill_style_build(bs, &(line_style->fill_style), tag);
} else {
swf_rgba_build(bs, &(line_style->rgba));
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
swf_rgba_build(bs, &(line_style->rgba_morph));
}
}
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
bitstream_putbytesLE(bs, line_style->width, 2);
swf_rgba_build(bs, &(line_style->rgba));
} else {
fprintf(stderr, "swf_line_style_print: line_style == NULL\n");
return 1;
}
- if (tag->tag == 46) { // DefineMorphShape
+ if (tag->code == 46) { // DefineMorphShape
print_indent(indent_depth);
printf("width=%.2f width_morph=%.2f\n",
(float) line_style->width / SWF_TWIPS,
(float) line_style->width_morph / SWF_TWIPS);
swf_rgba_print(&(line_style->rgba), indent_depth);
swf_rgba_print(&(line_style->rgba_morph), indent_depth);
- } else if (tag->tag == 83 || tag->tag == 84) {
+ } else if (tag->code == 83 || tag->code == 84) {
// DefineShape4 || DefineMorphShape2
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
print_indent(indent_depth);
printf("width_morph=%d\n", line_style->width_morph);
}
tag);
} else {
swf_rgba_print(&(line_style->rgba), indent_depth);
- if (tag->tag == 84) { // DefineMorphShape2
+ if (tag->code == 84) { // DefineMorphShape2
swf_rgba_print(&(line_style->rgba_morph), indent_depth);
}
}
- } else if (tag->tag == 32) { // DefineShape3
+ } else if (tag->code == 32) { // DefineShape3
print_indent(indent_depth);
printf("width=%.2f ", (float) line_style->width / SWF_TWIPS);
swf_rgba_print(&(line_style->rgba), 0);
return 1;
}
line_style_array->count = result;
- if ((tag->tag != 2) && // ! DefineShape
+ if ((tag->code != 2) && // ! DefineShape
(line_style_array->count == 255)) {
result = bitstream_getbytesLE(bs, 2);
if (result == -1) {
int
swf_line_style_array_build(bitstream_t *bs, swf_line_style_array_t *line_style_array, swf_tag_t *tag) {
int i;
- if ((tag->tag == 2) || // DefineShape
- ((tag->tag > 2) && (line_style_array->count < 255))) {
- // tag->tag == 2 の時は count == 255 でもここに来るように
+ if ((tag->code == 2) || // DefineShape
+ ((tag->code > 2) && (line_style_array->count < 255))) {
+ // tag->code == 2 の時は count == 255 でもここに来るように
bitstream_putbyte(bs, line_style_array->count);
} else {
bitstream_putbyte(bs, 255);
tag->next = NULL;
}
swf->tag_tail = tag;
- if (tag->tag == 0) { // END Tag
+ if (tag->code == 0) { // END Tag
break; // SUCCESS
}
prev_tag = tag;
for (tag = swf->tag_head; tag ; tag = tag->next) {
printf("[%d] ", i);
swf_tag_print(tag, swf, 0);
- if (tag->tag == 0) { // END Tag
+ if (tag->code == 0) { // END Tag
break;
}
i++;
// 以下コンテンツ系のタグ
if (trans_table_get(refcid_trans_table, cid) == TRANS_TABLE_RESERVE_ID) {
// no purge
- if (isShapeTag(tag->tag)) {
+ if (isShapeTag(tag->code)) {
int *bitmap_id_list, bitmap_id_list_num;
bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num);
if (bitmap_id_list) {
}
free(bitmap_id_list);
}
- } else if (isSpriteTag(tag->tag)) {
+ } else if (isSpriteTag(tag->code)) {
swf_tag_t *t;
swf_tag_sprite_detail_t *tag_sprite;
tag_sprite = swf_tag_create_input_detail(tag, swf);
}
}
} else { // Purge!
- if (isShapeTag(tag->tag) || isBitmapTag(tag->tag)) {
+ if (isShapeTag(tag->code) || isBitmapTag(tag->code)) {
// TODO: tag == head ? tag == tail ? OK?
swf_tag_t *next_tag = tag->next;
tag->prev->next = tag->next;
tag = swf_object_search_tag_byseqno(swf, tag_seqno);
if (tag) {
if (tag_seqno_in_sprite >= 0) {
- if (isSpriteTag(tag->tag)) {
+ if (isSpriteTag(tag->code)) {
swf_tag_sprite_detail_t *tag_sprite;
swf_tag_t *tag_in_sprite;
tag_sprite = swf_tag_create_input_detail(tag, swf);
}
}
if (tag) {
- if (! isShapeTag(tag->tag)) {
- fprintf(stderr, "swf_object_get_shapedata: not isShapeTag(%d)\n", tag->tag);
+ if (! isShapeTag(tag->code)) {
+ fprintf(stderr, "swf_object_get_shapedata: not isShapeTag(%d)\n", tag->code);
return NULL;
}
if ((tag->data == NULL ) && tag->detail) {
}
}
if (tag) {
- if (! isShapeTag(tag->tag)) {
+ if (! isShapeTag(tag->code)) {
return 1; // failure
}
if (tag->detail) {
free(tag->data);
tag->data = NULL;
}
- // if (tag->tag == 2) { // DefineShape
- // tag->tag = 22; // => DefineShape2
+ // if (tag->code == 2) { // DefineShape
+ // tag->code = 22; // => DefineShape2
// }
tag->length = length + 2;
tag->data = malloc(length + 2);
return NULL;
}
for (tag = swf->tag_head ; tag ; tag = tag->next) {
- register int tag_code = tag->tag;
+ register int tag_code = tag->code;
if (isBitmapTag(tag_code)) {
if (swf_tag_get_cid(tag) == bitmap_id) {
return tag; // match
width_scale = (double) old_width / new_width;
height_scale = (double) old_height / new_height;
for (tag = swf->tag_head ; tag ; tag=tag->next) {
- register int tag_code = tag->tag;
+ register int tag_code = tag->code;
if (isShapeTag(tag_code)) {
bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num);
if (bitmap_id_list) {
width_scale = (double) new_width / old_width;
height_scale = (double) new_height / old_height;
for (tag = swf->tag_head ; tag ; tag=tag->next) {
- register int tag_code = tag->tag;
+ register int tag_code = tag->code;
if (isShapeTag(tag_code)) {
bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num);
if (bitmap_id_list) {
}
if (swf->shape_adjust_mode & SWFED_SHAPE_BITMAP_TYPE_TILLED) {
for (tag = swf->tag_head ; tag ; tag=tag->next) {
- register int tag_code = tag->tag;
+ register int tag_code = tag->code;
if (isShapeTag(tag_code)) {
bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num);
if (bitmap_id_list) {
return NULL;
}
for (tag=swf->tag_head ; tag ; tag=tag->next) {
- if (tag->tag == 8) { // JPEGTables
+ if (tag->code == 8) { // JPEGTables
tag_jpegtables = tag;
continue;
}
// ! DefineBitsJPEG(1),2,3
- if ((tag->tag != 6) && (tag->tag != 21) && (tag->tag != 35)) {
+ if ((tag->code != 6) && (tag->code != 21) && (tag->code != 35)) {
continue;
}
data = swf_tag_get_jpeg_data(tag, length, image_id, tag_jpegtables);
return NULL;
}
for (tag=swf->tag_head ; tag ; tag=tag->next) {
- if (tag->tag != 35) { // ! DefineBitsJPEG3
+ if (tag->code != 35) { // ! DefineBitsJPEG3
continue;
}
data = swf_tag_get_alpha_data(tag, length, image_id);
*length = 0;
for (tag=swf->tag_head ; tag ; tag=tag->next) {
// DefineBitsLossless(1),2
- if ((tag->tag != 20) && (tag->tag != 36)) {
+ if ((tag->code != 20) && (tag->code != 36)) {
continue;
}
data = swf_tag_get_png_data(tag, length, image_id);
}
for (tag=swf->tag_head ; tag ; tag=tag->next) {
// DefineSound
- if (tag->tag != 14) {
+ if (tag->code != 14) {
continue;
}
data = swf_tag_get_sound_data(tag, length, sound_id);
if (tag == NULL) {
return NULL;
}
- if ((tag->tag != 12) && (tag->tag != 59)) { // DoAction, DoInitAction
+ if ((tag->code != 12) && (tag->code != 59)) { // DoAction, DoInitAction
return NULL;
}
swf_tag_action = (swf_tag_action_detail_t *) swf_tag_create_input_detail(tag, swf);
return 1; // NG
}
for (tag=swf->tag_head ; tag ; tag=tag->next) {
- switch (tag->tag) {
+ switch (tag->code) {
case 1: // ShowFrame
if (prev_tag == NULL) {
// ShowFrame までに候補が見つからなければ、ShowFrame の直前
static void
trans_table_replace_refcid_recursive(swf_tag_t *tag, trans_table_t *cid_trans_table) {
for ( ; tag ; tag=tag->next) {
- int tag_no = tag->tag;
+ int tag_no = tag->code;
if (isSpriteTag(tag_no)) {
swf_tag_sprite_detail_t *tag_sprite;
tag_sprite = swf_tag_create_input_detail(tag, NULL);
// インスタンス名から PlaceObject を探し、参照している CID を取得する
for (tag = tag_head ; tag ; tag=tag->next) {
cid = 0;
- if (tag->tag == 26) { // PlaceObject2
+ if (tag->code == 26) { // PlaceObject2
cid = swf_tag_place_get_cid_by_instance_name(tag, instance_name, instance_name_len, swf);
}
if (cid > 0) {
// CID で DefineSprite を探す
for (tag=swf->tag_head ; tag ; tag=tag->next) {
- if (isSpriteTag(tag->tag)) {
+ if (isSpriteTag(tag->code)) {
if (swf_tag_get_cid(tag) == cid) {
sprite_tag = tag;
break;
// trans_table_print(cid_trans_table);
// Sprite タグの中を綺麗にする
- tag_info = get_swf_tag_info(sprite_tag->tag);
+ tag_info = get_swf_tag_info(sprite_tag->code);
detail_handler = tag_info->detail_handler();
free(sprite_tag->data);
sprite_tag->data = NULL;
// SWF 中のタグを種類に応じて展開する
for (tag = swf4sprite->tag_head ; tag ; tag = tag->next) {
- int tag_no = tag->tag;
+ int tag_no = tag->code;
switch (tag_no) {
// tag skip
default: // misc
bitstream_input(bs, data, data_len);
tag = swf_tag_create(bs);
if (tag) {
- if (isShapeTag(tag->tag)) {
+ if (isShapeTag(tag->code)) {
ret = 1; // TRUE
}
}
bitstream_input(bs, data, data_len);
tag = swf_tag_create(bs);
if (tag) {
- if (isBitmapTag(tag->tag)) {
+ if (isBitmapTag(tag->code)) {
ret = 1; // TRUE
}
}
return NULL;
}
tag = calloc(sizeof(*tag), 1);
- tag->tag = tag_and_length >> 6;
+ tag->code = tag_and_length >> 6;
tag->length = tag_and_length & 0x3f;
tag->length_longformat = 0;
if (tag->length == 0x3f) {
if (tag->length >= 0x3f) {
tag->length_longformat = 1;
} else {
- switch (tag->tag) {
+ switch (tag->code) {
case 6: // DefineBitsJPEG
case 21: // DefineBitsJPEG2
case 35: // DefineBitsJPEG3
}
}
if (tag->length_longformat) {
- tag_and_length = (tag->tag << 6) | 0x3f;
+ tag_and_length = (tag->code << 6) | 0x3f;
bitstream_putbytesLE(bs, tag_and_length, 2);
bitstream_putbytesLE(bs, tag->length, 4);
} else {
- tag_and_length = (tag->tag << 6) | tag->length;
+ tag_and_length = (tag->code << 6) | tag->length;
bitstream_putbytesLE(bs, tag_and_length, 2);
}
return 0;
fprintf(stderr, "swf_tag_build: tag == NULL\n");
return 1;
}
-// fprintf(stderr, "XXX: swf_tag_build: tag->tag=%d\n",tag->tag);
+// fprintf(stderr, "XXX: swf_tag_build: tag->code=%d\n",tag->code);
if (tag->data) {
swf_tag_and_length_build(bs, tag);
bitstream_putstring(bs, tag->data, tag->length);
} else if (tag->detail) {
- tag_info = get_swf_tag_info(tag->tag);
+ tag_info = get_swf_tag_info(tag->code);
if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) {
- fprintf(stderr, "swf_tag_build: not implemented yet. detail build tag->tag=%d\n",
- tag->tag);
+ fprintf(stderr, "swf_tag_build: not implemented yet. detail build tag->code=%d\n",
+ tag->code);
return 1;
}
detail_handler = tag_info->detail_handler();
if (detail_handler->output == NULL) {
- fprintf(stderr, "swf_tag_build: detail_handler->output == NULL: tag->tag=%d\n",
- tag->tag);
+ fprintf(stderr, "swf_tag_build: detail_handler->output == NULL: tag->code=%d\n",
+ tag->code);
return 1;
}
data = detail_handler->output(tag, &data_len, swf);
swf_tag_info_t *tag_info = NULL;
swf_tag_detail_handler_t * detail_handler = NULL;
int ret;
- tag_info = get_swf_tag_info(tag->tag);
+ tag_info = get_swf_tag_info(tag->code);
if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) {
return 1; // no info
}
}
ret = detail_handler->input(tag, swf);
if (ret) {
- fprintf(stderr, "swf_tag_rebuild: detail_hander->input failed tag_no=%d\n", tag->tag);
+ fprintf(stderr, "swf_tag_rebuild: detail_hander->input failed tag_no=%d\n", tag->code);
return 1;
}
free(tag->data);
fprintf(stderr, "swf_tag_print: tag == NULL\n");
return ;
}
- tag_info = get_swf_tag_info(tag->tag);
+ tag_info = get_swf_tag_info(tag->code);
tag_name = (tag_info)?tag_info->name:"Unknown";
// print_indent(indent_depth);
- printf("tag=%s(%d)", tag_name, tag->tag);
+ printf("tag=%s(%d)", tag_name, tag->code);
if (tag->length > 0) {
printf(" length=%lu", tag->length);
}
if (tag->detail) {
return tag->detail;
}
- tag_info = get_swf_tag_info(tag->tag);
+ tag_info = get_swf_tag_info(tag->code);
if (tag_info && tag_info->detail_handler) {
int result;
swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler();
if (detail_handler->create == NULL) {
fprintf(stderr, "detail_handler->create == NULL (tag=%d)\n",
- tag->tag);
+ tag->code);
return NULL;
}
tag->detail = detail_handler->create();
if (tag->detail == NULL) {
- fprintf(stderr, "can't create tag detail (tag=%d)\n", tag->tag);
+ fprintf(stderr, "can't create tag detail (tag=%d)\n", tag->code);
return NULL;
}
result = detail_handler->input(tag, swf);
return;
}
if (tag->detail) {
- swf_tag_info_t *tag_info = get_swf_tag_info(tag->tag);
+ swf_tag_info_t *tag_info = get_swf_tag_info(tag->code);
if (tag_info && tag_info->detail_handler) {
swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler();
if (detail_handler->destroy) {
detail_handler->destroy(tag);
} else {
fprintf(stderr, "detail_handler->destroy == NULL (tag=%d)\n",
- tag->tag);
+ tag->code);
}
} else {
fprintf(stderr, "not impremented yet. destroy tag detail\n");
fprintf(stderr, "swf_tag_get_cid: tag == NULL\n");
return 1;
}
- tag_no = tag->tag;
+ tag_no = tag->code;
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();
fprintf(stderr, "swf_tag_replace_cid: tag == NULL\n");
return 1; // failure
}
- tag_no = tag->tag;
+ tag_no = tag->code;
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();
fprintf(stderr, "swf_tag_get_refcid: tag == NULL\n");
return -1;
}
- if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2
+ if (isPlaceTag(tag->code)) { // PlaceObject, PlaceObject2
swf_tag_place_detail_t *swf_tag_place;
swf_tag_place = swf_tag_create_input_detail(tag, NULL);
if (swf_tag_place == NULL) {
fprintf(stderr, "swf_tag_replace_refcid: tag == NULL\n");
return 1; // failure
}
- if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2
+ if (isPlaceTag(tag->code)) { // PlaceObject, PlaceObject2
swf_tag_place_detail_t *swf_tag_place;
swf_tag_place = swf_tag_create_input_detail(tag, NULL);
if (swf_tag_place == NULL) {
fprintf(stderr, "swf_tag_get_bitmap_size: swf_tag_create_input_detail failed\n");
return 1;
}
- if (isBitsJPEGTag(tag->tag)) {
+ if (isBitsJPEGTag(tag->code)) {
swf_tag_jpeg_detail_t *swf_tag_jpeg = (swf_tag_jpeg_detail_t *) tag->detail;
ret = jpeg_size(swf_tag_jpeg->jpeg_data, swf_tag_jpeg->jpeg_data_len,
width, height);
- } else if (isBitsLosslessTag(tag->tag)) {
+ } else if (isBitsLosslessTag(tag->code)) {
swf_tag_lossless_detail_t *swf_tag_lossless = (swf_tag_lossless_detail_t *) tag->detail;
*width = swf_tag_lossless->width;
*height = swf_tag_lossless->height;
fprintf(stderr, "swf_tag_get_jpeg_data: length == NULL\n");
return NULL;
}
- tag_info = get_swf_tag_info(tag->tag);
- if ((tag->tag != 6) && (tag->tag != 21) && (tag->tag != 35)) {
+ tag_info = get_swf_tag_info(tag->code);
+ if ((tag->code != 6) && (tag->code != 21) && (tag->code != 35)) {
return NULL;
}
if (swf_tag_create_input_detail(tag, NULL) == NULL) {
fprintf(stderr, "swf_tag_get_alpha_data: length == NULL\n");
return NULL;
}
- if (tag->tag != 35) { // ! DefineBitsJPEG3
+ if (tag->code != 35) { // ! DefineBitsJPEG3
return NULL;
}
if (swf_tag_get_cid(tag) != image_id) {
fprintf(stderr, "swf_tag_replace_jpeg_data: jpeg_data == NULL\n");
return 1;
}
- if (! isBitmapTag(tag->tag)) {
+ if (! isBitmapTag(tag->code)) {
return 1;
}
- tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag
+ tag_info = get_swf_tag_info(tag->code); // Bitmap Tag
detail_handler = tag_info->detail_handler();
if (detail_handler->get_cid(tag) != image_id) {
return 1;
}
- if (tag->detail && (! isBitsJPEGTag(tag->tag))) {
+ if (tag->detail && (! isBitsJPEGTag(tag->code))) {
detail_handler->destroy(tag);
tag->detail = NULL;
}
if (alpha_data && (alpha_data_len > 0)) {
- tag->tag = 35; // DefineBitsJPEG3
+ tag->code = 35; // DefineBitsJPEG3
} else {
- tag->tag = 21; // DefineBitsJPEG2
+ tag->code = 21; // DefineBitsJPEG2
}
- tag_info = get_swf_tag_info(tag->tag); // JPEG Tag
+ tag_info = get_swf_tag_info(tag->code); // JPEG Tag
detail_handler = tag_info->detail_handler();
if (tag->detail == NULL) {
tag->detail = detail_handler->create();
fprintf(stderr, "swf_tag_get_png_data: length == NULL\n");
return NULL;
}
- tag_info = get_swf_tag_info(tag->tag);
- if ((tag->tag != 20) && (tag->tag != 36)) {
+ tag_info = get_swf_tag_info(tag->code);
+ if ((tag->code != 20) && (tag->code != 36)) {
return NULL;
}
if (swf_tag_create_input_detail(tag, NULL) == NULL) {
fprintf(stderr, "swf_tag_replace_png_data: png_data == NULL\n");
return 1;
}
- if (! isBitmapTag(tag->tag)) {
+ if (! isBitmapTag(tag->code)) {
return 1;
}
- tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag
+ tag_info = get_swf_tag_info(tag->code); // Bitmap Tag
detail_handler = tag_info->detail_handler();
if (detail_handler->get_cid(tag) != image_id) {
return 1;
}
- if (tag->detail && (! isBitsLosslessTag(tag->tag))) {
+ if (tag->detail && (! isBitsLosslessTag(tag->code))) {
detail_handler->destroy(tag);
tag->detail = NULL;
}
- if (tag->tag == 20) {
- tag->tag = 20; // DefineBitsLossless
+ if (tag->code == 20) {
+ tag->code = 20; // DefineBitsLossless
} else {
- tag->tag = 36; // DefineBitsLossless2
+ tag->code = 36; // DefineBitsLossless2
}
- tag_info = get_swf_tag_info(tag->tag); // Lossless Tag
+ tag_info = get_swf_tag_info(tag->code); // Lossless Tag
detail_handler = tag_info->detail_handler();
if (tag->detail == NULL) {
tag->detail = detail_handler->create();
fprintf(stderr, "swf_tag_replace_gif_data: gif_data == NULL\n");
return 1;
}
- if (! isBitmapTag(tag->tag)) {
+ if (! isBitmapTag(tag->code)) {
return 1;
}
- tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag
+ tag_info = get_swf_tag_info(tag->code); // Bitmap Tag
detail_handler = tag_info->detail_handler();
if (detail_handler->get_cid(tag) != image_id) {
return 1;
}
- if (tag->detail && (! isBitsLosslessTag(tag->tag))) {
+ if (tag->detail && (! isBitsLosslessTag(tag->code))) {
detail_handler->destroy(tag);
tag->detail = NULL;
}
- if (tag->tag == 20) {
- tag->tag = 20; // DefineBitsLossless
+ if (tag->code == 20) {
+ tag->code = 20; // DefineBitsLossless
} else {
- tag->tag = 36; // DefineBitsLossless2
+ tag->code = 36; // DefineBitsLossless2
}
- tag_info = get_swf_tag_info(tag->tag); // Lossless Tag
+ tag_info = get_swf_tag_info(tag->code); // Lossless Tag
detail_handler = tag_info->detail_handler();
if (tag->detail == NULL) {
tag->detail = detail_handler->create();
fprintf(stderr, "swf_tag_get_sound_data: length == NULL\n");
return NULL;
}
- tag_info = get_swf_tag_info(tag->tag);
- if (tag->tag != 14) { // DefineSound
+ tag_info = get_swf_tag_info(tag->code);
+ if (tag->code != 14) { // DefineSound
return NULL;
}
if (! tag->detail) {
fprintf(stderr, "swf_tag_replace_melo_data: melo_data == NULL\n");
return 1;
}
- if (tag->tag != 14) { // DefineSound
+ if (tag->code != 14) { // DefineSound
return 1;
}
if (swf_tag_get_cid(tag) != sound_id) {
fprintf(stderr, "swf_tag_get_edit_string: variable_name == NULL\n");
return NULL;
}
- if (tag->tag != 37) { // DefineEditText
+ if (tag->code != 37) { // DefineEditText
return NULL;
}
if (swf_tag_create_input_detail(tag, swf) == NULL) {
fprintf(stderr, "swf_tag_replace_edit_string: variable_name == NULL\n");
return 1;
}
- if (tag->tag != 37) { // DefineEditText
+ if (tag->code != 37) { // DefineEditText
return 1;
}
if (swf_tag_create_input_detail(tag, swf) == NULL) {
fprintf(stderr, "swf_tag_apply_shape_matrix_factor: tag == NULL\n");
return 1;
}
- if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 )
- && (tag->tag != 46)) {
+ if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 )
+ && (tag->code != 46)) {
// ! DefineShape1,2,3, DefineMorphShape
return 1;
}
fprintf(stderr, "swf_tag_apply_shape_rect_factor: tag == NULL\n");
return 1;
}
- if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 )
- && (tag->tag != 46)) {
+ if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 )
+ && (tag->code != 46)) {
// ! DefineShape1,2,3, DefineMorphShape
return 1;
}
fprintf(stderr, "swf_tag_apply_shape_type_tylled: tag == NULL\n");
return 1;
}
- if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 )
- && (tag->tag != 46)) {
+ if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 )
+ && (tag->code != 46)) {
// ! DefineShape1,2,3, DefineMorphShape
return 1;
}
return NULL;
}
tag = calloc(sizeof(*tag), 1);
- tag->tag = 12; // DoAction
- swf_tag_info_t *tag_info = get_swf_tag_info(tag->tag);
+ tag->code = 12; // DoAction
+ swf_tag_info_t *tag_info = get_swf_tag_info(tag->code);
swf_tag_detail_handler_t *detail_handler = tag_info->detail_handler();
tag->detail = detail_handler->create();
ret = swf_tag_action_create_setvaribles(tag, kv);
return NULL;
}
to_tag = calloc(sizeof(*to_tag), 1);
- to_tag->tag = from_tag->tag;
+ to_tag->code = from_tag->code;
to_tag->length = from_tag->length;
to_tag->length_longformat = from_tag->length_longformat;
to_tag->data = from_tag->data;
struct swf_object_; // swf_object.h
typedef struct swf_tag_ {
- int tag;
+ int code;
unsigned long length;
int length_longformat;
//
bs = bitstream_open();
bitstream_input(bs, data, length);
- if (tag->tag == 59) { // DoInitAction
+ if (tag->code == 59) { // DoInitAction
swf_tag_action->action_sprite = bitstream_getbytesLE(bs, 2);
} else { // DoAction
swf_tag_action->action_sprite = 0; // fail safe
(void) swf;
bs = bitstream_open();
- if (tag->tag == 59) { // DoInitAction
+ if (tag->code == 59) { // DoInitAction
bitstream_putbytesLE(bs, swf_tag_action->action_sprite, 2);
} else { // DoAction
; // nothing
swf_tag_action_detail_t *swf_tag_action = (swf_tag_action_detail_t *) tag->detail;
(void) swf;
print_indent(indent_depth);
- if (tag->tag == 59) { // DoInitAction
+ if (tag->code == 59) { // DoInitAction
printf("action_sprite=%d ", swf_tag_action->action_sprite);
}
printf("action_record =\n");
return 1;
}
swf_tag_jpeg->image_id = image_id;
- if (tag->tag == 6) { // DefineBitsJPEG
+ if (tag->code == 6) { // DefineBitsJPEG
if (jpeg_data && jpeg_data_len) { // fail safe
free(swf_tag_jpeg->jpeg_data);
swf_tag_jpeg->jpeg_data = malloc(jpeg_data_len);
int bytes_per_color;
swf_tag_lossless->colormap_count = bitstream_getbyte(bs) + 1;
indices_len = ((swf_tag_lossless->width + 3) & -4) * swf_tag_lossless->height;
- if (tag->tag == 20) { // Lossless => rgb (3 bytes)
+ if (tag->code == 20) { // Lossless => rgb (3 bytes)
bytes_per_color = 3;
} else { // Lossless2 => rgba (4 bytes)
bytes_per_color = 4;
}
bs2 = bitstream_open();
bitstream_input(bs2, tmp_buff, origsize);
- if (tag->tag == 20) { // Lossless
+ if (tag->code == 20) { // Lossless
swf_tag_lossless->colormap = malloc(sizeof(swf_rgb_t) * swf_tag_lossless->colormap_count);
for (i=0 ; i < swf_tag_lossless->colormap_count ; i++) {
swf_rgb_t *rgb = swf_tag_lossless->colormap + i;
}
bs2 = bitstream_open();
bitstream_input(bs2, tmp_buff, origsize);
- if (tag->tag == 20) { // Lossless
+ if (tag->code == 20) { // Lossless
swf_tag_lossless->bitmap = malloc(bitmap_count * sizeof(swf_xrgb_t));
for (i=0 ; i < bitmap_count ; i++) {
swf_xrgb_t *xrgb = swf_tag_lossless->bitmap + i;
unsigned long indices_len;
bitstream_putbyte(bs, swf_tag_lossless->colormap_count - 1); /* XXX */
bs2 = bitstream_open();
- if (tag->tag == 20) { // Lossless
+ if (tag->code == 20) { // Lossless
for (i=0 ; i < swf_tag_lossless->colormap_count ; i++) {
swf_rgb_t *rgb = swf_tag_lossless->colormap + i;
swf_rgb_build(bs2, rgb);
} else {
unsigned long bitmap_size;
bs2 = bitstream_open();
- if (tag->tag == 20) { // Lossless
+ if (tag->code == 20) { // Lossless
bitmap_size = swf_tag_lossless->width * swf_tag_lossless->height;
for (i=0 ; i < bitmap_size ; i++) {
swf_xrgb_t *xrgb = swf_tag_lossless->bitmap + i;
swf_tag_lossless->format);
return NULL;
}
- if (tag->tag == 20) {
+ if (tag->code == 20) {
if (swf_tag_lossless->format == 3) {
index_data = (void *) swf_tag_lossless->colormap;
image_data = (void *) swf_tag_lossless->indices;
swf_tag_lossless->height,
index_data,
swf_tag_lossless->colormap_count,
- tag->tag, swf_tag_lossless->format,
+ tag->code, swf_tag_lossless->format,
length);
return data;
}
fprintf(stderr, "swf_tag_lossess_replace_png_data: pngconv_png2lossless failed at line(%d)\n", __LINE__);
return 1;
}
- tag->tag = tag_no;
+ tag->code = tag_no;
swf_tag_lossless->format = format;
swf_tag_lossless->width = width;
swf_tag_lossless->height = height;
fprintf(stderr, "swf_tag_lossless_replace_gif_data: gifconv_gif2lossless failed at line(%d)\n", __LINE__);
return 1;
}
- tag->tag = tag_no;
+ tag->code = tag_no;
swf_tag_lossless->format = format;
swf_tag_lossless->width = width;
swf_tag_lossless->height = height;
bs = bitstream_open();
bitstream_input(bs, data, length);
- if (tag->tag == 4) { // PlaceObject
+ if (tag->code == 4) { // PlaceObject
swf_tag_place->character_id = bitstream_getbytesLE(bs, 2);
swf_tag_place->depth = bitstream_getbytesLE(bs, 2);
ret = swf_matrix_parse(bs, &(swf_tag_place->matrix));
bitstream_close(bs);
return ret;
}
- } else if (tag->tag == 26) { // PlaceObject2
+ } else if (tag->code == 26) { // PlaceObject2
swf_tag_place->flag_has_clip_action = bitstream_getbit(bs);
swf_tag_place->flag_has_clip_depth = bitstream_getbit(bs);
swf_tag_place->flag_has_name = bitstream_getbit(bs);
bs = bitstream_open();
- if (tag->tag == 4) { // PlaceObject
+ if (tag->code == 4) { // PlaceObject
bitstream_putbytesLE(bs, swf_tag_place->character_id, 2);
bitstream_putbytesLE(bs, swf_tag_place->depth, 2);
ret = swf_matrix_build(bs, &(swf_tag_place->matrix));
bitstream_close(bs);
return NULL;
}
- } else if (tag->tag == 26) { // PlaceObject2
+ } else if (tag->code == 26) { // PlaceObject2
bitstream_putbit(bs, swf_tag_place->flag_has_clip_action);
bitstream_putbit(bs, swf_tag_place->flag_has_clip_depth);
bitstream_putbit(bs, swf_tag_place->flag_has_name);
swf_tag_place_detail_t *swf_tag_place = (swf_tag_place_detail_t *) tag->detail;
(void) swf;
print_indent(indent_depth);
- if (tag->tag == 4) { // PlaceObject
+ if (tag->code == 4) { // PlaceObject
printf("character_id=%d depth=%d\n",
swf_tag_place->character_id, swf_tag_place->depth);
swf_matrix_print(&(swf_tag_place->matrix), indent_depth);
swf_cxform_print(&(swf_tag_place->color_transform), indent_depth);
- } else if (tag->tag == 26) { // PlaceObject2
+ } else if (tag->code == 26) { // PlaceObject2
printf("(clipact,clipdepth,name,ratio,coltrans,mat,cid,move)=(%d,%d,%d,%d,%d,%d,%d,%d)\n",
swf_tag_place->flag_has_clip_action,
swf_tag_place->flag_has_clip_depth,
printf("ratio=%d\n", swf_tag_place->clip_depth);
}
} else {
- fprintf(stderr, "Illegal tag no(%d)\n", tag->tag);
+ fprintf(stderr, "Illegal tag no(%d)\n", tag->code);
}
return ;
}
int
swf_tag_place_get_cid_by_instance_name(swf_tag_t *tag, unsigned char *instance_name, int instance_name_len, struct swf_object_ *swf) {
swf_tag_place_detail_t *swf_tag_place;
- if (! isPlaceTag(tag->tag)) {
- fprintf(stderr, "swf_tag_place_get_cid_by_instance_name: ! isPlaceTag(%d)\n", tag->tag);
+ if (! isPlaceTag(tag->code)) {
+ fprintf(stderr, "swf_tag_place_get_cid_by_instance_name: ! isPlaceTag(%d)\n", tag->code);
return -1; // wrong tag
}
swf_tag_place = (swf_tag_place_detail_t *) swf_tag_create_input_detail(tag, swf);
}
// DefineMorphShape, DefineMorphShape2
- swf_tag_shape->is_morph = (tag->tag == 46) || (tag->tag == 84);
+ swf_tag_shape->is_morph = (tag->code == 46) || (tag->code == 84);
// DefineShape4, DefineMorphShape2
- swf_tag_shape->has_strokes = (tag->tag == 83) || (tag->tag == 84);
+ swf_tag_shape->has_strokes = (tag->code == 83) || (tag->code == 84);
if (swf_tag_shape->is_morph) {
ret = swf_rect_parse(bs, &(swf_tag_shape->rect_morph));
fprintf(stderr, "swf_tag_shape_bitmap_get_refcid: tag == NULL\n");
return NULL;
}
- if (! isShapeTag(tag->tag)) {
+ if (! isShapeTag(tag->code)) {
fprintf(stderr, "swf_tag_shape_bitmap_get_refcid: ! isShapeTag(%d)\n",
- tag->tag);
+ tag->code);
return NULL;
}
if (tag->detail == NULL) {
fprintf(stderr, "swf_tag_shape_bitmap_replace_refcid: tag == NULL\n");
return 1;
}
- if (! isShapeTag(tag->tag)) {
+ if (! isShapeTag(tag->code)) {
fprintf(stderr, "swf_tag_shape_bitmap_replace_refcid: ! isShapeTag(%d)\n",
- tag->tag);
+ tag->code);
return 1;
}
if (tag->detail == NULL) {
swf_rect_build(bs, &(swf_tag_shape->rect));
// DefineMorphShape, DefineMorphShape2
- swf_tag_shape->is_morph = (tag->tag == 46) || (tag->tag == 84);
+ swf_tag_shape->is_morph = (tag->code == 46) || (tag->code == 84);
// DefineShape4, DefineMorphShape2
- swf_tag_shape->has_strokes = (tag->tag == 83) || (tag->tag == 84);
+ swf_tag_shape->has_strokes = (tag->code == 83) || (tag->code == 84);
if (swf_tag_shape->is_morph) {
ret = swf_rect_build(bs, &(swf_tag_shape->rect_morph));
print_indent(indent_depth);
printf(" [%d] ", i);
swf_tag_print(_tag, swf, indent_depth + 1);
- if (_tag->tag == 0) { // END Tag
+ if (_tag->code == 0) { // END Tag
break;
}
_tag = _tag->next;
--EXPECTF--
seqno=3
array (
- 'tag' => 6,
+ 'code' => 6,
'tagName' => 'DefineBitsJPEG',
'length' => 2133,
'detail' => true,
--EXPECTF--
seqno=4
array (
- 'tag' => 2,
+ 'code' => 2,
'tagName' => 'DefineShape',
'length' => 51,
'detail' => true,