Commit 07f65184 by Rémi Verschelde Committed by GitHub

Merge pull request #7519 from eska014/web-presentation

Improve Web export presentation
parents fe8459ac 1f7d4c4d
......@@ -22,6 +22,7 @@ env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_fu
env.Append(LINKFLAGS=["--shell-file", '"platform/javascript/godot_shell.html"'])
build = env.Program('#bin/godot', javascript_objects, PROGSUFFIX=env["PROGSUFFIX"] + ".html")
Depends(build, "godot_shell.html")
def make_html_shell(target, source, env):
html_path = target[0].rstr()
......
......@@ -81,7 +81,6 @@ def configure(env):
env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
env.Append(CPPFLAGS=['-DGLES2_ENABLED'])
env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS'])
env.Append(CPPFLAGS=['-s', 'FULL_ES2=1'])
# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])
if env['wasm'] == 'yes':
......
......@@ -377,7 +377,7 @@ EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
logo->create_from_image(img);
max_memory=3;
html_title="";
html_font_family="arial,sans-serif";
html_font_family="'Droid Sans',arial,sans-serif";
html_controls_enabled=true;
pack_mode=PACK_SINGLE_FILE;
}
......
......@@ -140,10 +140,9 @@ static void _godot_draw(void) {
extern "C" {
void main_after_fs_sync(int value) {
void main_after_fs_sync() {
start_step=1;
printf("FS SYNCHED!\n");
}
}
......@@ -178,26 +177,25 @@ int main(int argc, char *argv[]) {
glutDisplayFunc(_godot_draw);
//glutSpecialFunc(gears_special);
//mount persistent filesystem
EM_ASM(
FS.mkdir('/userfs');
FS.mount(IDBFS, {}, '/userfs');
// sync from persisted state into memory and then
// run the 'test' function
FS.syncfs(true, function (err) {
assert(!err);
console.log("done syncinc!");
_after_sync_cb = Module.cwrap('main_after_fs_sync', 'void',['number']);
_after_sync_cb(0);
});
);
//mount persistent file system
EM_ASM(
FS.mkdir('/userfs');
FS.mount(IDBFS, {}, '/userfs');
// sync from persistent state into memory and then
// run the 'main_after_fs_sync' function
FS.syncfs(true, function(err) {
if (err) {
Module.setStatus('Failed to load persistent data\nPlease allow (third-party) cookies');
Module.printErr('Failed to populate IDB file system: ' + err.message);
Module.exit();
} else {
Module.print('Successfully populated IDB file system');
ccall('main_after_fs_sync', 'void', []);
}
});
);
glutMainLoop();
......
......@@ -502,18 +502,12 @@ bool OS_JavaScript::main_loop_iterate() {
time_to_save_sync-=elapsed;
print_line("elapsed "+itos(elapsed)+" tts "+itos(time_to_save_sync));
if (time_to_save_sync<0) {
//time to sync, for real
// run 'success'
print_line("DOING SYNCH!");
EM_ASM(
FS.syncfs(function (err) {
assert(!err);
console.log("Synched!");
//ccall('success', 'v');
});
FS.syncfs(function(err) {
if (err) { Module.printErr('Failed to save IDB file system: ' + err.message); }
});
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment