This commit is contained in:
bridge
2025-12-11 00:43:00 +08:00
parent 9a16e2aa16
commit f6bd854eaf
4 changed files with 13 additions and 10 deletions

View File

@@ -123,13 +123,13 @@ async function renderMap() {
// 处理普通地块
let tex = getTileTexture(type, x, y)
// SECT 地块由 renderLargeRegions 渲染,这里跳过
if (type === 'SECT') {
// Legacy placeholder
tex = textures.value['CITY']
continue
}
if (!tex) {
tex = textures.value['PLAIN']
throw new Error(`Missing texture for tile type: ${type} at (${x}, ${y})`)
}
if (!tex) continue

View File

@@ -142,13 +142,10 @@ export function useTextures() {
const tex = await Assets.load(url)
textures.value[key] = tex
} catch (e) {
try {
const encodedUrl = `/assets/sects/${encodeURIComponent(`${sectName}_${i}`)}.png`
const tex = await Assets.load(encodedUrl)
textures.value[key] = tex
} catch (e2) {
console.warn(`Failed to load sect slice: ${key}`)
}
// 尝试 URL 编码后加载
const encodedUrl = `/assets/sects/${encodeURIComponent(`${sectName}_${i}`)}.png`
const tex = await Assets.load(encodedUrl)
textures.value[key] = tex
}
})