diff -ru a/src/play.c b/src/play.c --- a/src/play.c +++ b/src/play.c @@ -13,6 +13,9 @@ #include #include +#ifdef __EMSCRIPTEN__ +#include +#endif /* __EMSCRIPTEN__ */ #ifdef USE_CURL #include @@ -5972,5 +5975,9 @@ SDL_RemoveTimer (updateTimer); PlayRelease (); /* fermeture générale */ +#ifdef __EMSCRIPTEN__ + /* FredyGames: there is no program to return to in a browser; "Quit" starts the game again. */ + emscripten_run_script ("location.reload()"); +#endif /* __EMSCRIPTEN__ */ return 0; } diff -ru a/src/smaky.c b/src/smaky.c --- a/src/smaky.c +++ b/src/smaky.c @@ -1637,9 +1637,14 @@ lang); else { +#ifdef __EMSCRIPTEN__ + /* FredyGames: the page mounts the browser storage (IndexedDB) here. */ + snprintf (filename, length, "/saves/blupimania/blupixa.dat"); +#else char * prefPath = SDL_GetPrefPath ("Epsitec SA", "Blupimania"); snprintf (filename, length, "%sblupixa.dat", prefPath); SDL_free (prefPath); +#endif /* __EMSCRIPTEN__ */ } }