import{aF as d}from"./index-6jOCfdig.js";import{DDSTools as s}from"./dds-DVaQpxpG.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./abstractEngine.cubeTexture-IPepzteq.js";class T{constructor(){this.supportCascades=!0}loadCubeData(e,o,t,p){const a=o.getEngine();let i,n=!1,r=1e3;if(Array.isArray(e))for(let m=0;m<e.length;m++){const l=e[m];i=s.GetDDSInfo(l),o.width=i.width,o.height=i.height,n=(i.isRGB||i.isLuminance||i.mipmapCount>1)&&o.generateMipMaps,a._unpackFlipY(i.isCompressed),s.UploadDDSLevels(a,o,l,i,n,6,-1,m),!i.isFourCC&&i.mipmapCount===1?a.generateMipMapsForCubemap(o):r=i.mipmapCount-1}else{const m=e;i=s.GetDDSInfo(m),o.width=i.width,o.height=i.height,t&&(i.sphericalPolynomial=new d),n=(i.isRGB||i.isLuminance||i.mipmapCount>1)&&o.generateMipMaps,a._unpackFlipY(i.isCompressed),s.UploadDDSLevels(a,o,m,i,n,6),!i.isFourCC&&i.mipmapCount===1?a.generateMipMapsForCubemap(o,!1):r=i.mipmapCount-1}a._setCubeMapTextureParams(o,n,r),o.isReady=!0,o.onLoadedObservable.notifyObservers(o),o.onLoadedObservable.clear(),p&&p({isDDS:!0,width:o.width,info:i,data:e,texture:o})}loadData(e,o,t){const p=s.GetDDSInfo(e),a=(p.isRGB||p.isLuminance||p.mipmapCount>1)&&o.generateMipMaps&&Math.max(p.width,p.height)>>p.mipmapCount-1===1;t(p.width,p.height,a,p.isFourCC,()=>{s.UploadDDSLevels(o.getEngine(),o,e,p,a,1)})}}export{T as _DDSTextureLoader};
