swfformat.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:8k
源码类别:

DVD

开发平台:

C/C++

  1. #define typebtn 0
  2. #define typebmp 1
  3. #define typeact 2
  4. #define typempg1 3  //()
  5. #define typempg2 4  //()
  6. #define typesprite 5
  7. #define typeEventsn 6
  8. #define typesprite2 7
  9. #define STACKSIZE 100
  10. typedef struct s_swfInfo
  11. {   char head[4];
  12.     int totalframes;
  13.     int framesloaded;
  14.     int visible;
  15.     int width;
  16.     int height;
  17.     int scrwidth;
  18.     int scrheight;
  19.     int objcount;
  20.     
  21.     int btncount;
  22.     int bmpcount;
  23.     int spritecount;
  24.     int actcount;
  25.     int mpgcount;
  26.     int EventSnCount;
  27.     
  28.     int nFramerate;
  29.     int Version;
  30.     
  31.     int btnindex;//Param1;
  32.     int btnnum;
  33.     int mpg1index;
  34.     int mpg1num;
  35.     int mpg2index;
  36.     int mpg2num;
  37.     int actindex;
  38.     int actnum;
  39.     int spriteindex;
  40.     int Eventsnindex;
  41.     int Eventsnnum;
  42.     int totalview;
  43.     int EventsnStart;
  44.     int EventsnCount;
  45.     int sprite2index;
  46.     int Param16;
  47.     int Param17;
  48.     int Param18;
  49.     int Param19;
  50.     int Param20;
  51. }swfInfo;
  52. //indexlength =5 if more than 5 show error
  53. typedef struct s_S_IDX {
  54. short int type; //2
  55. short int sindex;  //=0 all sceen //2              
  56. unsigned short start_sec; //4 action start address
  57. unsigned short end_sec; //4
  58. unsigned short param1; //4 startframe of mpg;action currentframe
  59. unsigned short param2; //4 endframe of mpg;action actid
  60. unsigned short param3; //4 action acttype
  61. unsigned short param4; //4 action actlength
  62. unsigned short param5;
  63. unsigned short param6;
  64. unsigned short param7;
  65. unsigned short param8;
  66. unsigned short param9;
  67. unsigned short paramA;
  68. }S_IDX;
  69. /*typedef struct sButtonInfoHead
  70. {
  71. unsigned long actionoffset; //4
  72. unsigned long actionlength; //4
  73. unsigned long bkcolor; //4
  74. unsigned long bmptop; //4
  75. unsigned long bmpleft; //4
  76. unsigned long bmpwidth; //4
  77. unsigned long bmpheight; //4
  78. unsigned long bmpoffset; //4
  79. unsigned long bmpfilelength; //4
  80. }ButtonInfoHead;*/
  81. typedef struct sButtonInfoHead
  82. {
  83. //unsigned long actionoffset; //4
  84. //unsigned long actionlength; //4
  85. unsigned long bkcolor; //4
  86. unsigned short bmptop; //4
  87. unsigned short bmpleft; //4
  88. unsigned short bmpwidth; //4
  89. unsigned short bmpheight; //4
  90. unsigned long bmpoffset; //4
  91. unsigned long bmpfilelength; //4
  92. }ButtonInfoHead;
  93. typedef struct sRECT
  94. {
  95. unsigned short x; //4
  96. unsigned short y; //4
  97. unsigned short w; //4
  98. unsigned short h;
  99. }mRect;
  100. typedef struct sTButtonInfoHead
  101. {
  102. unsigned long validsize;
  103. unsigned long soundoffset;
  104. unsigned long soundlength;
  105. unsigned long actionoffset; //4
  106. unsigned long actionlength; //4
  107. ButtonInfoHead mybtninfo[4];
  108. }TButtonInfoHead; 
  109. typedef struct sSpriteInfoHead
  110. {
  111. unsigned long reswidth;
  112. unsigned long resheight;
  113. unsigned long datapos;
  114. unsigned long bmpfilelength;    
  115. }SpriteInfoHead;
  116. typedef struct sSpriteInfoHead2
  117. {       unsigned long namelength;      //4
  118.         char instancename[20];
  119. }SpriteInfoHead2;
  120. typedef struct sSpriteInfoHeadframe2
  121. {      /* unsigned long startx;
  122.         unsigned long starty;
  123.         unsigned long actionoffset; //4
  124.         unsigned long actionlength; //4
  125.         */
  126.         unsigned long reswidth;
  127. unsigned long resheight;
  128. unsigned long datapos;
  129. unsigned long bmpfilelength; 
  130. }SpriteInfoHeadframe2;
  131. enum
  132. {       obj_int=0,
  133.         obj_float= 1,
  134.         obj_boolean=2,
  135.         obj_string=3,
  136.         //obj_point=2,
  137.         obj_object=4,
  138.         //obj_class=3,
  139.         //obj_event=4,
  140.         obj_movie=5,
  141.         //obj_pic=6,
  142.         obj_null=6,
  143.         obj_undefined=7,
  144.         obj_function=8
  145.         //obj_bool=8
  146. };
  147. // Action codes
  148. enum
  149. {
  150.     sactionNone                     = 0x00,
  151.     sactionNextFrame                = 0x04,
  152.     sactionPrevFrame                = 0x05,
  153.     sactionPlay                     = 0x06,
  154.     sactionStop                     = 0x07,
  155.     sactionToggleQuality            = 0x08,
  156.     sactionStopSounds               = 0x09,
  157.     sactionAdd                      = 0x0A,
  158.     sactionSubtract                 = 0x0B,
  159.     sactionMultiply                 = 0x0C,
  160.     sactionDivide                   = 0x0D,
  161.     sactionEqual                    = 0x0E,
  162.     sactionLessThan                 = 0x0F,
  163.     sactionLogicalAnd               = 0x10,
  164.     sactionLogicalOr                = 0x11,
  165.     sactionLogicalNot               = 0x12,
  166.     sactionStringEqual              = 0x13,
  167.     sactionStringLength             = 0x14,
  168.     sactionSubString                = 0x15,
  169.     sactionInt                      = 0x18,
  170.     sactionGetVariable              = 0x1C,
  171.     sactionSetVariable              = 0x1D,
  172.     sactionSetTargetExpression      = 0x20,
  173.     sactionStringConcat             = 0x21,
  174.     sactionGetProperty              = 0x22,
  175.     sactionSetProperty              = 0x23,
  176.     sactionDuplicateClip            = 0x24,
  177.     sactionRemoveClip               = 0x25,
  178.     sactionTrace                    = 0x26,
  179.     sactionStartDragMovie           = 0x27,
  180.     sactionStopDragMovie            = 0x28,
  181.     sactionStringLessThan           = 0x29,
  182.     sactionRandom                   = 0x30,
  183.     sactionMBLength                 = 0x31,
  184.     sactionOrd                      = 0x32,
  185.     sactionChr                      = 0x33,
  186.     sactionGetTimer                 = 0x34,
  187.     sactionMBSubString              = 0x35,
  188.     sactionMBOrd                    = 0x36,
  189.     sactionMBChr                    = 0x37,
  190.     sactionDelete                   = 0x3a,
  191.     sactionDelete2                  = 0x3b,
  192.     sactionDefineLocal              = 0x3c,
  193.     sactionReturn                   = 0x3e,
  194.     sactionModulo                   = 0x3f,
  195.     sactionNewObject                = 0x40,
  196.     sactionDefineLocal2             = 0x41,
  197. //    sactionInitArray                = 0x42,
  198.     sactionTypeOf                   = 0x44,
  199.     sactionTargetPath               = 0x45,
  200.     sactionEnumerate                = 0x46,
  201.     sactionAdd2                     = 0x47,
  202.     sactionLess2                    = 0x48,
  203.     sactionEquals2                  = 0x49,
  204.     sactionToNumber                 = 0x4a,
  205.     sactionToString                 = 0x4b,
  206.     sactionPushDuplicate            = 0x4c,
  207.     sactionStackSwap                = 0x4d,
  208.     sactionGetMember                = 0x4e,
  209.     sactionSetMember                = 0x4f,
  210.     sactionIncrement                = 0x50,
  211.     sactionDecrement                = 0x51,
  212.     sactionEnumerate2               = 0x55,
  213.     sDoInitAction                   = 0x59,
  214.     sactionBitAnd                   = 0x60,
  215.     sactionBitOr                    = 0x61,
  216.     sactionBitXor                   = 0x62,
  217.     sactionBitLShift                = 0x63,
  218.     sactionBitRShift                = 0x64,
  219.     sactionBitURShift               = 0x65,
  220.     sactionGreater                  = 0x67,
  221.     sactionStringGreater            = 0x68,
  222.     sactionHasLength                = 0x80,
  223.     sactionGotoFrame                = 0x81, // frame num (WORD)
  224.     sactionGetURL                   = 0x83, // url (STR), window (STR)
  225.     sactionConstantPool             = 0x88, //flash5
  226.     sactionWaitForFrame             = 0x8A, // frame needed (WORD),
  227.                                             // actions to skip (BYTE)
  228.     sactionSetTarget                = 0x8B, // name (STR)
  229.     sactionGotoLabel                = 0x8C, // name (STR)
  230.     sactionWaitForFrameExpression   = 0x8D, // frame needed on stack,
  231.                                             // actions to skip (BYTE)
  232.     sactionPushData                 = 0x96,
  233.     sactionBranchAlways             = 0x99,
  234.     sactionGetURL2                  = 0x9A,
  235.     sactionBranchIfTrue             = 0x9D,
  236.     sactionCallFrame                = 0x9E,
  237.     sactionGotoExpression           = 0x9F,
  238.     sactionMyMovie     =0xaa,
  239. };
  240. typedef struct sobj_data
  241. {     int i_v;
  242.       int f_v_dec;//4.4
  243.       int f_v_int;
  244.       unsigned char *p_v;
  245.       void *b_v;
  246. }Actobj_data;
  247. typedef struct sActBase_obj
  248. {
  249.    unsigned char name[9];
  250.    unsigned char type;
  251.    Actobj_data u;
  252.    void *next;
  253. }ActBase_obj;