SEQ.H 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef __SEQ_H
  2. #define __SEQ_H
  3. #include "helix.h"
  4. #include "typedefs.h"
  5. #include "resource.h"
  6. #define kSEQSig "SEQ\x1A"
  7. #define kSEQVersion 0x0300
  8. struct SEQFRAME
  9. {
  10. unsigned nTile : 12;
  11. unsigned translucent : 1;
  12. unsigned translucentR : 1;
  13. unsigned blocking : 1;
  14. unsigned hitscan : 1;
  15. unsigned xrepeat : 8;
  16. unsigned yrepeat : 8;
  17. signed shade : 8;
  18. unsigned pal : 5;
  19. unsigned trigger : 1; // trigger callback
  20. unsigned smoke : 1; // add smoke tsprite
  21. // unsigned shadeRelative : 1;
  22. // unsigned reserved : 16;
  23. unsigned reserved : 17;
  24. };
  25. typedef void (*SEQCALLBACK)( int type, int nXIndex );
  26. struct Seq
  27. {
  28. char signature[4];
  29. short version;
  30. short nFrames; // sequence length
  31. short ticksPerFrame; // inverted play rate
  32. short soundID;
  33. uchar flags;
  34. char pad[3];
  35. SEQFRAME frame[];
  36. void Preload( void );
  37. };
  38. // sequence flags
  39. enum {
  40. kSeqLoop = 1,
  41. kSeqRemove = 2,
  42. };
  43. void seqSpawn( int nSeqID, int type, int nXIndex, SEQCALLBACK callback = NULL );
  44. void seqKill( int type, int nXIndex );
  45. /* use this when you need to delete a sprite which has a sequence playing. */
  46. void seqKillAll( void );
  47. int seqGetStatus( int type, int nXIndex );
  48. /* find out whether a sequence is finished */
  49. void seqProcess( int nTicks );
  50. /* update all sequences */
  51. #endif