blob: 854c50fe6efdc96cb01b4a84b88e7a3f639fb445 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "TZR_sound.h"
#include "TZR_globals.h"
#include "sdl_error.h"
int
TZR_PlayMusic(const char *path, int loop)
{
if (!___tzr_config.mixer) {
TZR_Log("mixer is disabled");
return -1;
}
TZR_StopMusic();
___tzr_music = Mix_LoadMUS(path);
if (___tzr_music == NULL)
return sdl_error(-1);
if (Mix_PlayMusic(___tzr_music, loop) < 0)
return sdl_error(-1);
return 0;
}
|