home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / toolkit / mm / beehive / beehive.h < prev    next >
Text File  |  1996-11-19  |  6KB  |  179 lines

  1.  
  2. //   Menu items definitions
  3. //
  4. #define ID_MAINWND      256
  5. #define ID_OPTIONS      257
  6. #define ID_EXIT         258
  7. #define ID_START        259
  8. #define ID_NEWTEXT      260
  9. #define ID_DIRECT       261
  10. #define ID_FULLSCRN     262
  11. #define ID_NORMAL       263
  12. #define ID_COMPILED     264
  13. #define ID_TIMER        1
  14.  
  15. // Misc defs.
  16. //
  17. #define SAVED_REGS         6
  18.  
  19. #define  STRING_LENGTH  128
  20. #define  MAX_SOUNDS     4
  21. #define  BUFFER_NUMBER  100
  22. #define  BUFFER_SIZE    512
  23.  
  24. #define  MONO           1
  25. #define  STEREO         2
  26. #define  LOW_QUALITY    8
  27. #define  HIGH_QUALITY   16
  28. #define  VOICE          11025
  29. #define  MUSIC          22050
  30. #define  HIGH_FI        44100
  31.  
  32. // Full screen dive definitions
  33. //
  34. #define  WS_DesktopDive    0x00000000L   // Desktop dive window style
  35. #define  WS_MaxDesktopDive 0x00000001L   // Maximized desktop dive window style
  36. #define  WS_FullScreenDive 0x00000002L   // Full-screen 320x200x256 dive style
  37.  
  38. #define  WM_SetVideoMode            0x04A0
  39. #define  WM_NotifyVideoModeChange   0x04A1
  40. #define  WM_GetVideoModeTable       0x04A2
  41.  
  42. // For using with DosAllocMem
  43. //
  44. #define MY_ALLOC_FLAGS     PAG_COMMIT | PAG_EXECUTE | PAG_READ | PAG_WRITE
  45.  
  46.  
  47. // New data types
  48. //
  49. typedef  PBYTE    *PPBYTE;
  50.  
  51. //   Bitmap data structure
  52. //
  53. typedef struct _BMPDATA
  54. {
  55.    ULONG    ulImage;                // Dive image buffer number
  56.    PBYTE    pbBuffer;               // Pointer to image buffer
  57.    ULONG    ulWidth;                // Bitmap Width in pels
  58.    ULONG    ulHeight;               // Bitmap Height in pels
  59.  
  60.    // Each bitmap will have its own custom blitter
  61.    //
  62.    VOID  ( *  _System pfnBlit )( PBYTE pSourceBuffer,
  63.                                  PBYTE pDestinationBuffer,
  64.                                  ULONG ulPositionX,
  65.                                  ULONG ulPositionY );
  66. } BMPDATA, *PBMPDATA;
  67.  
  68. // This structure is used to build a linked list that tracks the location
  69. // and attitude of each sprite in the scene.
  70. //
  71. typedef struct _SPRITEDATA
  72. {
  73.    PBMPDATA pbmp;                   // Pointer to current image data
  74.    ULONG    ulPositionX;            // Sprite position in scene
  75.    ULONG    ulPositionY;            // Sprite position in scene
  76.    LONG     lDeltaX;                // Horizontal velocity
  77.    LONG     lDeltaY;                // Vertical velocity
  78.    ULONG    ulState;                // Current state of sprite
  79.    struct _SPRITEDATA *pNextSprite; // next sprite in the list
  80. } SPRITEDATA, * PSPRITEDATA;
  81.  
  82.  
  83. // Every PCX file has a header that can must be interpreted in order
  84. // to decode the image stored in the file. This structure is designed
  85. // to mirror the header of a typical PCX file. The size of this structure
  86. // can be used with "sizeof" to load the entire header into the structure
  87. // with a single fread.
  88. //
  89. typedef struct _PCX_HEADER
  90. {
  91.    CHAR     chManufacturer;         // Always 10
  92.    CHAR     chVersion;              // 0 - Ver 2.5 Paintbrush
  93.                                     // 2 - Ver 2.8 with palette
  94.                                     // 3 - Ver 2.8 use default palette
  95.                                     // 5 - Ver 3.0 or better of paintbrush
  96.    CHAR     encoding;               // Always 1 meaning RLE encoding
  97.    CHAR     chBitsPerPel;
  98.    SHORT    shX;                    // -
  99.    SHORT    shY;                    // Upper left corner of image
  100.    SHORT    shWidth;
  101.    SHORT    shHeight;
  102.    SHORT    shHorzRez;              // Number of pixels in the x direction
  103.    SHORT    shVertRez;              // Number of pixels in the y direction
  104.    CHAR     chEgaPalette[48];       // Ignore
  105.    CHAR     chReserved;
  106.    CHAR     chNumColorPlanes;
  107.    SHORT    shBytesPerLine;
  108.    SHORT    shPaletteType;
  109.    CHAR     chPadding[58];          // Unused
  110.  
  111. } PCX_HEADER, * PPCX_HEADER;
  112.  
  113.  
  114. // The LoadSound prcedure returns a structure of this type. This structure
  115. // contains all of the audio data for the file as well as a description of
  116. // the type of audio data.
  117. //
  118. typedef struct _SOUND
  119. {
  120.    PBYTE    pData;               // Pointer to audio data
  121.    ULONG    ulDataSize;          // Size of audio data
  122.    ULONG    ulFormatTag;
  123.    ULONG    ulSamplesPerSec;
  124.    ULONG    ulBitsPerSample;
  125.    ULONG    ulChannels;
  126. } SOUND, *PSOUND;
  127.  
  128.  
  129.  
  130. // Procedure prototypes.
  131. //
  132.  
  133. // This procedure is exported by the BLITGEN module. It compiles a sprite
  134. // and provides a pointer to the new code.
  135. //
  136. ULONG GenBlitSprite( PPVOID ppfnCode,  // Pointer to generated code pointer
  137.                      PBYTE pbSource,   // Pointer to sprite color data
  138.                      ULONG ulSizeX,    // Width of sprite
  139.                      ULONG ulSizeY,    // Height of sprite
  140.                      ULONG ulTargetWidth,   // Width of target video buffer
  141.                      ULONG ulTransparentColor );
  142.  
  143. // The encoding methode for PCX files is not yet supported by the
  144. // base operating system. This procedure will decode a PCX file and
  145. // fill a BMPDATA structure with the image information.
  146. //
  147. ULONG ReadFile ( PSZ pszFile, PBMPDATA pbmpData );
  148.  
  149. // Each PCX file has it's own pallete. This procedure will extract the
  150. // palette information from the passed file. The palette is stored in
  151. // an RGB. 4 bytes per color format.
  152. //
  153. ULONG ExtractPalette( PSZ pszFile, PBYTE pbPalette );
  154.  
  155. // This procedure will take the passed image data and map the colors
  156. // to the system palette.
  157. //
  158. ULONG  ConvertImage( PBMPDATA pbmpData, PBYTE pbPalette );
  159.  
  160.  
  161.  
  162. PSOUND LoadSound( CHAR szFileName[] );
  163.  
  164. VOID FreeSound( PSOUND pSound );
  165.  
  166. VOID CloseMixer( VOID );
  167.  
  168. BOOL SetupMixer( VOID );
  169.  
  170. VOID QueueSound( PSOUND pSound );
  171.  
  172. VOID  QueueContinuousSound( PSOUND pSound );
  173.  
  174. VOID DequeueContinuousSound( VOID );
  175.  
  176.  
  177.  
  178.  
  179.