Add shell

This commit is contained in:
Varun Patil 2020-05-04 22:38:59 +05:30
parent 920168abe0
commit b7c8011c52
4 changed files with 116 additions and 1 deletions

View file

@ -197,6 +197,7 @@ void Config::read(int argc, char *argv[])
defScreenW = 640;
defScreenH = 480;
enableBlitting = false;
winResizable = false;
#undef PO_DESC
#undef PO_DESC_ALL

View file

@ -4,6 +4,7 @@
EM_JS(void, load_file_async_js, (const char* fullPathC), {
Asyncify.handleSleep(function(wakeUp) {
// Get argument
const fullPath = UTF8ToString(fullPathC);
// Make cache object
@ -12,6 +13,9 @@ EM_JS(void, load_file_async_js, (const char* fullPathC), {
// Check if already loaded
if (window.fileAsyncCache.hasOwnProperty(fullPath)) return wakeUp();
// Show spinner
if (window.setBusy) window.setBusy();
// Get full destination
const file = "game/" + fullPath;
@ -28,6 +32,7 @@ EM_JS(void, load_file_async_js, (const char* fullPathC), {
// Get the new file
FS.createPreloadedFile(path, filename, iurl, true, true, function() {
window.fileAsyncCache[fullPath] = 1;
if (window.setNotBusy) window.setNotBusy();
wakeUp();
}, console.error);
});