X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=c41fbef27494cd40806fbd4b8567f53d801da07b;hb=fba4d73f859e45839b0e32da0ad389e9145311a7;hp=ea8288e033870af9f9e2308300a5850a993b40d7;hpb=59cc2c3d3bd985cc378f9cc6bfae6c5ebdb32e78;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index ea8288e0..c41fbef2 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -273,7 +273,7 @@ void InitGfxClipRegion(boolean enabled, int x, int y, int width, int height) gfx.clip_height = height; } -void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)) +void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(boolean)) { gfx.draw_busy_anim_function = draw_busy_anim_function; } @@ -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)