projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed crash with "autotest" due to clearing undefined bitmap rectangle
[rocksndiamonds.git]
/
src
/
libgame
/
system.c
diff --git
a/src/libgame/system.c
b/src/libgame/system.c
index ea8288e033870af9f9e2308300a5850a993b40d7..c41fbef27494cd40806fbd4b8567f53d801da07b 100644
(file)
--- 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;
}
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;
}
{
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)
{
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;
if (DrawingDeactivated(x, y, width, height))
return;
@@
-1908,17
+1911,19
@@
void InitEmscriptenFilesystem(void)
{
#if defined(PLATFORM_EMSCRIPTEN)
EM_ASM
{
#if defined(PLATFORM_EMSCRIPTEN)
EM_ASM
- (
+ ({
+ dir = UTF8ToString($0);
+
Module.sync_done = 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;
});
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)
// wait for persistent data to be synchronized to memory
while (emscripten_run_script_int("Module.sync_done") == 0)