5 Extension module for the rfxswf library.
\r
6 Part of the swftools package.
\r
8 Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
\r
10 This file is distributed under the GPL, see file COPYING for details
\r
14 int ButtonSetRecord(LPTAG t,U8 state,U16 id,U16 layer,LPMATRIX m,LPCXFORM cx)
\r
20 // SetCXForm(t,cx,0);
\r
24 int ButtonSetCondition(LPTAG t,U16 condition)
\r
25 { SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
\r
26 SetU16(t,condition);
\r
30 int ButtonSetFlags(LPTAG t,U8 flags)
\r
31 { if (GetTagID(t)==ST_DEFINEBUTTON2)
\r
33 SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
\r
38 void SetButtonOffset(LPTAG t,U32 offsetpos)
\r
39 { U32 now = GetTagPos(t);
\r
40 U16 diff = now-offsetpos;
\r
41 SetTagPos(t,offsetpos);
\r
42 t->data[t->pos++] = (U8)(diff&0xff);
\r
43 t->data[t->pos++] = (U8)(diff>>8);
\r
47 int ButtonPostProcess(LPTAG t,int anz_action)
\r
48 { if (GetTagID(t)==ST_DEFINEBUTTON2)
\r
52 oldTagPos = GetTagPos(t);
\r
54 // scan DefineButton2 Record
\r
56 GetU16(t); // Character ID
\r
59 offsetpos = GetTagPos(t); // first offset
\r
62 while (GetU8(t)) // state -> parse ButtonRecord
\r
65 GetMatrix(t,NULL); // matrix
\r
69 SetButtonOffset(t,offsetpos);
\r
74 offsetpos = GetTagPos(t); // offset
\r
77 GetU16(t); // condition
\r
79 while (a=GetU8(t)) // skip action records
\r
81 { U16 l = GetU16(t);
\r
86 if (--anz_action) SetButtonOffset(t,offsetpos);
\r
89 SetTagPos(t,oldTagPos);
\r