Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
6fa2a5ac
Unverified
Commit
6fa2a5ac
authored
Jun 14, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 14, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39537 from Faless/js/fs_sync_iteration
Immediately run first iteration after JS FS sync.
parents
79947dfe
5c75cb01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
javascript_main.cpp
platform/javascript/javascript_main.cpp
+8
-4
No files found.
platform/javascript/javascript_main.cpp
View file @
6fa2a5ac
...
...
@@ -80,6 +80,9 @@ extern "C" EMSCRIPTEN_KEEPALIVE void main_after_fs_sync(char *p_idbfs_err) {
Main
::
start
();
os
->
get_main_loop
()
->
init
();
emscripten_resume_main_loop
();
// Immediately run the first iteration.
// We are inside an animation frame, we want to immediately draw on the newly setup canvas.
main_loop_callback
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -91,14 +94,15 @@ int main(int argc, char *argv[]) {
// Sync from persistent state into memory and then
// run the 'main_after_fs_sync' function.
/* clang-format off */
EM_ASM
(
EM_ASM
(
{
FS
.
mkdir
(
'
/
userfs
'
);
FS
.
mount
(
IDBFS
,
{},
'
/
userfs
'
);
FS
.
syncfs
(
true
,
function
(
err
)
{
ccall
(
'
main_after_fs_sync
'
,
null
,
[
'
string
'
],
[
err
?
err
.
message
:
""
])
requestAnimationFrame
(
function
()
{
ccall
(
'
main_after_fs_sync
'
,
null
,
[
'
string
'
],
[
err
?
err
.
message
:
""
]);
});
});
);
});
/* clang-format on */
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment