void swf_ActionFree(ActionTAG*action)
{
if(!action) {
- fprintf(stderr, "Warning: freeing zero action");
return;
}
action = action->parent;
void swf_ActionSet(TAG*tag, ActionTAG*action)
{
+ if(!action) {
+ return;
+ }
action=action->parent;
while(action)
{
if (a1->op == ACTION_IF || a1->op == ACTION_JUMP)
{
- *(U16*)(a1->data) = SWAP16(len);
+ *(U16*)(a1->data) = LE_16_TO_NATIVE(len);
}
else if(a1->op == ACTION_WAITFORFRAME)
{
ActionTAG* action_GotoFrame(ActionTAG*atag, U16 frame)
{
atag = swf_AddActionTAG(atag, ACTION_GOTOFRAME, 0, 2);
- *(U16*)atag->tmp = SWAP16(frame);
+ *(U16*)atag->tmp = LE_16_TO_NATIVE(frame);
return atag;
}
ActionTAG* action_Jump(ActionTAG*atag, U16 branch)
{
atag = swf_AddActionTAG(atag, ACTION_JUMP, 0, 2);
- *(U16*)atag->tmp = SWAP16(branch);
+ *(U16*)atag->tmp = LE_16_TO_NATIVE(branch);
return atag;
}
ActionTAG* action_If(ActionTAG*atag, U16 branch)
{
atag = swf_AddActionTAG(atag, ACTION_IF, 0, 2);
- *(U16*)atag->tmp = SWAP16(branch);
+ *(U16*)atag->tmp = LE_16_TO_NATIVE(branch);
return atag;
}
ActionTAG* action_StoreRegister(ActionTAG*atag, U8 reg)
ActionTAG* action_WaitForFrame(ActionTAG*atag, U16 frame, U8 skip)
{
atag = swf_AddActionTAG(atag, ACTION_WAITFORFRAME, 0, 3);
- *(U16*)atag->tmp = SWAP16(frame);
+ *(U16*)atag->tmp = LE_16_TO_NATIVE(frame);
*(U8*)&atag->tmp[2] = skip;
return atag;
}
-ActionTAG* action_SetTarget(ActionTAG*atag, char* target)
+ActionTAG* action_SetTarget(ActionTAG*atag, const char* target)
{
char*ptr = strdup(target);
return swf_AddActionTAG(atag, ACTION_SETTARGET, (U8*)ptr, strlen(ptr)+1);
rfx_free(buffer);
a = swf_ActionGet(tag);
- swf_DeleteTag(tag);
+ swf_DeleteTag(0, tag);
return a;
}