perfection

This commit is contained in:
Marc
2023-01-21 19:17:51 +01:00
parent 3a4dbbe9b8
commit 5c6b6513c3
9 changed files with 124 additions and 41 deletions
+17
View File
@@ -1,5 +1,6 @@
#include "menu.h"
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <stdio.h>
#include "renderer.h"
#include "scaller.h"
@@ -15,6 +16,7 @@ static float blinkDelta = 0;
static bool increaseTextBrightness = false;
static Uint8 textOpacity = 255;
static Mix_Music * music;
Scene_t menuScene = { NULL, 0, 0, 0, 0, 0 };
@@ -30,6 +32,19 @@ int menu_staticRender(void){
return -1;
}
music = Mix_LoadMUS("./assets/music/pet.mp3");
if(music == NULL) {
fprintf(stderr, "Prout not found!\n");
exit(1);
}
if(Mix_PlayMusic(music, 0) != 0){
printf("Music sound could not be played!\n"
"SDL_Error: %s\n", Mix_GetError());
Mix_FreeMusic(music);
running = false;
}
RenderObject_t backgroundImage;
strcpy(backgroundImage.name, "BackgroundImg");
backgroundImage.z = 0;
@@ -94,5 +109,7 @@ int menu_render(float delta){
void menu_remove(void){
//scene_free(&menuScene);
Mix_FreeMusic(music);
menuObjectsSize = 0;
}