aaa
This commit is contained in:
parent
f1c3af2b89
commit
2636d580a8
75 changed files with 3890 additions and 1084 deletions
11
js/main.js
11
js/main.js
|
|
@ -16,8 +16,6 @@ function ensureWorldBootstrap() {
|
|||
let world = ensureWorldBootstrap();
|
||||
let last = nowSec();
|
||||
let statsTimer = 0;
|
||||
let fpsTimer = 0;
|
||||
let fpsFrames = 0;
|
||||
window.__tarinaiFps = 0;
|
||||
|
||||
const LOADING_SPRITES = SPRITES
|
||||
|
|
@ -74,6 +72,7 @@ function setLoadingProgress(text = "", ratio = 0) {
|
|||
|
||||
function hideLoadingScreen() {
|
||||
if (loadingSpriteTimer) { clearInterval(loadingSpriteTimer); loadingSpriteTimer = 0; }
|
||||
document.getElementById("loadingSpriteStrip")?.replaceChildren();
|
||||
setLoadingProgress("\u8d77\u52d5\u5b8c\u4e86", 1);
|
||||
const screen = document.getElementById("loadingScreen");
|
||||
if (!screen) return;
|
||||
|
|
@ -84,14 +83,8 @@ function loop() {
|
|||
const rawDt = t - last;
|
||||
const dt = clamp(rawDt, 0, 0.05);
|
||||
last = t;
|
||||
window.TarinaiPerf.observeFrameDelta(rawDt);
|
||||
window.TarinaiPerf.beginFrame();
|
||||
fpsTimer += rawDt;
|
||||
fpsFrames += 1;
|
||||
if (fpsTimer >= 0.5) {
|
||||
window.__tarinaiFps = Math.round(fpsFrames / Math.max(fpsTimer, 0.001));
|
||||
fpsTimer = 0;
|
||||
fpsFrames = 0;
|
||||
}
|
||||
const endUpdate = window.TarinaiPerf.begin("update.total");
|
||||
world.update(dt);
|
||||
if (endUpdate) endUpdate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue