home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / duel / sfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-15  |  2.1 KB  |  54 lines

  1. #ifndef SFX_HEADER
  2. #define SFX_HEADER
  3. /*==========================================================================
  4.  *
  5.  *  Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  6.  *
  7.  *  File:       sfx.h
  8.  *  Content:    Routines
  9.  *
  10.  *
  11.  ***************************************************************************/
  12.  
  13. #include <dsound.h>
  14. #include "ds3dutil.h"
  15. /******************* DEFINITIONS ***************************
  16. These will be used to index the array of CSound3D objects.
  17. *********************************************************/
  18. #define BFIRE       0 //Bullet Firing
  19. #define SBOOM       1 //Ship Exploding
  20. #define SENGINE     2 //Ship Engine
  21. #define SSTART      3 //Starting Engine
  22. #define SSTOP       4 //Stopping Engine (key 5)
  23. #define SBOUNCE     5 //Bouncing off a block or window edge
  24. #define LBOOM       6 //Block destruction
  25.  
  26. #define MAX_SOUNDS  7 
  27.  
  28. /******************* DEFINITIONS FOR SHARED INFO ************/
  29. #define ENGINE_STATE 0x00000001l      // Set if Engine is running
  30.  
  31.  
  32. /**************** CONVERSION MACROS **************************
  33. These would be faster if hard-coded, but are left like this
  34. for readability.
  35. **************************************************************/
  36. #define SCREEN_METERS D3DVAL(6)         //(How many meters wide is the screen?)
  37. #define PPM    D3DVAL(640/SCREEN_METERS)  //How many pixels per meter?
  38. #define MPP    D3DVAL(SCREEN_METERS/640.f)  //How many meters per pixel?
  39. #define P2M(x) D3DVAL(D3DVAL(x) * MPP)   //converts pixels to meters
  40. #define M2P(x) D3DVAL(D3DVAL(x) * PPM)   //converts meters to pixels
  41.  
  42. /****************** FUNCTION PROTOTYPES *********************/
  43. BOOL InitSfx(void);
  44. void CleanupSfx(void);
  45. /************************ VARIABLES *************************/
  46. extern LPWAVEDATA           gSoundEffect[MAX_SOUNDS];
  47. extern BOOL                 gbSoundInitialized;
  48. extern CHAR *               gszResourceName[MAX_SOUNDS];
  49. extern LPDIRECTSOUND        glpDirectSound;
  50. extern LPDIRECTSOUND3DLISTENER   glpDirectSound3DListener;
  51. extern LPDIRECTSOUNDBUFFER  glpPrimaryBuffer;
  52.  
  53. #endif
  54.