removed unused processesseessess
This commit is contained in:
parent
348f355eb2
commit
4fdc567e08
158 changed files with 1317 additions and 3351 deletions
32
js/main.js
32
js/main.js
|
|
@ -9,7 +9,6 @@ function ensureWorldBootstrap() {
|
|||
if (typeof globalThis !== "undefined") globalThis.world = currentWorld;
|
||||
return currentWorld;
|
||||
} catch (error) {
|
||||
if (typeof window !== "undefined") window.__worldInitError = error?.stack || String(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,19 +20,10 @@ let fpsTimer = 0;
|
|||
let fpsFrames = 0;
|
||||
window.__tarinaiFps = 0;
|
||||
|
||||
const LOADING_SPRITES = [
|
||||
"assets/sprites/tarinai_01_smile.webp",
|
||||
"assets/sprites/tarinai_02_angry.webp",
|
||||
"assets/sprites/tarinai_03_teary.webp",
|
||||
"assets/sprites/tarinai_04_jito.webp",
|
||||
"assets/sprites/tarinai_05_drool.webp",
|
||||
"assets/sprites/tarinai_06_cry.webp",
|
||||
"assets/sprites/tarinai_07_sleep.webp",
|
||||
"assets/sprites/tarinai_08_pokan.webp",
|
||||
"assets/sprites/tarinai_11_weak.webp",
|
||||
"assets/sprites/tarinai_21_normal_happy.webp",
|
||||
"assets/sprites/tarinai_29_hungry_70.webp",
|
||||
];
|
||||
const LOADING_SPRITES = SPRITES
|
||||
.filter(asset => asset && !asset.actionOnly)
|
||||
.slice(0, 11)
|
||||
.map(asset => asset.path);
|
||||
let loadingSpriteTimer = 0;
|
||||
|
||||
function shuffledLoadingSprites() {
|
||||
|
|
@ -94,7 +84,7 @@ function loop() {
|
|||
const rawDt = t - last;
|
||||
const dt = clamp(rawDt, 0, 0.05);
|
||||
last = t;
|
||||
window.TarinaiPerf?.beginFrame?.();
|
||||
window.TarinaiPerf.beginFrame();
|
||||
fpsTimer += rawDt;
|
||||
fpsFrames += 1;
|
||||
if (fpsTimer >= 0.5) {
|
||||
|
|
@ -102,14 +92,14 @@ function loop() {
|
|||
fpsTimer = 0;
|
||||
fpsFrames = 0;
|
||||
}
|
||||
const endUpdate = window.TarinaiPerf?.begin?.("update.total") || null;
|
||||
const endUpdate = window.TarinaiPerf.begin("update.total");
|
||||
world.update(dt);
|
||||
if (endUpdate) endUpdate();
|
||||
const endRender = window.TarinaiPerf?.begin?.("render.total") || null;
|
||||
const endRender = window.TarinaiPerf.begin("render.total");
|
||||
render();
|
||||
if (endRender) endRender();
|
||||
window.TarinaiPerf?.endFrame?.(rawDt, window.__tarinaiFps || 0);
|
||||
if (window.TarinaiPerf?.consumeResizeRequest?.() && typeof resizeCanvas === "function") resizeCanvas();
|
||||
window.TarinaiPerf.endFrame(rawDt, window.__tarinaiFps || 0);
|
||||
if (window.TarinaiPerf.consumeResizeRequest() && typeof resizeCanvas === "function") resizeCanvas();
|
||||
statsTimer += dt;
|
||||
const statsInterval = 2.5;
|
||||
if (statsTimer > statsInterval) {
|
||||
|
|
@ -121,7 +111,7 @@ function loop() {
|
|||
|
||||
initLoadingShowcase();
|
||||
setLoadingProgress("\u521d\u671f\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u307f\u4e2d", 0.08);
|
||||
loadImages(null, (done, total) => {
|
||||
loadImages((done, total) => {
|
||||
const p = total > 0 ? done / total : 1;
|
||||
setLoadingProgress(`\u521d\u671f\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u307f\u4e2d ${done}/${total}`, 0.08 + p * 0.46);
|
||||
}).then(() => {
|
||||
|
|
@ -138,7 +128,7 @@ loadImages(null, (done, total) => {
|
|||
render();
|
||||
renderStats();
|
||||
syncTopButtons();
|
||||
if (typeof startBackgroundImageLoading === "function") startBackgroundImageLoading();
|
||||
startBackgroundImageLoading();
|
||||
setLoadingProgress("\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u59cb\u4e2d", 0.94);
|
||||
loop();
|
||||
requestAnimationFrame(hideLoadingScreen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue