-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
326 changed files
with
3,326 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
pc.script.createLoadingScreen(function (app) { | ||
var showSplash = function () { | ||
// splash wrapper | ||
var wrapper = document.createElement('div'); | ||
wrapper.id = 'application-splash-wrapper'; | ||
document.body.appendChild(wrapper); | ||
|
||
// splash | ||
var splash = document.createElement('div'); | ||
splash.id = 'application-splash'; | ||
wrapper.appendChild(splash); | ||
splash.style.display = 'none'; | ||
|
||
var logo = document.createElement('img'); | ||
logo.src = ASSET_PREFIX + 'logo.png'; | ||
splash.appendChild(logo); | ||
logo.onload = function () { | ||
splash.style.display = 'block'; | ||
}; | ||
|
||
var container = document.createElement('div'); | ||
container.id = 'progress-bar-container'; | ||
splash.appendChild(container); | ||
|
||
var bar = document.createElement('div'); | ||
bar.id = 'progress-bar'; | ||
container.appendChild(bar); | ||
|
||
}; | ||
|
||
var hideSplash = function () { | ||
var splash = document.getElementById('application-splash-wrapper'); | ||
splash.parentElement.removeChild(splash); | ||
}; | ||
|
||
var setProgress = function (value) { | ||
var bar = document.getElementById('progress-bar'); | ||
if (bar) { | ||
value = Math.min(1, Math.max(0, value)); | ||
bar.style.width = value * 100 + '%'; | ||
} | ||
}; | ||
|
||
var createCss = function () { | ||
var css = [ | ||
'body {', | ||
' background-color: #283538;', | ||
'}', | ||
|
||
'#application-splash-wrapper {', | ||
' position: absolute;', | ||
' top: 0;', | ||
' left: 0;', | ||
' height: 100%;', | ||
' width: 100%;', | ||
' background-color: #283538;', | ||
'}', | ||
|
||
'#application-splash {', | ||
' position: absolute;', | ||
' top: calc(50% - 28px);', | ||
' width: 264px;', | ||
' left: calc(50% - 132px);', | ||
'}', | ||
|
||
'#application-splash img {', | ||
' width: 100%;', | ||
'}', | ||
|
||
'#progress-bar-container {', | ||
' margin: 20px auto 0 auto;', | ||
' height: 2px;', | ||
' width: 100%;', | ||
' background-color: #1d292c;', | ||
'}', | ||
|
||
'#progress-bar {', | ||
' width: 0%;', | ||
' height: 100%;', | ||
' background-color: #f60;', | ||
'}', | ||
'@media (max-width: 480px) {', | ||
' #application-splash {', | ||
' width: 170px;', | ||
' left: calc(50% - 85px);', | ||
' }', | ||
'}' | ||
|
||
].join('\n'); | ||
|
||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
|
||
document.head.appendChild(style); | ||
}; | ||
|
||
|
||
createCss(); | ||
|
||
showSplash(); | ||
|
||
app.on('preload:end', function () { | ||
app.off('preload:progress'); | ||
}); | ||
app.on('preload:progress', setProgress); | ||
app.on('start', hideSplash); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var loadModules = function (modules, urlPrefix, doneCallback) { // eslint-disable-line no-unused-vars | ||
|
||
if (typeof modules === "undefined" || modules.length === 0) { | ||
// caller may depend on callback behaviour being async | ||
setTimeout(doneCallback); | ||
} else { | ||
let remaining = modules.length; | ||
const moduleLoaded = () => { | ||
if (--remaining === 0) { | ||
doneCallback(); | ||
} | ||
}; | ||
|
||
modules.forEach(function (m) { | ||
pc.WasmModule.setConfig(m.moduleName, { | ||
glueUrl: urlPrefix + m.glueUrl, | ||
wasmUrl: urlPrefix + m.wasmUrl, | ||
fallbackUrl: urlPrefix + m.fallbackUrl | ||
}); | ||
|
||
if (!m.hasOwnProperty('preload') || m.preload) { | ||
if (m.moduleName === 'BASIS') { | ||
// preload basis transcoder | ||
pc.basisInitialize(); | ||
moduleLoaded(); | ||
} else if (m.moduleName === 'DracoDecoderModule') { | ||
// preload draco decoder | ||
if (pc.dracoInitialize) { | ||
// 1.63 onwards | ||
pc.dracoInitialize(); | ||
moduleLoaded(); | ||
} else { | ||
// 1.62 and earlier | ||
pc.WasmModule.getInstance(m.moduleName, () => { moduleLoaded(); }); | ||
} | ||
} else { | ||
// load remaining modules in global scope | ||
pc.WasmModule.getInstance(m.moduleName, () => { moduleLoaded(); }); | ||
} | ||
} else { | ||
moduleLoaded(); | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
window.ASSET_PREFIX = ""; | ||
window.SCRIPT_PREFIX = ""; | ||
window.SCENE_PATH = "1952292.json"; | ||
window.CONTEXT_OPTIONS = { | ||
'antialias': true, | ||
'alpha': true, | ||
'preserveDrawingBuffer': false, | ||
'preferWebGl2': true, | ||
'powerPreference': "high-performance" | ||
}; | ||
window.SCRIPTS = [ 167671208, 167671178, 167671192, 167671176, 167671185, 167671207, 167671190, 167671260, 167671187, 167671193, 167671156, 167671143, 167671157, 167677899, 167679806, 167680803, 167681607 ]; | ||
window.CONFIG_FILENAME = "config.json"; | ||
window.INPUT_SETTINGS = { | ||
useKeyboard: true, | ||
useMouse: true, | ||
useGamepads: false, | ||
useTouch: true | ||
}; | ||
pc.script.legacy = false; | ||
window.PRELOAD_MODULES = [ | ||
{'moduleName' : 'Ammo', 'glueUrl' : 'files/assets/167671205/1/ammo.wasm.js', 'wasmUrl' : 'files/assets/167671189/1/ammo.wasm.wasm', 'fallbackUrl' : 'files/assets/167671182/1/ammo.js', 'preload' : true}, | ||
{'moduleName' : 'BASIS', 'glueUrl' : 'files/assets/167671206/1/basis.wasm.js', 'wasmUrl' : 'files/assets/167671184/1/basis.wasm.wasm', 'fallbackUrl' : 'files/assets/167671181/1/basis.js', 'preload' : false}, | ||
]; |
Oops, something went wrong.