Initial
This commit is contained in:
21
resources/app/node_modules/@pixi/compressed-textures/LICENSE
generated
vendored
Normal file
21
resources/app/node_modules/@pixi/compressed-textures/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
52
resources/app/node_modules/@pixi/compressed-textures/lib/const.js
generated
vendored
Normal file
52
resources/app/node_modules/@pixi/compressed-textures/lib/const.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
var INTERNAL_FORMATS = /* @__PURE__ */ ((INTERNAL_FORMATS2) => (INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777] = "COMPRESSED_RGBA_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778] = "COMPRESSED_RGBA_S3TC_DXT3_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916] = "COMPRESSED_SRGB_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_R11_EAC = 37488] = "COMPRESSED_R11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SIGNED_R11_EAC = 37489] = "COMPRESSED_SIGNED_R11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RG11_EAC = 37490] = "COMPRESSED_RG11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SIGNED_RG11_EAC = 37491] = "COMPRESSED_SIGNED_RG11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA8_ETC2_EAC = 37496] = "COMPRESSED_RGBA8_ETC2_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_ETC2 = 37493] = "COMPRESSED_SRGB8_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497] = "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494] = "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495] = "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841] = "COMPRESSED_RGB_PVRTC_2BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843] = "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_ATC_WEBGL = 35986] = "COMPRESSED_RGB_ATC_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987] = "COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798] = "COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4x4_KHR", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493] = "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494] = "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495] = "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT", INTERNAL_FORMATS2))(INTERNAL_FORMATS || {});
|
||||
const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = {
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
33776: 0.5,
|
||||
33777: 0.5,
|
||||
33778: 1,
|
||||
33779: 1,
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
35916: 0.5,
|
||||
35917: 0.5,
|
||||
35918: 1,
|
||||
35919: 1,
|
||||
// WEBGL_compressed_texture_etc
|
||||
37488: 0.5,
|
||||
37489: 0.5,
|
||||
37490: 1,
|
||||
37491: 1,
|
||||
37492: 0.5,
|
||||
37496: 1,
|
||||
37493: 0.5,
|
||||
37497: 1,
|
||||
37494: 0.5,
|
||||
// ~~
|
||||
37495: 0.5,
|
||||
// ~~
|
||||
// WEBGL_compressed_texture_pvrtc
|
||||
35840: 0.5,
|
||||
35842: 0.5,
|
||||
35841: 0.25,
|
||||
35843: 0.25,
|
||||
// WEBGL_compressed_texture_etc1
|
||||
36196: 0.5,
|
||||
// @see https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_compressed_ATC_texture.txt
|
||||
// WEBGL_compressed_texture_atc
|
||||
35986: 0.5,
|
||||
35987: 1,
|
||||
34798: 1,
|
||||
// @see https://registry.khronos.org/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
|
||||
// WEBGL_compressed_texture_astc
|
||||
/* eslint-disable-next-line camelcase */
|
||||
37808: 1,
|
||||
// @see https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_compression_bptc.txt
|
||||
// EXT_texture_compression_bptc
|
||||
36492: 1,
|
||||
36493: 1,
|
||||
36494: 1,
|
||||
36495: 1
|
||||
};
|
||||
exports.INTERNAL_FORMATS = INTERNAL_FORMATS;
|
||||
exports.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL;
|
||||
//# sourceMappingURL=const.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/const.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/const.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
53
resources/app/node_modules/@pixi/compressed-textures/lib/const.mjs
generated
vendored
Normal file
53
resources/app/node_modules/@pixi/compressed-textures/lib/const.mjs
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
var INTERNAL_FORMATS = /* @__PURE__ */ ((INTERNAL_FORMATS2) => (INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777] = "COMPRESSED_RGBA_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778] = "COMPRESSED_RGBA_S3TC_DXT3_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916] = "COMPRESSED_SRGB_S3TC_DXT1_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_R11_EAC = 37488] = "COMPRESSED_R11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SIGNED_R11_EAC = 37489] = "COMPRESSED_SIGNED_R11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RG11_EAC = 37490] = "COMPRESSED_RG11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SIGNED_RG11_EAC = 37491] = "COMPRESSED_SIGNED_RG11_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA8_ETC2_EAC = 37496] = "COMPRESSED_RGBA8_ETC2_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_ETC2 = 37493] = "COMPRESSED_SRGB8_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497] = "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494] = "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495] = "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841] = "COMPRESSED_RGB_PVRTC_2BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843] = "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_ATC_WEBGL = 35986] = "COMPRESSED_RGB_ATC_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987] = "COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798] = "COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4x4_KHR", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493] = "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494] = "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT", INTERNAL_FORMATS2[INTERNAL_FORMATS2.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495] = "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT", INTERNAL_FORMATS2))(INTERNAL_FORMATS || {});
|
||||
const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = {
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
33776: 0.5,
|
||||
33777: 0.5,
|
||||
33778: 1,
|
||||
33779: 1,
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
35916: 0.5,
|
||||
35917: 0.5,
|
||||
35918: 1,
|
||||
35919: 1,
|
||||
// WEBGL_compressed_texture_etc
|
||||
37488: 0.5,
|
||||
37489: 0.5,
|
||||
37490: 1,
|
||||
37491: 1,
|
||||
37492: 0.5,
|
||||
37496: 1,
|
||||
37493: 0.5,
|
||||
37497: 1,
|
||||
37494: 0.5,
|
||||
// ~~
|
||||
37495: 0.5,
|
||||
// ~~
|
||||
// WEBGL_compressed_texture_pvrtc
|
||||
35840: 0.5,
|
||||
35842: 0.5,
|
||||
35841: 0.25,
|
||||
35843: 0.25,
|
||||
// WEBGL_compressed_texture_etc1
|
||||
36196: 0.5,
|
||||
// @see https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_compressed_ATC_texture.txt
|
||||
// WEBGL_compressed_texture_atc
|
||||
35986: 0.5,
|
||||
35987: 1,
|
||||
34798: 1,
|
||||
// @see https://registry.khronos.org/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
|
||||
// WEBGL_compressed_texture_astc
|
||||
/* eslint-disable-next-line camelcase */
|
||||
37808: 1,
|
||||
// @see https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_compression_bptc.txt
|
||||
// EXT_texture_compression_bptc
|
||||
36492: 1,
|
||||
36493: 1,
|
||||
36494: 1,
|
||||
36495: 1
|
||||
};
|
||||
export {
|
||||
INTERNAL_FORMATS,
|
||||
INTERNAL_FORMAT_TO_BYTES_PER_PIXEL
|
||||
};
|
||||
//# sourceMappingURL=const.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/const.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/const.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
resources/app/node_modules/@pixi/compressed-textures/lib/index.js
generated
vendored
Normal file
20
resources/app/node_modules/@pixi/compressed-textures/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
var _const = require("./const.js");
|
||||
require("./loaders/index.js");
|
||||
require("./parsers/index.js");
|
||||
require("./resources/index.js");
|
||||
var detectCompressedTextures = require("./loaders/detectCompressedTextures.js"), loadDDS = require("./loaders/loadDDS.js"), loadKTX = require("./loaders/loadKTX.js"), resolveCompressedTextureUrl = require("./loaders/resolveCompressedTextureUrl.js"), parseDDS = require("./parsers/parseDDS.js"), parseKTX = require("./parsers/parseKTX.js"), BlobResource = require("./resources/BlobResource.js"), CompressedTextureResource = require("./resources/CompressedTextureResource.js");
|
||||
exports.INTERNAL_FORMATS = _const.INTERNAL_FORMATS;
|
||||
exports.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = _const.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL;
|
||||
exports.detectCompressedTextures = detectCompressedTextures.detectCompressedTextures;
|
||||
exports.loadDDS = loadDDS.loadDDS;
|
||||
exports.loadKTX = loadKTX.loadKTX;
|
||||
exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl.resolveCompressedTextureUrl;
|
||||
exports.parseDDS = parseDDS.parseDDS;
|
||||
exports.FORMATS_TO_COMPONENTS = parseKTX.FORMATS_TO_COMPONENTS;
|
||||
exports.TYPES_TO_BYTES_PER_COMPONENT = parseKTX.TYPES_TO_BYTES_PER_COMPONENT;
|
||||
exports.TYPES_TO_BYTES_PER_PIXEL = parseKTX.TYPES_TO_BYTES_PER_PIXEL;
|
||||
exports.parseKTX = parseKTX.parseKTX;
|
||||
exports.BlobResource = BlobResource.BlobResource;
|
||||
exports.CompressedTextureResource = CompressedTextureResource.CompressedTextureResource;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
||||
28
resources/app/node_modules/@pixi/compressed-textures/lib/index.mjs
generated
vendored
Normal file
28
resources/app/node_modules/@pixi/compressed-textures/lib/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { INTERNAL_FORMATS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from "./const.mjs";
|
||||
import "./loaders/index.mjs";
|
||||
import "./parsers/index.mjs";
|
||||
import "./resources/index.mjs";
|
||||
import { detectCompressedTextures } from "./loaders/detectCompressedTextures.mjs";
|
||||
import { loadDDS } from "./loaders/loadDDS.mjs";
|
||||
import { loadKTX } from "./loaders/loadKTX.mjs";
|
||||
import { resolveCompressedTextureUrl } from "./loaders/resolveCompressedTextureUrl.mjs";
|
||||
import { parseDDS } from "./parsers/parseDDS.mjs";
|
||||
import { FORMATS_TO_COMPONENTS, TYPES_TO_BYTES_PER_COMPONENT, TYPES_TO_BYTES_PER_PIXEL, parseKTX } from "./parsers/parseKTX.mjs";
|
||||
import { BlobResource } from "./resources/BlobResource.mjs";
|
||||
import { CompressedTextureResource } from "./resources/CompressedTextureResource.mjs";
|
||||
export {
|
||||
BlobResource,
|
||||
CompressedTextureResource,
|
||||
FORMATS_TO_COMPONENTS,
|
||||
INTERNAL_FORMATS,
|
||||
INTERNAL_FORMAT_TO_BYTES_PER_PIXEL,
|
||||
TYPES_TO_BYTES_PER_COMPONENT,
|
||||
TYPES_TO_BYTES_PER_PIXEL,
|
||||
detectCompressedTextures,
|
||||
loadDDS,
|
||||
loadKTX,
|
||||
parseDDS,
|
||||
parseKTX,
|
||||
resolveCompressedTextureUrl
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
||||
2
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.js
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=compressedTextureExtensions.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"compressedTextureExtensions.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
||||
2
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.mjs
generated
vendored
Normal file
2
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
//# sourceMappingURL=compressedTextureExtensions.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/compressedTextureExtensions.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"compressedTextureExtensions.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
||||
37
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.js
generated
vendored
Normal file
37
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
let storedGl, extensions;
|
||||
function getCompressedTextureExtensions() {
|
||||
extensions = {
|
||||
bptc: storedGl.getExtension("EXT_texture_compression_bptc"),
|
||||
astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
|
||||
etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
|
||||
s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
|
||||
s3tc_sRGB: storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
|
||||
/* eslint-disable-line camelcase */
|
||||
pvrtc: storedGl.getExtension("WEBGL_compressed_texture_pvrtc") || storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
|
||||
etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
|
||||
atc: storedGl.getExtension("WEBGL_compressed_texture_atc")
|
||||
};
|
||||
}
|
||||
const detectCompressedTextures = {
|
||||
extension: {
|
||||
type: core.ExtensionType.DetectionParser,
|
||||
priority: 2
|
||||
},
|
||||
test: async () => {
|
||||
const gl = core.settings.ADAPTER.createCanvas().getContext("webgl");
|
||||
return gl ? (storedGl = gl, !0) : (console.warn("WebGL not available for compressed textures."), !1);
|
||||
},
|
||||
add: async (formats) => {
|
||||
extensions || getCompressedTextureExtensions();
|
||||
const textureFormats = [];
|
||||
for (const extensionName in extensions)
|
||||
extensions[extensionName] && textureFormats.push(extensionName);
|
||||
return [...textureFormats, ...formats];
|
||||
},
|
||||
remove: async (formats) => (extensions || getCompressedTextureExtensions(), formats.filter((f) => !(f in extensions)))
|
||||
};
|
||||
core.extensions.add(detectCompressedTextures);
|
||||
exports.detectCompressedTextures = detectCompressedTextures;
|
||||
//# sourceMappingURL=detectCompressedTextures.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectCompressedTextures.js","sources":["../../src/loaders/detectCompressedTextures.ts"],"sourcesContent":["import { extensions as ext, ExtensionType, settings } from '@pixi/core';\n\nimport type { FormatDetectionParser } from '@pixi/assets';\nimport type { CompressedTextureExtensionRef, CompressedTextureExtensions } from './compressedTextureExtensions';\n\nlet storedGl: WebGLRenderingContext;\nlet extensions: Partial<CompressedTextureExtensions>;\n\nfunction getCompressedTextureExtensions()\n{\n extensions = {\n bptc: storedGl.getExtension('EXT_texture_compression_bptc'),\n astc: storedGl.getExtension('WEBGL_compressed_texture_astc'),\n etc: storedGl.getExtension('WEBGL_compressed_texture_etc'),\n s3tc: storedGl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: storedGl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), /* eslint-disable-line camelcase */\n pvrtc: storedGl.getExtension('WEBGL_compressed_texture_pvrtc')\n || storedGl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n etc1: storedGl.getExtension('WEBGL_compressed_texture_etc1'),\n atc: storedGl.getExtension('WEBGL_compressed_texture_atc'),\n } as Partial<CompressedTextureExtensions>;\n}\n\nexport const detectCompressedTextures = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 2,\n },\n test: async (): Promise<boolean> =>\n {\n // Auto-detect WebGL compressed-texture extensions\n const canvas = settings.ADAPTER.createCanvas();\n const gl = canvas.getContext('webgl');\n\n if (!gl)\n {\n if (process.env.DEBUG)\n {\n console.warn('WebGL not available for compressed textures.');\n }\n\n return false;\n }\n\n storedGl = gl;\n\n return true;\n },\n add: async (formats: string[]): Promise<string[]> =>\n {\n if (!extensions) getCompressedTextureExtensions();\n\n const textureFormats = [];\n\n // Assign all available compressed-texture formats\n for (const extensionName in extensions)\n {\n const extension = extensions[extensionName as CompressedTextureExtensionRef];\n\n if (!extension)\n {\n continue;\n }\n\n textureFormats.push(extensionName);\n }\n\n return [...textureFormats, ...formats];\n },\n remove: async (formats: string[]): Promise<string[]> =>\n {\n if (!extensions) getCompressedTextureExtensions();\n\n return formats.filter((f) => !(f in extensions));\n },\n} as FormatDetectionParser;\n\next.add(detectCompressedTextures);\n"],"names":["ExtensionType","settings","ext"],"mappings":";;AAKA,IAAI,UACA;AAEJ,SAAS,iCACT;AACiB,eAAA;AAAA,IACT,MAAM,SAAS,aAAa,8BAA8B;AAAA,IAC1D,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,KAAK,SAAS,aAAa,8BAA8B;AAAA,IACzD,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,WAAW,SAAS,aAAa,oCAAoC;AAAA;AAAA,IACrE,OAAO,SAAS,aAAa,gCAAgC,KACtD,SAAS,aAAa,uCAAuC;AAAA,IACpE,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,KAAK,SAAS,aAAa,8BAA8B;AAAA,EAAA;AAEjE;AAEO,MAAM,2BAA2B;AAAA,EACpC,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YACN;AAGI,UAAM,KADSC,KAAAA,SAAS,QAAQ,aAAa,EAC3B,WAAW,OAAO;AAEpC,WAAK,MAUL,WAAW,IAEJ,OARC,QAAQ,KAAK,8CAA8C,GAGxD;AAAA,EAMf;AAAA,EACA,KAAK,OAAO,YACZ;AACS,kBAAY,+BAA+B;AAEhD,UAAM,iBAAiB,CAAA;AAGvB,eAAW,iBAAiB;AAEN,iBAAW,aAA8C,KAO3E,eAAe,KAAK,aAAa;AAGrC,WAAO,CAAC,GAAG,gBAAgB,GAAG,OAAO;AAAA,EACzC;AAAA,EACA,QAAQ,OAAO,aAEN,cAAY,+BAA+B,GAEzC,QAAQ,OAAO,CAAC,MAAM,EAAE,KAAK,WAAW;AAEvD;AAEAC,KAAAA,WAAI,IAAI,wBAAwB;;"}
|
||||
38
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.mjs
generated
vendored
Normal file
38
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.mjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { ExtensionType, settings, extensions as extensions$1 } from "@pixi/core";
|
||||
let storedGl, extensions;
|
||||
function getCompressedTextureExtensions() {
|
||||
extensions = {
|
||||
bptc: storedGl.getExtension("EXT_texture_compression_bptc"),
|
||||
astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
|
||||
etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
|
||||
s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
|
||||
s3tc_sRGB: storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
|
||||
/* eslint-disable-line camelcase */
|
||||
pvrtc: storedGl.getExtension("WEBGL_compressed_texture_pvrtc") || storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
|
||||
etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
|
||||
atc: storedGl.getExtension("WEBGL_compressed_texture_atc")
|
||||
};
|
||||
}
|
||||
const detectCompressedTextures = {
|
||||
extension: {
|
||||
type: ExtensionType.DetectionParser,
|
||||
priority: 2
|
||||
},
|
||||
test: async () => {
|
||||
const gl = settings.ADAPTER.createCanvas().getContext("webgl");
|
||||
return gl ? (storedGl = gl, !0) : (console.warn("WebGL not available for compressed textures."), !1);
|
||||
},
|
||||
add: async (formats) => {
|
||||
extensions || getCompressedTextureExtensions();
|
||||
const textureFormats = [];
|
||||
for (const extensionName in extensions)
|
||||
extensions[extensionName] && textureFormats.push(extensionName);
|
||||
return [...textureFormats, ...formats];
|
||||
},
|
||||
remove: async (formats) => (extensions || getCompressedTextureExtensions(), formats.filter((f) => !(f in extensions)))
|
||||
};
|
||||
extensions$1.add(detectCompressedTextures);
|
||||
export {
|
||||
detectCompressedTextures
|
||||
};
|
||||
//# sourceMappingURL=detectCompressedTextures.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/detectCompressedTextures.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"detectCompressedTextures.mjs","sources":["../../src/loaders/detectCompressedTextures.ts"],"sourcesContent":["import { extensions as ext, ExtensionType, settings } from '@pixi/core';\n\nimport type { FormatDetectionParser } from '@pixi/assets';\nimport type { CompressedTextureExtensionRef, CompressedTextureExtensions } from './compressedTextureExtensions';\n\nlet storedGl: WebGLRenderingContext;\nlet extensions: Partial<CompressedTextureExtensions>;\n\nfunction getCompressedTextureExtensions()\n{\n extensions = {\n bptc: storedGl.getExtension('EXT_texture_compression_bptc'),\n astc: storedGl.getExtension('WEBGL_compressed_texture_astc'),\n etc: storedGl.getExtension('WEBGL_compressed_texture_etc'),\n s3tc: storedGl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: storedGl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), /* eslint-disable-line camelcase */\n pvrtc: storedGl.getExtension('WEBGL_compressed_texture_pvrtc')\n || storedGl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n etc1: storedGl.getExtension('WEBGL_compressed_texture_etc1'),\n atc: storedGl.getExtension('WEBGL_compressed_texture_atc'),\n } as Partial<CompressedTextureExtensions>;\n}\n\nexport const detectCompressedTextures = {\n extension: {\n type: ExtensionType.DetectionParser,\n priority: 2,\n },\n test: async (): Promise<boolean> =>\n {\n // Auto-detect WebGL compressed-texture extensions\n const canvas = settings.ADAPTER.createCanvas();\n const gl = canvas.getContext('webgl');\n\n if (!gl)\n {\n if (process.env.DEBUG)\n {\n console.warn('WebGL not available for compressed textures.');\n }\n\n return false;\n }\n\n storedGl = gl;\n\n return true;\n },\n add: async (formats: string[]): Promise<string[]> =>\n {\n if (!extensions) getCompressedTextureExtensions();\n\n const textureFormats = [];\n\n // Assign all available compressed-texture formats\n for (const extensionName in extensions)\n {\n const extension = extensions[extensionName as CompressedTextureExtensionRef];\n\n if (!extension)\n {\n continue;\n }\n\n textureFormats.push(extensionName);\n }\n\n return [...textureFormats, ...formats];\n },\n remove: async (formats: string[]): Promise<string[]> =>\n {\n if (!extensions) getCompressedTextureExtensions();\n\n return formats.filter((f) => !(f in extensions));\n },\n} as FormatDetectionParser;\n\next.add(detectCompressedTextures);\n"],"names":["ext"],"mappings":";AAKA,IAAI,UACA;AAEJ,SAAS,iCACT;AACiB,eAAA;AAAA,IACT,MAAM,SAAS,aAAa,8BAA8B;AAAA,IAC1D,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,KAAK,SAAS,aAAa,8BAA8B;AAAA,IACzD,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,WAAW,SAAS,aAAa,oCAAoC;AAAA;AAAA,IACrE,OAAO,SAAS,aAAa,gCAAgC,KACtD,SAAS,aAAa,uCAAuC;AAAA,IACpE,MAAM,SAAS,aAAa,+BAA+B;AAAA,IAC3D,KAAK,SAAS,aAAa,8BAA8B;AAAA,EAAA;AAEjE;AAEO,MAAM,2BAA2B;AAAA,EACpC,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU;AAAA,EACd;AAAA,EACA,MAAM,YACN;AAGI,UAAM,KADS,SAAS,QAAQ,aAAa,EAC3B,WAAW,OAAO;AAEpC,WAAK,MAUL,WAAW,IAEJ,OARC,QAAQ,KAAK,8CAA8C,GAGxD;AAAA,EAMf;AAAA,EACA,KAAK,OAAO,YACZ;AACS,kBAAY,+BAA+B;AAEhD,UAAM,iBAAiB,CAAA;AAGvB,eAAW,iBAAiB;AAEN,iBAAW,aAA8C,KAO3E,eAAe,KAAK,aAAa;AAGrC,WAAO,CAAC,GAAG,gBAAgB,GAAG,OAAO;AAAA,EACzC;AAAA,EACA,QAAQ,OAAO,aAEN,cAAY,+BAA+B,GAEzC,QAAQ,OAAO,CAAC,MAAM,EAAE,KAAK,WAAW;AAEvD;AAEAA,aAAI,IAAI,wBAAwB;"}
|
||||
8
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.js
generated
vendored
Normal file
8
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
require("./compressedTextureExtensions.js");
|
||||
var detectCompressedTextures = require("./detectCompressedTextures.js"), loadDDS = require("./loadDDS.js"), loadKTX = require("./loadKTX.js"), resolveCompressedTextureUrl = require("./resolveCompressedTextureUrl.js");
|
||||
exports.detectCompressedTextures = detectCompressedTextures.detectCompressedTextures;
|
||||
exports.loadDDS = loadDDS.loadDDS;
|
||||
exports.loadKTX = loadKTX.loadKTX;
|
||||
exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl.resolveCompressedTextureUrl;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
||||
12
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.mjs
generated
vendored
Normal file
12
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import "./compressedTextureExtensions.mjs";
|
||||
import { detectCompressedTextures } from "./detectCompressedTextures.mjs";
|
||||
import { loadDDS } from "./loadDDS.mjs";
|
||||
import { loadKTX } from "./loadKTX.mjs";
|
||||
import { resolveCompressedTextureUrl } from "./resolveCompressedTextureUrl.mjs";
|
||||
export {
|
||||
detectCompressedTextures,
|
||||
loadDDS,
|
||||
loadKTX,
|
||||
resolveCompressedTextureUrl
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
||||
32
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.js
generated
vendored
Normal file
32
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
var assets = require("@pixi/assets"), core = require("@pixi/core");
|
||||
require("../parsers/index.js");
|
||||
var parseDDS = require("../parsers/parseDDS.js");
|
||||
const loadDDS = {
|
||||
extension: {
|
||||
type: core.ExtensionType.LoadParser,
|
||||
priority: assets.LoaderParserPriority.High
|
||||
},
|
||||
name: "loadDDS",
|
||||
test(url) {
|
||||
return assets.checkExtension(url, ".dds");
|
||||
},
|
||||
async load(url, asset, loader) {
|
||||
const arrayBuffer = await (await core.settings.ADAPTER.fetch(url)).arrayBuffer(), textures = parseDDS.parseDDS(arrayBuffer).map((resource) => {
|
||||
const base = new core.BaseTexture(resource, {
|
||||
mipmap: core.MIPMAP_MODES.OFF,
|
||||
alphaMode: core.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
|
||||
resolution: core.utils.getResolutionOfUrl(url),
|
||||
...asset.data
|
||||
});
|
||||
return assets.createTexture(base, loader, url);
|
||||
});
|
||||
return textures.length === 1 ? textures[0] : textures;
|
||||
},
|
||||
unload(texture) {
|
||||
Array.isArray(texture) ? texture.forEach((t) => t.destroy(!0)) : texture.destroy(!0);
|
||||
}
|
||||
};
|
||||
core.extensions.add(loadDDS);
|
||||
exports.loadDDS = loadDDS;
|
||||
//# sourceMappingURL=loadDDS.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadDDS.js","sources":["../../src/loaders/loadDDS.ts"],"sourcesContent":["import { checkExtension, createTexture, LoaderParserPriority } from '@pixi/assets';\nimport { ALPHA_MODES, BaseTexture, extensions, ExtensionType, MIPMAP_MODES, settings, utils } from '@pixi/core';\nimport { parseDDS } from '../parsers';\n\nimport type { Loader, LoaderParser, ResolvedAsset } from '@pixi/assets';\nimport type { IBaseTextureOptions, Texture } from '@pixi/core';\n\n/** Load our DDS textures! */\nexport const loadDDS: LoaderParser = {\n extension: {\n type: ExtensionType.LoadParser,\n priority: LoaderParserPriority.High,\n },\n\n name: 'loadDDS',\n\n test(url: string): boolean\n {\n return checkExtension(url, '.dds');\n },\n\n async load(url: string, asset: ResolvedAsset, loader: Loader): Promise<Texture | Texture[]>\n {\n // get an array buffer...\n const response = await settings.ADAPTER.fetch(url);\n\n const arrayBuffer = await response.arrayBuffer();\n\n const resources = parseDDS(arrayBuffer);\n\n const textures = resources.map((resource) =>\n {\n const base = new BaseTexture(resource, {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n resolution: utils.getResolutionOfUrl(url),\n ...asset.data,\n });\n\n return createTexture(base, loader, url);\n });\n\n return textures.length === 1 ? textures[0] : textures;\n },\n\n unload(texture: Texture | Texture[]): void\n {\n if (Array.isArray(texture))\n {\n texture.forEach((t) => t.destroy(true));\n }\n else\n {\n texture.destroy(true);\n }\n }\n\n} as LoaderParser<Texture | Texture[], IBaseTextureOptions>;\n\nextensions.add(loadDDS);\n"],"names":["ExtensionType","LoaderParserPriority","checkExtension","settings","parseDDS","BaseTexture","MIPMAP_MODES","ALPHA_MODES","utils","createTexture","extensions"],"mappings":";;;;AAQO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAUC,OAAqB,qBAAA;AAAA,EACnC;AAAA,EAEA,MAAM;AAAA,EAEN,KAAK,KACL;AACW,WAAAC,OAAA,eAAe,KAAK,MAAM;AAAA,EACrC;AAAA,EAEA,MAAM,KAAK,KAAa,OAAsB,QAC9C;AAII,UAAM,cAAc,OAFH,MAAMC,KAAS,SAAA,QAAQ,MAAM,GAAG,GAEd,YAAY,GAIzC,WAFYC,SAAS,SAAA,WAAW,EAEX,IAAI,CAAC,aAChC;AACU,YAAA,OAAO,IAAIC,KAAA,YAAY,UAAU;AAAA,QACnC,QAAQC,KAAa,aAAA;AAAA,QACrB,WAAWC,KAAY,YAAA;AAAA,QACvB,YAAYC,KAAAA,MAAM,mBAAmB,GAAG;AAAA,QACxC,GAAG,MAAM;AAAA,MAAA,CACZ;AAEM,aAAAC,qBAAc,MAAM,QAAQ,GAAG;AAAA,IAAA,CACzC;AAED,WAAO,SAAS,WAAW,IAAI,SAAS,CAAC,IAAI;AAAA,EACjD;AAAA,EAEA,OAAO,SACP;AACQ,UAAM,QAAQ,OAAO,IAErB,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAI,CAAC,IAItC,QAAQ,QAAQ,EAAI;AAAA,EAE5B;AAEJ;AAEAC,KAAAA,WAAW,IAAI,OAAO;;"}
|
||||
34
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.mjs
generated
vendored
Normal file
34
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.mjs
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { LoaderParserPriority, checkExtension, createTexture } from "@pixi/assets";
|
||||
import { ExtensionType, settings, BaseTexture, MIPMAP_MODES, ALPHA_MODES, utils, extensions } from "@pixi/core";
|
||||
import "../parsers/index.mjs";
|
||||
import { parseDDS } from "../parsers/parseDDS.mjs";
|
||||
const loadDDS = {
|
||||
extension: {
|
||||
type: ExtensionType.LoadParser,
|
||||
priority: LoaderParserPriority.High
|
||||
},
|
||||
name: "loadDDS",
|
||||
test(url) {
|
||||
return checkExtension(url, ".dds");
|
||||
},
|
||||
async load(url, asset, loader) {
|
||||
const arrayBuffer = await (await settings.ADAPTER.fetch(url)).arrayBuffer(), textures = parseDDS(arrayBuffer).map((resource) => {
|
||||
const base = new BaseTexture(resource, {
|
||||
mipmap: MIPMAP_MODES.OFF,
|
||||
alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
|
||||
resolution: utils.getResolutionOfUrl(url),
|
||||
...asset.data
|
||||
});
|
||||
return createTexture(base, loader, url);
|
||||
});
|
||||
return textures.length === 1 ? textures[0] : textures;
|
||||
},
|
||||
unload(texture) {
|
||||
Array.isArray(texture) ? texture.forEach((t) => t.destroy(!0)) : texture.destroy(!0);
|
||||
}
|
||||
};
|
||||
extensions.add(loadDDS);
|
||||
export {
|
||||
loadDDS
|
||||
};
|
||||
//# sourceMappingURL=loadDDS.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadDDS.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadDDS.mjs","sources":["../../src/loaders/loadDDS.ts"],"sourcesContent":["import { checkExtension, createTexture, LoaderParserPriority } from '@pixi/assets';\nimport { ALPHA_MODES, BaseTexture, extensions, ExtensionType, MIPMAP_MODES, settings, utils } from '@pixi/core';\nimport { parseDDS } from '../parsers';\n\nimport type { Loader, LoaderParser, ResolvedAsset } from '@pixi/assets';\nimport type { IBaseTextureOptions, Texture } from '@pixi/core';\n\n/** Load our DDS textures! */\nexport const loadDDS: LoaderParser = {\n extension: {\n type: ExtensionType.LoadParser,\n priority: LoaderParserPriority.High,\n },\n\n name: 'loadDDS',\n\n test(url: string): boolean\n {\n return checkExtension(url, '.dds');\n },\n\n async load(url: string, asset: ResolvedAsset, loader: Loader): Promise<Texture | Texture[]>\n {\n // get an array buffer...\n const response = await settings.ADAPTER.fetch(url);\n\n const arrayBuffer = await response.arrayBuffer();\n\n const resources = parseDDS(arrayBuffer);\n\n const textures = resources.map((resource) =>\n {\n const base = new BaseTexture(resource, {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n resolution: utils.getResolutionOfUrl(url),\n ...asset.data,\n });\n\n return createTexture(base, loader, url);\n });\n\n return textures.length === 1 ? textures[0] : textures;\n },\n\n unload(texture: Texture | Texture[]): void\n {\n if (Array.isArray(texture))\n {\n texture.forEach((t) => t.destroy(true));\n }\n else\n {\n texture.destroy(true);\n }\n }\n\n} as LoaderParser<Texture | Texture[], IBaseTextureOptions>;\n\nextensions.add(loadDDS);\n"],"names":[],"mappings":";;;;AAQO,MAAM,UAAwB;AAAA,EACjC,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU,qBAAqB;AAAA,EACnC;AAAA,EAEA,MAAM;AAAA,EAEN,KAAK,KACL;AACW,WAAA,eAAe,KAAK,MAAM;AAAA,EACrC;AAAA,EAEA,MAAM,KAAK,KAAa,OAAsB,QAC9C;AAII,UAAM,cAAc,OAFH,MAAM,SAAS,QAAQ,MAAM,GAAG,GAEd,YAAY,GAIzC,WAFY,SAAS,WAAW,EAEX,IAAI,CAAC,aAChC;AACU,YAAA,OAAO,IAAI,YAAY,UAAU;AAAA,QACnC,QAAQ,aAAa;AAAA,QACrB,WAAW,YAAY;AAAA,QACvB,YAAY,MAAM,mBAAmB,GAAG;AAAA,QACxC,GAAG,MAAM;AAAA,MAAA,CACZ;AAEM,aAAA,cAAc,MAAM,QAAQ,GAAG;AAAA,IAAA,CACzC;AAED,WAAO,SAAS,WAAW,IAAI,SAAS,CAAC,IAAI;AAAA,EACjD;AAAA,EAEA,OAAO,SACP;AACQ,UAAM,QAAQ,OAAO,IAErB,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAI,CAAC,IAItC,QAAQ,QAAQ,EAAI;AAAA,EAE5B;AAEJ;AAEA,WAAW,IAAI,OAAO;"}
|
||||
36
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.js
generated
vendored
Normal file
36
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var assets = require("@pixi/assets"), core = require("@pixi/core");
|
||||
require("../parsers/index.js");
|
||||
var parseKTX = require("../parsers/parseKTX.js");
|
||||
const loadKTX = {
|
||||
extension: {
|
||||
type: core.ExtensionType.LoadParser,
|
||||
priority: assets.LoaderParserPriority.High
|
||||
},
|
||||
name: "loadKTX",
|
||||
test(url) {
|
||||
return assets.checkExtension(url, ".ktx");
|
||||
},
|
||||
async load(url, asset, loader) {
|
||||
const arrayBuffer = await (await core.settings.ADAPTER.fetch(url)).arrayBuffer(), { compressed, uncompressed, kvData } = parseKTX.parseKTX(url, arrayBuffer), resources = compressed ?? uncompressed, options = {
|
||||
mipmap: core.MIPMAP_MODES.OFF,
|
||||
alphaMode: core.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
|
||||
resolution: core.utils.getResolutionOfUrl(url),
|
||||
...asset.data
|
||||
}, textures = resources.map((resource) => {
|
||||
resources === uncompressed && Object.assign(options, {
|
||||
type: resource.type,
|
||||
format: resource.format
|
||||
});
|
||||
const res = resource.resource ?? resource, base = new core.BaseTexture(res, options);
|
||||
return base.ktxKeyValueData = kvData, assets.createTexture(base, loader, url);
|
||||
});
|
||||
return textures.length === 1 ? textures[0] : textures;
|
||||
},
|
||||
unload(texture) {
|
||||
Array.isArray(texture) ? texture.forEach((t) => t.destroy(!0)) : texture.destroy(!0);
|
||||
}
|
||||
};
|
||||
core.extensions.add(loadKTX);
|
||||
exports.loadKTX = loadKTX;
|
||||
//# sourceMappingURL=loadKTX.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadKTX.js","sources":["../../src/loaders/loadKTX.ts"],"sourcesContent":["import { checkExtension, createTexture, LoaderParserPriority } from '@pixi/assets';\nimport { ALPHA_MODES, BaseTexture, extensions, ExtensionType, MIPMAP_MODES, settings, utils } from '@pixi/core';\nimport { parseKTX } from '../parsers';\n\nimport type { Loader, LoaderParser, ResolvedAsset } from '@pixi/assets';\nimport type { IBaseTextureOptions, Texture } from '@pixi/core';\n\n/** Loads KTX textures! */\nexport const loadKTX = {\n extension: {\n type: ExtensionType.LoadParser,\n priority: LoaderParserPriority.High,\n },\n\n name: 'loadKTX',\n\n test(url: string): boolean\n {\n return checkExtension(url, '.ktx');\n },\n\n async load(url: string, asset: ResolvedAsset, loader: Loader): Promise<Texture | Texture[]>\n {\n // get an array buffer...\n const response = await settings.ADAPTER.fetch(url);\n\n const arrayBuffer = await response.arrayBuffer();\n\n const { compressed, uncompressed, kvData } = parseKTX(url, arrayBuffer);\n\n const resources = compressed ?? uncompressed;\n\n const options = {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n resolution: utils.getResolutionOfUrl(url),\n ...asset.data,\n };\n\n const textures = resources.map((resource) =>\n {\n if (resources === uncompressed)\n {\n Object.assign(options, {\n type: (resource as typeof uncompressed[0]).type,\n format: (resource as typeof uncompressed[0]).format,\n });\n }\n\n const res = (resource as typeof uncompressed[0]).resource ?? (resource as typeof compressed[0]);\n\n const base = new BaseTexture(res, options);\n\n base.ktxKeyValueData = kvData;\n\n return createTexture(base, loader, url);\n });\n\n return textures.length === 1 ? textures[0] : textures;\n },\n\n unload(texture: Texture | Texture[]): void\n {\n if (Array.isArray(texture))\n {\n texture.forEach((t) => t.destroy(true));\n }\n else\n {\n texture.destroy(true);\n }\n }\n\n} as LoaderParser<Texture | Texture[], IBaseTextureOptions>;\n\nextensions.add(loadKTX);\n"],"names":["ExtensionType","LoaderParserPriority","checkExtension","settings","parseKTX","MIPMAP_MODES","ALPHA_MODES","utils","BaseTexture","createTexture","extensions"],"mappings":";;;;AAQO,MAAM,UAAU;AAAA,EACnB,WAAW;AAAA,IACP,MAAMA,KAAc,cAAA;AAAA,IACpB,UAAUC,OAAqB,qBAAA;AAAA,EACnC;AAAA,EAEA,MAAM;AAAA,EAEN,KAAK,KACL;AACW,WAAAC,OAAA,eAAe,KAAK,MAAM;AAAA,EACrC;AAAA,EAEA,MAAM,KAAK,KAAa,OAAsB,QAC9C;AAIU,UAAA,cAAc,OAFH,MAAMC,cAAS,QAAQ,MAAM,GAAG,GAEd,YAAA,GAE7B,EAAE,YAAY,cAAc,OAAA,IAAWC,SAAS,SAAA,KAAK,WAAW,GAEhE,YAAY,cAAc,cAE1B,UAAU;AAAA,MACZ,QAAQC,KAAa,aAAA;AAAA,MACrB,WAAWC,KAAY,YAAA;AAAA,MACvB,YAAYC,KAAAA,MAAM,mBAAmB,GAAG;AAAA,MACxC,GAAG,MAAM;AAAA,IAGP,GAAA,WAAW,UAAU,IAAI,CAAC,aAChC;AACQ,oBAAc,gBAEd,OAAO,OAAO,SAAS;AAAA,QACnB,MAAO,SAAoC;AAAA,QAC3C,QAAS,SAAoC;AAAA,MAAA,CAChD;AAGC,YAAA,MAAO,SAAoC,YAAa,UAExD,OAAO,IAAIC,KAAA,YAAY,KAAK,OAAO;AAEzC,aAAA,KAAK,kBAAkB,QAEhBC,OAAc,cAAA,MAAM,QAAQ,GAAG;AAAA,IAAA,CACzC;AAED,WAAO,SAAS,WAAW,IAAI,SAAS,CAAC,IAAI;AAAA,EACjD;AAAA,EAEA,OAAO,SACP;AACQ,UAAM,QAAQ,OAAO,IAErB,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAI,CAAC,IAItC,QAAQ,QAAQ,EAAI;AAAA,EAE5B;AAEJ;AAEAC,KAAAA,WAAW,IAAI,OAAO;;"}
|
||||
38
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.mjs
generated
vendored
Normal file
38
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.mjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { LoaderParserPriority, checkExtension, createTexture } from "@pixi/assets";
|
||||
import { ExtensionType, settings, MIPMAP_MODES, ALPHA_MODES, utils, BaseTexture, extensions } from "@pixi/core";
|
||||
import "../parsers/index.mjs";
|
||||
import { parseKTX } from "../parsers/parseKTX.mjs";
|
||||
const loadKTX = {
|
||||
extension: {
|
||||
type: ExtensionType.LoadParser,
|
||||
priority: LoaderParserPriority.High
|
||||
},
|
||||
name: "loadKTX",
|
||||
test(url) {
|
||||
return checkExtension(url, ".ktx");
|
||||
},
|
||||
async load(url, asset, loader) {
|
||||
const arrayBuffer = await (await settings.ADAPTER.fetch(url)).arrayBuffer(), { compressed, uncompressed, kvData } = parseKTX(url, arrayBuffer), resources = compressed ?? uncompressed, options = {
|
||||
mipmap: MIPMAP_MODES.OFF,
|
||||
alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
|
||||
resolution: utils.getResolutionOfUrl(url),
|
||||
...asset.data
|
||||
}, textures = resources.map((resource) => {
|
||||
resources === uncompressed && Object.assign(options, {
|
||||
type: resource.type,
|
||||
format: resource.format
|
||||
});
|
||||
const res = resource.resource ?? resource, base = new BaseTexture(res, options);
|
||||
return base.ktxKeyValueData = kvData, createTexture(base, loader, url);
|
||||
});
|
||||
return textures.length === 1 ? textures[0] : textures;
|
||||
},
|
||||
unload(texture) {
|
||||
Array.isArray(texture) ? texture.forEach((t) => t.destroy(!0)) : texture.destroy(!0);
|
||||
}
|
||||
};
|
||||
extensions.add(loadKTX);
|
||||
export {
|
||||
loadKTX
|
||||
};
|
||||
//# sourceMappingURL=loadKTX.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/loadKTX.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadKTX.mjs","sources":["../../src/loaders/loadKTX.ts"],"sourcesContent":["import { checkExtension, createTexture, LoaderParserPriority } from '@pixi/assets';\nimport { ALPHA_MODES, BaseTexture, extensions, ExtensionType, MIPMAP_MODES, settings, utils } from '@pixi/core';\nimport { parseKTX } from '../parsers';\n\nimport type { Loader, LoaderParser, ResolvedAsset } from '@pixi/assets';\nimport type { IBaseTextureOptions, Texture } from '@pixi/core';\n\n/** Loads KTX textures! */\nexport const loadKTX = {\n extension: {\n type: ExtensionType.LoadParser,\n priority: LoaderParserPriority.High,\n },\n\n name: 'loadKTX',\n\n test(url: string): boolean\n {\n return checkExtension(url, '.ktx');\n },\n\n async load(url: string, asset: ResolvedAsset, loader: Loader): Promise<Texture | Texture[]>\n {\n // get an array buffer...\n const response = await settings.ADAPTER.fetch(url);\n\n const arrayBuffer = await response.arrayBuffer();\n\n const { compressed, uncompressed, kvData } = parseKTX(url, arrayBuffer);\n\n const resources = compressed ?? uncompressed;\n\n const options = {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n resolution: utils.getResolutionOfUrl(url),\n ...asset.data,\n };\n\n const textures = resources.map((resource) =>\n {\n if (resources === uncompressed)\n {\n Object.assign(options, {\n type: (resource as typeof uncompressed[0]).type,\n format: (resource as typeof uncompressed[0]).format,\n });\n }\n\n const res = (resource as typeof uncompressed[0]).resource ?? (resource as typeof compressed[0]);\n\n const base = new BaseTexture(res, options);\n\n base.ktxKeyValueData = kvData;\n\n return createTexture(base, loader, url);\n });\n\n return textures.length === 1 ? textures[0] : textures;\n },\n\n unload(texture: Texture | Texture[]): void\n {\n if (Array.isArray(texture))\n {\n texture.forEach((t) => t.destroy(true));\n }\n else\n {\n texture.destroy(true);\n }\n }\n\n} as LoaderParser<Texture | Texture[], IBaseTextureOptions>;\n\nextensions.add(loadKTX);\n"],"names":[],"mappings":";;;;AAQO,MAAM,UAAU;AAAA,EACnB,WAAW;AAAA,IACP,MAAM,cAAc;AAAA,IACpB,UAAU,qBAAqB;AAAA,EACnC;AAAA,EAEA,MAAM;AAAA,EAEN,KAAK,KACL;AACW,WAAA,eAAe,KAAK,MAAM;AAAA,EACrC;AAAA,EAEA,MAAM,KAAK,KAAa,OAAsB,QAC9C;AAIU,UAAA,cAAc,OAFH,MAAM,SAAS,QAAQ,MAAM,GAAG,GAEd,YAAA,GAE7B,EAAE,YAAY,cAAc,OAAA,IAAW,SAAS,KAAK,WAAW,GAEhE,YAAY,cAAc,cAE1B,UAAU;AAAA,MACZ,QAAQ,aAAa;AAAA,MACrB,WAAW,YAAY;AAAA,MACvB,YAAY,MAAM,mBAAmB,GAAG;AAAA,MACxC,GAAG,MAAM;AAAA,IAGP,GAAA,WAAW,UAAU,IAAI,CAAC,aAChC;AACQ,oBAAc,gBAEd,OAAO,OAAO,SAAS;AAAA,QACnB,MAAO,SAAoC;AAAA,QAC3C,QAAS,SAAoC;AAAA,MAAA,CAChD;AAGC,YAAA,MAAO,SAAoC,YAAa,UAExD,OAAO,IAAI,YAAY,KAAK,OAAO;AAEzC,aAAA,KAAK,kBAAkB,QAEhB,cAAc,MAAM,QAAQ,GAAG;AAAA,IAAA,CACzC;AAED,WAAO,SAAS,WAAW,IAAI,SAAS,CAAC,IAAI;AAAA,EACjD;AAAA,EAEA,OAAO,SACP;AACQ,UAAM,QAAQ,OAAO,IAErB,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAI,CAAC,IAItC,QAAQ,QAAQ,EAAI;AAAA,EAE5B;AAEJ;AAEA,WAAW,IAAI,OAAO;"}
|
||||
29
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.js
generated
vendored
Normal file
29
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
const knownFormats = ["s3tc", "s3tc_sRGB", "etc", "etc1", "pvrtc", "atc", "astc", "bptc"], resolveCompressedTextureUrl = {
|
||||
extension: core.ExtensionType.ResolveParser,
|
||||
test: (value) => {
|
||||
const extension = core.utils.path.extname(value).slice(1);
|
||||
return ["basis", "ktx", "dds"].includes(extension);
|
||||
},
|
||||
parse: (value) => {
|
||||
const parts = value.split("."), extension = parts.pop();
|
||||
if (["ktx", "dds"].includes(extension)) {
|
||||
const textureFormat = parts.pop();
|
||||
if (knownFormats.includes(textureFormat))
|
||||
return {
|
||||
resolution: parseFloat(core.settings.RETINA_PREFIX.exec(value)?.[1] ?? "1"),
|
||||
format: textureFormat,
|
||||
src: value
|
||||
};
|
||||
}
|
||||
return {
|
||||
resolution: parseFloat(core.settings.RETINA_PREFIX.exec(value)?.[1] ?? "1"),
|
||||
format: extension,
|
||||
src: value
|
||||
};
|
||||
}
|
||||
};
|
||||
core.extensions.add(resolveCompressedTextureUrl);
|
||||
exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl;
|
||||
//# sourceMappingURL=resolveCompressedTextureUrl.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"resolveCompressedTextureUrl.js","sources":["../../src/loaders/resolveCompressedTextureUrl.ts"],"sourcesContent":["import { extensions, ExtensionType, settings, utils } from '@pixi/core';\n\nimport type { ResolveURLParser, UnresolvedAsset } from '@pixi/assets';\n\nconst knownFormats = ['s3tc', 's3tc_sRGB', 'etc', 'etc1', 'pvrtc', 'atc', 'astc', 'bptc'];\n\nexport const resolveCompressedTextureUrl = {\n extension: ExtensionType.ResolveParser,\n test: (value: string) =>\n {\n const extension = utils.path.extname(value).slice(1);\n\n return ['basis', 'ktx', 'dds'].includes(extension);\n },\n parse: (value: string): UnresolvedAsset =>\n {\n // value expected in format: {name}{resolution}.{format}.{extension} - texture@2x.astc.ktx\n const parts = value.split('.');\n const extension = parts.pop();\n\n if (['ktx', 'dds'].includes(extension))\n {\n const textureFormat = parts.pop();\n\n if (knownFormats.includes(textureFormat))\n {\n return {\n resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? '1'),\n format: textureFormat,\n src: value,\n };\n }\n }\n\n return {\n resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? '1'),\n format: extension,\n src: value,\n };\n },\n} as ResolveURLParser;\n\nextensions.add(resolveCompressedTextureUrl);\n"],"names":["ExtensionType","utils","settings","extensions"],"mappings":";;AAIA,MAAM,eAAe,CAAC,QAAQ,aAAa,OAAO,QAAQ,SAAS,OAAO,QAAQ,MAAM,GAE3E,8BAA8B;AAAA,EACvC,WAAWA,KAAc,cAAA;AAAA,EACzB,MAAM,CAAC,UACP;AACI,UAAM,YAAYC,KAAM,MAAA,KAAK,QAAQ,KAAK,EAAE,MAAM,CAAC;AAEnD,WAAO,CAAC,SAAS,OAAO,KAAK,EAAE,SAAS,SAAS;AAAA,EACrD;AAAA,EACA,OAAO,CAAC,UACR;AAEI,UAAM,QAAQ,MAAM,MAAM,GAAG,GACvB,YAAY,MAAM;AAExB,QAAI,CAAC,OAAO,KAAK,EAAE,SAAS,SAAS,GACrC;AACU,YAAA,gBAAgB,MAAM;AAExB,UAAA,aAAa,SAAS,aAAa;AAE5B,eAAA;AAAA,UACH,YAAY,WAAWC,KAAAA,SAAS,cAAc,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAAA,UACrE,QAAQ;AAAA,UACR,KAAK;AAAA,QAAA;AAAA,IAGjB;AAEO,WAAA;AAAA,MACH,YAAY,WAAWA,KAAAA,SAAS,cAAc,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAAA,MACrE,QAAQ;AAAA,MACR,KAAK;AAAA,IAAA;AAAA,EAEb;AACJ;AAEAC,KAAAA,WAAW,IAAI,2BAA2B;;"}
|
||||
30
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.mjs
generated
vendored
Normal file
30
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { ExtensionType, utils, settings, extensions } from "@pixi/core";
|
||||
const knownFormats = ["s3tc", "s3tc_sRGB", "etc", "etc1", "pvrtc", "atc", "astc", "bptc"], resolveCompressedTextureUrl = {
|
||||
extension: ExtensionType.ResolveParser,
|
||||
test: (value) => {
|
||||
const extension = utils.path.extname(value).slice(1);
|
||||
return ["basis", "ktx", "dds"].includes(extension);
|
||||
},
|
||||
parse: (value) => {
|
||||
const parts = value.split("."), extension = parts.pop();
|
||||
if (["ktx", "dds"].includes(extension)) {
|
||||
const textureFormat = parts.pop();
|
||||
if (knownFormats.includes(textureFormat))
|
||||
return {
|
||||
resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? "1"),
|
||||
format: textureFormat,
|
||||
src: value
|
||||
};
|
||||
}
|
||||
return {
|
||||
resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? "1"),
|
||||
format: extension,
|
||||
src: value
|
||||
};
|
||||
}
|
||||
};
|
||||
extensions.add(resolveCompressedTextureUrl);
|
||||
export {
|
||||
resolveCompressedTextureUrl
|
||||
};
|
||||
//# sourceMappingURL=resolveCompressedTextureUrl.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/loaders/resolveCompressedTextureUrl.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"resolveCompressedTextureUrl.mjs","sources":["../../src/loaders/resolveCompressedTextureUrl.ts"],"sourcesContent":["import { extensions, ExtensionType, settings, utils } from '@pixi/core';\n\nimport type { ResolveURLParser, UnresolvedAsset } from '@pixi/assets';\n\nconst knownFormats = ['s3tc', 's3tc_sRGB', 'etc', 'etc1', 'pvrtc', 'atc', 'astc', 'bptc'];\n\nexport const resolveCompressedTextureUrl = {\n extension: ExtensionType.ResolveParser,\n test: (value: string) =>\n {\n const extension = utils.path.extname(value).slice(1);\n\n return ['basis', 'ktx', 'dds'].includes(extension);\n },\n parse: (value: string): UnresolvedAsset =>\n {\n // value expected in format: {name}{resolution}.{format}.{extension} - texture@2x.astc.ktx\n const parts = value.split('.');\n const extension = parts.pop();\n\n if (['ktx', 'dds'].includes(extension))\n {\n const textureFormat = parts.pop();\n\n if (knownFormats.includes(textureFormat))\n {\n return {\n resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? '1'),\n format: textureFormat,\n src: value,\n };\n }\n }\n\n return {\n resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? '1'),\n format: extension,\n src: value,\n };\n },\n} as ResolveURLParser;\n\nextensions.add(resolveCompressedTextureUrl);\n"],"names":[],"mappings":";AAIA,MAAM,eAAe,CAAC,QAAQ,aAAa,OAAO,QAAQ,SAAS,OAAO,QAAQ,MAAM,GAE3E,8BAA8B;AAAA,EACvC,WAAW,cAAc;AAAA,EACzB,MAAM,CAAC,UACP;AACI,UAAM,YAAY,MAAM,KAAK,QAAQ,KAAK,EAAE,MAAM,CAAC;AAEnD,WAAO,CAAC,SAAS,OAAO,KAAK,EAAE,SAAS,SAAS;AAAA,EACrD;AAAA,EACA,OAAO,CAAC,UACR;AAEI,UAAM,QAAQ,MAAM,MAAM,GAAG,GACvB,YAAY,MAAM;AAExB,QAAI,CAAC,OAAO,KAAK,EAAE,SAAS,SAAS,GACrC;AACU,YAAA,gBAAgB,MAAM;AAExB,UAAA,aAAa,SAAS,aAAa;AAE5B,eAAA;AAAA,UACH,YAAY,WAAW,SAAS,cAAc,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAAA,UACrE,QAAQ;AAAA,UACR,KAAK;AAAA,QAAA;AAAA,IAGjB;AAEO,WAAA;AAAA,MACH,YAAY,WAAW,SAAS,cAAc,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAAA,MACrE,QAAQ;AAAA,MACR,KAAK;AAAA,IAAA;AAAA,EAEb;AACJ;AAEA,WAAW,IAAI,2BAA2B;"}
|
||||
8
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.js
generated
vendored
Normal file
8
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
var parseDDS = require("./parseDDS.js"), parseKTX = require("./parseKTX.js");
|
||||
exports.parseDDS = parseDDS.parseDDS;
|
||||
exports.FORMATS_TO_COMPONENTS = parseKTX.FORMATS_TO_COMPONENTS;
|
||||
exports.TYPES_TO_BYTES_PER_COMPONENT = parseKTX.TYPES_TO_BYTES_PER_COMPONENT;
|
||||
exports.TYPES_TO_BYTES_PER_PIXEL = parseKTX.TYPES_TO_BYTES_PER_PIXEL;
|
||||
exports.parseKTX = parseKTX.parseKTX;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
||||
10
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.mjs
generated
vendored
Normal file
10
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { parseDDS } from "./parseDDS.mjs";
|
||||
import { FORMATS_TO_COMPONENTS, TYPES_TO_BYTES_PER_COMPONENT, TYPES_TO_BYTES_PER_PIXEL, parseKTX } from "./parseKTX.mjs";
|
||||
export {
|
||||
FORMATS_TO_COMPONENTS,
|
||||
TYPES_TO_BYTES_PER_COMPONENT,
|
||||
TYPES_TO_BYTES_PER_PIXEL,
|
||||
parseDDS,
|
||||
parseKTX
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
||||
107
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.js
generated
vendored
Normal file
107
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
var _const = require("../const.js");
|
||||
require("../resources/index.js");
|
||||
var CompressedTextureResource = require("../resources/CompressedTextureResource.js");
|
||||
const DDS_MAGIC_SIZE = 4, DDS_HEADER_SIZE = 124, DDS_HEADER_PF_SIZE = 32, DDS_HEADER_DX10_SIZE = 20, DDS_MAGIC = 542327876, DDS_FIELDS = {
|
||||
SIZE: 1,
|
||||
FLAGS: 2,
|
||||
HEIGHT: 3,
|
||||
WIDTH: 4,
|
||||
MIPMAP_COUNT: 7,
|
||||
PIXEL_FORMAT: 19
|
||||
}, DDS_PF_FIELDS = {
|
||||
SIZE: 0,
|
||||
FLAGS: 1,
|
||||
FOURCC: 2,
|
||||
RGB_BITCOUNT: 3,
|
||||
R_BIT_MASK: 4,
|
||||
G_BIT_MASK: 5,
|
||||
B_BIT_MASK: 6,
|
||||
A_BIT_MASK: 7
|
||||
}, DDS_DX10_FIELDS = {
|
||||
DXGI_FORMAT: 0,
|
||||
RESOURCE_DIMENSION: 1,
|
||||
MISC_FLAG: 2,
|
||||
ARRAY_SIZE: 3,
|
||||
MISC_FLAGS2: 4
|
||||
}, PF_FLAGS = 1, DDPF_ALPHA = 2, DDPF_FOURCC = 4, DDPF_RGB = 64, DDPF_YUV = 512, DDPF_LUMINANCE = 131072, FOURCC_DXT1 = 827611204, FOURCC_DXT3 = 861165636, FOURCC_DXT5 = 894720068, FOURCC_DX10 = 808540228, DDS_RESOURCE_MISC_TEXTURECUBE = 4, FOURCC_TO_FORMAT = {
|
||||
[FOURCC_DXT1]: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
[FOURCC_DXT3]: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
[FOURCC_DXT5]: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT
|
||||
}, DXGI_TO_FORMAT = {
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
70: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
71: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
73: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
74: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
76: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
77: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
// WEBGL_compressed_texture_s3tc_srgb
|
||||
72: _const.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
|
||||
75: _const.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
|
||||
78: _const.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
|
||||
// EXT_texture_compression_bptc
|
||||
// BC6H
|
||||
96: _const.INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
|
||||
95: _const.INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
|
||||
// BC7
|
||||
98: _const.INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
||||
99: _const.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
|
||||
};
|
||||
function parseDDS(arrayBuffer) {
|
||||
const data = new Uint32Array(arrayBuffer);
|
||||
if (data[0] !== DDS_MAGIC)
|
||||
throw new Error("Invalid DDS file magic word");
|
||||
const header = new Uint32Array(arrayBuffer, 0, DDS_HEADER_SIZE / Uint32Array.BYTES_PER_ELEMENT), height = header[DDS_FIELDS.HEIGHT], width = header[DDS_FIELDS.WIDTH], mipmapCount = header[DDS_FIELDS.MIPMAP_COUNT], pixelFormat = new Uint32Array(
|
||||
arrayBuffer,
|
||||
DDS_FIELDS.PIXEL_FORMAT * Uint32Array.BYTES_PER_ELEMENT,
|
||||
DDS_HEADER_PF_SIZE / Uint32Array.BYTES_PER_ELEMENT
|
||||
), formatFlags = pixelFormat[PF_FLAGS];
|
||||
if (formatFlags & DDPF_FOURCC) {
|
||||
const fourCC = pixelFormat[DDS_PF_FIELDS.FOURCC];
|
||||
if (fourCC !== FOURCC_DX10) {
|
||||
const internalFormat2 = FOURCC_TO_FORMAT[fourCC], dataOffset2 = DDS_MAGIC_SIZE + DDS_HEADER_SIZE, texData = new Uint8Array(arrayBuffer, dataOffset2);
|
||||
return [new CompressedTextureResource.CompressedTextureResource(texData, {
|
||||
format: internalFormat2,
|
||||
width,
|
||||
height,
|
||||
levels: mipmapCount
|
||||
// CompressedTextureResource will separate the levelBuffers for us!
|
||||
})];
|
||||
}
|
||||
const dx10Offset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE, dx10Header = new Uint32Array(
|
||||
data.buffer,
|
||||
dx10Offset,
|
||||
DDS_HEADER_DX10_SIZE / Uint32Array.BYTES_PER_ELEMENT
|
||||
), dxgiFormat = dx10Header[DDS_DX10_FIELDS.DXGI_FORMAT], resourceDimension = dx10Header[DDS_DX10_FIELDS.RESOURCE_DIMENSION], miscFlag = dx10Header[DDS_DX10_FIELDS.MISC_FLAG], arraySize = dx10Header[DDS_DX10_FIELDS.ARRAY_SIZE], internalFormat = DXGI_TO_FORMAT[dxgiFormat];
|
||||
if (internalFormat === void 0)
|
||||
throw new Error(`DDSParser cannot parse texture data with DXGI format ${dxgiFormat}`);
|
||||
if (miscFlag === DDS_RESOURCE_MISC_TEXTURECUBE)
|
||||
throw new Error("DDSParser does not support cubemap textures");
|
||||
if (resourceDimension === 6)
|
||||
throw new Error("DDSParser does not supported 3D texture data");
|
||||
const imageBuffers = new Array(), dataOffset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE + DDS_HEADER_DX10_SIZE;
|
||||
if (arraySize === 1)
|
||||
imageBuffers.push(new Uint8Array(arrayBuffer, dataOffset));
|
||||
else {
|
||||
const pixelSize = _const.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[internalFormat];
|
||||
let imageSize = 0, levelWidth = width, levelHeight = height;
|
||||
for (let i = 0; i < mipmapCount; i++) {
|
||||
const alignedLevelWidth = Math.max(1, levelWidth + 3 & -4), alignedLevelHeight = Math.max(1, levelHeight + 3 & -4), levelSize = alignedLevelWidth * alignedLevelHeight * pixelSize;
|
||||
imageSize += levelSize, levelWidth = levelWidth >>> 1, levelHeight = levelHeight >>> 1;
|
||||
}
|
||||
let imageOffset = dataOffset;
|
||||
for (let i = 0; i < arraySize; i++)
|
||||
imageBuffers.push(new Uint8Array(arrayBuffer, imageOffset, imageSize)), imageOffset += imageSize;
|
||||
}
|
||||
return imageBuffers.map((buffer) => new CompressedTextureResource.CompressedTextureResource(buffer, {
|
||||
format: internalFormat,
|
||||
width,
|
||||
height,
|
||||
levels: mipmapCount
|
||||
}));
|
||||
}
|
||||
throw formatFlags & DDPF_RGB ? new Error("DDSParser does not support uncompressed texture data.") : formatFlags & DDPF_YUV ? new Error("DDSParser does not supported YUV uncompressed texture data.") : formatFlags & DDPF_LUMINANCE ? new Error("DDSParser does not support single-channel (lumninance) texture data!") : formatFlags & DDPF_ALPHA ? new Error("DDSParser does not support single-channel (alpha) texture data!") : new Error("DDSParser failed to load a texture file due to an unknown reason!");
|
||||
}
|
||||
exports.parseDDS = parseDDS;
|
||||
//# sourceMappingURL=parseDDS.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
108
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.mjs
generated
vendored
Normal file
108
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.mjs
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
import { INTERNAL_FORMATS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from "../const.mjs";
|
||||
import "../resources/index.mjs";
|
||||
import { CompressedTextureResource } from "../resources/CompressedTextureResource.mjs";
|
||||
const DDS_MAGIC_SIZE = 4, DDS_HEADER_SIZE = 124, DDS_HEADER_PF_SIZE = 32, DDS_HEADER_DX10_SIZE = 20, DDS_MAGIC = 542327876, DDS_FIELDS = {
|
||||
SIZE: 1,
|
||||
FLAGS: 2,
|
||||
HEIGHT: 3,
|
||||
WIDTH: 4,
|
||||
MIPMAP_COUNT: 7,
|
||||
PIXEL_FORMAT: 19
|
||||
}, DDS_PF_FIELDS = {
|
||||
SIZE: 0,
|
||||
FLAGS: 1,
|
||||
FOURCC: 2,
|
||||
RGB_BITCOUNT: 3,
|
||||
R_BIT_MASK: 4,
|
||||
G_BIT_MASK: 5,
|
||||
B_BIT_MASK: 6,
|
||||
A_BIT_MASK: 7
|
||||
}, DDS_DX10_FIELDS = {
|
||||
DXGI_FORMAT: 0,
|
||||
RESOURCE_DIMENSION: 1,
|
||||
MISC_FLAG: 2,
|
||||
ARRAY_SIZE: 3,
|
||||
MISC_FLAGS2: 4
|
||||
}, PF_FLAGS = 1, DDPF_ALPHA = 2, DDPF_FOURCC = 4, DDPF_RGB = 64, DDPF_YUV = 512, DDPF_LUMINANCE = 131072, FOURCC_DXT1 = 827611204, FOURCC_DXT3 = 861165636, FOURCC_DXT5 = 894720068, FOURCC_DX10 = 808540228, DDS_RESOURCE_MISC_TEXTURECUBE = 4, FOURCC_TO_FORMAT = {
|
||||
[FOURCC_DXT1]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
[FOURCC_DXT3]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
[FOURCC_DXT5]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT
|
||||
}, DXGI_TO_FORMAT = {
|
||||
// WEBGL_compressed_texture_s3tc
|
||||
70: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
71: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
73: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
74: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
76: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
77: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
// WEBGL_compressed_texture_s3tc_srgb
|
||||
72: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
|
||||
75: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
|
||||
78: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
|
||||
// EXT_texture_compression_bptc
|
||||
// BC6H
|
||||
96: INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
|
||||
95: INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
|
||||
// BC7
|
||||
98: INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
||||
99: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
|
||||
};
|
||||
function parseDDS(arrayBuffer) {
|
||||
const data = new Uint32Array(arrayBuffer);
|
||||
if (data[0] !== DDS_MAGIC)
|
||||
throw new Error("Invalid DDS file magic word");
|
||||
const header = new Uint32Array(arrayBuffer, 0, DDS_HEADER_SIZE / Uint32Array.BYTES_PER_ELEMENT), height = header[DDS_FIELDS.HEIGHT], width = header[DDS_FIELDS.WIDTH], mipmapCount = header[DDS_FIELDS.MIPMAP_COUNT], pixelFormat = new Uint32Array(
|
||||
arrayBuffer,
|
||||
DDS_FIELDS.PIXEL_FORMAT * Uint32Array.BYTES_PER_ELEMENT,
|
||||
DDS_HEADER_PF_SIZE / Uint32Array.BYTES_PER_ELEMENT
|
||||
), formatFlags = pixelFormat[PF_FLAGS];
|
||||
if (formatFlags & DDPF_FOURCC) {
|
||||
const fourCC = pixelFormat[DDS_PF_FIELDS.FOURCC];
|
||||
if (fourCC !== FOURCC_DX10) {
|
||||
const internalFormat2 = FOURCC_TO_FORMAT[fourCC], dataOffset2 = DDS_MAGIC_SIZE + DDS_HEADER_SIZE, texData = new Uint8Array(arrayBuffer, dataOffset2);
|
||||
return [new CompressedTextureResource(texData, {
|
||||
format: internalFormat2,
|
||||
width,
|
||||
height,
|
||||
levels: mipmapCount
|
||||
// CompressedTextureResource will separate the levelBuffers for us!
|
||||
})];
|
||||
}
|
||||
const dx10Offset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE, dx10Header = new Uint32Array(
|
||||
data.buffer,
|
||||
dx10Offset,
|
||||
DDS_HEADER_DX10_SIZE / Uint32Array.BYTES_PER_ELEMENT
|
||||
), dxgiFormat = dx10Header[DDS_DX10_FIELDS.DXGI_FORMAT], resourceDimension = dx10Header[DDS_DX10_FIELDS.RESOURCE_DIMENSION], miscFlag = dx10Header[DDS_DX10_FIELDS.MISC_FLAG], arraySize = dx10Header[DDS_DX10_FIELDS.ARRAY_SIZE], internalFormat = DXGI_TO_FORMAT[dxgiFormat];
|
||||
if (internalFormat === void 0)
|
||||
throw new Error(`DDSParser cannot parse texture data with DXGI format ${dxgiFormat}`);
|
||||
if (miscFlag === DDS_RESOURCE_MISC_TEXTURECUBE)
|
||||
throw new Error("DDSParser does not support cubemap textures");
|
||||
if (resourceDimension === 6)
|
||||
throw new Error("DDSParser does not supported 3D texture data");
|
||||
const imageBuffers = new Array(), dataOffset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE + DDS_HEADER_DX10_SIZE;
|
||||
if (arraySize === 1)
|
||||
imageBuffers.push(new Uint8Array(arrayBuffer, dataOffset));
|
||||
else {
|
||||
const pixelSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[internalFormat];
|
||||
let imageSize = 0, levelWidth = width, levelHeight = height;
|
||||
for (let i = 0; i < mipmapCount; i++) {
|
||||
const alignedLevelWidth = Math.max(1, levelWidth + 3 & -4), alignedLevelHeight = Math.max(1, levelHeight + 3 & -4), levelSize = alignedLevelWidth * alignedLevelHeight * pixelSize;
|
||||
imageSize += levelSize, levelWidth = levelWidth >>> 1, levelHeight = levelHeight >>> 1;
|
||||
}
|
||||
let imageOffset = dataOffset;
|
||||
for (let i = 0; i < arraySize; i++)
|
||||
imageBuffers.push(new Uint8Array(arrayBuffer, imageOffset, imageSize)), imageOffset += imageSize;
|
||||
}
|
||||
return imageBuffers.map((buffer) => new CompressedTextureResource(buffer, {
|
||||
format: internalFormat,
|
||||
width,
|
||||
height,
|
||||
levels: mipmapCount
|
||||
}));
|
||||
}
|
||||
throw formatFlags & DDPF_RGB ? new Error("DDSParser does not support uncompressed texture data.") : formatFlags & DDPF_YUV ? new Error("DDSParser does not supported YUV uncompressed texture data.") : formatFlags & DDPF_LUMINANCE ? new Error("DDSParser does not support single-channel (lumninance) texture data!") : formatFlags & DDPF_ALPHA ? new Error("DDSParser does not support single-channel (alpha) texture data!") : new Error("DDSParser failed to load a texture file due to an unknown reason!");
|
||||
}
|
||||
export {
|
||||
parseDDS
|
||||
};
|
||||
//# sourceMappingURL=parseDDS.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseDDS.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
164
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.js
generated
vendored
Normal file
164
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), _const = require("../const.js");
|
||||
require("../resources/index.js");
|
||||
var CompressedTextureResource = require("../resources/CompressedTextureResource.js");
|
||||
const FILE_IDENTIFIER = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10], ENDIANNESS = 67305985, KTX_FIELDS = {
|
||||
FILE_IDENTIFIER: 0,
|
||||
ENDIANNESS: 12,
|
||||
GL_TYPE: 16,
|
||||
GL_TYPE_SIZE: 20,
|
||||
GL_FORMAT: 24,
|
||||
GL_INTERNAL_FORMAT: 28,
|
||||
GL_BASE_INTERNAL_FORMAT: 32,
|
||||
PIXEL_WIDTH: 36,
|
||||
PIXEL_HEIGHT: 40,
|
||||
PIXEL_DEPTH: 44,
|
||||
NUMBER_OF_ARRAY_ELEMENTS: 48,
|
||||
NUMBER_OF_FACES: 52,
|
||||
NUMBER_OF_MIPMAP_LEVELS: 56,
|
||||
BYTES_OF_KEY_VALUE_DATA: 60
|
||||
}, FILE_HEADER_SIZE = 64, TYPES_TO_BYTES_PER_COMPONENT = {
|
||||
[core.TYPES.UNSIGNED_BYTE]: 1,
|
||||
[core.TYPES.UNSIGNED_SHORT]: 2,
|
||||
[core.TYPES.INT]: 4,
|
||||
[core.TYPES.UNSIGNED_INT]: 4,
|
||||
[core.TYPES.FLOAT]: 4,
|
||||
[core.TYPES.HALF_FLOAT]: 8
|
||||
}, FORMATS_TO_COMPONENTS = {
|
||||
[core.FORMATS.RGBA]: 4,
|
||||
[core.FORMATS.RGB]: 3,
|
||||
[core.FORMATS.RG]: 2,
|
||||
[core.FORMATS.RED]: 1,
|
||||
[core.FORMATS.LUMINANCE]: 1,
|
||||
[core.FORMATS.LUMINANCE_ALPHA]: 2,
|
||||
[core.FORMATS.ALPHA]: 1
|
||||
}, TYPES_TO_BYTES_PER_PIXEL = {
|
||||
[core.TYPES.UNSIGNED_SHORT_4_4_4_4]: 2,
|
||||
[core.TYPES.UNSIGNED_SHORT_5_5_5_1]: 2,
|
||||
[core.TYPES.UNSIGNED_SHORT_5_6_5]: 2
|
||||
};
|
||||
function parseKTX(url, arrayBuffer, loadKeyValueData = !1) {
|
||||
const dataView = new DataView(arrayBuffer);
|
||||
if (!validate(url, dataView))
|
||||
return null;
|
||||
const littleEndian = dataView.getUint32(KTX_FIELDS.ENDIANNESS, !0) === ENDIANNESS, glType = dataView.getUint32(KTX_FIELDS.GL_TYPE, littleEndian), glFormat = dataView.getUint32(KTX_FIELDS.GL_FORMAT, littleEndian), glInternalFormat = dataView.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT, littleEndian), pixelWidth = dataView.getUint32(KTX_FIELDS.PIXEL_WIDTH, littleEndian), pixelHeight = dataView.getUint32(KTX_FIELDS.PIXEL_HEIGHT, littleEndian) || 1, pixelDepth = dataView.getUint32(KTX_FIELDS.PIXEL_DEPTH, littleEndian) || 1, numberOfArrayElements = dataView.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS, littleEndian) || 1, numberOfFaces = dataView.getUint32(KTX_FIELDS.NUMBER_OF_FACES, littleEndian), numberOfMipmapLevels = dataView.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS, littleEndian), bytesOfKeyValueData = dataView.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA, littleEndian);
|
||||
if (pixelHeight === 0 || pixelDepth !== 1)
|
||||
throw new Error("Only 2D textures are supported");
|
||||
if (numberOfFaces !== 1)
|
||||
throw new Error("CubeTextures are not supported by KTXLoader yet!");
|
||||
if (numberOfArrayElements !== 1)
|
||||
throw new Error("WebGL does not support array textures");
|
||||
const blockWidth = 4, blockHeight = 4, alignedWidth = pixelWidth + 3 & -4, alignedHeight = pixelHeight + 3 & -4, imageBuffers = new Array(numberOfArrayElements);
|
||||
let imagePixels = pixelWidth * pixelHeight;
|
||||
glType === 0 && (imagePixels = alignedWidth * alignedHeight);
|
||||
let imagePixelByteSize;
|
||||
if (glType !== 0 ? TYPES_TO_BYTES_PER_COMPONENT[glType] ? imagePixelByteSize = TYPES_TO_BYTES_PER_COMPONENT[glType] * FORMATS_TO_COMPONENTS[glFormat] : imagePixelByteSize = TYPES_TO_BYTES_PER_PIXEL[glType] : imagePixelByteSize = _const.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[glInternalFormat], imagePixelByteSize === void 0)
|
||||
throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");
|
||||
const kvData = loadKeyValueData ? parseKvData(dataView, bytesOfKeyValueData, littleEndian) : null;
|
||||
let mipByteSize = imagePixels * imagePixelByteSize, mipWidth = pixelWidth, mipHeight = pixelHeight, alignedMipWidth = alignedWidth, alignedMipHeight = alignedHeight, imageOffset = FILE_HEADER_SIZE + bytesOfKeyValueData;
|
||||
for (let mipmapLevel = 0; mipmapLevel < numberOfMipmapLevels; mipmapLevel++) {
|
||||
const imageSize = dataView.getUint32(imageOffset, littleEndian);
|
||||
let elementOffset = imageOffset + 4;
|
||||
for (let arrayElement = 0; arrayElement < numberOfArrayElements; arrayElement++) {
|
||||
let mips = imageBuffers[arrayElement];
|
||||
mips || (mips = imageBuffers[arrayElement] = new Array(numberOfMipmapLevels)), mips[mipmapLevel] = {
|
||||
levelID: mipmapLevel,
|
||||
// don't align mipWidth when texture not compressed! (glType not zero)
|
||||
levelWidth: numberOfMipmapLevels > 1 || glType !== 0 ? mipWidth : alignedMipWidth,
|
||||
levelHeight: numberOfMipmapLevels > 1 || glType !== 0 ? mipHeight : alignedMipHeight,
|
||||
levelBuffer: new Uint8Array(arrayBuffer, elementOffset, mipByteSize)
|
||||
}, elementOffset += mipByteSize;
|
||||
}
|
||||
imageOffset += imageSize + 4, imageOffset = imageOffset % 4 !== 0 ? imageOffset + 4 - imageOffset % 4 : imageOffset, mipWidth = mipWidth >> 1 || 1, mipHeight = mipHeight >> 1 || 1, alignedMipWidth = mipWidth + blockWidth - 1 & ~(blockWidth - 1), alignedMipHeight = mipHeight + blockHeight - 1 & ~(blockHeight - 1), mipByteSize = alignedMipWidth * alignedMipHeight * imagePixelByteSize;
|
||||
}
|
||||
return glType !== 0 ? {
|
||||
uncompressed: imageBuffers.map((levelBuffers) => {
|
||||
let buffer = levelBuffers[0].levelBuffer, convertToInt = !1;
|
||||
return glType === core.TYPES.FLOAT ? buffer = new Float32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
) : glType === core.TYPES.UNSIGNED_INT ? (convertToInt = !0, buffer = new Uint32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
)) : glType === core.TYPES.INT && (convertToInt = !0, buffer = new Int32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
)), {
|
||||
resource: new core.BufferResource(
|
||||
buffer,
|
||||
{
|
||||
width: levelBuffers[0].levelWidth,
|
||||
height: levelBuffers[0].levelHeight
|
||||
}
|
||||
),
|
||||
type: glType,
|
||||
format: convertToInt ? convertFormatToInteger(glFormat) : glFormat
|
||||
};
|
||||
}),
|
||||
kvData
|
||||
} : {
|
||||
compressed: imageBuffers.map((levelBuffers) => new CompressedTextureResource.CompressedTextureResource(null, {
|
||||
format: glInternalFormat,
|
||||
width: pixelWidth,
|
||||
height: pixelHeight,
|
||||
levels: numberOfMipmapLevels,
|
||||
levelBuffers
|
||||
})),
|
||||
kvData
|
||||
};
|
||||
}
|
||||
function validate(url, dataView) {
|
||||
for (let i = 0; i < FILE_IDENTIFIER.length; i++)
|
||||
if (dataView.getUint8(i) !== FILE_IDENTIFIER[i])
|
||||
return console.error(`${url} is not a valid *.ktx file!`), !1;
|
||||
return !0;
|
||||
}
|
||||
function convertFormatToInteger(format) {
|
||||
switch (format) {
|
||||
case core.FORMATS.RGBA:
|
||||
return core.FORMATS.RGBA_INTEGER;
|
||||
case core.FORMATS.RGB:
|
||||
return core.FORMATS.RGB_INTEGER;
|
||||
case core.FORMATS.RG:
|
||||
return core.FORMATS.RG_INTEGER;
|
||||
case core.FORMATS.RED:
|
||||
return core.FORMATS.RED_INTEGER;
|
||||
default:
|
||||
return format;
|
||||
}
|
||||
}
|
||||
function parseKvData(dataView, bytesOfKeyValueData, littleEndian) {
|
||||
const kvData = /* @__PURE__ */ new Map();
|
||||
let bytesIntoKeyValueData = 0;
|
||||
for (; bytesIntoKeyValueData < bytesOfKeyValueData; ) {
|
||||
const keyAndValueByteSize = dataView.getUint32(FILE_HEADER_SIZE + bytesIntoKeyValueData, littleEndian), keyAndValueByteOffset = FILE_HEADER_SIZE + bytesIntoKeyValueData + 4, valuePadding = 3 - (keyAndValueByteSize + 3) % 4;
|
||||
if (keyAndValueByteSize === 0 || keyAndValueByteSize > bytesOfKeyValueData - bytesIntoKeyValueData) {
|
||||
console.error("KTXLoader: keyAndValueByteSize out of bounds");
|
||||
break;
|
||||
}
|
||||
let keyNulByte = 0;
|
||||
for (; keyNulByte < keyAndValueByteSize && dataView.getUint8(keyAndValueByteOffset + keyNulByte) !== 0; keyNulByte++)
|
||||
;
|
||||
if (keyNulByte === -1) {
|
||||
console.error("KTXLoader: Failed to find null byte terminating kvData key");
|
||||
break;
|
||||
}
|
||||
const key = new TextDecoder().decode(
|
||||
new Uint8Array(dataView.buffer, keyAndValueByteOffset, keyNulByte)
|
||||
), value = new DataView(
|
||||
dataView.buffer,
|
||||
keyAndValueByteOffset + keyNulByte + 1,
|
||||
keyAndValueByteSize - keyNulByte - 1
|
||||
);
|
||||
kvData.set(key, value), bytesIntoKeyValueData += 4 + keyAndValueByteSize + valuePadding;
|
||||
}
|
||||
return kvData;
|
||||
}
|
||||
exports.FORMATS_TO_COMPONENTS = FORMATS_TO_COMPONENTS;
|
||||
exports.TYPES_TO_BYTES_PER_COMPONENT = TYPES_TO_BYTES_PER_COMPONENT;
|
||||
exports.TYPES_TO_BYTES_PER_PIXEL = TYPES_TO_BYTES_PER_PIXEL;
|
||||
exports.parseKTX = parseKTX;
|
||||
//# sourceMappingURL=parseKTX.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
166
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.mjs
generated
vendored
Normal file
166
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.mjs
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
import { TYPES, FORMATS, BufferResource } from "@pixi/core";
|
||||
import { INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from "../const.mjs";
|
||||
import "../resources/index.mjs";
|
||||
import { CompressedTextureResource } from "../resources/CompressedTextureResource.mjs";
|
||||
const FILE_IDENTIFIER = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10], ENDIANNESS = 67305985, KTX_FIELDS = {
|
||||
FILE_IDENTIFIER: 0,
|
||||
ENDIANNESS: 12,
|
||||
GL_TYPE: 16,
|
||||
GL_TYPE_SIZE: 20,
|
||||
GL_FORMAT: 24,
|
||||
GL_INTERNAL_FORMAT: 28,
|
||||
GL_BASE_INTERNAL_FORMAT: 32,
|
||||
PIXEL_WIDTH: 36,
|
||||
PIXEL_HEIGHT: 40,
|
||||
PIXEL_DEPTH: 44,
|
||||
NUMBER_OF_ARRAY_ELEMENTS: 48,
|
||||
NUMBER_OF_FACES: 52,
|
||||
NUMBER_OF_MIPMAP_LEVELS: 56,
|
||||
BYTES_OF_KEY_VALUE_DATA: 60
|
||||
}, FILE_HEADER_SIZE = 64, TYPES_TO_BYTES_PER_COMPONENT = {
|
||||
[TYPES.UNSIGNED_BYTE]: 1,
|
||||
[TYPES.UNSIGNED_SHORT]: 2,
|
||||
[TYPES.INT]: 4,
|
||||
[TYPES.UNSIGNED_INT]: 4,
|
||||
[TYPES.FLOAT]: 4,
|
||||
[TYPES.HALF_FLOAT]: 8
|
||||
}, FORMATS_TO_COMPONENTS = {
|
||||
[FORMATS.RGBA]: 4,
|
||||
[FORMATS.RGB]: 3,
|
||||
[FORMATS.RG]: 2,
|
||||
[FORMATS.RED]: 1,
|
||||
[FORMATS.LUMINANCE]: 1,
|
||||
[FORMATS.LUMINANCE_ALPHA]: 2,
|
||||
[FORMATS.ALPHA]: 1
|
||||
}, TYPES_TO_BYTES_PER_PIXEL = {
|
||||
[TYPES.UNSIGNED_SHORT_4_4_4_4]: 2,
|
||||
[TYPES.UNSIGNED_SHORT_5_5_5_1]: 2,
|
||||
[TYPES.UNSIGNED_SHORT_5_6_5]: 2
|
||||
};
|
||||
function parseKTX(url, arrayBuffer, loadKeyValueData = !1) {
|
||||
const dataView = new DataView(arrayBuffer);
|
||||
if (!validate(url, dataView))
|
||||
return null;
|
||||
const littleEndian = dataView.getUint32(KTX_FIELDS.ENDIANNESS, !0) === ENDIANNESS, glType = dataView.getUint32(KTX_FIELDS.GL_TYPE, littleEndian), glFormat = dataView.getUint32(KTX_FIELDS.GL_FORMAT, littleEndian), glInternalFormat = dataView.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT, littleEndian), pixelWidth = dataView.getUint32(KTX_FIELDS.PIXEL_WIDTH, littleEndian), pixelHeight = dataView.getUint32(KTX_FIELDS.PIXEL_HEIGHT, littleEndian) || 1, pixelDepth = dataView.getUint32(KTX_FIELDS.PIXEL_DEPTH, littleEndian) || 1, numberOfArrayElements = dataView.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS, littleEndian) || 1, numberOfFaces = dataView.getUint32(KTX_FIELDS.NUMBER_OF_FACES, littleEndian), numberOfMipmapLevels = dataView.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS, littleEndian), bytesOfKeyValueData = dataView.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA, littleEndian);
|
||||
if (pixelHeight === 0 || pixelDepth !== 1)
|
||||
throw new Error("Only 2D textures are supported");
|
||||
if (numberOfFaces !== 1)
|
||||
throw new Error("CubeTextures are not supported by KTXLoader yet!");
|
||||
if (numberOfArrayElements !== 1)
|
||||
throw new Error("WebGL does not support array textures");
|
||||
const blockWidth = 4, blockHeight = 4, alignedWidth = pixelWidth + 3 & -4, alignedHeight = pixelHeight + 3 & -4, imageBuffers = new Array(numberOfArrayElements);
|
||||
let imagePixels = pixelWidth * pixelHeight;
|
||||
glType === 0 && (imagePixels = alignedWidth * alignedHeight);
|
||||
let imagePixelByteSize;
|
||||
if (glType !== 0 ? TYPES_TO_BYTES_PER_COMPONENT[glType] ? imagePixelByteSize = TYPES_TO_BYTES_PER_COMPONENT[glType] * FORMATS_TO_COMPONENTS[glFormat] : imagePixelByteSize = TYPES_TO_BYTES_PER_PIXEL[glType] : imagePixelByteSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[glInternalFormat], imagePixelByteSize === void 0)
|
||||
throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");
|
||||
const kvData = loadKeyValueData ? parseKvData(dataView, bytesOfKeyValueData, littleEndian) : null;
|
||||
let mipByteSize = imagePixels * imagePixelByteSize, mipWidth = pixelWidth, mipHeight = pixelHeight, alignedMipWidth = alignedWidth, alignedMipHeight = alignedHeight, imageOffset = FILE_HEADER_SIZE + bytesOfKeyValueData;
|
||||
for (let mipmapLevel = 0; mipmapLevel < numberOfMipmapLevels; mipmapLevel++) {
|
||||
const imageSize = dataView.getUint32(imageOffset, littleEndian);
|
||||
let elementOffset = imageOffset + 4;
|
||||
for (let arrayElement = 0; arrayElement < numberOfArrayElements; arrayElement++) {
|
||||
let mips = imageBuffers[arrayElement];
|
||||
mips || (mips = imageBuffers[arrayElement] = new Array(numberOfMipmapLevels)), mips[mipmapLevel] = {
|
||||
levelID: mipmapLevel,
|
||||
// don't align mipWidth when texture not compressed! (glType not zero)
|
||||
levelWidth: numberOfMipmapLevels > 1 || glType !== 0 ? mipWidth : alignedMipWidth,
|
||||
levelHeight: numberOfMipmapLevels > 1 || glType !== 0 ? mipHeight : alignedMipHeight,
|
||||
levelBuffer: new Uint8Array(arrayBuffer, elementOffset, mipByteSize)
|
||||
}, elementOffset += mipByteSize;
|
||||
}
|
||||
imageOffset += imageSize + 4, imageOffset = imageOffset % 4 !== 0 ? imageOffset + 4 - imageOffset % 4 : imageOffset, mipWidth = mipWidth >> 1 || 1, mipHeight = mipHeight >> 1 || 1, alignedMipWidth = mipWidth + blockWidth - 1 & ~(blockWidth - 1), alignedMipHeight = mipHeight + blockHeight - 1 & ~(blockHeight - 1), mipByteSize = alignedMipWidth * alignedMipHeight * imagePixelByteSize;
|
||||
}
|
||||
return glType !== 0 ? {
|
||||
uncompressed: imageBuffers.map((levelBuffers) => {
|
||||
let buffer = levelBuffers[0].levelBuffer, convertToInt = !1;
|
||||
return glType === TYPES.FLOAT ? buffer = new Float32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
) : glType === TYPES.UNSIGNED_INT ? (convertToInt = !0, buffer = new Uint32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
)) : glType === TYPES.INT && (convertToInt = !0, buffer = new Int32Array(
|
||||
levelBuffers[0].levelBuffer.buffer,
|
||||
levelBuffers[0].levelBuffer.byteOffset,
|
||||
levelBuffers[0].levelBuffer.byteLength / 4
|
||||
)), {
|
||||
resource: new BufferResource(
|
||||
buffer,
|
||||
{
|
||||
width: levelBuffers[0].levelWidth,
|
||||
height: levelBuffers[0].levelHeight
|
||||
}
|
||||
),
|
||||
type: glType,
|
||||
format: convertToInt ? convertFormatToInteger(glFormat) : glFormat
|
||||
};
|
||||
}),
|
||||
kvData
|
||||
} : {
|
||||
compressed: imageBuffers.map((levelBuffers) => new CompressedTextureResource(null, {
|
||||
format: glInternalFormat,
|
||||
width: pixelWidth,
|
||||
height: pixelHeight,
|
||||
levels: numberOfMipmapLevels,
|
||||
levelBuffers
|
||||
})),
|
||||
kvData
|
||||
};
|
||||
}
|
||||
function validate(url, dataView) {
|
||||
for (let i = 0; i < FILE_IDENTIFIER.length; i++)
|
||||
if (dataView.getUint8(i) !== FILE_IDENTIFIER[i])
|
||||
return console.error(`${url} is not a valid *.ktx file!`), !1;
|
||||
return !0;
|
||||
}
|
||||
function convertFormatToInteger(format) {
|
||||
switch (format) {
|
||||
case FORMATS.RGBA:
|
||||
return FORMATS.RGBA_INTEGER;
|
||||
case FORMATS.RGB:
|
||||
return FORMATS.RGB_INTEGER;
|
||||
case FORMATS.RG:
|
||||
return FORMATS.RG_INTEGER;
|
||||
case FORMATS.RED:
|
||||
return FORMATS.RED_INTEGER;
|
||||
default:
|
||||
return format;
|
||||
}
|
||||
}
|
||||
function parseKvData(dataView, bytesOfKeyValueData, littleEndian) {
|
||||
const kvData = /* @__PURE__ */ new Map();
|
||||
let bytesIntoKeyValueData = 0;
|
||||
for (; bytesIntoKeyValueData < bytesOfKeyValueData; ) {
|
||||
const keyAndValueByteSize = dataView.getUint32(FILE_HEADER_SIZE + bytesIntoKeyValueData, littleEndian), keyAndValueByteOffset = FILE_HEADER_SIZE + bytesIntoKeyValueData + 4, valuePadding = 3 - (keyAndValueByteSize + 3) % 4;
|
||||
if (keyAndValueByteSize === 0 || keyAndValueByteSize > bytesOfKeyValueData - bytesIntoKeyValueData) {
|
||||
console.error("KTXLoader: keyAndValueByteSize out of bounds");
|
||||
break;
|
||||
}
|
||||
let keyNulByte = 0;
|
||||
for (; keyNulByte < keyAndValueByteSize && dataView.getUint8(keyAndValueByteOffset + keyNulByte) !== 0; keyNulByte++)
|
||||
;
|
||||
if (keyNulByte === -1) {
|
||||
console.error("KTXLoader: Failed to find null byte terminating kvData key");
|
||||
break;
|
||||
}
|
||||
const key = new TextDecoder().decode(
|
||||
new Uint8Array(dataView.buffer, keyAndValueByteOffset, keyNulByte)
|
||||
), value = new DataView(
|
||||
dataView.buffer,
|
||||
keyAndValueByteOffset + keyNulByte + 1,
|
||||
keyAndValueByteSize - keyNulByte - 1
|
||||
);
|
||||
kvData.set(key, value), bytesIntoKeyValueData += 4 + keyAndValueByteSize + valuePadding;
|
||||
}
|
||||
return kvData;
|
||||
}
|
||||
export {
|
||||
FORMATS_TO_COMPONENTS,
|
||||
TYPES_TO_BYTES_PER_COMPONENT,
|
||||
TYPES_TO_BYTES_PER_PIXEL,
|
||||
parseKTX
|
||||
};
|
||||
//# sourceMappingURL=parseKTX.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/parsers/parseKTX.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
25
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.js
generated
vendored
Normal file
25
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
class BlobResource extends core.BufferResource {
|
||||
/**
|
||||
* @param source - The buffer/URL of the texture file.
|
||||
* @param {PIXI.IBlobResourceOptions} [options]
|
||||
* @param {boolean} [options.autoLoad=false] - Whether to fetch the data immediately;
|
||||
* you can fetch it later via {@link PIXI.BlobResource#load}.
|
||||
* @param {number} [options.width=1] - The width in pixels.
|
||||
* @param {number} [options.height=1] - The height in pixels.
|
||||
* @param {1|2|4|8} [options.unpackAlignment=4] - The alignment of the pixel rows.
|
||||
*/
|
||||
constructor(source, options = { width: 1, height: 1, autoLoad: !0 }) {
|
||||
let origin, data;
|
||||
typeof source == "string" ? (origin = source, data = new Uint8Array()) : (origin = null, data = source), super(data, options), this.origin = origin, this.buffer = data ? new core.ViewableBuffer(data) : null, this._load = null, this.loaded = !1, this.origin !== null && options.autoLoad !== !1 && this.load(), this.origin === null && this.buffer && (this._load = Promise.resolve(this), this.loaded = !0, this.onBlobLoaded(this.buffer.rawBinaryData));
|
||||
}
|
||||
onBlobLoaded(_data) {
|
||||
}
|
||||
/** Loads the blob */
|
||||
load() {
|
||||
return this._load ? this._load : (this._load = fetch(this.origin).then((response) => response.blob()).then((blob) => blob.arrayBuffer()).then((arrayBuffer) => (this.data = new Uint32Array(arrayBuffer), this.buffer = new core.ViewableBuffer(arrayBuffer), this.loaded = !0, this.onBlobLoaded(arrayBuffer), this.update(), this)), this._load);
|
||||
}
|
||||
}
|
||||
exports.BlobResource = BlobResource;
|
||||
//# sourceMappingURL=BlobResource.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BlobResource.js","sources":["../../src/resources/BlobResource.ts"],"sourcesContent":["import { BufferResource, ViewableBuffer } from '@pixi/core';\n\nimport type { BufferType, IBufferResourceOptions } from '@pixi/core';\n\n/**\n * Constructor options for BlobResource.\n * @memberof PIXI\n */\nexport interface IBlobResourceOptions extends IBufferResourceOptions\n{\n autoLoad?: boolean;\n}\n\n/**\n * Resource that fetches texture data over the network and stores it in a buffer.\n * @class\n * @extends PIXI.Resource\n * @memberof PIXI\n */\nexport abstract class BlobResource extends BufferResource\n{\n /** The URL of the texture file. */\n protected origin: string | null;\n\n /** The viewable buffer on the data. */\n protected buffer: ViewableBuffer | null;\n\n protected loaded: boolean;\n\n /**\n * Promise when loading.\n * @default null\n */\n private _load: Promise<this>;\n\n /**\n * @param source - The buffer/URL of the texture file.\n * @param {PIXI.IBlobResourceOptions} [options]\n * @param {boolean} [options.autoLoad=false] - Whether to fetch the data immediately;\n * you can fetch it later via {@link PIXI.BlobResource#load}.\n * @param {number} [options.width=1] - The width in pixels.\n * @param {number} [options.height=1] - The height in pixels.\n * @param {1|2|4|8} [options.unpackAlignment=4] - The alignment of the pixel rows.\n */\n constructor(source: string | BufferType, options: IBlobResourceOptions = { width: 1, height: 1, autoLoad: true })\n {\n let origin: string | null;\n let data: BufferType;\n\n if (typeof source === 'string')\n {\n origin = source;\n data = new Uint8Array();\n }\n else\n {\n origin = null;\n data = source;\n }\n\n super(data, options);\n\n this.origin = origin;\n this.buffer = data ? new ViewableBuffer(data) : null;\n\n this._load = null;\n this.loaded = false;\n\n // Allow autoLoad = \"undefined\" still load the resource by default\n if (this.origin !== null && options.autoLoad !== false)\n {\n this.load();\n }\n if (this.origin === null && this.buffer)\n {\n this._load = Promise.resolve(this);\n this.loaded = true;\n this.onBlobLoaded(this.buffer.rawBinaryData);\n }\n }\n\n protected onBlobLoaded(_data: ArrayBuffer): void\n {\n // TODO: Override this method\n }\n\n /** Loads the blob */\n load(): Promise<this>\n {\n if (this._load)\n {\n return this._load;\n }\n\n this._load = fetch(this.origin)\n .then((response) => response.blob())\n .then((blob) => blob.arrayBuffer())\n .then((arrayBuffer) =>\n {\n this.data = new Uint32Array(arrayBuffer);\n this.buffer = new ViewableBuffer(arrayBuffer);\n this.loaded = true;\n\n this.onBlobLoaded(arrayBuffer);\n this.update();\n\n return this;\n });\n\n return this._load;\n }\n}\n"],"names":["BufferResource","ViewableBuffer"],"mappings":";;AAmBO,MAAe,qBAAqBA,KAAAA,eAC3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBI,YAAY,QAA6B,UAAgC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,MAC1G;AACI,QAAI,QACA;AAEA,WAAO,UAAW,YAElB,SAAS,QACT,OAAO,IAAI,WAAW,MAItB,SAAS,MACT,OAAO,SAGX,MAAM,MAAM,OAAO,GAEnB,KAAK,SAAS,QACd,KAAK,SAAS,OAAO,IAAIC,oBAAe,IAAI,IAAI,MAEhD,KAAK,QAAQ,MACb,KAAK,SAAS,IAGV,KAAK,WAAW,QAAQ,QAAQ,aAAa,MAE7C,KAAK,KAAA,GAEL,KAAK,WAAW,QAAQ,KAAK,WAE7B,KAAK,QAAQ,QAAQ,QAAQ,IAAI,GACjC,KAAK,SAAS,IACd,KAAK,aAAa,KAAK,OAAO,aAAa;AAAA,EAEnD;AAAA,EAEU,aAAa,OACvB;AAAA,EAEA;AAAA;AAAA,EAGA,OACA;AACQ,WAAA,KAAK,QAEE,KAAK,SAGhB,KAAK,QAAQ,MAAM,KAAK,MAAM,EACzB,KAAK,CAAC,aAAa,SAAS,MAAM,EAClC,KAAK,CAAC,SAAS,KAAK,YAAY,CAAC,EACjC,KAAK,CAAC,iBAEH,KAAK,OAAO,IAAI,YAAY,WAAW,GACvC,KAAK,SAAS,IAAIA,oBAAe,WAAW,GAC5C,KAAK,SAAS,IAEd,KAAK,aAAa,WAAW,GAC7B,KAAK,OAAO,GAEL,KACV,GAEE,KAAK;AAAA,EAChB;AACJ;;"}
|
||||
26
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.mjs
generated
vendored
Normal file
26
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.mjs
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { BufferResource, ViewableBuffer } from "@pixi/core";
|
||||
class BlobResource extends BufferResource {
|
||||
/**
|
||||
* @param source - The buffer/URL of the texture file.
|
||||
* @param {PIXI.IBlobResourceOptions} [options]
|
||||
* @param {boolean} [options.autoLoad=false] - Whether to fetch the data immediately;
|
||||
* you can fetch it later via {@link PIXI.BlobResource#load}.
|
||||
* @param {number} [options.width=1] - The width in pixels.
|
||||
* @param {number} [options.height=1] - The height in pixels.
|
||||
* @param {1|2|4|8} [options.unpackAlignment=4] - The alignment of the pixel rows.
|
||||
*/
|
||||
constructor(source, options = { width: 1, height: 1, autoLoad: !0 }) {
|
||||
let origin, data;
|
||||
typeof source == "string" ? (origin = source, data = new Uint8Array()) : (origin = null, data = source), super(data, options), this.origin = origin, this.buffer = data ? new ViewableBuffer(data) : null, this._load = null, this.loaded = !1, this.origin !== null && options.autoLoad !== !1 && this.load(), this.origin === null && this.buffer && (this._load = Promise.resolve(this), this.loaded = !0, this.onBlobLoaded(this.buffer.rawBinaryData));
|
||||
}
|
||||
onBlobLoaded(_data) {
|
||||
}
|
||||
/** Loads the blob */
|
||||
load() {
|
||||
return this._load ? this._load : (this._load = fetch(this.origin).then((response) => response.blob()).then((blob) => blob.arrayBuffer()).then((arrayBuffer) => (this.data = new Uint32Array(arrayBuffer), this.buffer = new ViewableBuffer(arrayBuffer), this.loaded = !0, this.onBlobLoaded(arrayBuffer), this.update(), this)), this._load);
|
||||
}
|
||||
}
|
||||
export {
|
||||
BlobResource
|
||||
};
|
||||
//# sourceMappingURL=BlobResource.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/BlobResource.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BlobResource.mjs","sources":["../../src/resources/BlobResource.ts"],"sourcesContent":["import { BufferResource, ViewableBuffer } from '@pixi/core';\n\nimport type { BufferType, IBufferResourceOptions } from '@pixi/core';\n\n/**\n * Constructor options for BlobResource.\n * @memberof PIXI\n */\nexport interface IBlobResourceOptions extends IBufferResourceOptions\n{\n autoLoad?: boolean;\n}\n\n/**\n * Resource that fetches texture data over the network and stores it in a buffer.\n * @class\n * @extends PIXI.Resource\n * @memberof PIXI\n */\nexport abstract class BlobResource extends BufferResource\n{\n /** The URL of the texture file. */\n protected origin: string | null;\n\n /** The viewable buffer on the data. */\n protected buffer: ViewableBuffer | null;\n\n protected loaded: boolean;\n\n /**\n * Promise when loading.\n * @default null\n */\n private _load: Promise<this>;\n\n /**\n * @param source - The buffer/URL of the texture file.\n * @param {PIXI.IBlobResourceOptions} [options]\n * @param {boolean} [options.autoLoad=false] - Whether to fetch the data immediately;\n * you can fetch it later via {@link PIXI.BlobResource#load}.\n * @param {number} [options.width=1] - The width in pixels.\n * @param {number} [options.height=1] - The height in pixels.\n * @param {1|2|4|8} [options.unpackAlignment=4] - The alignment of the pixel rows.\n */\n constructor(source: string | BufferType, options: IBlobResourceOptions = { width: 1, height: 1, autoLoad: true })\n {\n let origin: string | null;\n let data: BufferType;\n\n if (typeof source === 'string')\n {\n origin = source;\n data = new Uint8Array();\n }\n else\n {\n origin = null;\n data = source;\n }\n\n super(data, options);\n\n this.origin = origin;\n this.buffer = data ? new ViewableBuffer(data) : null;\n\n this._load = null;\n this.loaded = false;\n\n // Allow autoLoad = \"undefined\" still load the resource by default\n if (this.origin !== null && options.autoLoad !== false)\n {\n this.load();\n }\n if (this.origin === null && this.buffer)\n {\n this._load = Promise.resolve(this);\n this.loaded = true;\n this.onBlobLoaded(this.buffer.rawBinaryData);\n }\n }\n\n protected onBlobLoaded(_data: ArrayBuffer): void\n {\n // TODO: Override this method\n }\n\n /** Loads the blob */\n load(): Promise<this>\n {\n if (this._load)\n {\n return this._load;\n }\n\n this._load = fetch(this.origin)\n .then((response) => response.blob())\n .then((blob) => blob.arrayBuffer())\n .then((arrayBuffer) =>\n {\n this.data = new Uint32Array(arrayBuffer);\n this.buffer = new ViewableBuffer(arrayBuffer);\n this.loaded = true;\n\n this.onBlobLoaded(arrayBuffer);\n this.update();\n\n return this;\n });\n\n return this._load;\n }\n}\n"],"names":[],"mappings":";AAmBO,MAAe,qBAAqB,eAC3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBI,YAAY,QAA6B,UAAgC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,MAC1G;AACI,QAAI,QACA;AAEA,WAAO,UAAW,YAElB,SAAS,QACT,OAAO,IAAI,WAAW,MAItB,SAAS,MACT,OAAO,SAGX,MAAM,MAAM,OAAO,GAEnB,KAAK,SAAS,QACd,KAAK,SAAS,OAAO,IAAI,eAAe,IAAI,IAAI,MAEhD,KAAK,QAAQ,MACb,KAAK,SAAS,IAGV,KAAK,WAAW,QAAQ,QAAQ,aAAa,MAE7C,KAAK,KAAA,GAEL,KAAK,WAAW,QAAQ,KAAK,WAE7B,KAAK,QAAQ,QAAQ,QAAQ,IAAI,GACjC,KAAK,SAAS,IACd,KAAK,aAAa,KAAK,OAAO,aAAa;AAAA,EAEnD;AAAA,EAEU,aAAa,OACvB;AAAA,EAEA;AAAA;AAAA,EAGA,OACA;AACQ,WAAA,KAAK,QAEE,KAAK,SAGhB,KAAK,QAAQ,MAAM,KAAK,MAAM,EACzB,KAAK,CAAC,aAAa,SAAS,MAAM,EAClC,KAAK,CAAC,SAAS,KAAK,YAAY,CAAC,EACjC,KAAK,CAAC,iBAEH,KAAK,OAAO,IAAI,YAAY,WAAW,GACvC,KAAK,SAAS,IAAI,eAAe,WAAW,GAC5C,KAAK,SAAS,IAEd,KAAK,aAAa,WAAW,GAC7B,KAAK,OAAO,GAEL,KACV,GAEE,KAAK;AAAA,EAChB;AACJ;"}
|
||||
107
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.js
generated
vendored
Normal file
107
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
var _const = require("../const.js"), BlobResource = require("./BlobResource.js");
|
||||
class CompressedTextureResource extends BlobResource.BlobResource {
|
||||
/**
|
||||
* @param source - the buffer/URL holding the compressed texture data
|
||||
* @param options
|
||||
* @param {PIXI.INTERNAL_FORMATS} options.format - the compression format
|
||||
* @param {number} options.width - the image width in pixels.
|
||||
* @param {number} options.height - the image height in pixels.
|
||||
* @param {number} [options.level=1] - the mipmap levels stored in the compressed texture, including level 0.
|
||||
* @param {number} [options.levelBuffers] - the buffers for each mipmap level. `CompressedTextureResource` can allows you
|
||||
* to pass `null` for `source`, for cases where each level is stored in non-contiguous memory.
|
||||
*/
|
||||
constructor(source, options) {
|
||||
super(source, options), this.format = options.format, this.levels = options.levels || 1, this._width = options.width, this._height = options.height, this._extension = CompressedTextureResource._formatToExtension(this.format), (options.levelBuffers || this.buffer) && (this._levelBuffers = options.levelBuffers || CompressedTextureResource._createLevelBuffers(
|
||||
source instanceof Uint8Array ? source : this.buffer.uint8View,
|
||||
this.format,
|
||||
this.levels,
|
||||
4,
|
||||
4,
|
||||
// PVRTC has 8x4 blocks in 2bpp mode
|
||||
this.width,
|
||||
this.height
|
||||
));
|
||||
}
|
||||
/**
|
||||
* @override
|
||||
* @param renderer - A reference to the current renderer
|
||||
* @param _texture - the texture
|
||||
* @param _glTexture - texture instance for this webgl context
|
||||
*/
|
||||
upload(renderer, _texture, _glTexture) {
|
||||
const gl = renderer.gl;
|
||||
if (!renderer.context.extensions[this._extension])
|
||||
throw new Error(`${this._extension} textures are not supported on the current machine`);
|
||||
if (!this._levelBuffers)
|
||||
return !1;
|
||||
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
|
||||
for (let i = 0, j = this.levels; i < j; i++) {
|
||||
const { levelID, levelWidth, levelHeight, levelBuffer } = this._levelBuffers[i];
|
||||
gl.compressedTexImage2D(gl.TEXTURE_2D, levelID, this.format, levelWidth, levelHeight, 0, levelBuffer);
|
||||
}
|
||||
return !0;
|
||||
}
|
||||
/** @protected */
|
||||
onBlobLoaded() {
|
||||
this._levelBuffers = CompressedTextureResource._createLevelBuffers(
|
||||
this.buffer.uint8View,
|
||||
this.format,
|
||||
this.levels,
|
||||
4,
|
||||
4,
|
||||
// PVRTC has 8x4 blocks in 2bpp mode
|
||||
this.width,
|
||||
this.height
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Returns the key (to ContextSystem#extensions) for the WebGL extension supporting the compression format
|
||||
* @private
|
||||
* @param format - the compression format to get the extension for.
|
||||
*/
|
||||
static _formatToExtension(format) {
|
||||
if (format >= 33776 && format <= 33779)
|
||||
return "s3tc";
|
||||
if (format >= 35916 && format <= 35919)
|
||||
return "s3tc_sRGB";
|
||||
if (format >= 37488 && format <= 37497)
|
||||
return "etc";
|
||||
if (format >= 35840 && format <= 35843)
|
||||
return "pvrtc";
|
||||
if (format === 36196)
|
||||
return "etc1";
|
||||
if (format === 35986 || format === 35987 || format === 34798)
|
||||
return "atc";
|
||||
if (format >= 36492 && format <= 36495)
|
||||
return "bptc";
|
||||
if (format === 37808)
|
||||
return "astc";
|
||||
throw new Error(`Invalid (compressed) texture format given: ${format}`);
|
||||
}
|
||||
/**
|
||||
* Pre-creates buffer views for each mipmap level
|
||||
* @private
|
||||
* @param buffer -
|
||||
* @param format - compression formats
|
||||
* @param levels - mipmap levels
|
||||
* @param blockWidth -
|
||||
* @param blockHeight -
|
||||
* @param imageWidth - width of the image in pixels
|
||||
* @param imageHeight - height of the image in pixels
|
||||
*/
|
||||
static _createLevelBuffers(buffer, format, levels, blockWidth, blockHeight, imageWidth, imageHeight) {
|
||||
const buffers = new Array(levels);
|
||||
let offset = buffer.byteOffset, levelWidth = imageWidth, levelHeight = imageHeight, alignedLevelWidth = levelWidth + blockWidth - 1 & ~(blockWidth - 1), alignedLevelHeight = levelHeight + blockHeight - 1 & ~(blockHeight - 1), levelSize = alignedLevelWidth * alignedLevelHeight * _const.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];
|
||||
for (let i = 0; i < levels; i++)
|
||||
buffers[i] = {
|
||||
levelID: i,
|
||||
levelWidth: levels > 1 ? levelWidth : alignedLevelWidth,
|
||||
levelHeight: levels > 1 ? levelHeight : alignedLevelHeight,
|
||||
levelBuffer: new Uint8Array(buffer.buffer, offset, levelSize)
|
||||
}, offset += levelSize, levelWidth = levelWidth >> 1 || 1, levelHeight = levelHeight >> 1 || 1, alignedLevelWidth = levelWidth + blockWidth - 1 & ~(blockWidth - 1), alignedLevelHeight = levelHeight + blockHeight - 1 & ~(blockHeight - 1), levelSize = alignedLevelWidth * alignedLevelHeight * _const.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];
|
||||
return buffers;
|
||||
}
|
||||
}
|
||||
exports.CompressedTextureResource = CompressedTextureResource;
|
||||
//# sourceMappingURL=CompressedTextureResource.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
109
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.mjs
generated
vendored
Normal file
109
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.mjs
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
import { INTERNAL_FORMAT_TO_BYTES_PER_PIXEL } from "../const.mjs";
|
||||
import { BlobResource } from "./BlobResource.mjs";
|
||||
class CompressedTextureResource extends BlobResource {
|
||||
/**
|
||||
* @param source - the buffer/URL holding the compressed texture data
|
||||
* @param options
|
||||
* @param {PIXI.INTERNAL_FORMATS} options.format - the compression format
|
||||
* @param {number} options.width - the image width in pixels.
|
||||
* @param {number} options.height - the image height in pixels.
|
||||
* @param {number} [options.level=1] - the mipmap levels stored in the compressed texture, including level 0.
|
||||
* @param {number} [options.levelBuffers] - the buffers for each mipmap level. `CompressedTextureResource` can allows you
|
||||
* to pass `null` for `source`, for cases where each level is stored in non-contiguous memory.
|
||||
*/
|
||||
constructor(source, options) {
|
||||
super(source, options), this.format = options.format, this.levels = options.levels || 1, this._width = options.width, this._height = options.height, this._extension = CompressedTextureResource._formatToExtension(this.format), (options.levelBuffers || this.buffer) && (this._levelBuffers = options.levelBuffers || CompressedTextureResource._createLevelBuffers(
|
||||
source instanceof Uint8Array ? source : this.buffer.uint8View,
|
||||
this.format,
|
||||
this.levels,
|
||||
4,
|
||||
4,
|
||||
// PVRTC has 8x4 blocks in 2bpp mode
|
||||
this.width,
|
||||
this.height
|
||||
));
|
||||
}
|
||||
/**
|
||||
* @override
|
||||
* @param renderer - A reference to the current renderer
|
||||
* @param _texture - the texture
|
||||
* @param _glTexture - texture instance for this webgl context
|
||||
*/
|
||||
upload(renderer, _texture, _glTexture) {
|
||||
const gl = renderer.gl;
|
||||
if (!renderer.context.extensions[this._extension])
|
||||
throw new Error(`${this._extension} textures are not supported on the current machine`);
|
||||
if (!this._levelBuffers)
|
||||
return !1;
|
||||
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
|
||||
for (let i = 0, j = this.levels; i < j; i++) {
|
||||
const { levelID, levelWidth, levelHeight, levelBuffer } = this._levelBuffers[i];
|
||||
gl.compressedTexImage2D(gl.TEXTURE_2D, levelID, this.format, levelWidth, levelHeight, 0, levelBuffer);
|
||||
}
|
||||
return !0;
|
||||
}
|
||||
/** @protected */
|
||||
onBlobLoaded() {
|
||||
this._levelBuffers = CompressedTextureResource._createLevelBuffers(
|
||||
this.buffer.uint8View,
|
||||
this.format,
|
||||
this.levels,
|
||||
4,
|
||||
4,
|
||||
// PVRTC has 8x4 blocks in 2bpp mode
|
||||
this.width,
|
||||
this.height
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Returns the key (to ContextSystem#extensions) for the WebGL extension supporting the compression format
|
||||
* @private
|
||||
* @param format - the compression format to get the extension for.
|
||||
*/
|
||||
static _formatToExtension(format) {
|
||||
if (format >= 33776 && format <= 33779)
|
||||
return "s3tc";
|
||||
if (format >= 35916 && format <= 35919)
|
||||
return "s3tc_sRGB";
|
||||
if (format >= 37488 && format <= 37497)
|
||||
return "etc";
|
||||
if (format >= 35840 && format <= 35843)
|
||||
return "pvrtc";
|
||||
if (format === 36196)
|
||||
return "etc1";
|
||||
if (format === 35986 || format === 35987 || format === 34798)
|
||||
return "atc";
|
||||
if (format >= 36492 && format <= 36495)
|
||||
return "bptc";
|
||||
if (format === 37808)
|
||||
return "astc";
|
||||
throw new Error(`Invalid (compressed) texture format given: ${format}`);
|
||||
}
|
||||
/**
|
||||
* Pre-creates buffer views for each mipmap level
|
||||
* @private
|
||||
* @param buffer -
|
||||
* @param format - compression formats
|
||||
* @param levels - mipmap levels
|
||||
* @param blockWidth -
|
||||
* @param blockHeight -
|
||||
* @param imageWidth - width of the image in pixels
|
||||
* @param imageHeight - height of the image in pixels
|
||||
*/
|
||||
static _createLevelBuffers(buffer, format, levels, blockWidth, blockHeight, imageWidth, imageHeight) {
|
||||
const buffers = new Array(levels);
|
||||
let offset = buffer.byteOffset, levelWidth = imageWidth, levelHeight = imageHeight, alignedLevelWidth = levelWidth + blockWidth - 1 & ~(blockWidth - 1), alignedLevelHeight = levelHeight + blockHeight - 1 & ~(blockHeight - 1), levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];
|
||||
for (let i = 0; i < levels; i++)
|
||||
buffers[i] = {
|
||||
levelID: i,
|
||||
levelWidth: levels > 1 ? levelWidth : alignedLevelWidth,
|
||||
levelHeight: levels > 1 ? levelHeight : alignedLevelHeight,
|
||||
levelBuffer: new Uint8Array(buffer.buffer, offset, levelSize)
|
||||
}, offset += levelSize, levelWidth = levelWidth >> 1 || 1, levelHeight = levelHeight >> 1 || 1, alignedLevelWidth = levelWidth + blockWidth - 1 & ~(blockWidth - 1), alignedLevelHeight = levelHeight + blockHeight - 1 & ~(blockHeight - 1), levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];
|
||||
return buffers;
|
||||
}
|
||||
}
|
||||
export {
|
||||
CompressedTextureResource
|
||||
};
|
||||
//# sourceMappingURL=CompressedTextureResource.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/CompressedTextureResource.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.js
generated
vendored
Normal file
5
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
var BlobResource = require("./BlobResource.js"), CompressedTextureResource = require("./CompressedTextureResource.js");
|
||||
exports.BlobResource = BlobResource.BlobResource;
|
||||
exports.CompressedTextureResource = CompressedTextureResource.CompressedTextureResource;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
||||
7
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.mjs
generated
vendored
Normal file
7
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { BlobResource } from "./BlobResource.mjs";
|
||||
import { CompressedTextureResource } from "./CompressedTextureResource.mjs";
|
||||
export {
|
||||
BlobResource,
|
||||
CompressedTextureResource
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/compressed-textures/lib/resources/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
||||
39
resources/app/node_modules/@pixi/compressed-textures/package.json
generated
vendored
Normal file
39
resources/app/node_modules/@pixi/compressed-textures/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "@pixi/compressed-textures",
|
||||
"version": "7.4.2",
|
||||
"description": "Loaders for compressed texture file formats",
|
||||
"author": "Shukant Pal <shukantpal@outlook.com>",
|
||||
"homepage": "https://github.com/pixijs/pixijs#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.mjs",
|
||||
"types": "lib/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"*.d.ts"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pixijs/pixijs.git"
|
||||
},
|
||||
"sideEffects": true,
|
||||
"peerDependencies": {
|
||||
"@pixi/assets": "7.4.2",
|
||||
"@pixi/core": "7.4.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user