mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
merge main f13c60c into feat/voice-outlines
reconcile voice outlines with main f13c60c, retaining German/Japanese,
Operator HUD retirement and Context/Radio cleanup, named-building
containment, courtyard-hole, non-Latin identity, attribution, cancellation
and antimeridian repairs
keep outline callouts above the open voice preview when an above-panel
slot fits without colliding with another callout,
and clip the compact dock location label on narrow screens
This commit is contained in:
commit
578ebdc030
449 files changed
+30400
-3429
No files matched your search
@@ -295,21 +295,8 @@ function decodeSharedOpenFreeMapTile(bytes, z, x, y) {
|
||||
let baseBytes = 0;
|
||||
let projectionBytes = 0;
|
||||
let resizeCacheEntry = null;
|
||||
let cacheBound = false;
|
||||
const idleCallbacks = new Map();
|
||||
|
||||
const cancelIdleProjection = (name) => {
|
||||
if (!idleCallbacks.has(name)) return;
|
||||
const handle = idleCallbacks.get(name);
|
||||
idleCallbacks.delete(name);
|
||||
globalThis.cancelIdleCallback?.(handle);
|
||||
};
|
||||
const cancelIdleProjections = () => {
|
||||
for (const name of [...idleCallbacks.keys()]) cancelIdleProjection(name);
|
||||
};
|
||||
const project = (name) => {
|
||||
if (projections.has(name)) return projections.get(name);
|
||||
cancelIdleProjection(name);
|
||||
const projector = TILE_PROJECTIONS.get(name);
|
||||
if (!projector)
|
||||
throw new Error(`Unknown OpenFreeMap tile projection: ${name}`);
|
||||
@@ -320,45 +307,16 @@ function decodeSharedOpenFreeMapTile(bytes, z, x, y) {
|
||||
resizeCacheEntry?.(baseBytes + projectionBytes);
|
||||
return value;
|
||||
};
|
||||
const scheduleIdleProjections = () => {
|
||||
if (
|
||||
!cacheBound ||
|
||||
typeof globalThis.requestIdleCallback !== 'function' ||
|
||||
typeof globalThis.cancelIdleCallback !== 'function'
|
||||
)
|
||||
return;
|
||||
for (const name of TILE_PROJECTIONS.keys())
|
||||
if (!projections.has(name) && !idleCallbacks.has(name)) {
|
||||
const handle = globalThis.requestIdleCallback(
|
||||
() => {
|
||||
if (!cacheBound || idleCallbacks.get(name) !== handle) return;
|
||||
idleCallbacks.delete(name);
|
||||
try {
|
||||
project(name);
|
||||
} catch {
|
||||
// The explicit consumer path retries and reports projection errors.
|
||||
}
|
||||
},
|
||||
{ timeout: 1000 },
|
||||
);
|
||||
idleCallbacks.set(name, handle);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
...base,
|
||||
project,
|
||||
bindSharedCacheEntry(resize, initialBytes) {
|
||||
cancelIdleProjections();
|
||||
resizeCacheEntry = resize;
|
||||
baseBytes = initialBytes;
|
||||
cacheBound = true;
|
||||
resizeCacheEntry(baseBytes + projectionBytes);
|
||||
scheduleIdleProjections();
|
||||
},
|
||||
releaseSharedCacheEntry() {
|
||||
cacheBound = false;
|
||||
cancelIdleProjections();
|
||||
projections.clear();
|
||||
baseBytes = 0;
|
||||
projectionBytes = 0;
|
||||
|
||||
Reference in new issue
Block a user