aboutsummaryrefslogtreecommitdiff
path: root/src/sdl/audio.c
diff options
context:
space:
mode:
authorptitSeb2017-12-16 14:38:00 +0100
committerptitSeb2017-12-16 14:38:00 +0100
commitddd76d59cc4958abb5c42090046bf6781cf75096 (patch)
tree796082296283a5aaec052469bc7d4360184c50ce /src/sdl/audio.c
parent3638a171bda48dc9a8d264f68dd04a187a433aa6 (diff)
downloadhydracastlelabyrinth-ddd76d59cc4958abb5c42090046bf6781cf75096.tar.gz
hydracastlelabyrinth-ddd76d59cc4958abb5c42090046bf6781cf75096.tar.bz2
hydracastlelabyrinth-ddd76d59cc4958abb5c42090046bf6781cf75096.zip
Added Music Volume option
Diffstat (limited to 'src/sdl/audio.c')
-rw-r--r--src/sdl/audio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sdl/audio.c b/src/sdl/audio.c
index 8e19bf9..b66ce1e 100644
--- a/src/sdl/audio.c
+++ b/src/sdl/audio.c
@@ -1,11 +1,15 @@
#include "audio.h"
#include <SDL/SDL.h>
+int music_volume = 4;
+
void PHL_AudioInit()
{
SDL_InitSubSystem(SDL_INIT_AUDIO);
Mix_Init(0);
Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096);
+
+ PHL_MusicVolume(0.25f * music_volume);
}
void PHL_AudioClose()
@@ -35,6 +39,10 @@ PHL_Sound PHL_LoadSound(char* fname)
return Mix_LoadWAV(buff);
}
+void PHL_MusicVolume(float vol)
+{
+ Mix_VolumeMusic(SDL_MIX_MAXVOLUME*vol);
+}
void PHL_PlayMusic(PHL_Music snd)
{