case ST_DEFINESHAPE3:
case ST_DEFINESHAPE4:
case ST_DEFINEMORPHSHAPE:
+ case ST_DEFINEMORPHSHAPE2:
case ST_DEFINEEDITTEXT:
case ST_DEFINEBITS:
case ST_DEFINEBITSJPEG2:
case ST_DEFINEFONTINFO: //pseudodefine
case ST_DEFINEFONTINFO2: //pseudodefine
case ST_DEFINEFONTALIGNZONES: //pseudodefine
+ case ST_DEFINEFONTNAME: //pseudodefine
case ST_DEFINETEXT:
case ST_DEFINETEXT2:
case ST_DEFINESOUND:
ST_DEFINESHAPE3,
ST_DEFINESHAPE4,
ST_DEFINEMORPHSHAPE,
+ ST_DEFINEMORPHSHAPE2,
ST_DEFINEFONT,
ST_DEFINEFONT2,
ST_DEFINEFONT3,
ST_DEFINEBUTTON2,
ST_DEFINESOUND,
ST_DEFINEVIDEOSTREAM,
+ ST_DEFINEBINARY,
-1
};
ST_REMOVEOBJECT,
ST_REMOVEOBJECT2,
ST_DOACTION,
+ ST_DOABC,
ST_STARTSOUND,
ST_FRAMELABEL,
ST_SOUNDSTREAMHEAD,
ST_DEFINEFONTINFO,
ST_DEFINEFONTINFO2,
ST_DEFINEFONTALIGNZONES,
+ ST_DEFINEFONTNAME,
ST_DEFINEBUTTONCXFORM,
ST_DEFINEBUTTONSOUND,
ST_DEFINESCALINGGRID,
switch(swf_GetTagID(t))
{
case ST_FRAMELABEL:
- name = &t->data[swf_GetTagPos(t)];
+ name = (char*)&t->data[swf_GetTagPos(t)];
break;
case ST_PLACEOBJECT3:
case ST_PLACEOBJECT2: {
swf_GetU16(t);
if(flags&PF_NAME) {
swf_ResetReadBits(t);
- name = &t->data[swf_GetTagPos(t)];
+ name = (char*)&t->data[swf_GetTagPos(t)];
}
}
break;
if(gradient1) {
gradient1->num = num;
- gradient1->rgba = rfx_calloc(sizeof(RGBA)*gradient1->num);
- gradient1->ratios = rfx_calloc(sizeof(gradient1->ratios[0])*gradient1->num);
+ gradient1->rgba = (RGBA*)rfx_calloc(sizeof(RGBA)*gradient1->num);
+ gradient1->ratios = (U8*)rfx_calloc(sizeof(gradient1->ratios[0])*gradient1->num);
}
if(gradient2) {
gradient2->num = num;
- gradient2->rgba = rfx_calloc(sizeof(RGBA)*gradient2->num);
- gradient2->ratios = rfx_calloc(sizeof(gradient2->ratios[0])*gradient2->num);
+ gradient2->rgba = (RGBA*)rfx_calloc(sizeof(RGBA)*gradient2->num);
+ gradient2->ratios = (U8*)rfx_calloc(sizeof(gradient2->ratios[0])*gradient2->num);
}
for(t=0;t<num;t++)
{
for(t=0;t<count;t++)
{
int type;
- U8*pos;
type = swf_GetU8(tag); //type
DEBUG_ENUMERATE printf("fill style %d) %02x (tagpos=%d)\n", t, type, tag->pos);
if(type == 0) {
case ST_FREECHARACTER: /* unusual tags, which all start with an ID */
case ST_NAMECHARACTER:
+ case ST_DEFINEBINARY:
+ case ST_DEFINEFONTNAME:
case ST_GENERATORTEXT:
callback(tag, tag->pos + base, callback_data);
break;
if(id == ST_END)
break;
tag2->len = tag2->memsize = len;
- tag2->data = rfx_alloc(len);
+ tag2->data = (U8*)rfx_alloc(len);
memcpy(tag2->data, &tag->data[tag->pos], len);
/* I never saw recursive sprites, but they are (theoretically)
possible, so better add base here again */
}
while(1)
{
- U16 charid;
if(!swf_GetU8(tag)) //flags
break;
callback(tag, tag->pos + base, callback_data);
num = swf_GetNumUsedIDs(tag);
if(num) {
- ptr = rfx_alloc(sizeof(int)*num);
+ ptr = (int*)rfx_alloc(sizeof(int)*num);
swf_GetUsedIDs(tag, ptr);
for(t=0;t<num;t++) {
if(slaveids[id]<0) {
fprintf(stderr, "swf_Relocate: Mapping id (%d) never encountered before in %s\n", id,
swf_TagGetName(tag));
- return ;
+ } else {
+ id = slaveids[id];
+ PUT16(&tag->data[ptr[t]], id);
}
- id = slaveids[id];
- PUT16(&tag->data[ptr[t]], id);
}
}
tag=tag->next;
if(num) {
int *ptr;
int t;
- ptr = rfx_alloc(sizeof(int)*num);
+ ptr = (int*)rfx_alloc(sizeof(int)*num);
swf_GetUsedIDs(tag, ptr);
for(t=0;t<num;t++) {
int id = GET16(&tag->data[ptr[t]]);
void swf_Optimize(SWF*swf)
{
const int hash_size = 131072;
- char* dontremap = rfx_calloc(sizeof(char)*65536);
- U16* remap = rfx_alloc(sizeof(U16)*65536);
- TAG* id2tag = rfx_calloc(sizeof(TAG*)*65536);
- TAG** hashmap = rfx_calloc(sizeof(TAG*)*hash_size);
+ char* dontremap = (char*)rfx_calloc(sizeof(char)*65536);
+ U16* remap = (U16*)rfx_alloc(sizeof(U16)*65536);
+ TAG* id2tag = (TAG*)rfx_calloc(sizeof(TAG*)*65536);
+ TAG** hashmap = (TAG**)rfx_calloc(sizeof(TAG*)*hash_size);
TAG* tag;
int t;
for(t=0;t<65536;t++) {
/* remap the tag */
int num = swf_GetNumUsedIDs(tag);
- int*positions = rfx_alloc(sizeof(int)*num);
+ int*positions = (int*)rfx_alloc(sizeof(int)*num);
int t;
swf_GetUsedIDs(tag, positions);
for(t=0;t<num;t++) {
swf_ResetReadBits(tag);
after_bbox_offset = tag->pos;
len = tag->len - after_bbox_offset;
- data = malloc(len);
+ data = (U8*)malloc(len);
memcpy(data, &tag->data[after_bbox_offset], len);
tag->writeBit = 0;
tag->len = 2;