Web support + compilable in mingw
This commit is contained in:
+14
-5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user