00001 00025 #include "bool.h" 00026 00027 #ifdef WIN32 00028 #undef PlaySound 00029 #define PlaySound _PlaySound_tank_ 00030 #endif 00031 00055 enum SND_SOUND { 00059 SND_IDLE, 00063 SND_MOVE, 00067 SND_SHOOT, 00071 SND_DEATH, 00072 SND_MAX 00073 }; 00074 00078 enum SND_CHANNEL { 00082 SND_CH_LOCALSHOOT, 00090 SND_CH_TANK, 00094 SND_CH_RESERVE, 00100 SND_CH_MAX = 8 00101 }; 00102 00107 #define MAX_SQ_DIST (27500<<2) // 178374 00108 00116 Bool InitAudio(); 00117 00130 Bool PlaySound(int snd, int chan, int count); 00131 00149 Bool PlaySoundDist(int snd, int chan, int distsq, int count); 00150 00158 #define PlayTankMove(distsq) PlaySoundDist(SND_MOVE, SND_CH_TANK, distsq, -1) 00159 00165 #define PlayLocalTankMove() PlaySound(SND_MOVE, SND_CH_TANK, -1) 00166 00172 #define PlayTankIdle() PlaySound(SND_IDLE, SND_CH_TANK, -1) 00173 00181 #define PlayTankShoot(distsq) PlaySoundDist(SND_SHOOT, -1, distsq, 0) 00182 00191 #define PlayTankKilled(distsq) PlaySoundDist(SND_DEATH, -1, distsq, 0) 00192 00200 #define DistSq(p1, p2) \ 00201 ((int)(((p1)->x - (p2)->x) >> 8) * (int)(((p1)->x - (p2)->x) >> 8) + \ 00202 (int)(((p1)->y - (p2)->y) >> 8) * (int)(((p1)->y - (p2)->y) >> 8)) 00203 00212 Bool PlayLocalDeath(); 00213 00219 void PauseSound(int chan); 00220 00225 void StopAllSounds(); 00226 00231 void UninitAudio(); 00232