lecodes-sdk 2.4.9 → 2.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "marcidb-embedded": "^0.15.0",
44
44
  "sharp": "^0.35.2"
45
45
  },
46
- "version": "2.4.9",
46
+ "version": "2.4.10",
47
47
  "files": [
48
48
  "src",
49
49
  "dist",
@@ -437,6 +437,15 @@ export class Lightmap {
437
437
  static async load(scene: Scene, def: LightmapDef): Promise<LightmapInfo | null> {
438
438
  Lightmap.scene = scene
439
439
  const bake = bakeConfig()
440
+ // a def built by hand the old way — `{ data, light: asset('…-light.ktx2'), aux }`: the pages are LISTS and `path` the
441
+ // bake's target (only the bake needs it), both of them bake()'s; without this a string page fails as "not a function"
442
+ // on its .map, a missing path on its .lastIndexOf
443
+ if (!Array.isArray(def.light) || !Array.isArray(def.aux) || (bake && typeof def.path !== "string")) {
444
+ const msg = `${String(def.path ?? def.data)} is not what bake() compiles to — pass \`bake('<path>.bake')\`: it reads every page off the manifest`
445
+ if (bake) console.error(`[lightmap] error: ${msg}`)
446
+ else console.warn(`Lightmap: ${msg}; rendering without the bake`)
447
+ return null
448
+ }
440
449
  if (bake) { Lightmap.bake(bake, def); return null }
441
450
  if (!_creator.lightmapApply) {
442
451
  if (!Lightmap.warned) { Lightmap.warned = true; console.warn("Lightmap: this host has no lightmap support — rendering without the bake") }
package/src/version.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  // same manifest). Its MAJOR is the bundle ↔ runtime contract: a bundle's `// sdk:` header line
5
5
  // and a host's embedded version must agree on the major for the host to run the bundle; minor
6
6
  // and patch never gate anything (features are detected, never versioned).
7
- export const SDK_VERSION = "2.4.9"
7
+ export const SDK_VERSION = "2.4.10"
8
8
 
9
9
  /** The major of a semver string, or null when it is not one. */
10
10
  export const sdkMajor = (version: string | null | undefined): number | null => {