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;
}
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;
SDL_PushEvent((SDL_Event *)&event);
}
+boolean PendingEscapeKeyEvent(void)
+{
+ if (PendingEvent())
+ {
+ Event event;
+
+ // check if any key press event is pending
+ if (SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN, SDL_KEYDOWN) != 1)
+ return FALSE;
+
+ // check if pressed key is "Escape" key
+ if (event.key.keysym.sym == KSYM_Escape)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
// ============================================================================
// joystick functions
{
#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)