rfxswf cleanup: replaced LP<type> by <type> *
[swftools.git] / lib / modules / swfbutton.c
index 23bd3c7..fc1d087 100644 (file)
@@ -1,92 +1,92 @@
-/* swfbutton.c\r
-\r
-   Button functions\r
-\r
-   Extension module for the rfxswf library.\r
-   Part of the swftools package.\r
-\r
-   Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>\r
\r
-   This file is distributed under the GPL, see file COPYING for details \r
-\r
-*/\r
-\r
-int ButtonSetRecord(LPTAG t,U8 state,U16 id,U16 layer,LPMATRIX m,LPCXFORM cx)\r
-\r
-{ SetU8(t,state);\r
-  SetU16(t,id);\r
-  SetU16(t,layer);\r
-  SetMatrix(t,m);\r
-//  SetCXForm(t,cx,0);\r
-  return 0;\r
-}\r
-\r
-int ButtonSetCondition(LPTAG t,U16 condition)\r
-{ SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess\r
-  SetU16(t,condition);\r
-  return 0;\r
-}\r
-\r
-int ButtonSetFlags(LPTAG t,U8 flags)\r
-{ if (GetTagID(t)==ST_DEFINEBUTTON2)\r
-  { SetU8(t,flags);\r
-    SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess\r
-  }\r
-  return 0;\r
-}\r
-\r
-void SetButtonOffset(LPTAG t,U32 offsetpos)\r
-{ U32 now = GetTagPos(t);\r
-  U16 diff = now-offsetpos;\r
-  SetTagPos(t,offsetpos);\r
-  t->data[t->pos++] = (U8)(diff&0xff);\r
-  t->data[t->pos++] = (U8)(diff>>8);\r
-  SetTagPos(t,now);\r
-}\r
-\r
-int ButtonPostProcess(LPTAG t,int anz_action)\r
-{ if (GetTagID(t)==ST_DEFINEBUTTON2)\r
-  { U32 oldTagPos;\r
-    U32 offsetpos;\r
-\r
-    oldTagPos = GetTagPos(t);\r
-\r
-    // scan DefineButton2 Record\r
-    \r
-    GetU16(t);          // Character ID\r
-    GetU8(t);           // Flags;\r
-\r
-    offsetpos = GetTagPos(t);  // first offset\r
-    GetU16(t);\r
-\r
-    while (GetU8(t))      // state  -> parse ButtonRecord\r
-    { GetU16(t);          // id\r
-      GetU16(t);          // layer\r
-      GetMatrix(t,NULL);  // matrix\r
-      // evtl.: CXForm\r
-    }\r
-\r
-    SetButtonOffset(t,offsetpos);\r
-\r
-    while(anz_action)\r
-    { U8 a;\r
-        \r
-      offsetpos = GetTagPos(t); // offset\r
-      GetU16(t);\r
-\r
-      GetU16(t);                // condition\r
-      \r
-      while (a=GetU8(t))        // skip action records\r
-      { if (a&0x80)\r
-        { U16 l = GetU16(t);\r
-          GetBlock(t,NULL,l);\r
-        }\r
-      }\r
-      \r
-      if (--anz_action) SetButtonOffset(t,offsetpos);\r
-    }\r
-    \r
-    SetTagPos(t,oldTagPos);\r
-  }\r
-  return 0;\r
-}\r
+/* swfbutton.c
+
+   Button functions
+
+   Extension module for the rfxswf library.
+   Part of the swftools package.
+
+   Copyright (c) 2000, 2001 Rainer Böhme <rfxswf@reflex-studio.de>
+   This file is distributed under the GPL, see file COPYING for details 
+
+*/
+
+int ButtonSetRecord(TAG * t,U8 state,U16 id,U16 layer,MATRIX * m,CXFORM * cx)
+
+{ SetU8(t,state);
+  SetU16(t,id);
+  SetU16(t,layer);
+  SetMatrix(t,m);
+//  SetCXForm(t,cx,0);
+  return 0;
+}
+
+int ButtonSetCondition(TAG * t,U16 condition)
+{ SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
+  SetU16(t,condition);
+  return 0;
+}
+
+int ButtonSetFlags(TAG * t,U8 flags)
+{ if (GetTagID(t)==ST_DEFINEBUTTON2)
+  { SetU8(t,flags);
+    SetU16(t,0); // dummy for Action Offset -> later set by ButtonPostProcess
+  }
+  return 0;
+}
+
+void SetButtonOffset(TAG * t,U32 offsetpos)
+{ U32 now = GetTagPos(t);
+  U16 diff = now-offsetpos;
+  SetTagPos(t,offsetpos);
+  t->data[t->pos++] = (U8)(diff&0xff);
+  t->data[t->pos++] = (U8)(diff>>8);
+  SetTagPos(t,now);
+}
+
+int ButtonPostProcess(TAG * t,int anz_action)
+{ if (GetTagID(t)==ST_DEFINEBUTTON2)
+  { U32 oldTagPos;
+    U32 offsetpos;
+
+    oldTagPos = GetTagPos(t);
+
+    // scan DefineButton2 Record
+    
+    GetU16(t);          // Character ID
+    GetU8(t);           // Flags;
+
+    offsetpos = GetTagPos(t);  // first offset
+    GetU16(t);
+
+    while (GetU8(t))      // state  -> parse ButtonRecord
+    { GetU16(t);          // id
+      GetU16(t);          // layer
+      GetMatrix(t,NULL);  // matrix
+      // evtl.: CXForm
+    }
+
+    SetButtonOffset(t,offsetpos);
+
+    while(anz_action)
+    { U8 a;
+        
+      offsetpos = GetTagPos(t); // offset
+      GetU16(t);
+
+      GetU16(t);                // condition
+      
+      while (a=GetU8(t))        // skip action records
+      { if (a&0x80)
+        { U16 l = GetU16(t);
+          GetBlock(t,NULL,l);
+        }
+      }
+      
+      if (--anz_action) SetButtonOffset(t,offsetpos);
+    }
+    
+    SetTagPos(t,oldTagPos);
+  }
+  return 0;
+}