Mercurial > molko
diff libmlk-core/core/music.c @ 298:196264679079
misc: remove usage of bool
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 10 Mar 2021 18:49:08 +0100 |
parents | 71b3b7036de7 |
children | d01e83210ca2 |
line wrap: on
line diff
--- a/libmlk-core/core/music.c Wed Mar 10 18:49:00 2021 +0100 +++ b/libmlk-core/core/music.c Wed Mar 10 18:49:08 2021 +0100 @@ -24,7 +24,7 @@ #include "error.h" #include "music.h" -bool +int music_open(struct music *mus, const char *path) { assert(mus); @@ -33,10 +33,10 @@ if (!(mus->handle = Mix_LoadMUS(path))) return errorf("%s", SDL_GetError()); - return true; + return 0; } -bool +int music_openmem(struct music *mus, const void *buffer, size_t buffersz) { assert(mus); @@ -45,19 +45,19 @@ SDL_RWops *ops; if (!(ops = SDL_RWFromConstMem(buffer, buffersz)) || - !(mus->handle = Mix_LoadMUS_RW(ops, true))) + !(mus->handle = Mix_LoadMUS_RW(ops, 1))) return errorf("%s", SDL_GetError()); - return true; + return 0; } -bool +int music_ok(const struct music *mus) { return mus && mus->handle; } -bool +int music_play(struct music *mus, enum music_flags flags, unsigned int fadein) { assert(mus); @@ -73,10 +73,10 @@ if (ret < 0) return errorf("%s", SDL_GetError()); - return true; + return 0; } -bool +int music_playing(void) { return Mix_PlayingMusic();