1import{D as U}from"./dds.pure-DV13YyYT.js";import{A as x,R as v,L as A,I as b,_ as W,a as P}from"./index-DDBsTPp3.js";import"./cubemapToSphericalPolynomial-B9zG5eXO.js";function B(e){const o=e.split("?")[0],t=o.lastIndexOf(".");return t>-1?o.substring(t).toLowerCase():""}let y=!1;function O(){y||(y=!0,x.prototype._partialLoadFile=function(e,o,t,n,a=null){const r=s=>{t[o]=s,t._internalCount++,t._internalCount===6&&n(t)},l=(s,f)=>{a&&s&&a(s.status+" "+s.statusText,f)};this._loadFile(e,r,void 0,void 0,!0,l)},x.prototype._cascadeLoadFiles=function(e,o,t,n=null){const a=[];a._internalCount=0;for(let r=0;r<6;r++)this._partialLoadFile(t[r],r,a,o,n)},x.prototype._cascadeLoadImgs=function(e,o,t,n,a=null,r){const l=[];l._internalCount=0;for(let s=0;s<6;s++)this._partialLoadImg(n[s],s,l,e,o,t,a,r)},x.prototype._partialLoadImg=function(e,o,t,n,a,r,l=null,s){const f=v();A(e,_=>{t[o]=_,t._internalCount++,n&&n.removePendingData(f),t._internalCount===6&&r&&r(a,t)},(_,h)=>{n&&n.removePendingData(f),l&&l(_,h)},n?n.offlineProvider:null,s),n&&n.addPendingData(f)},x.prototype.createCubeTextureBase=function(e,o,t,n,a=null,r=null,l,s=null,f=!1,L=0,T=0,_=null,h=null,m=null,w=!1,g=null){const i=_||new b(this,7);i.isCube=!0,i.url=e,i.generateMipMaps=!n,i._lodGenerationScale=L,i._lodGenerationOffset=T,i._useSRGBBuffer=!!w&&this._caps.supportSRGBBuffers&&(this.version>1||this.isWebGPU||!!n),i!==_&&(i.label=e.substring(0,60)),this._doNotHandleContextLost||(i._extension=s,i._files=t,i._buffer=g);const C=e;this._transformTextureUrl&&!_&&(e=this._transformTextureUrl(e));const G=s??B(e),I=W(G),p=(u,d)=>{i.dispose(),r?r(u,d):u&&P.Warn(u)},F=(u,d)=>{e===C?u&&p(u.status+" "+u.statusText,d):(P.Warn(`Failed to load ${e}, falling back to the ${C}`),this.createCubeTextureBase(C,o,t,!!n,a,p,l,s,f,L,T,i,h,m,w,g))};if(I)I.then(u=>{const d=c=>{h&&h(i,c),u.loadCubeData(c,i,f,a,(D,R)=>{p(D,R)})};g?d(g):t&&t.length===6?u.supportCascades?this._cascadeLoadFiles(o,c=>d(c.map(D=>new Uint8Array(D))),t,p):p("Textures type does not support cascades."):this._loadFile(e,c=>d(new Uint8Array(c)),void 0,o?o.offlineProvider||null:void 0,!0,F)});else{if(!t||t.length===0)throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");this._cascadeLoadImgs(o,i,(u,d)=>{m&&m(u,d)},t,p)}return this._internalTexturesCache.push(i),i})}O();export{U as DDSTools};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.