78 lines
3.3 KiB
JavaScript
78 lines
3.3 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TextureStyle = function(global, require, module, exports) {
|
|
global = require("module$node_modules$eventemitter3$index");
|
|
var uid = require("module$node_modules$pixi_DOT_js$lib$utils$data$uid"), deprecation = require("module$node_modules$pixi_DOT_js$lib$utils$logging$deprecation");
|
|
"use strict";
|
|
const idHash = Object.create(null), node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TextureStyle$classdecl$var1 = class extends global {
|
|
constructor(options = {}) {
|
|
super();
|
|
this._resourceType = "textureSampler";
|
|
this._touched = 0;
|
|
this._maxAnisotropy = 1;
|
|
this.destroyed = !1;
|
|
options = {...node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TextureStyle$classdecl$var1.defaultOptions, ...options};
|
|
this.addressMode = options.addressMode;
|
|
this.addressModeU = options.addressModeU ?? this.addressModeU;
|
|
this.addressModeV = options.addressModeV ?? this.addressModeV;
|
|
this.addressModeW = options.addressModeW ?? this.addressModeW;
|
|
this.scaleMode = options.scaleMode;
|
|
this.magFilter = options.magFilter ?? this.magFilter;
|
|
this.minFilter = options.minFilter ?? this.minFilter;
|
|
this.mipmapFilter = options.mipmapFilter ?? this.mipmapFilter;
|
|
this.lodMinClamp = options.lodMinClamp;
|
|
this.lodMaxClamp = options.lodMaxClamp;
|
|
this.compare = options.compare;
|
|
this.maxAnisotropy = options.maxAnisotropy ?? 1;
|
|
}
|
|
set addressMode(value) {
|
|
this.addressModeW = this.addressModeV = this.addressModeU = value;
|
|
}
|
|
get addressMode() {
|
|
return this.addressModeU;
|
|
}
|
|
set wrapMode(value) {
|
|
deprecation.deprecation(deprecation.v8_0_0, "TextureStyle.wrapMode is now TextureStyle.addressMode");
|
|
this.addressMode = value;
|
|
}
|
|
get wrapMode() {
|
|
return this.addressMode;
|
|
}
|
|
set scaleMode(value) {
|
|
this.mipmapFilter = this.minFilter = this.magFilter = value;
|
|
}
|
|
get scaleMode() {
|
|
return this.magFilter;
|
|
}
|
|
set maxAnisotropy(value) {
|
|
this._maxAnisotropy = Math.min(value, 16);
|
|
1 < this._maxAnisotropy && (this.scaleMode = "linear");
|
|
}
|
|
get maxAnisotropy() {
|
|
return this._maxAnisotropy;
|
|
}
|
|
get _resourceId() {
|
|
return this._sharedResourceId || this._generateResourceId();
|
|
}
|
|
update() {
|
|
this._sharedResourceId = null;
|
|
this.emit("change", this);
|
|
}
|
|
_generateResourceId() {
|
|
const bigKey = `${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`, id = idHash[bigKey];
|
|
void 0 === id && (idHash[bigKey] = uid.uid("resource"));
|
|
this._sharedResourceId = id;
|
|
return this._resourceId;
|
|
}
|
|
destroy() {
|
|
this.destroyed = !0;
|
|
this.emit("destroy", this);
|
|
this.emit("change", this);
|
|
this.removeAllListeners();
|
|
}
|
|
};
|
|
require = node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TextureStyle$classdecl$var1;
|
|
require.defaultOptions = {addressMode:"clamp-to-edge", scaleMode:"linear"};
|
|
exports.TextureStyle = require;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TextureStyle.js.map
|