#include <stdio.h>
#include "bitstream.h"
#include "swf_morph_shape_with_style.h"
+#include "swf_tag_shape.h"
int
swf_morph_shape_with_style_parse(bitstream_t *bs,
swf_morph_shape_with_style_t *morph_shape_with_style,
swf_tag_t *tag) {
+ swf_tag_shape_detail_t *swf_tag_shape = (swf_tag_shape_detail_t *) tag->detail;
swf_styles_parse(bs, &(morph_shape_with_style->styles), tag);
+ swf_tag_shape->_current_styles_count = morph_shape_with_style->styles.styles_count; // XXX
swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records), tag,
&(morph_shape_with_style->styles.styles_count));
bitstream_align(bs);
swf_styles_count_parse(bs, &(morph_shape_with_style->styles_count));
+
+ swf_tag_shape->_current_styles_count = morph_shape_with_style->styles_count; // XXX
swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records_morph),
tag, &(morph_shape_with_style->styles_count));
return 0;
break;
} if (first_bit == 0) {
swf_shape_record_setup_parse(bs, &(current_record->shape.shape_setup),
- tag, count);
+ tag);
} else {
swf_shape_record_edge_parse(bs, &(current_record->shape.shape_edge));
}
#include <stdio.h>
#include "bitstream.h"
#include "swf_shape_record_setup.h"
+#include "swf_tag_shape.h"
int
swf_shape_record_setup_parse(bitstream_t *bs,
swf_shape_record_setup_t *shape_record_setup,
- swf_tag_t *tag, swf_styles_count_t *count) {
+ swf_tag_t *tag) {
int shape_move_size;
+ swf_tag_shape_detail_t *swf_tag_shape = (swf_tag_shape_detail_t *) tag->detail;
shape_record_setup->shape_record_type = bitstream_getbit(bs);
shape_record_setup->shape_has_new_styles = bitstream_getbit(bs);
shape_record_setup->shape_has_line_style = bitstream_getbit(bs);
shape_record_setup->shape_move_y = bitstream_getbits(bs, shape_move_size);
}
if (shape_record_setup->shape_has_fill_style0) {
- shape_record_setup->shape_fill_style0 = bitstream_getbits(bs, count->fill_bits_count);
+ shape_record_setup->shape_fill_style0 = bitstream_getbits(bs, swf_tag_shape->_current_styles_count.fill_bits_count);
}
if (shape_record_setup->shape_has_fill_style1) {
- shape_record_setup->shape_fill_style1 = bitstream_getbits(bs, count->fill_bits_count);
-
+ shape_record_setup->shape_fill_style1 = bitstream_getbits(bs, swf_tag_shape->_current_styles_count.fill_bits_count);
}
if (shape_record_setup->shape_has_line_style) {
- shape_record_setup->shape_line_style = bitstream_getbits(bs, count->line_bits_count);
+ shape_record_setup->shape_line_style = bitstream_getbits(bs, swf_tag_shape->_current_styles_count.line_bits_count);
}
if (shape_record_setup->shape_has_new_styles) {
swf_styles_parse(bs, &(shape_record_setup->styles), tag);
+ swf_tag_shape->_current_styles_count = shape_record_setup->styles.styles_count;
}
return 0;
}
extern int swf_shape_record_setup_parse(bitstream_t *bs,
swf_shape_record_setup_t *setup,
- swf_tag_t *tag,
- swf_styles_count_t *count);
+ swf_tag_t *tag);
extern int swf_shape_record_setup_build(bitstream_t *bs,
swf_shape_record_setup_t *setup,
swf_tag_t *tag,
#include <stdio.h>
#include "bitstream.h"
#include "swf_shape_with_style.h"
+#include "swf_tag_shape.h"
int
swf_shape_with_style_parse(bitstream_t *bs,
swf_shape_with_style_t *shape_with_style,
swf_tag_t *tag) {
int result;
+ swf_tag_shape_detail_t *swf_tag_shape = (swf_tag_shape_detail_t *) tag->detail;
result = swf_styles_parse(bs, &(shape_with_style->styles), tag);
if (result) {
return result;
}
+ swf_tag_shape->_current_styles_count = shape_with_style->styles.styles_count; // XXX
result = swf_shape_record_parse(bs, &(shape_with_style->shape_records),
tag,
&(shape_with_style->styles.styles_count));
return result;
}
result = swf_styles_count_parse(bs, &(shape_with_style->styles_count));
+ if (result) {
+ return result;
+ }
+
return result;
}
#include <stdio.h>
#include "bitstream.h"
#include "swf_styles_count.h"
+#include "swf_tag_shape.h"
int
swf_styles_count_parse(bitstream_t *bs, swf_styles_count_t *styles_count) {
swf_morph_shape_with_style_t morph_shape_with_style;
// else
swf_shape_with_style_t shape_with_style;
+ /*
+ * parse context
+ */
+ swf_styles_count_t _current_styles_count;
} swf_tag_shape_detail_t;
extern swf_tag_detail_handler_t *swf_tag_shape_detail_handler(void);