add assets

This commit is contained in:
2023-01-21 10:39:19 +01:00
parent 81508bf712
commit 8a93d29021
4 changed files with 6 additions and 3 deletions
+3
View File
@@ -33,3 +33,6 @@ target_link_libraries(FLOPPE_FION SDL2 SDL2_image SDL2_ttf SDL2_mixer pthread m)
set_property(TARGET FLOPPE_FION PROPERTY C_STANDARD 23) set_property(TARGET FLOPPE_FION PROPERTY C_STANDARD 23)
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

+3 -3
View File
@@ -14,7 +14,7 @@ int main(void) {
return 0; return 0;
} }
Mix_Music *music = Mix_LoadMUS("../assets/music/test.mp3"); Mix_Music *music = Mix_LoadMUS("./assets/music/pet.mp3");
if(Mix_PlayMusic(music, -1) != 0){ if(Mix_PlayMusic(music, -1) != 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());
@@ -25,12 +25,12 @@ int main(void) {
RenderObject_t text; RenderObject_t text;
SDL_Color white = {255, 255, 255, 255}; SDL_Color white = {255, 255, 255, 255};
TTF_Init(); TTF_Init();
if(text_renderText(&text, 0.f, 0.f, 1000, 1, white, "/usr/share/fonts/TTF/arial.ttf", 25, "Hello World") < 0){ if(text_renderText(&text, 0.f, 0.f, 1000, 1, white, "./assets/fonts/arial.ttf", 25, "Hello World") < 0){
printf("error"); printf("error");
exit(1); exit(1);
} }
SDL_Surface* img = IMG_Load("pp.png"); SDL_Surface* img = IMG_Load("./assets/img/pp.png");
RenderObject_t duck = { RenderObject_t duck = {
0.2, 0.2,