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/dist/types/version.d.ts +1 -1
- package/dist/types.json +1 -1
- package/package.json +1 -1
- package/src/gl/Lightmap.ts +9 -0
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/gl/Lightmap.ts
CHANGED
|
@@ -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.
|
|
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 => {
|