aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpingflood2020-01-15 17:29:37 -0300
committerpingflood2020-01-15 17:29:37 -0300
commit9576851f5037ab047f2c73722e182665794d116a (patch)
tree9254e2ee20cc3b25f9495505233f82f90dae3b08 /src
parent73069f59b284c9c7ad6218f848e1dbc6f6a7b1a8 (diff)
downloadhydracastlelabyrinth-9576851f5037ab047f2c73722e182665794d116a.tar.gz
hydracastlelabyrinth-9576851f5037ab047f2c73722e182665794d116a.tar.bz2
hydracastlelabyrinth-9576851f5037ab047f2c73722e182665794d116a.zip
Fix ogg player
Diffstat (limited to 'src')
-rw-r--r--src/sdl/audio.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/sdl/audio.c b/src/sdl/audio.c
index 20b036d..ec09050 100644
--- a/src/sdl/audio.c
+++ b/src/sdl/audio.c
@@ -7,9 +7,7 @@ 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);
+ Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 1024);
}
void PHL_AudioClose()
@@ -24,9 +22,7 @@ PHL_Music PHL_LoadMusic(char* fname, int loop)
PHL_Music ret;
ret.loop = loop;
char buff[4096];
- strcpy(buff, "data/");
- strcat(buff, fname);
- strcat(buff, ".ogg");
+ sprintf(buff, "data/%s.ogg", fname);
ret.snd = Mix_LoadMUS(buff);
return ret;
}
@@ -34,8 +30,7 @@ PHL_Music PHL_LoadMusic(char* fname, int loop)
PHL_Sound PHL_LoadSound(char* fname)
{
char buff[4096];
- strcpy(buff, "data/");
- strcat(buff, fname);
+ sprintf(buff, "data/%s", fname);
return Mix_LoadWAV(buff);
}
@@ -47,7 +42,7 @@ void PHL_MusicVolume(float vol)
void PHL_PlayMusic(PHL_Music snd)
{
if(snd.snd)
- Mix_PlayMusic(snd.snd, snd.loop?-1:0);
+ Mix_PlayMusic(snd.snd, snd.loop ? -1 : 0);
}
void PHL_PlaySound(PHL_Sound snd, int channel)