-static void renderpoint_write(TAG*tag, renderpoint_t*p)
-{
- if(tag->len == 0) {
- swf_SetU32(tag, 1);
- } else {
- int num = GET32(tag->data);
- PUT32(tag->data, num+1);
- }
-
- swf_SetBits(tag, p->type, 1);
- swf_SetBits(tag, *(U32*)&p->x, 32);
- if(p->depth & 0xffff) {
- swf_SetBits(tag, 1, 1);
- swf_SetBits(tag, p->depth, 32);
- } else {
- swf_SetBits(tag, 0, 1);
- swf_SetBits(tag, p->depth >> 16, 16);
- }
- swf_SetBits(tag, *(U32*)&p->shapeline, 32);
- if(p->type == clip_type) {
- if(p->clipdepth & 0xffff) {
- swf_SetBits(tag, 1, 1);
- swf_SetBits(tag, p->clipdepth, 32);
- } else {
- swf_SetBits(tag, 0, 1);
- swf_SetBits(tag, p->clipdepth >> 16, 16);
- }
- /* don't set s */
- } else {
- swf_SetBits(tag, *(U32*)&p->s, 32);
- /* don't set clipdepth */
- }
-}
-static renderpoint_t renderpoint_read(TAG*tag, int num)
-{
- renderpoint_t p;
- U8 flag = 0;
- U32 dummy = 0;
-
- p.type = swf_GetBits(tag, 1);
-
- dummy = swf_GetBits(tag, 32);p.x = *(float*)&dummy;
- flag = swf_GetBits(tag, 1);
- if(flag) {
- p.depth = swf_GetBits(tag, 32);
- } else {
- p.depth = swf_GetBits(tag, 16) << 16;
- }
- dummy = swf_GetBits(tag, 32);p.shapeline = *(SHAPELINE**)&dummy;
- if(p.type == clip_type) {
- flag = swf_GetBits(tag, 1);
- if(flag) {
- p.clipdepth = swf_GetBits(tag, 32);
- } else {
- p.clipdepth = swf_GetBits(tag, 16) << 16;
- }
- p.s = 0;
- } else {
- dummy = swf_GetBits(tag, 32);p.s = *(dummyshape_t**)&dummy;
- p.clipdepth = 0;
- }
-
- return p;
-}
-
-static int renderpoint_num(TAG*tag)
-{
- if(tag->len == 0)
- return 0;
- return GET32(tag->data);
-}
-
-static renderpoint_t* renderpoint_readall(TAG*tag)
-{
- int num;
- int t;
- renderpoint_t*p;
- swf_SetTagPos(tag, 0);
- if(tag->len == 0)
- num = 0;
- else
- num = swf_GetU32(tag);
- p = (renderpoint_t*)rfx_alloc(num*sizeof(renderpoint_t));
- for(t=0;t<num;t++)
- p[t] = renderpoint_read(tag,t);
- return p;
-}
-