audio looping fix

This commit is contained in:
2023-01-21 12:57:52 +01:00
parent 7af164dd20
commit f096f1c160
+4 -4
View File
@@ -16,7 +16,7 @@ Mix_Music *prout;
static void space(void) { static void space(void) {
printf("space!\n"); printf("space!\n");
if(Mix_PlayMusic(prout, -1) != 0){ if(Mix_PlayMusic(prout, 0) != 0){
printf("Music sound could not be played!\n" printf("Music sound could not be played!\n"
"SDL_Error: %s\n", Mix_GetError()); "SDL_Error: %s\n", Mix_GetError());
Mix_FreeMusic(prout); Mix_FreeMusic(prout);
@@ -40,8 +40,8 @@ static void game_main(void) {
SDL_Surface* img = IMG_Load("./assets/img/pp.png"); SDL_Surface* img = IMG_Load("./assets/img/pp.png");
RenderObject_t duck = { RenderObject_t duck = {
0.2, 0.25,
0.2, 0.25,
0, 0,
0.50, 0.50,
0.50, 0.50,
@@ -69,7 +69,7 @@ int main(void) {
running = false; running = false;
} }
prout = Mix_LoadMUS("./assets/music/pet.mp3"); prout = Mix_LoadMUS("./assets/music/jojo arab.mp3");
if(prout == NULL) { if(prout == NULL) {
fprintf(stderr, "Prout not found!\n"); fprintf(stderr, "Prout not found!\n");
exit(1); exit(1);