mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 22:25:23 +00:00
refactored loadTerrainMap to reuse the existing canUseSharedBuffers
This commit is contained in:
@@ -58,11 +58,7 @@ export async function loadTerrainMap(
|
||||
|
||||
const stateBuffer =
|
||||
sharedStateBuffer ??
|
||||
(typeof SharedArrayBuffer !== "undefined" &&
|
||||
typeof Atomics !== "undefined" &&
|
||||
// crossOriginIsolated is only defined in browser contexts
|
||||
typeof (globalThis as any).crossOriginIsolated === "boolean" &&
|
||||
(globalThis as any).crossOriginIsolated === true
|
||||
(canUseSharedBuffers
|
||||
? new SharedArrayBuffer(
|
||||
manifest.map.width *
|
||||
manifest.map.height *
|
||||
|
||||
Reference in New Issue
Block a user