16 |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
17 |
//====================================================================== |
//====================================================================== |
18 |
#include "enigma.hh" |
#include "enigma.hh" |
19 |
|
#include "options.hh" |
20 |
#include "sound.hh" |
#include "sound.hh" |
21 |
#include "SDL.h" |
#include "SDL.h" |
22 |
#include "SDL_mixer.h" |
#include "SDL_mixer.h" |
23 |
#include "px/dict.hh" |
#include "px/dict.hh" |
24 |
|
#include "px/tools.hh" |
25 |
#include <string> |
#include <string> |
26 |
|
|
27 |
|
using namespace px; |
28 |
using namespace std; |
using namespace std; |
29 |
|
|
30 |
namespace |
namespace |
54 |
sound_enabled = false; |
sound_enabled = false; |
55 |
return; |
return; |
56 |
} |
} |
57 |
|
UpdateVolume(); |
58 |
sound_initialized = true; |
sound_initialized = true; |
59 |
} |
} |
60 |
|
|
61 |
|
void |
62 |
|
sound::UpdateVolume() |
63 |
|
{ |
64 |
|
int soundvol = int(options::SoundVolume * MIX_MAX_VOLUME); |
65 |
|
Mix_Volume(-1, Max(0, Min(soundvol, MIX_MAX_VOLUME))); |
66 |
|
int musicvol = int(options::MusicVolume * MIX_MAX_VOLUME); |
67 |
|
Mix_VolumeMusic(Max(0, Min(musicvol, MIX_MAX_VOLUME))); |
68 |
|
} |
69 |
|
|
70 |
void |
void |
71 |
sound::Shutdown() |
sound::Shutdown() |
72 |
{ |
{ |