-
Notifications
You must be signed in to change notification settings - Fork 4
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
0 parents
commit 1274568
Showing
166 changed files
with
4,172 additions
and
0 deletions.
There are no files selected for viewing
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,29 @@ | ||
/out/ | ||
/resources/public/js/compiled/ | ||
/target/ | ||
/*-init.clj | ||
/*.log | ||
|
||
# Leiningen | ||
/.lein-* | ||
/.nrepl-port | ||
|
||
# Node.js dependencies | ||
/node_modules/ | ||
|
||
# shadow-cljs cache, port files | ||
/.shadow-cljs/ | ||
|
||
# clj-kondo cache and configs from libs | ||
/.clj-kondo/* | ||
|
||
# clj-kondo config | ||
!/.clj-kondo/config.edn | ||
|
||
# clojure-lsp cache | ||
/.lsp/.cache | ||
|
||
.idea/ | ||
*.iml | ||
pom.xml | ||
compiled/ |
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,70 @@ | ||
var loadModules = function (modules, urlPrefix, doneCallback) { // eslint-disable-line no-unused-vars | ||
|
||
// check for wasm module support | ||
function wasmSupported() { | ||
try { | ||
if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") { | ||
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)); | ||
if (module instanceof WebAssembly.Module) | ||
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; | ||
} | ||
} catch (e) { } | ||
return false; | ||
} | ||
|
||
// load a script | ||
function loadScriptAsync(url, doneCallback) { | ||
var tag = document.createElement('script'); | ||
tag.onload = function () { | ||
doneCallback(); | ||
}; | ||
tag.onerror = function () { | ||
throw new Error('failed to load ' + url); | ||
}; | ||
tag.async = true; | ||
tag.src = url; | ||
tag.crossOrigin = 'anonymous'; | ||
document.head.appendChild(tag); | ||
} | ||
|
||
// load and initialize a wasm module | ||
function loadWasmModuleAsync(moduleName, jsUrl, binaryUrl, doneCallback) { | ||
loadScriptAsync(jsUrl, function () { | ||
var lib = window[moduleName]; | ||
window[moduleName + 'Lib'] = lib; | ||
lib({ locateFile: function () { return binaryUrl; } } ).then( function (instance) { | ||
window[moduleName] = instance; | ||
doneCallback(); | ||
}); | ||
}); | ||
} | ||
|
||
if (typeof modules === "undefined" || modules.length === 0) { | ||
// caller may depend on callback behaviour being async | ||
setTimeout(doneCallback); | ||
} else { | ||
var asyncCounter = modules.length; | ||
var asyncCallback = function () { | ||
asyncCounter--; | ||
if (asyncCounter === 0) { | ||
doneCallback(); | ||
} | ||
}; | ||
|
||
var wasm = wasmSupported(); | ||
modules.forEach(function (m) { | ||
if (!m.hasOwnProperty('preload') || m.preload) { | ||
if (wasm) { | ||
loadWasmModuleAsync(m.moduleName, urlPrefix + m.glueUrl, urlPrefix + m.wasmUrl, asyncCallback); | ||
} else { | ||
if (!m.fallbackUrl) { | ||
throw new Error('wasm not supported and no fallback supplied for module ' + m.moduleName); | ||
} | ||
loadWasmModuleAsync(m.moduleName, urlPrefix + m.fallbackUrl, "", asyncCallback); | ||
} | ||
} else { | ||
asyncCallback(); | ||
} | ||
}); | ||
} | ||
}; |
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,22 @@ | ||
ASSET_PREFIX = ""; | ||
SCRIPT_PREFIX = ""; | ||
SCENE_PATH = "1396021.json"; | ||
CONTEXT_OPTIONS = { | ||
'antialias': true, | ||
'alpha': false, | ||
'preserveDrawingBuffer': false, | ||
'preferWebGl2': true, | ||
'powerPreference': "default" | ||
}; | ||
SCRIPTS = [ 78753239, 78753240, 99767394, 108026252, 108026253, 109387017, 109391726, 109848422, 109848430, 110329954, 110757119 ]; | ||
CONFIG_FILENAME = "config.json"; | ||
INPUT_SETTINGS = { | ||
useKeyboard: true, | ||
useMouse: true, | ||
useGamepads: false, | ||
useTouch: true | ||
}; | ||
pc.script.legacy = false; | ||
PRELOAD_MODULES = [ | ||
{'moduleName' : 'Ammo', 'glueUrl' : 'files/assets/78753243/1/ammo.wasm.js', 'wasmUrl' : 'files/assets/78753249/1/ammo.wasm.wasm', 'fallbackUrl' : 'files/assets/78753251/1/ammo.js', 'preload' : true}, | ||
]; |
Oops, something went wrong.