00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _SOUND_
00010 #define _SOUND_
00011
00012
00013 #ifdef _MSC_VER // if the compiler is from Microsoft
00014 #pragma warning(disable:4786)
00015 #endif
00016
00017 #include "world.h"
00018 #include <SDL.h>
00019 #include <SDL_mixer.h>
00020
00021
00022 using namespace std;
00023 enum Sounds {BEEP, FOOTSTEP, NCHUNKS};
00024 class Sound {
00025 public:
00031 Sound();
00032
00037 ~Sound();
00038
00043 void playWorld(World & world);
00044
00050 void playSound(int soundIdentifier);
00051
00055 void playMusic();
00056
00057
00062 void loadData();
00063
00064 private:
00065 int audio_rate;
00066 Uint16 audio_format;
00067 int audio_channels;
00068 int sound_effects;
00069 int audio_buffers;
00070 bool sound_on;
00071
00075 Mix_Music *music;
00076 Mix_Chunk *chunk2;
00077 Mix_Chunk *chunk;
00078
00079 };
00080
00081 #endif
00082
00083