Changes for thread based player.

This commit is contained in:
Jean-Philip Desjardins 2021-10-21 13:16:02 -04:00
parent 231ffb8059
commit 82800241aa
6 changed files with 111 additions and 9 deletions

View file

@ -12,7 +12,7 @@ let updateTimer : any;
let updateFct = async function() {
let releaseLock = await tickMutex.acquire();
await tickPsf();
// await tickPsf();
updateTimer = setTimeout(updateFct, updateDelay);
releaseLock();
};

View file

@ -6,7 +6,8 @@ let module_overrides = {
locateFile: function(path : string) {
const baseURL = window.location.origin + window.location.pathname.substring(0, window.location.pathname.lastIndexOf( "/" ));
return baseURL + '/' + path;
}
},
mainScriptUrlOrBlob: "",
};
function convertStringVectorToArray(strVector : any) {
@ -33,9 +34,10 @@ function convertStringMapToDictionary(strMap : any) {
}
export let initPsfPlayerModule = async function() {
module_overrides.mainScriptUrlOrBlob = module_overrides.locateFile('PsfPlayer.js');
PsfPlayerModule = await PsfPlayer(module_overrides);
PsfPlayerModule.FS.mkdir("/work");
await PsfPlayerModule.ccall("initVm", "", [], [], { async: true });
PsfPlayerModule.ccall("initVm", "", [], []);
};
export let getPsfArchiveFileList = function(archivePath : string) {