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
+16 -1
View File
@@ -1,10 +1,11 @@
#include "game.h"
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include "scaller.h"
static RenderId_t menuObjects[10];
static unsigned menuObjectsSize = 0;
static Mix_Music * music;
Scene_t gameScene;
@@ -18,6 +19,19 @@ int game_staticRender(void){
return -1;
}
music = Mix_LoadMUS("./assets/music/jojo arab.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 pp;
strcpy(pp.name, "pp");
pp.z = 10;
@@ -37,5 +51,6 @@ int game_render([[maybe_unused]] float delta){
void game_remove(void){
scene_free(&gameScene);
Mix_FreeMusic(music);
menuObjectsSize = 0;
}