X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=c41fbef27494cd40806fbd4b8567f53d801da07b;hb=refs%2Ftags%2F4.3.2.1;hp=f9cc4fe894708219c0f1af1e383c251c10608fab;hpb=92736512b4fedc65254597f1b3e85a885b0e6e62;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index f9cc4fe8..c41fbef2 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -906,6 +906,9 @@ void FadeRectangle(int x, int y, int width, int height, void FillRectangle(Bitmap *bitmap, int x, int y, int width, int height, Pixel color) { + if (program.headless) + return; + if (DrawingDeactivated(x, y, width, height)) return; @@ -1908,17 +1911,19 @@ void InitEmscriptenFilesystem(void) { #if defined(PLATFORM_EMSCRIPTEN) EM_ASM - ( + ({ + dir = UTF8ToString($0); + Module.sync_done = 0; - FS.mkdir('/persistent'); // create persistent data directory - FS.mount(IDBFS, {}, '/persistent'); // mount with IDBFS filesystem type + FS.mkdir(dir); // create persistent data directory + FS.mount(IDBFS, {}, dir); // mount with IDBFS filesystem type FS.syncfs(true, function(err) // sync persistent data into memory { assert(!err); Module.sync_done = 1; }); - ); + }, PERSISTENT_DIRECTORY); // wait for persistent data to be synchronized to memory while (emscripten_run_script_int("Module.sync_done") == 0)