Web support + compilable in mingw

This commit is contained in:
Marc
2023-01-23 01:40:29 +01:00
parent ade88dff84
commit a182c0f30a
21 changed files with 121 additions and 62 deletions
+14 -5
View File
@@ -20,21 +20,30 @@ static Mix_Music * music;
Scene_t menuScene = { NULL, 0, 0, 0, 0, 0 };
//Web asembly
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
int menu_staticRender(void){
MonitorSize_t size = renderer_getMonitorSize();
float aspectRatio = (float)size.width / size.height;
SDL_Surface* backgroundImageSurface = IMG_Load("./assets/img/menu_bg.png");
SDL_Surface* backgroundImageSurface = IMG_Load("assets/img/menu_bg.png");
if(backgroundImageSurface == NULL){
printf("cannot load background");
return -1;
printf("Could not load menu background\n");
#ifdef __EMSCRIPTEN__
emscripten_pause_main_loop();
#endif
return -1;
}
music = Mix_LoadMUS("./assets/music/menu.wav");
music = Mix_LoadMUS("assets/music/menu.ogg");
if(music == NULL) {
fprintf(stderr, "Menu music not found!\n");
fprintf(stderr, "Menu music not found!: %s\n", Mix_GetError());
exit(1);
}