(src, framewidth, frameheight)
| 31 | // to the whole image); a subclass like Sprite3d passes them so the atlas |
| 32 | // carries an animation frame grid. |
| 33 | function resolveTextureAtlas(src, framewidth, frameheight) { |
| 34 | if (src instanceof TextureAtlas) { |
| 35 | return src; |
| 36 | } |
| 37 | const image = typeof src === "object" ? src : getImage(src); |
| 38 | if (!image) { |
| 39 | throw new Error("Mesh: '" + src + "' image/texture not found!"); |
| 40 | } |
| 41 | return game.renderer.cache.get(image, { |
| 42 | framewidth: framewidth || image.width, |
| 43 | frameheight: frameheight || image.height, |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Normalize an emissive color input (`[r, g, b]` array / Float32Array, or |
no test coverage detected