projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
code cleanup
[rocksndiamonds.git]
/
src
/
libgame
/
system.c
diff --git
a/src/libgame/system.c
b/src/libgame/system.c
index f9cc4fe894708219c0f1af1e383c251c10608fab..83bbe67a6c04aab4f81805b3f7fb809619eded40 100644
(file)
--- a/
src/libgame/system.c
+++ b/
src/libgame/system.c
@@
-567,14
+567,14
@@
void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
video.window_scaling_available = WINDOW_SCALING_STATUS;
video.frame_counter = 0;
video.window_scaling_available = WINDOW_SCALING_STATUS;
video.frame_counter = 0;
- video.frame_delay = 0;
- video.frame_delay
_
value = GAME_FRAME_DELAY;
+ video.frame_delay
.count
= 0;
+ video.frame_delay
.
value = GAME_FRAME_DELAY;
video.shifted_up = FALSE;
video.shifted_up_pos = 0;
video.shifted_up_pos_last = 0;
video.shifted_up = FALSE;
video.shifted_up_pos = 0;
video.shifted_up_pos_last = 0;
- video.shifted_up_delay = 0;
- video.shifted_up_delay
_
value = ONE_SECOND_DELAY / 4;
+ video.shifted_up_delay
.count
= 0;
+ video.shifted_up_delay
.
value = ONE_SECOND_DELAY / 4;
SDLInitVideoBuffer(fullscreen);
SDLInitVideoBuffer(fullscreen);
@@
-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;
@@
-1109,12
+1112,12
@@
boolean SetVideoMode(boolean fullscreen)
void SetVideoFrameDelay(unsigned int frame_delay_value)
{
void SetVideoFrameDelay(unsigned int frame_delay_value)
{
- video.frame_delay
_
value = frame_delay_value;
+ video.frame_delay
.
value = frame_delay_value;
}
unsigned int GetVideoFrameDelay(void)
{
}
unsigned int GetVideoFrameDelay(void)
{
- return video.frame_delay
_
value;
+ return video.frame_delay
.
value;
}
boolean ChangeVideoModeIfNeeded(boolean fullscreen)
}
boolean ChangeVideoModeIfNeeded(boolean fullscreen)
@@
-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)