mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Merge pull request #12853 from nbarkhina/master
Fixed web player bug with filesystem and runtime
This commit is contained in:
commit
f2d574fd87
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
var BrowserFS = BrowserFS;
|
var BrowserFS = BrowserFS;
|
||||||
var afs;
|
var afs;
|
||||||
|
var initializationCount = 0;
|
||||||
|
|
||||||
function cleanupStorage()
|
function cleanupStorage()
|
||||||
{
|
{
|
||||||
@ -42,7 +43,7 @@ function idbfsInit()
|
|||||||
afs = new BrowserFS.FileSystem.InMemory();
|
afs = new BrowserFS.FileSystem.InMemory();
|
||||||
console.log("WEBPLAYER: error: " + e + " falling back to in-memory filesystem");
|
console.log("WEBPLAYER: error: " + e + " falling back to in-memory filesystem");
|
||||||
setupFileSystem("browser");
|
setupFileSystem("browser");
|
||||||
preLoadingComplete();
|
appInitialized();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -54,7 +55,7 @@ function idbfsInit()
|
|||||||
afs = new BrowserFS.FileSystem.InMemory();
|
afs = new BrowserFS.FileSystem.InMemory();
|
||||||
console.log("WEBPLAYER: error: " + e + " falling back to in-memory filesystem");
|
console.log("WEBPLAYER: error: " + e + " falling back to in-memory filesystem");
|
||||||
setupFileSystem("browser");
|
setupFileSystem("browser");
|
||||||
preLoadingComplete();
|
appInitialized();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -74,9 +75,20 @@ function idbfsSyncComplete()
|
|||||||
console.log("WEBPLAYER: idbfs setup successful");
|
console.log("WEBPLAYER: idbfs setup successful");
|
||||||
|
|
||||||
setupFileSystem("browser");
|
setupFileSystem("browser");
|
||||||
preLoadingComplete();
|
appInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function appInitialized()
|
||||||
|
{
|
||||||
|
/* Need to wait for both the file system and the wasm runtime
|
||||||
|
to complete before enabling the Run button. */
|
||||||
|
initializationCount++;
|
||||||
|
if (initializationCount == 2)
|
||||||
|
{
|
||||||
|
preLoadingComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function preLoadingComplete()
|
function preLoadingComplete()
|
||||||
{
|
{
|
||||||
/* Make the Preview image clickable to start RetroArch. */
|
/* Make the Preview image clickable to start RetroArch. */
|
||||||
@ -184,6 +196,10 @@ var Module =
|
|||||||
arguments: ["-v", "--menu"],
|
arguments: ["-v", "--menu"],
|
||||||
preRun: [],
|
preRun: [],
|
||||||
postRun: [],
|
postRun: [],
|
||||||
|
onRuntimeInitialized: function()
|
||||||
|
{
|
||||||
|
appInitialized();
|
||||||
|
},
|
||||||
print: function(text)
|
print: function(text)
|
||||||
{
|
{
|
||||||
console.log(text);
|
console.log(text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user