EVENTQ.H 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef __EVENTQ_H
  2. #define __EVENTQ_H
  3. #include <stdlib.h>
  4. #include "typedefs.h"
  5. // command types
  6. enum {
  7. kCommandOff = 0,
  8. kCommandOn = 1,
  9. kCommandState = 2,
  10. kCommandToggle = 3,
  11. kCommandNotState = 4,
  12. kCommandLink = 5,
  13. kCommandLock = 6,
  14. kCommandUnlock = 7,
  15. kCommandToggleLock = 8,
  16. kCommandCallback,
  17. kCommandRespawn,
  18. kCommandSpritePush = 16,
  19. kCommandSpriteImpact,
  20. kCommandSpritePickup,
  21. kCommandSpriteTouch,
  22. kCommandSpriteSight,
  23. kCommandSpriteProximity,
  24. kCommandSpriteExplode,
  25. kCommandSectorPush = 32,
  26. kCommandSectorImpact,
  27. kCommandSectorEnter,
  28. kCommandSectorExit,
  29. kCommandWallPush = 48,
  30. kCommandWallImpact,
  31. kCommandWallCross,
  32. kCommandNumbered = 64,
  33. };
  34. // txId constants
  35. enum {
  36. kChannelNull = 0,
  37. kChannelTextOver = 3,
  38. kChannelEndLevelA = 4,
  39. kChannelEndLevelB = 5,
  40. kChannelLightning = 6,
  41. kChannelTriggerStart = 7, // channel triggered at startup
  42. kChannelTriggerMatch = 8, // channel triggered at startup for BloodBath mode
  43. kChannelTriggerCoop = 9, // channel triggered at startup for Coop mode
  44. // REMOTE BOMBS: Channels 90-99 reserved
  45. kChannelRemoteFire1 = 90,
  46. kChannelRemoteFire2,
  47. kChannelRemoteFire3,
  48. kChannelRemoteFire4,
  49. kChannelRemoteFire5,
  50. kChannelRemoteFire6,
  51. kChannelRemoteFire7,
  52. kChannelRemoteFire8,
  53. kUserChannelStart = 100
  54. };
  55. struct EVENT {
  56. unsigned index : 13; // object array index (sprite[], sector[], wall[])
  57. unsigned type : 3; // 0=sprite, 1=sector, 2=wall
  58. unsigned to : 10; // objects with matching rxID will receive message
  59. unsigned command : 6; // kCommandOn, kCommandOff, etc.
  60. };
  61. void evInit( void );
  62. void evSend( int index, int type, int to, int command );
  63. void evPost( int index, int type, ulong time, int command = kCommandCallback );
  64. void evProcess( ulong time );
  65. #endif // __EVENTQ_H