Revert to PIXI4
This commit is contained in:
parent
35dcbf3276
commit
a7d6c0355c
21 changed files with 44598 additions and 88738 deletions
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -92,9 +92,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/android-versions": {
|
"node_modules/android-versions": {
|
||||||
"version": "1.8.2",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.9.0.tgz",
|
||||||
"integrity": "sha512-2MT/Y/mR3BLSbR9E3ugwvE/aA4k84XtjG2Iusu4pRKt4FwfpEvIEAHzm7ZBhL3/aTVNdx3PzZ+sAiK+Dbc4r9A==",
|
"integrity": "sha512-13O2B6PQMEM4ej9n13ePRQeckrCoKbZrvuzlLvK+9s2QmncpHDbYzZxhgapN32sJNoifN6VAHexLnd/6CYrs7Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.5.2"
|
"semver": "^7.5.2"
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"./plugins_dev/*.js",
|
"./plugins_dev/*.js",
|
||||||
"./plugins/*.js",
|
"./plugins/*.js",
|
||||||
"libs/yaml.js",
|
"libs/yaml.js",
|
||||||
"require.js"
|
"porting/require.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
9
www/js/libs/pixi-legacy.min.js
vendored
9
www/js/libs/pixi-legacy.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,404 +1,428 @@
|
||||||
var __extends = (this && this.__extends) || (function () {
|
var __extends = (this && this.__extends) || function (d, b) {
|
||||||
var extendStatics = function (d, b) {
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||||
extendStatics = Object.setPrototypeOf ||
|
function __() { this.constructor = d; }
|
||||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
};
|
||||||
return extendStatics(d, b);
|
var PIXI;
|
||||||
};
|
(function (PIXI) {
|
||||||
return function (d, b) {
|
var extras;
|
||||||
extendStatics(d, b);
|
(function (extras) {
|
||||||
function __() { this.constructor = d; }
|
var shaderLib = [
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
{
|
||||||
};
|
vertUniforms: "",
|
||||||
})();
|
vertCode: "vTextureCoord = aTextureCoord;",
|
||||||
var pixi_picture;
|
fragUniforms: "uniform vec4 uTextureClamp;",
|
||||||
(function (pixi_picture) {
|
fragCode: "vec2 textureCoord = clamp(vTextureCoord, uTextureClamp.xy, uTextureClamp.zw);"
|
||||||
var BackdropFilter = (function (_super) {
|
},
|
||||||
__extends(BackdropFilter, _super);
|
{
|
||||||
function BackdropFilter() {
|
vertUniforms: "uniform mat3 uTransform;",
|
||||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||||
_this.backdropUniformName = null;
|
fragUniforms: "",
|
||||||
_this._backdropActive = false;
|
fragCode: "vec2 textureCoord = vTextureCoord;"
|
||||||
_this.clearColor = null;
|
},
|
||||||
return _this;
|
{
|
||||||
}
|
vertUniforms: "uniform mat3 uTransform;",
|
||||||
return BackdropFilter;
|
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||||
}(PIXI.Filter));
|
fragUniforms: "uniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;",
|
||||||
pixi_picture.BackdropFilter = BackdropFilter;
|
fragCode: "vec2 textureCoord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;" +
|
||||||
var filterFrag = "\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D uBackdrop;\n\n%UNIFORM_CODE%\n\nvoid main(void)\n{\n vec4 b_src = texture2D(uSampler, vTextureCoord);\n vec4 b_dest = texture2D(uBackdrop, vTextureCoord);\n vec4 b_res = b_dest;\n \n %BLEND_CODE%\n\n gl_FragColor = b_res;\n}";
|
"\ntextureCoord = (uMapCoord * vec3(textureCoord, 1.0)).xy;" +
|
||||||
var BlendFilter = (function (_super) {
|
"\ntextureCoord = clamp(textureCoord, uClampFrame.xy, uClampFrame.zw);"
|
||||||
__extends(BlendFilter, _super);
|
|
||||||
function BlendFilter(shaderParts) {
|
|
||||||
var _this = this;
|
|
||||||
var fragCode = filterFrag;
|
|
||||||
fragCode = fragCode.replace('%UNIFORM_CODE%', shaderParts.uniformCode || "");
|
|
||||||
fragCode = fragCode.replace('%BLEND_CODE%', shaderParts.blendCode || "");
|
|
||||||
_this = _super.call(this, undefined, fragCode, shaderParts.uniforms) || this;
|
|
||||||
_this.backdropUniformName = 'uBackdrop';
|
|
||||||
return _this;
|
|
||||||
}
|
|
||||||
return BlendFilter;
|
|
||||||
}(BackdropFilter));
|
|
||||||
pixi_picture.BlendFilter = BlendFilter;
|
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
|
||||||
var pixi_picture;
|
|
||||||
(function (pixi_picture) {
|
|
||||||
function containsRect(rectOut, rectIn) {
|
|
||||||
var r1 = rectIn.x + rectIn.width;
|
|
||||||
var b1 = rectIn.y + rectIn.height;
|
|
||||||
var r2 = rectOut.x + rectOut.width;
|
|
||||||
var b2 = rectOut.y + rectOut.height;
|
|
||||||
return (rectIn.x >= rectOut.x) &&
|
|
||||||
(rectIn.x <= r2) &&
|
|
||||||
(rectIn.y >= rectOut.y) &&
|
|
||||||
(rectIn.y <= b2) &&
|
|
||||||
(r1 >= rectOut.x) &&
|
|
||||||
(r1 <= r2) &&
|
|
||||||
(b1 >= rectOut.y) &&
|
|
||||||
(b1 <= b2);
|
|
||||||
}
|
|
||||||
PIXI.systems.TextureSystem.prototype.bindForceLocation = function (texture, location) {
|
|
||||||
if (location === void 0) { location = 0; }
|
|
||||||
var gl = this.gl;
|
|
||||||
if (this.currentLocation !== location) {
|
|
||||||
this.currentLocation = location;
|
|
||||||
gl.activeTexture(gl.TEXTURE0 + location);
|
|
||||||
}
|
|
||||||
this.bind(texture, location);
|
|
||||||
};
|
|
||||||
function pushWithCheck(target, filters, checkEmptyBounds) {
|
|
||||||
if (checkEmptyBounds === void 0) { checkEmptyBounds = true; }
|
|
||||||
var renderer = this.renderer;
|
|
||||||
var filterStack = this.defaultFilterStack;
|
|
||||||
var state = this.statePool.pop() || new PIXI.FilterState();
|
|
||||||
var resolution = filters[0].resolution;
|
|
||||||
var padding = filters[0].padding;
|
|
||||||
var autoFit = filters[0].autoFit;
|
|
||||||
var legacy = filters[0].legacy;
|
|
||||||
for (var i = 1; i < filters.length; i++) {
|
|
||||||
var filter = filters[i];
|
|
||||||
resolution = Math.min(resolution, filter.resolution);
|
|
||||||
padding = this.useMaxPadding
|
|
||||||
? Math.max(padding, filter.padding)
|
|
||||||
: padding + filter.padding;
|
|
||||||
autoFit = autoFit || filter.autoFit;
|
|
||||||
legacy = legacy || filter.legacy;
|
|
||||||
}
|
|
||||||
if (filterStack.length === 1) {
|
|
||||||
this.defaultFilterStack[0].renderTexture = renderer.renderTexture.current;
|
|
||||||
}
|
|
||||||
filterStack.push(state);
|
|
||||||
state.resolution = resolution;
|
|
||||||
state.legacy = legacy;
|
|
||||||
state.target = target;
|
|
||||||
state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true));
|
|
||||||
var canUseBackdrop = true;
|
|
||||||
state.sourceFrame.pad(padding);
|
|
||||||
if (autoFit) {
|
|
||||||
state.sourceFrame.fit(this.renderer.renderTexture.sourceFrame);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
canUseBackdrop = containsRect(this.renderer.renderTexture.sourceFrame, state.sourceFrame);
|
|
||||||
}
|
|
||||||
if (checkEmptyBounds && state.sourceFrame.width <= 1 && state.sourceFrame.height <= 1) {
|
|
||||||
filterStack.pop();
|
|
||||||
state.clear();
|
|
||||||
this.statePool.push(state);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
state.sourceFrame.ceil(resolution);
|
|
||||||
if (canUseBackdrop) {
|
|
||||||
var backdrop = null;
|
|
||||||
for (var i = 0; i < filters.length; i++) {
|
|
||||||
var bName = filters[i].backdropUniformName;
|
|
||||||
if (bName) {
|
|
||||||
if (backdrop === null) {
|
|
||||||
backdrop = this.prepareBackdrop(state.sourceFrame);
|
|
||||||
}
|
|
||||||
filters[i].uniforms[bName] = backdrop;
|
|
||||||
if (backdrop) {
|
|
||||||
filters[i]._backdropActive = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height, resolution);
|
var PictureShader = (function (_super) {
|
||||||
state.filters = filters;
|
__extends(PictureShader, _super);
|
||||||
state.destinationFrame.width = state.renderTexture.width;
|
function PictureShader(gl, vert, frag, tilingMode) {
|
||||||
state.destinationFrame.height = state.renderTexture.height;
|
var lib = shaderLib[tilingMode];
|
||||||
var destinationFrame = this.tempRect;
|
_super.call(this, gl, vert.replace(/%SPRITE_UNIFORMS%/gi, lib.vertUniforms)
|
||||||
destinationFrame.width = state.sourceFrame.width;
|
.replace(/%SPRITE_CODE%/gi, lib.vertCode), frag.replace(/%SPRITE_UNIFORMS%/gi, lib.fragUniforms)
|
||||||
destinationFrame.height = state.sourceFrame.height;
|
.replace(/%SPRITE_CODE%/gi, lib.fragCode));
|
||||||
state.renderTexture.filterFrame = state.sourceFrame;
|
this.bind();
|
||||||
renderer.renderTexture.bind(state.renderTexture, state.sourceFrame, destinationFrame);
|
this.tilingMode = tilingMode;
|
||||||
renderer.renderTexture.clear(filters[filters.length - 1].clearColor);
|
this.tempQuad = new PIXI.Quad(gl);
|
||||||
return true;
|
this.tempQuad.initVao(this);
|
||||||
}
|
this.uniforms.uColor = new Float32Array([1, 1, 1, 1]);
|
||||||
function push(target, filters) {
|
this.uniforms.uSampler = [0, 1];
|
||||||
return this.pushWithCheck(target, filters, false);
|
|
||||||
}
|
|
||||||
function pop() {
|
|
||||||
var filterStack = this.defaultFilterStack;
|
|
||||||
var state = filterStack.pop();
|
|
||||||
var filters = state.filters;
|
|
||||||
this.activeState = state;
|
|
||||||
var globalUniforms = this.globalUniforms.uniforms;
|
|
||||||
globalUniforms.outputFrame = state.sourceFrame;
|
|
||||||
globalUniforms.resolution = state.resolution;
|
|
||||||
var inputSize = globalUniforms.inputSize;
|
|
||||||
var inputPixel = globalUniforms.inputPixel;
|
|
||||||
var inputClamp = globalUniforms.inputClamp;
|
|
||||||
inputSize[0] = state.destinationFrame.width;
|
|
||||||
inputSize[1] = state.destinationFrame.height;
|
|
||||||
inputSize[2] = 1.0 / inputSize[0];
|
|
||||||
inputSize[3] = 1.0 / inputSize[1];
|
|
||||||
inputPixel[0] = inputSize[0] * state.resolution;
|
|
||||||
inputPixel[1] = inputSize[1] * state.resolution;
|
|
||||||
inputPixel[2] = 1.0 / inputPixel[0];
|
|
||||||
inputPixel[3] = 1.0 / inputPixel[1];
|
|
||||||
inputClamp[0] = 0.5 * inputPixel[2];
|
|
||||||
inputClamp[1] = 0.5 * inputPixel[3];
|
|
||||||
inputClamp[2] = (state.sourceFrame.width * inputSize[2]) - (0.5 * inputPixel[2]);
|
|
||||||
inputClamp[3] = (state.sourceFrame.height * inputSize[3]) - (0.5 * inputPixel[3]);
|
|
||||||
if (state.legacy) {
|
|
||||||
var filterArea = globalUniforms.filterArea;
|
|
||||||
filterArea[0] = state.destinationFrame.width;
|
|
||||||
filterArea[1] = state.destinationFrame.height;
|
|
||||||
filterArea[2] = state.sourceFrame.x;
|
|
||||||
filterArea[3] = state.sourceFrame.y;
|
|
||||||
globalUniforms.filterClamp = globalUniforms.inputClamp;
|
|
||||||
}
|
|
||||||
this.globalUniforms.update();
|
|
||||||
var lastState = filterStack[filterStack.length - 1];
|
|
||||||
if (state.renderTexture.framebuffer.multisample > 1) {
|
|
||||||
this.renderer.framebuffer.blit();
|
|
||||||
}
|
|
||||||
if (filters.length === 1) {
|
|
||||||
filters[0].apply(this, state.renderTexture, lastState.renderTexture, PIXI.CLEAR_MODES.BLEND, state);
|
|
||||||
this.returnFilterTexture(state.renderTexture);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var flip = state.renderTexture;
|
|
||||||
var flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);
|
|
||||||
flop.filterFrame = flip.filterFrame;
|
|
||||||
var i = 0;
|
|
||||||
for (i = 0; i < filters.length - 1; ++i) {
|
|
||||||
filters[i].apply(this, flip, flop, PIXI.CLEAR_MODES.CLEAR, state);
|
|
||||||
var t = flip;
|
|
||||||
flip = flop;
|
|
||||||
flop = t;
|
|
||||||
}
|
}
|
||||||
filters[i].apply(this, flip, lastState.renderTexture, PIXI.CLEAR_MODES.BLEND, state);
|
PictureShader.blendVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 mapMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n vMapCoord = (mapMatrix * vec3(aVertexPosition, 1.0)).xy;\n}\n";
|
||||||
this.returnFilterTexture(flip);
|
return PictureShader;
|
||||||
this.returnFilterTexture(flop);
|
}(PIXI.Shader));
|
||||||
}
|
extras.PictureShader = PictureShader;
|
||||||
var backdropFree = false;
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
for (var i = 0; i < filters.length; i++) {
|
})(PIXI || (PIXI = {}));
|
||||||
if (filters[i]._backdropActive) {
|
var PIXI;
|
||||||
var bName = filters[i].backdropUniformName;
|
(function (PIXI) {
|
||||||
if (!backdropFree) {
|
var extras;
|
||||||
this.returnFilterTexture(filters[i].uniforms[bName]);
|
(function (extras) {
|
||||||
backdropFree = true;
|
var overlayFrag = "\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cs2 = Cs * 2.0 - 1.0;\n vec3 screen = Cb + Cs2 - Cb * Cs2;\n vec3 B;\n if (Cb.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cb.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cb.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||||
}
|
var HardLightShader = (function (_super) {
|
||||||
filters[i].uniforms[bName] = null;
|
__extends(HardLightShader, _super);
|
||||||
filters[i]._backdropActive = false;
|
function HardLightShader(gl, tilingMode) {
|
||||||
|
_super.call(this, gl, extras.PictureShader.blendVert, overlayFrag, tilingMode);
|
||||||
}
|
}
|
||||||
|
return HardLightShader;
|
||||||
|
}(extras.PictureShader));
|
||||||
|
extras.HardLightShader = HardLightShader;
|
||||||
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
|
})(PIXI || (PIXI = {}));
|
||||||
|
var PIXI;
|
||||||
|
(function (PIXI) {
|
||||||
|
var extras;
|
||||||
|
(function (extras) {
|
||||||
|
function mapFilterBlendModesToPixi(gl, array) {
|
||||||
|
if (array === void 0) { array = []; }
|
||||||
|
array[PIXI.BLEND_MODES.OVERLAY] = [new extras.OverlayShader(gl, 0), new extras.OverlayShader(gl, 1), new extras.OverlayShader(gl, 2)];
|
||||||
|
array[PIXI.BLEND_MODES.HARD_LIGHT] = [new extras.HardLightShader(gl, 0), new extras.HardLightShader(gl, 1), new extras.HardLightShader(gl, 2)];
|
||||||
|
return array;
|
||||||
}
|
}
|
||||||
state.clear();
|
extras.mapFilterBlendModesToPixi = mapFilterBlendModesToPixi;
|
||||||
this.statePool.push(state);
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
}
|
})(PIXI || (PIXI = {}));
|
||||||
var hadBackbufferError = false;
|
var PIXI;
|
||||||
function prepareBackdrop(bounds) {
|
(function (PIXI) {
|
||||||
var renderer = this.renderer;
|
var extras;
|
||||||
var renderTarget = renderer.renderTexture.current;
|
(function (extras) {
|
||||||
var fr = this.renderer.renderTexture.sourceFrame;
|
var normalFrag = "\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n\n vec4 sample = texture2D(uSampler[0], textureCoord);\n gl_FragColor = sample * uColor;\n}\n";
|
||||||
if (!renderTarget) {
|
var normalVert = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n}\n";
|
||||||
if (!hadBackbufferError) {
|
var NormalShader = (function (_super) {
|
||||||
hadBackbufferError = true;
|
__extends(NormalShader, _super);
|
||||||
console.warn('pixi-picture: you are trying to use Blend Filter on main framebuffer! That wont work.');
|
function NormalShader(gl, tilingMode) {
|
||||||
|
_super.call(this, gl, normalVert, normalFrag, tilingMode);
|
||||||
}
|
}
|
||||||
return null;
|
return NormalShader;
|
||||||
|
}(extras.PictureShader));
|
||||||
|
extras.NormalShader = NormalShader;
|
||||||
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
|
})(PIXI || (PIXI = {}));
|
||||||
|
var PIXI;
|
||||||
|
(function (PIXI) {
|
||||||
|
var extras;
|
||||||
|
(function (extras) {
|
||||||
|
var overlayFrag = "\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cb2 = Cb * 2.0 - 1.0;\n vec3 screen = Cb2 + Cs - Cb2 * Cs;\n vec3 B;\n if (Cs.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cs.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cs.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||||
|
var OverlayShader = (function (_super) {
|
||||||
|
__extends(OverlayShader, _super);
|
||||||
|
function OverlayShader(gl, tilingMode) {
|
||||||
|
_super.call(this, gl, extras.PictureShader.blendVert, overlayFrag, tilingMode);
|
||||||
|
}
|
||||||
|
return OverlayShader;
|
||||||
|
}(extras.PictureShader));
|
||||||
|
extras.OverlayShader = OverlayShader;
|
||||||
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
|
})(PIXI || (PIXI = {}));
|
||||||
|
var PIXI;
|
||||||
|
(function (PIXI) {
|
||||||
|
var extras;
|
||||||
|
(function (extras) {
|
||||||
|
function nextPow2(v) {
|
||||||
|
v += (v === 0) ? 1 : 0;
|
||||||
|
--v;
|
||||||
|
v |= v >>> 1;
|
||||||
|
v |= v >>> 2;
|
||||||
|
v |= v >>> 4;
|
||||||
|
v |= v >>> 8;
|
||||||
|
v |= v >>> 16;
|
||||||
|
return v + 1;
|
||||||
}
|
}
|
||||||
var resolution = renderTarget.baseTexture.resolution;
|
var PictureRenderer = (function (_super) {
|
||||||
var x = (bounds.x - fr.x) * resolution;
|
__extends(PictureRenderer, _super);
|
||||||
var y = (bounds.y - fr.y) * resolution;
|
function PictureRenderer(renderer) {
|
||||||
var w = (bounds.width) * resolution;
|
_super.call(this, renderer);
|
||||||
var h = (bounds.height) * resolution;
|
}
|
||||||
var gl = renderer.gl;
|
PictureRenderer.prototype.onContextChange = function () {
|
||||||
var rt = this.getOptimalFilterTexture(w, h, 1);
|
var gl = this.renderer.gl;
|
||||||
rt.filterFrame = fr;
|
this.drawModes = extras.mapFilterBlendModesToPixi(gl);
|
||||||
renderer.texture.bindForceLocation(rt.baseTexture, 0);
|
this.normalShader = [new extras.NormalShader(gl, 0), new extras.NormalShader(gl, 1), new extras.NormalShader(gl, 2)];
|
||||||
gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x, y, w, h);
|
this._tempClamp = new Float32Array(4);
|
||||||
return rt;
|
this._tempColor = new Float32Array(4);
|
||||||
}
|
this._tempRect = new PIXI.Rectangle();
|
||||||
PIXI.systems.FilterSystem.prototype.push = push;
|
this._tempRect2 = new PIXI.Rectangle();
|
||||||
PIXI.systems.FilterSystem.prototype.pushWithCheck = pushWithCheck;
|
this._tempRect3 = new PIXI.Rectangle();
|
||||||
PIXI.systems.FilterSystem.prototype.pop = pop;
|
this._tempMatrix = new PIXI.Matrix();
|
||||||
PIXI.systems.FilterSystem.prototype.prepareBackdrop = prepareBackdrop;
|
this._tempMatrix2 = new PIXI.Matrix();
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
this._bigBuf = new Uint8Array(1 << 20);
|
||||||
var pixi_picture;
|
this._renderTexture = new PIXI.BaseRenderTexture(1024, 1024);
|
||||||
(function (pixi_picture) {
|
|
||||||
var MASK_CHANNEL;
|
|
||||||
(function (MASK_CHANNEL) {
|
|
||||||
MASK_CHANNEL[MASK_CHANNEL["RED"] = 0] = "RED";
|
|
||||||
MASK_CHANNEL[MASK_CHANNEL["GREEN"] = 1] = "GREEN";
|
|
||||||
MASK_CHANNEL[MASK_CHANNEL["BLUE"] = 2] = "BLUE";
|
|
||||||
MASK_CHANNEL[MASK_CHANNEL["ALPHA"] = 3] = "ALPHA";
|
|
||||||
})(MASK_CHANNEL = pixi_picture.MASK_CHANNEL || (pixi_picture.MASK_CHANNEL = {}));
|
|
||||||
var MaskConfig = (function () {
|
|
||||||
function MaskConfig(maskBefore, channel) {
|
|
||||||
if (maskBefore === void 0) { maskBefore = false; }
|
|
||||||
if (channel === void 0) { channel = MASK_CHANNEL.ALPHA; }
|
|
||||||
this.maskBefore = maskBefore;
|
|
||||||
this.uniformCode = 'uniform vec4 uChannel;';
|
|
||||||
this.uniforms = {
|
|
||||||
uChannel: new Float32Array([0, 0, 0, 0]),
|
|
||||||
};
|
};
|
||||||
this.blendCode = "b_res = dot(b_src, uChannel) * b_dest;";
|
PictureRenderer.prototype.start = function () {
|
||||||
this.uniforms.uChannel[channel] = 1.0;
|
};
|
||||||
}
|
PictureRenderer.prototype.flush = function () {
|
||||||
return MaskConfig;
|
};
|
||||||
}());
|
PictureRenderer.prototype._getRenderTexture = function (minWidth, minHeight) {
|
||||||
pixi_picture.MaskConfig = MaskConfig;
|
if (this._renderTexture.width < minWidth ||
|
||||||
var MaskFilter = (function (_super) {
|
this._renderTexture.height < minHeight) {
|
||||||
__extends(MaskFilter, _super);
|
minHeight = nextPow2(minWidth);
|
||||||
function MaskFilter(baseFilter, config) {
|
minHeight = nextPow2(minHeight);
|
||||||
if (config === void 0) { config = new MaskConfig(); }
|
this._renderTexture.resize(minWidth, minHeight);
|
||||||
var _this = _super.call(this, config) || this;
|
}
|
||||||
_this.baseFilter = baseFilter;
|
return this._renderTexture;
|
||||||
_this.config = config;
|
};
|
||||||
_this.padding = baseFilter.padding;
|
PictureRenderer.prototype._getBuf = function (size) {
|
||||||
return _this;
|
var buf = this._bigBuf;
|
||||||
}
|
if (buf.length < size) {
|
||||||
MaskFilter.prototype.apply = function (filterManager, input, output, clearMode) {
|
size = nextPow2(size);
|
||||||
var target = filterManager.getFilterTexture(input);
|
buf = new Uint8Array(size);
|
||||||
if (this.config.maskBefore) {
|
this._bigBuf = buf;
|
||||||
var blendMode = this.state.blendMode;
|
}
|
||||||
this.state.blendMode = PIXI.BLEND_MODES.NONE;
|
return buf;
|
||||||
filterManager.applyFilter(this, input, target, PIXI.CLEAR_MODES.YES);
|
};
|
||||||
this.baseFilter.blendMode = blendMode;
|
PictureRenderer.prototype.render = function (sprite) {
|
||||||
this.baseFilter.apply(filterManager, target, output, clearMode);
|
if (!sprite.texture.valid) {
|
||||||
this.state.blendMode = blendMode;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var uBackdrop = this.uniforms.uBackdrop;
|
|
||||||
this.baseFilter.apply(filterManager, uBackdrop, target, PIXI.CLEAR_MODES.YES);
|
|
||||||
this.uniforms.uBackdrop = target;
|
|
||||||
filterManager.applyFilter(this, input, output, clearMode);
|
|
||||||
this.uniforms.uBackdrop = uBackdrop;
|
|
||||||
}
|
|
||||||
filterManager.returnFilterTexture(target);
|
|
||||||
};
|
|
||||||
return MaskFilter;
|
|
||||||
}(pixi_picture.BlendFilter));
|
|
||||||
pixi_picture.MaskFilter = MaskFilter;
|
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
|
||||||
var pixi_picture;
|
|
||||||
(function (pixi_picture) {
|
|
||||||
var blends;
|
|
||||||
(function (blends) {
|
|
||||||
blends.NPM_BLEND = "if (b_src.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n}\nvec3 Cb = b_src.rgb / b_src.a, Cs;\nif (b_dest.a > 0.0) {\n Cs = b_dest.rgb / b_dest.a;\n}\n%NPM_BLEND%\nb_res.a = b_src.a + b_dest.a * (1.0-b_src.a);\nb_res.rgb = (1.0 - b_src.a) * Cs + b_src.a * B;\nb_res.rgb *= b_res.a;\n";
|
|
||||||
blends.OVERLAY_PART = "vec3 multiply = Cb * Cs * 2.0;\nvec3 Cb2 = Cb * 2.0 - 1.0;\nvec3 screen = Cb2 + Cs - Cb2 * Cs;\nvec3 B;\nif (Cs.r <= 0.5) {\n B.r = multiply.r;\n} else {\n B.r = screen.r;\n}\nif (Cs.g <= 0.5) {\n B.g = multiply.g;\n} else {\n B.g = screen.g;\n}\nif (Cs.b <= 0.5) {\n B.b = multiply.b;\n} else {\n B.b = screen.b;\n}\n";
|
|
||||||
blends.HARDLIGHT_PART = "vec3 multiply = Cb * Cs * 2.0;\nvec3 Cs2 = Cs * 2.0 - 1.0;\nvec3 screen = Cb + Cs2 - Cb * Cs2;\nvec3 B;\nif (Cb.r <= 0.5) {\n B.r = multiply.r;\n} else {\n B.r = screen.r;\n}\nif (Cb.g <= 0.5) {\n B.g = multiply.g;\n} else {\n B.g = screen.g;\n}\nif (Cb.b <= 0.5) {\n B.b = multiply.b;\n} else {\n B.b = screen.b;\n}\n";
|
|
||||||
blends.SOFTLIGHT_PART = "vec3 first = Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);\nvec3 B;\nvec3 D;\nif (Cs.r <= 0.5)\n{\n B.r = first.r;\n}\nelse\n{\n if (Cb.r <= 0.25)\n {\n D.r = ((16.0 * Cb.r - 12.0) * Cb.r + 4.0) * Cb.r; \n }\n else\n {\n D.r = sqrt(Cb.r);\n }\n B.r = Cb.r + (2.0 * Cs.r - 1.0) * (D.r - Cb.r);\n}\nif (Cs.g <= 0.5)\n{\n B.g = first.g;\n}\nelse\n{\n if (Cb.g <= 0.25)\n {\n D.g = ((16.0 * Cb.g - 12.0) * Cb.g + 4.0) * Cb.g; \n }\n else\n {\n D.g = sqrt(Cb.g);\n }\n B.g = Cb.g + (2.0 * Cs.g - 1.0) * (D.g - Cb.g);\n}\nif (Cs.b <= 0.5)\n{\n B.b = first.b;\n}\nelse\n{\n if (Cb.b <= 0.25)\n {\n D.b = ((16.0 * Cb.b - 12.0) * Cb.b + 4.0) * Cb.b; \n }\n else\n {\n D.b = sqrt(Cb.b);\n }\n B.b = Cb.b + (2.0 * Cs.b - 1.0) * (D.b - Cb.b);\n}\n";
|
|
||||||
blends.MULTIPLY_FULL = "if (b_dest.a > 0.0) {\n vec4 mult;\nmult.a = min(b_src.a + b_dest.a - b_src.a * b_dest.a, 1.0);\n mult.rgb = (b_dest.rgb / b_dest.a) * ((1.0 - b_src.a) + b_src.rgb);\n b_res.rgb = (b_dest.rgb / b_dest.a) * ((1.0 - b_src.a) + b_src.rgb);\n b_res.a = min(b_src.a + b_dest.a - b_src.a * b_dest.a, 1.0);\n b_res.rgb *= mult.a;\n}\n";
|
|
||||||
blends.OVERLAY_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.OVERLAY_PART);
|
|
||||||
blends.HARDLIGHT_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.HARDLIGHT_PART);
|
|
||||||
blends.SOFTLIGHT_FULL = blends.NPM_BLEND.replace("%NPM_BLEND%", blends.SOFTLIGHT_PART);
|
|
||||||
blends.blendFullArray = [];
|
|
||||||
blends.blendFullArray[PIXI.BLEND_MODES.MULTIPLY] = blends.MULTIPLY_FULL;
|
|
||||||
blends.blendFullArray[PIXI.BLEND_MODES.OVERLAY] = blends.OVERLAY_FULL;
|
|
||||||
blends.blendFullArray[PIXI.BLEND_MODES.HARD_LIGHT] = blends.HARDLIGHT_FULL;
|
|
||||||
blends.blendFullArray[PIXI.BLEND_MODES.SOFT_LIGHT] = blends.SOFTLIGHT_FULL;
|
|
||||||
})(blends = pixi_picture.blends || (pixi_picture.blends = {}));
|
|
||||||
var filterCache = [];
|
|
||||||
var filterCacheArray = [];
|
|
||||||
function getBlendFilter(blendMode) {
|
|
||||||
if (!blends.blendFullArray[blendMode]) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (!filterCache[blendMode]) {
|
|
||||||
filterCache[blendMode] = new pixi_picture.BlendFilter({ blendCode: blends.blendFullArray[blendMode] });
|
|
||||||
}
|
|
||||||
return filterCache[blendMode];
|
|
||||||
}
|
|
||||||
pixi_picture.getBlendFilter = getBlendFilter;
|
|
||||||
function getBlendFilterArray(blendMode) {
|
|
||||||
if (!blends.blendFullArray[blendMode]) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (!filterCacheArray[blendMode]) {
|
|
||||||
filterCacheArray[blendMode] = [this.getBlendFilter(blendMode)];
|
|
||||||
}
|
|
||||||
return filterCacheArray[blendMode];
|
|
||||||
}
|
|
||||||
pixi_picture.getBlendFilterArray = getBlendFilterArray;
|
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
|
||||||
var pixi_picture;
|
|
||||||
(function (pixi_picture) {
|
|
||||||
var Sprite = (function (_super) {
|
|
||||||
__extends(Sprite, _super);
|
|
||||||
function Sprite() {
|
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
|
||||||
}
|
|
||||||
Sprite.prototype._render = function (renderer) {
|
|
||||||
var texture = this._texture;
|
|
||||||
if (!texture || !texture.valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var blendFilterArray = pixi_picture.getBlendFilterArray(this.blendMode);
|
|
||||||
if (blendFilterArray) {
|
|
||||||
renderer.batch.flush();
|
|
||||||
if (!renderer.filter.pushWithCheck(this, blendFilterArray)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
var tilingMode = 0;
|
||||||
this.calculateVertices();
|
if (sprite.tileTransform) {
|
||||||
renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);
|
tilingMode = this._isSimpleSprite(sprite) ? 1 : 2;
|
||||||
renderer.plugins[this.pluginName].render(this);
|
}
|
||||||
if (blendFilterArray) {
|
var blendShader = this.drawModes[sprite.blendMode];
|
||||||
renderer.batch.flush();
|
if (blendShader) {
|
||||||
renderer.filter.pop();
|
this._renderBlend(sprite, blendShader[tilingMode]);
|
||||||
}
|
}
|
||||||
};
|
else {
|
||||||
return Sprite;
|
this._renderNormal(sprite, this.normalShader[tilingMode]);
|
||||||
}(PIXI.Sprite));
|
}
|
||||||
pixi_picture.Sprite = Sprite;
|
};
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
PictureRenderer.prototype._renderNormal = function (sprite, shader) {
|
||||||
var pixi_picture;
|
var renderer = this.renderer;
|
||||||
(function (pixi_picture) {
|
renderer.bindShader(shader);
|
||||||
var TilingSprite = (function (_super) {
|
renderer.state.setBlendMode(sprite.blendMode);
|
||||||
__extends(TilingSprite, _super);
|
this._renderInner(sprite, shader);
|
||||||
function TilingSprite() {
|
};
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
PictureRenderer.prototype._renderBlend = function (sprite, shader) {
|
||||||
}
|
var renderer = this.renderer;
|
||||||
TilingSprite.prototype._render = function (renderer) {
|
var spriteBounds = sprite.getBounds();
|
||||||
var texture = this._texture;
|
var renderTarget = renderer._activeRenderTarget;
|
||||||
if (!texture || !texture.valid) {
|
var matrix = renderTarget.projectionMatrix;
|
||||||
return;
|
var flipX = matrix.a < 0;
|
||||||
}
|
var flipY = matrix.d < 0;
|
||||||
var blendFilterArray = pixi_picture.getBlendFilterArray(this.blendMode);
|
var resolution = renderTarget.resolution;
|
||||||
if (blendFilterArray) {
|
var screen = this._tempRect;
|
||||||
renderer.batch.flush();
|
var fr = renderTarget.sourceFrame || renderTarget.destinationFrame;
|
||||||
if (!renderer.filter.pushWithCheck(this, blendFilterArray)) {
|
screen.x = 0;
|
||||||
|
screen.y = 0;
|
||||||
|
screen.width = fr.width;
|
||||||
|
screen.height = fr.height;
|
||||||
|
var bounds = this._tempRect2;
|
||||||
|
var fbw = fr.width * resolution, fbh = fr.height * resolution;
|
||||||
|
bounds.x = (spriteBounds.x + matrix.tx / matrix.a) * resolution + fbw / 2;
|
||||||
|
bounds.y = (spriteBounds.y + matrix.ty / matrix.d) * resolution + fbh / 2;
|
||||||
|
bounds.width = spriteBounds.width * resolution;
|
||||||
|
bounds.height = spriteBounds.height * resolution;
|
||||||
|
if (flipX) {
|
||||||
|
bounds.y = fbw - bounds.width - bounds.x;
|
||||||
|
}
|
||||||
|
if (flipY) {
|
||||||
|
bounds.y = fbh - bounds.height - bounds.y;
|
||||||
|
}
|
||||||
|
var screenBounds = this._tempRect3;
|
||||||
|
var x_1 = Math.floor(Math.max(screen.x, bounds.x));
|
||||||
|
var x_2 = Math.ceil(Math.min(screen.x + screen.width, bounds.x + bounds.width));
|
||||||
|
var y_1 = Math.floor(Math.max(screen.y, bounds.y));
|
||||||
|
var y_2 = Math.ceil(Math.min(screen.y + screen.height, bounds.y + bounds.height));
|
||||||
|
var pixelsWidth = x_2 - x_1;
|
||||||
|
var pixelsHeight = y_2 - y_1;
|
||||||
|
if (pixelsWidth <= 0 || pixelsHeight <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var rt = this._getRenderTexture(pixelsWidth, pixelsHeight);
|
||||||
|
renderer.bindTexture(rt, 1, true);
|
||||||
|
var gl = renderer.gl;
|
||||||
|
if (renderer.renderingToScreen && renderTarget.root) {
|
||||||
|
var buf = this._getBuf(pixelsWidth * pixelsHeight * 4);
|
||||||
|
gl.readPixels(x_1, y_1, pixelsWidth, pixelsHeight, gl.RGBA, gl.UNSIGNED_BYTE, this._bigBuf);
|
||||||
|
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, pixelsWidth, pixelsHeight, gl.RGBA, gl.UNSIGNED_BYTE, this._bigBuf);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x_1, y_1, pixelsWidth, pixelsHeight);
|
||||||
|
}
|
||||||
|
renderer.bindShader(shader);
|
||||||
|
renderer.state.setBlendMode(PIXI.BLEND_MODES.NORMAL);
|
||||||
|
if (shader.uniforms.mapMatrix) {
|
||||||
|
var mapMatrix = this._tempMatrix;
|
||||||
|
mapMatrix.a = bounds.width / rt.width / spriteBounds.width;
|
||||||
|
if (flipX) {
|
||||||
|
mapMatrix.a = -mapMatrix.a;
|
||||||
|
mapMatrix.tx = (bounds.x - x_1) / rt.width - (spriteBounds.x + spriteBounds.width) * mapMatrix.a;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mapMatrix.tx = (bounds.x - x_1) / rt.width - spriteBounds.x * mapMatrix.a;
|
||||||
|
}
|
||||||
|
mapMatrix.d = bounds.height / rt.height / spriteBounds.height;
|
||||||
|
if (flipY) {
|
||||||
|
mapMatrix.d = -mapMatrix.d;
|
||||||
|
mapMatrix.ty = (bounds.y - y_1) / rt.height - (spriteBounds.y + spriteBounds.height) * mapMatrix.d;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mapMatrix.ty = (bounds.y - y_1) / rt.height - spriteBounds.y * mapMatrix.d;
|
||||||
|
}
|
||||||
|
shader.uniforms.mapMatrix = mapMatrix.toArray(true);
|
||||||
|
}
|
||||||
|
this._renderInner(sprite, shader);
|
||||||
|
};
|
||||||
|
PictureRenderer.prototype._renderInner = function (sprite, shader) {
|
||||||
|
var renderer = this.renderer;
|
||||||
|
if (shader.tilingMode > 0) {
|
||||||
|
this._renderWithShader(sprite, shader.tilingMode === 1, shader);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this._renderSprite(sprite, shader);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PictureRenderer.prototype._renderWithShader = function (ts, isSimple, shader) {
|
||||||
|
var quad = shader.tempQuad;
|
||||||
|
var renderer = this.renderer;
|
||||||
|
renderer.bindVao(quad.vao);
|
||||||
|
var vertices = quad.vertices;
|
||||||
|
var _width = ts._width;
|
||||||
|
var _height = ts._height;
|
||||||
|
var _anchorX = ts._anchor._x;
|
||||||
|
var _anchorY = ts._anchor._y;
|
||||||
|
var w0 = _width * (1 - _anchorX);
|
||||||
|
var w1 = _width * -_anchorX;
|
||||||
|
var h0 = _height * (1 - _anchorY);
|
||||||
|
var h1 = _height * -_anchorY;
|
||||||
|
var wt = ts.transform.worldTransform;
|
||||||
|
var a = wt.a;
|
||||||
|
var b = wt.b;
|
||||||
|
var c = wt.c;
|
||||||
|
var d = wt.d;
|
||||||
|
var tx = wt.tx;
|
||||||
|
var ty = wt.ty;
|
||||||
|
vertices[0] = (a * w1) + (c * h1) + tx;
|
||||||
|
vertices[1] = (d * h1) + (b * w1) + ty;
|
||||||
|
vertices[2] = (a * w0) + (c * h1) + tx;
|
||||||
|
vertices[3] = (d * h1) + (b * w0) + ty;
|
||||||
|
vertices[4] = (a * w0) + (c * h0) + tx;
|
||||||
|
vertices[5] = (d * h0) + (b * w0) + ty;
|
||||||
|
vertices[6] = (a * w1) + (c * h0) + tx;
|
||||||
|
vertices[7] = (d * h0) + (b * w1) + ty;
|
||||||
|
vertices = quad.uvs;
|
||||||
|
vertices[0] = vertices[6] = -ts.anchor.x;
|
||||||
|
vertices[1] = vertices[3] = -ts.anchor.y;
|
||||||
|
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
|
||||||
|
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
|
||||||
|
quad.upload();
|
||||||
|
var tex = ts._texture;
|
||||||
|
var lt = ts.tileTransform.localTransform;
|
||||||
|
var uv = ts.uvTransform;
|
||||||
|
var mapCoord = uv.mapCoord;
|
||||||
|
var uClampFrame = uv.uClampFrame;
|
||||||
|
var uClampOffset = uv.uClampOffset;
|
||||||
|
var w = tex.width;
|
||||||
|
var h = tex.height;
|
||||||
|
var W = _width;
|
||||||
|
var H = _height;
|
||||||
|
var tempMat = this._tempMatrix2;
|
||||||
|
tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);
|
||||||
|
tempMat.invert();
|
||||||
|
if (isSimple) {
|
||||||
|
tempMat.append(mapCoord);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
shader.uniforms.uMapCoord = mapCoord.toArray(true);
|
||||||
|
shader.uniforms.uClampFrame = uClampFrame;
|
||||||
|
shader.uniforms.uClampOffset = uClampOffset;
|
||||||
|
}
|
||||||
|
shader.uniforms.uTransform = tempMat.toArray(true);
|
||||||
|
var color = this._tempColor;
|
||||||
|
var alpha = ts.worldAlpha;
|
||||||
|
PIXI.utils.hex2rgb(ts.tint, color);
|
||||||
|
color[0] *= alpha;
|
||||||
|
color[1] *= alpha;
|
||||||
|
color[2] *= alpha;
|
||||||
|
color[3] = alpha;
|
||||||
|
shader.uniforms.uColor = color;
|
||||||
|
renderer.bindTexture(tex, 0, true);
|
||||||
|
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||||
|
};
|
||||||
|
PictureRenderer.prototype._renderSprite = function (sprite, shader) {
|
||||||
|
var renderer = this.renderer;
|
||||||
|
var quad = shader.tempQuad;
|
||||||
|
renderer.bindVao(quad.vao);
|
||||||
|
var uvs = sprite.texture._uvs;
|
||||||
|
var vertices = quad.vertices;
|
||||||
|
var vd = sprite.vertexData;
|
||||||
|
for (var i = 0; i < 8; i++) {
|
||||||
|
quad.vertices[i] = vd[i];
|
||||||
|
}
|
||||||
|
quad.uvs[0] = uvs.x0;
|
||||||
|
quad.uvs[1] = uvs.y0;
|
||||||
|
quad.uvs[2] = uvs.x1;
|
||||||
|
quad.uvs[3] = uvs.y1;
|
||||||
|
quad.uvs[4] = uvs.x2;
|
||||||
|
quad.uvs[5] = uvs.y2;
|
||||||
|
quad.uvs[6] = uvs.x3;
|
||||||
|
quad.uvs[7] = uvs.y3;
|
||||||
|
quad.upload();
|
||||||
|
var frame = sprite.texture.frame;
|
||||||
|
var base = sprite.texture.baseTexture;
|
||||||
|
var clamp = this._tempClamp;
|
||||||
|
var eps = 0.5 / base.resolution;
|
||||||
|
clamp[0] = (frame.x + eps) / base.width;
|
||||||
|
clamp[1] = (frame.y + eps) / base.height;
|
||||||
|
clamp[2] = (frame.x + frame.width - eps) / base.width;
|
||||||
|
clamp[3] = (frame.y + frame.height - eps) / base.height;
|
||||||
|
shader.uniforms.uTextureClamp = clamp;
|
||||||
|
var color = this._tempColor;
|
||||||
|
PIXI.utils.hex2rgb(sprite.tint, color);
|
||||||
|
var alpha = sprite.worldAlpha;
|
||||||
|
color[0] *= alpha;
|
||||||
|
color[1] *= alpha;
|
||||||
|
color[2] *= alpha;
|
||||||
|
color[3] = alpha;
|
||||||
|
shader.uniforms.uColor = color;
|
||||||
|
renderer.bindTexture(base, 0, true);
|
||||||
|
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||||
|
};
|
||||||
|
PictureRenderer.prototype._isSimpleSprite = function (ts) {
|
||||||
|
var renderer = this.renderer;
|
||||||
|
var tex = ts._texture;
|
||||||
|
var baseTex = tex.baseTexture;
|
||||||
|
var isSimple = baseTex.isPowerOfTwo && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;
|
||||||
|
if (isSimple) {
|
||||||
|
if (!baseTex._glTextures[renderer.CONTEXT_UID]) {
|
||||||
|
if (baseTex.wrapMode === PIXI.WRAP_MODES.CLAMP) {
|
||||||
|
baseTex.wrapMode = PIXI.WRAP_MODES.REPEAT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
isSimple = baseTex.wrapMode !== PIXI.WRAP_MODES.CLAMP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isSimple;
|
||||||
|
};
|
||||||
|
return PictureRenderer;
|
||||||
|
}(PIXI.ObjectRenderer));
|
||||||
|
extras.PictureRenderer = PictureRenderer;
|
||||||
|
PIXI.WebGLRenderer.registerPlugin('picture', PictureRenderer);
|
||||||
|
PIXI.CanvasRenderer.registerPlugin('picture', PIXI.CanvasSpriteRenderer);
|
||||||
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
|
})(PIXI || (PIXI = {}));
|
||||||
|
var PIXI;
|
||||||
|
(function (PIXI) {
|
||||||
|
var extras;
|
||||||
|
(function (extras) {
|
||||||
|
var PictureSprite = (function (_super) {
|
||||||
|
__extends(PictureSprite, _super);
|
||||||
|
function PictureSprite(texture) {
|
||||||
|
_super.call(this, texture);
|
||||||
|
this.pluginName = 'picture';
|
||||||
}
|
}
|
||||||
this.tileTransform.updateLocalTransform();
|
return PictureSprite;
|
||||||
this.uvMatrix.update();
|
}(PIXI.Sprite));
|
||||||
renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);
|
extras.PictureSprite = PictureSprite;
|
||||||
renderer.plugins[this.pluginName].render(this);
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
if (blendFilterArray) {
|
})(PIXI || (PIXI = {}));
|
||||||
renderer.batch.flush();
|
var PIXI;
|
||||||
renderer.filter.pop();
|
(function (PIXI) {
|
||||||
|
var extras;
|
||||||
|
(function (extras) {
|
||||||
|
var PictureTilingSprite = (function (_super) {
|
||||||
|
__extends(PictureTilingSprite, _super);
|
||||||
|
function PictureTilingSprite(texture) {
|
||||||
|
_super.call(this, texture);
|
||||||
|
this.pluginName = 'picture';
|
||||||
}
|
}
|
||||||
};
|
return PictureTilingSprite;
|
||||||
return TilingSprite;
|
}(extras.TilingSprite));
|
||||||
}(PIXI.TilingSprite));
|
extras.PictureTilingSprite = PictureTilingSprite;
|
||||||
pixi_picture.TilingSprite = TilingSprite;
|
})(extras = PIXI.extras || (PIXI.extras = {}));
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
})(PIXI || (PIXI = {}));
|
||||||
var pixi_picture;
|
|
||||||
(function (pixi_picture) {
|
|
||||||
PIXI.picture = pixi_picture;
|
|
||||||
})(pixi_picture || (pixi_picture = {}));
|
|
||||||
//# sourceMappingURL=pixi-picture.js.map
|
//# sourceMappingURL=pixi-picture.js.map
|
File diff suppressed because it is too large
Load diff
83858
www/js/libs/pixi.js
83858
www/js/libs/pixi.js
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
9
www/js/libs/pixi.min.js
vendored
9
www/js/libs/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -51,7 +51,7 @@ AEL.Archeia_CoreChanges = AEL.Archeia_CoreChanges || {};
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// * Pixi Texture Fix
|
// * Pixi Texture Fix
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
PIXI.GLTexture.prototype.upload = function(source)
|
PIXI.glCore.GLTexture.prototype.upload = function(source)
|
||||||
{
|
{
|
||||||
this.bind();
|
this.bind();
|
||||||
|
|
||||||
|
|
|
@ -1902,13 +1902,7 @@ Gamefall.OmoriFixes = Gamefall.OmoriFixes || {};
|
||||||
for (let obj of mainWindows) { obj.filters = []; }
|
for (let obj of mainWindows) { obj.filters = []; }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let hasToneFilter;
|
let hasToneFilter = objects[0].filters.length > 0;
|
||||||
if (objects[0].filters !== null) {
|
|
||||||
hasToneFilter = objects[0].filters.length > 0;
|
|
||||||
} else {
|
|
||||||
hasToneFilter = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasToneFilter) {
|
if (!hasToneFilter) {
|
||||||
for (let obj of mainWindows) { obj.filters = [this._spriteset.getToneFilter()]; }
|
for (let obj of mainWindows) { obj.filters = [this._spriteset.getToneFilter()]; }
|
||||||
this._usingToneFilter = true;
|
this._usingToneFilter = true;
|
||||||
|
|
|
@ -413,7 +413,7 @@ Scene_OmoriTitleScreen.prototype.createTitleCommands = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createOptionWindowsContainer = function () {
|
Scene_OmoriTitleScreen.prototype.createOptionWindowsContainer = function () {
|
||||||
// Create Help Window Container
|
// Create Help Window Container
|
||||||
this._optionsWindowsContainer = new Sprite();
|
this._optionsWindowsContainer = new Sprite();
|
||||||
this._optionsWindowsContainer.x = 0;
|
this._optionsWindowsContainer.x = 10;
|
||||||
this._optionsWindowsContainer.y = -406;
|
this._optionsWindowsContainer.y = -406;
|
||||||
this._optionsWindowsContainer.opacity = 255;
|
this._optionsWindowsContainer.opacity = 255;
|
||||||
this.addChild(this._optionsWindowsContainer);
|
this.addChild(this._optionsWindowsContainer);
|
||||||
|
@ -424,7 +424,7 @@ Scene_OmoriTitleScreen.prototype.createOptionWindowsContainer = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createHelpWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createHelpWindow = function () {
|
||||||
// Create Help Window
|
// Create Help Window
|
||||||
this._helpWindow = new Window_OmoMenuOptionsHelp();
|
this._helpWindow = new Window_OmoMenuOptionsHelp();
|
||||||
this._helpWindow.x = 10;
|
this._helpWindow.x = 0;
|
||||||
this._helpWindow.y = Graphics.height - this._helpWindow.height - 10;
|
this._helpWindow.y = Graphics.height - this._helpWindow.height - 10;
|
||||||
this._optionsWindowsContainer.addChild(this._helpWindow);
|
this._optionsWindowsContainer.addChild(this._helpWindow);
|
||||||
};
|
};
|
||||||
|
@ -434,8 +434,6 @@ Scene_OmoriTitleScreen.prototype.createHelpWindow = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createOptionCategoriesWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createOptionCategoriesWindow = function () {
|
||||||
// Create Options Categories Window
|
// Create Options Categories Window
|
||||||
this._optionCategoriesWindow = new Window_OmoMenuOptionsCategory();
|
this._optionCategoriesWindow = new Window_OmoMenuOptionsCategory();
|
||||||
this._optionCategoriesWindow.x = 10;
|
|
||||||
this._optionCategoriesWindow.y = 37;
|
|
||||||
this._optionCategoriesWindow.deactivate();
|
this._optionCategoriesWindow.deactivate();
|
||||||
|
|
||||||
this._optionCategoriesWindow.setHandler('ok', this.onCategoryOk.bind(this));
|
this._optionCategoriesWindow.setHandler('ok', this.onCategoryOk.bind(this));
|
||||||
|
@ -462,8 +460,6 @@ Scene_OmoriTitleScreen.prototype.createOptionCategoriesWindow = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createGeneralOptionsWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createGeneralOptionsWindow = function () {
|
||||||
// Create General Options Window
|
// Create General Options Window
|
||||||
this._generalOptionsWindow = new Window_OmoMenuOptionsGeneral();
|
this._generalOptionsWindow = new Window_OmoMenuOptionsGeneral();
|
||||||
this._generalOptionsWindow.x = 10;
|
|
||||||
this._generalOptionsWindow.y = 37;
|
|
||||||
this._generalOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
this._generalOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
||||||
this._generalOptionsWindow.deactivate()
|
this._generalOptionsWindow.deactivate()
|
||||||
// Set Help Window Position
|
// Set Help Window Position
|
||||||
|
@ -478,8 +474,6 @@ Scene_OmoriTitleScreen.prototype.createGeneralOptionsWindow = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createAudioOptionsWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createAudioOptionsWindow = function () {
|
||||||
// Create Audio Options Window
|
// Create Audio Options Window
|
||||||
this._audioOptionsWindow = new Window_OmoMenuOptionsAudio();
|
this._audioOptionsWindow = new Window_OmoMenuOptionsAudio();
|
||||||
this._audioOptionsWindow.x = 10;
|
|
||||||
this._audioOptionsWindow.y = 37;
|
|
||||||
this._audioOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
this._audioOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
||||||
this._audioOptionsWindow.visible = false;
|
this._audioOptionsWindow.visible = false;
|
||||||
this._optionsWindowsContainer.addChild(this._audioOptionsWindow);
|
this._optionsWindowsContainer.addChild(this._audioOptionsWindow);
|
||||||
|
@ -490,8 +484,6 @@ Scene_OmoriTitleScreen.prototype.createAudioOptionsWindow = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createControllerOptionsWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createControllerOptionsWindow = function () {
|
||||||
// Create Control Options Window
|
// Create Control Options Window
|
||||||
this._controlOptionsWindow = new Window_OmoMenuOptionsControls();
|
this._controlOptionsWindow = new Window_OmoMenuOptionsControls();
|
||||||
this._controlOptionsWindow.x = 10;
|
|
||||||
this._controlOptionsWindow.y = 37;
|
|
||||||
this._controlOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
this._controlOptionsWindow.setHandler('cancel', this.onOptionWindowCancel.bind(this));
|
||||||
this._controlOptionsWindow.visible = false;
|
this._controlOptionsWindow.visible = false;
|
||||||
this._optionsWindowsContainer.addChild(this._controlOptionsWindow);
|
this._optionsWindowsContainer.addChild(this._controlOptionsWindow);
|
||||||
|
@ -502,8 +494,6 @@ Scene_OmoriTitleScreen.prototype.createControllerOptionsWindow = function () {
|
||||||
Scene_OmoriTitleScreen.prototype.createSystemOptionsWindow = function () {
|
Scene_OmoriTitleScreen.prototype.createSystemOptionsWindow = function () {
|
||||||
// Create System Option Window
|
// Create System Option Window
|
||||||
this._systemOptionsWindow = new Window_OmoMenuOptionsSystem();
|
this._systemOptionsWindow = new Window_OmoMenuOptionsSystem();
|
||||||
this._systemOptionsWindow.x = 10;
|
|
||||||
this._systemOptionsWindow.y = 37;
|
|
||||||
this._systemOptionsWindow.setHandler('restoreConfig', () => {
|
this._systemOptionsWindow.setHandler('restoreConfig', () => {
|
||||||
ConfigManager.restoreDefaultConfig();
|
ConfigManager.restoreDefaultConfig();
|
||||||
this._controlOptionsWindow.makeOptionsList()
|
this._controlOptionsWindow.makeOptionsList()
|
||||||
|
@ -598,12 +588,7 @@ Scene_OmoriTitleScreen.prototype.start = function () {
|
||||||
this._lightBulbLinesSprite.opacity = 255;
|
this._lightBulbLinesSprite.opacity = 255;
|
||||||
for (var i = 0; i < this._titleCommands.length; i++) {
|
for (var i = 0; i < this._titleCommands.length; i++) {
|
||||||
var win = this._titleCommands[i];
|
var win = this._titleCommands[i];
|
||||||
var patch = 40;
|
|
||||||
win.y = (Graphics.height - win.height) - 15;
|
win.y = (Graphics.height - win.height) - 15;
|
||||||
win.x = win.x - patch;
|
|
||||||
win.width = win.width + patch;
|
|
||||||
win.pivot.x = win.pivot.x - patch;
|
|
||||||
win.children[0].width = win.children[0].width - patch;
|
|
||||||
win.opacity = 255;
|
win.opacity = 255;
|
||||||
win.contentsOpacity = 255;
|
win.contentsOpacity = 255;
|
||||||
};
|
};
|
||||||
|
@ -1011,7 +996,7 @@ Scene_OmoriTitleScreen.prototype.commandOptions = function () {
|
||||||
// Set Duration
|
// Set Duration
|
||||||
var duration = 35;
|
var duration = 35;
|
||||||
var obj = this._optionsWindowsContainer;
|
var obj = this._optionsWindowsContainer;
|
||||||
var data = { obj: obj, properties: ['y', 'opacity'], from: { y: obj.y, opacity: obj.opacity }, to: { y: 0, opacity: 255 }, durations: { y: duration, opacity: duration } }
|
var data = { obj: obj, properties: ['y', 'opacity'], from: { y: obj.y, opacity: obj.opacity }, to: { y: 37, opacity: 255 }, durations: { y: duration, opacity: duration } }
|
||||||
data.easing = Object_Movement.easeOutCirc;
|
data.easing = Object_Movement.easeOutCirc;
|
||||||
this.move.startMove(data);
|
this.move.startMove(data);
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,6 @@
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// rpg_managers.js v1.6.2.2
|
// rpg_managers.js v1.6.1
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// DataManager
|
// DataManager
|
||||||
|
@ -35,6 +34,7 @@ var $gameMessage = null;
|
||||||
var $gameSwitches = null;
|
var $gameSwitches = null;
|
||||||
var $gameVariables = null;
|
var $gameVariables = null;
|
||||||
var $gameSelfSwitches = null;
|
var $gameSelfSwitches = null;
|
||||||
|
var $gameSelfVariables = null;
|
||||||
var $gameActors = null;
|
var $gameActors = null;
|
||||||
var $gameParty = null;
|
var $gameParty = null;
|
||||||
var $gameTroop = null;
|
var $gameTroop = null;
|
||||||
|
@ -76,10 +76,11 @@ DataManager.loadDatabase = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window._dfs = require("fs");
|
||||||
DataManager.loadDataFile = function (name, src) {
|
DataManager.loadDataFile = function (name, src) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
var url = CS_URL.MapURL('data/' + src);
|
var url = _dfs.cachedAlternativeName('data/' + src);
|
||||||
xhr.open('GET', CS_URL.MapURL(url));
|
xhr.open('GET', url);
|
||||||
xhr.overrideMimeType('application/json');
|
xhr.overrideMimeType('application/json');
|
||||||
xhr.onload = function () {
|
xhr.onload = function () {
|
||||||
if (xhr.status < 400) {
|
if (xhr.status < 400) {
|
||||||
|
@ -207,6 +208,7 @@ DataManager.createGameObjects = function () {
|
||||||
$gameSwitches = new Game_Switches();
|
$gameSwitches = new Game_Switches();
|
||||||
$gameVariables = new Game_Variables();
|
$gameVariables = new Game_Variables();
|
||||||
$gameSelfSwitches = new Game_SelfSwitches();
|
$gameSelfSwitches = new Game_SelfSwitches();
|
||||||
|
$gameSelfVariables = new Game_SelfVariables();
|
||||||
$gameActors = new Game_Actors();
|
$gameActors = new Game_Actors();
|
||||||
$gameParty = new Game_Party();
|
$gameParty = new Game_Party();
|
||||||
$gameTroop = new Game_Troop();
|
$gameTroop = new Game_Troop();
|
||||||
|
@ -437,6 +439,7 @@ DataManager.makeSaveContents = function () {
|
||||||
contents.switches = $gameSwitches;
|
contents.switches = $gameSwitches;
|
||||||
contents.variables = $gameVariables;
|
contents.variables = $gameVariables;
|
||||||
contents.selfSwitches = $gameSelfSwitches;
|
contents.selfSwitches = $gameSelfSwitches;
|
||||||
|
contents.selfVariables = $gameSelfVariables;
|
||||||
contents.actors = $gameActors;
|
contents.actors = $gameActors;
|
||||||
contents.party = $gameParty;
|
contents.party = $gameParty;
|
||||||
contents.map = $gameMap;
|
contents.map = $gameMap;
|
||||||
|
@ -451,6 +454,7 @@ DataManager.extractSaveContents = function (contents) {
|
||||||
$gameSwitches = contents.switches;
|
$gameSwitches = contents.switches;
|
||||||
$gameVariables = contents.variables;
|
$gameVariables = contents.variables;
|
||||||
$gameSelfSwitches = contents.selfSwitches;
|
$gameSelfSwitches = contents.selfSwitches;
|
||||||
|
$gameSelfVariables = contents.selfVariables;
|
||||||
$gameActors = contents.actors;
|
$gameActors = contents.actors;
|
||||||
$gameParty = contents.party;
|
$gameParty = contents.party;
|
||||||
$gameMap = contents.map;
|
$gameMap = contents.map;
|
||||||
|
@ -603,11 +607,9 @@ StorageManager.remove = function (savefileId) {
|
||||||
|
|
||||||
StorageManager.backup = function (savefileId) {
|
StorageManager.backup = function (savefileId) {
|
||||||
if (this.exists(savefileId)) {
|
if (this.exists(savefileId)) {
|
||||||
var data;
|
|
||||||
var compressed;
|
|
||||||
if (this.isLocalMode()) {
|
if (this.isLocalMode()) {
|
||||||
data = this.loadFromLocalFile(savefileId);
|
var data = this.loadFromLocalFile(savefileId);
|
||||||
compressed = LZString.compressToBase64(data);
|
var compressed = LZString.compressToBase64(data);
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var dirPath = this.localFileDirectoryPath();
|
var dirPath = this.localFileDirectoryPath();
|
||||||
var filePath = this.localFilePath(savefileId) + ".bak";
|
var filePath = this.localFilePath(savefileId) + ".bak";
|
||||||
|
@ -616,8 +618,8 @@ StorageManager.backup = function (savefileId) {
|
||||||
}
|
}
|
||||||
fs.writeFileSync(filePath, compressed);
|
fs.writeFileSync(filePath, compressed);
|
||||||
} else {
|
} else {
|
||||||
data = this.loadFromWebStorage(savefileId);
|
var data = this.loadFromWebStorage(savefileId);
|
||||||
compressed = LZString.compressToBase64(data);
|
var compressed = LZString.compressToBase64(data);
|
||||||
var key = this.webStorageKey(savefileId) + "bak";
|
var key = this.webStorageKey(savefileId) + "bak";
|
||||||
localStorage.setItem(key, compressed);
|
localStorage.setItem(key, compressed);
|
||||||
}
|
}
|
||||||
|
@ -648,11 +650,9 @@ StorageManager.cleanBackup = function (savefileId) {
|
||||||
|
|
||||||
StorageManager.restoreBackup = function (savefileId) {
|
StorageManager.restoreBackup = function (savefileId) {
|
||||||
if (this.backupExists(savefileId)) {
|
if (this.backupExists(savefileId)) {
|
||||||
var data;
|
|
||||||
var compressed;
|
|
||||||
if (this.isLocalMode()) {
|
if (this.isLocalMode()) {
|
||||||
data = this.loadFromLocalBackupFile(savefileId);
|
var data = this.loadFromLocalBackupFile(savefileId);
|
||||||
compressed = LZString.compressToBase64(data);
|
var compressed = LZString.compressToBase64(data);
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var dirPath = this.localFileDirectoryPath();
|
var dirPath = this.localFileDirectoryPath();
|
||||||
var filePath = this.localFilePath(savefileId);
|
var filePath = this.localFilePath(savefileId);
|
||||||
|
@ -662,8 +662,8 @@ StorageManager.restoreBackup = function (savefileId) {
|
||||||
fs.writeFileSync(filePath, compressed);
|
fs.writeFileSync(filePath, compressed);
|
||||||
fs.unlinkSync(filePath + ".bak");
|
fs.unlinkSync(filePath + ".bak");
|
||||||
} else {
|
} else {
|
||||||
data = this.loadFromWebStorageBackup(savefileId);
|
var data = this.loadFromWebStorageBackup(savefileId);
|
||||||
compressed = LZString.compressToBase64(data);
|
var compressed = LZString.compressToBase64(data);
|
||||||
var key = this.webStorageKey(savefileId);
|
var key = this.webStorageKey(savefileId);
|
||||||
localStorage.setItem(key, compressed);
|
localStorage.setItem(key, compressed);
|
||||||
localStorage.removeItem(key + "bak");
|
localStorage.removeItem(key + "bak");
|
||||||
|
@ -863,7 +863,7 @@ ImageManager.loadTitle2 = function (filename, hue) {
|
||||||
|
|
||||||
ImageManager.loadBitmap = function (folder, filename, hue, smooth) {
|
ImageManager.loadBitmap = function (folder, filename, hue, smooth) {
|
||||||
if (filename) {
|
if (filename) {
|
||||||
var path = folder + encodeURIComponent(filename) + '.png';
|
var path = folder + filename + '.png';
|
||||||
var bitmap = this.loadNormalBitmap(path, hue || 0);
|
var bitmap = this.loadNormalBitmap(path, hue || 0);
|
||||||
bitmap.smooth = smooth;
|
bitmap.smooth = smooth;
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
@ -1468,7 +1468,7 @@ AudioManager.makeEmptyAudioObject = function () {
|
||||||
|
|
||||||
AudioManager.createBuffer = function (folder, name) {
|
AudioManager.createBuffer = function (folder, name) {
|
||||||
var ext = this.audioFileExt();
|
var ext = this.audioFileExt();
|
||||||
var url = CS_URL.MapURL(this._path + folder + '/' + encodeURIComponent(name) + ext);
|
var url = this._path + folder + '/' + encodeURIComponent(name) + ext;
|
||||||
if (this.shouldUseHtml5Audio() && folder === 'bgm') {
|
if (this.shouldUseHtml5Audio() && folder === 'bgm') {
|
||||||
if (this._blobUrl) Html5Audio.setup(this._blobUrl);
|
if (this._blobUrl) Html5Audio.setup(this._blobUrl);
|
||||||
else Html5Audio.setup(url);
|
else Html5Audio.setup(url);
|
||||||
|
@ -1875,20 +1875,15 @@ SceneManager.initInput = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
SceneManager.initNwjs = function () {
|
SceneManager.initNwjs = function () {
|
||||||
try {
|
if (Utils.isNwjs()) {
|
||||||
if (Utils.isNwjs()) {
|
var gui = require('nw.gui');
|
||||||
var gui = require('nw.gui');
|
var win = gui.window;
|
||||||
var win = gui.Window.get();
|
if (process.platform === 'darwin' && !win.menu) {
|
||||||
if (process.platform === 'darwin' && !win.menu) {
|
var menubar = new gui.Menu({ type: 'menubar' });
|
||||||
var menubar = new gui.Menu({ type: 'menubar' });
|
var option = { hideEdit: true, hideWindow: true };
|
||||||
var option = { hideEdit: true, hideWindow: true };
|
menubar.createMacBuiltin('Game', option);
|
||||||
menubar.createMacBuiltin('Game', option);
|
win.menu = menubar;
|
||||||
win.menu = menubar;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (ex)
|
|
||||||
{
|
|
||||||
Utils.isNwjs = function () { return false; };
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1944,11 +1939,11 @@ SceneManager.onKeyDown = function (event) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/*case 119: // F8
|
case 119: // F8
|
||||||
if (Utils.isNwjs() && Utils.isOptionValid('test')) {
|
if (Utils.isNwjs() && Utils.isOptionValid('test')) {
|
||||||
require('nw.gui').Window.get().showDevTools();
|
require('nw.gui').window.showDevTools();
|
||||||
}
|
}
|
||||||
break;*/
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2834,7 +2829,7 @@ PluginManager.setParameters = function (name, parameters) {
|
||||||
};
|
};
|
||||||
|
|
||||||
PluginManager.loadScript = function (name) {
|
PluginManager.loadScript = function (name) {
|
||||||
var url = CS_URL.MapURL(this._path + name);
|
var url = this._path + name;
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.type = 'text/javascript';
|
script.type = 'text/javascript';
|
||||||
script.src = url;
|
script.src = url;
|
||||||
|
@ -2847,3 +2842,4 @@ PluginManager.loadScript = function (name) {
|
||||||
PluginManager.onError = function (e) {
|
PluginManager.onError = function (e) {
|
||||||
this._errorUrls.push(e.target._url);
|
this._errorUrls.push(e.target._url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,6 @@
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// rpg_scenes.js v1.6.2.2
|
// rpg_scenes.js v1.6.1
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// rpg_sprites.js v1.6.2.2
|
// rpg_sprites.js v1.6.1
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Sprite_Base
|
// Sprite_Base
|
||||||
|
@ -252,9 +251,9 @@ Sprite_Character.prototype.updateBitmap = function () {
|
||||||
|
|
||||||
Sprite_Character.prototype.isImageChanged = function () {
|
Sprite_Character.prototype.isImageChanged = function () {
|
||||||
return (this._tilesetId !== $gameMap.tilesetId() ||
|
return (this._tilesetId !== $gameMap.tilesetId() ||
|
||||||
this._tileId !== this._character.tileId() ||
|
this._tileId !== this._character.tileId() ||
|
||||||
this._characterName !== this._character.characterName() ||
|
this._characterName !== this._character.characterName() ||
|
||||||
this._characterIndex !== this._character.characterIndex());
|
this._characterIndex !== this._character.characterIndex());
|
||||||
};
|
};
|
||||||
|
|
||||||
Sprite_Character.prototype.setTileBitmap = function () {
|
Sprite_Character.prototype.setTileBitmap = function () {
|
||||||
|
@ -648,24 +647,24 @@ Sprite_Actor.prototype = Object.create(Sprite_Battler.prototype);
|
||||||
Sprite_Actor.prototype.constructor = Sprite_Actor;
|
Sprite_Actor.prototype.constructor = Sprite_Actor;
|
||||||
|
|
||||||
Sprite_Actor.MOTIONS = {
|
Sprite_Actor.MOTIONS = {
|
||||||
walk: { index: 0, loop: true },
|
walk: { index: 0, loop: true },
|
||||||
wait: { index: 1, loop: true },
|
wait: { index: 1, loop: true },
|
||||||
chant: { index: 2, loop: true },
|
chant: { index: 2, loop: true },
|
||||||
guard: { index: 3, loop: true },
|
guard: { index: 3, loop: true },
|
||||||
damage: { index: 4, loop: false },
|
damage: { index: 4, loop: false },
|
||||||
evade: { index: 5, loop: false },
|
evade: { index: 5, loop: false },
|
||||||
thrust: { index: 6, loop: false },
|
thrust: { index: 6, loop: false },
|
||||||
swing: { index: 7, loop: false },
|
swing: { index: 7, loop: false },
|
||||||
missile: { index: 8, loop: false },
|
missile: { index: 8, loop: false },
|
||||||
skill: { index: 9, loop: false },
|
skill: { index: 9, loop: false },
|
||||||
spell: { index: 10, loop: false },
|
spell: { index: 10, loop: false },
|
||||||
item: { index: 11, loop: false },
|
item: { index: 11, loop: false },
|
||||||
escape: { index: 12, loop: true },
|
escape: { index: 12, loop: true },
|
||||||
victory: { index: 13, loop: true },
|
victory: { index: 13, loop: true },
|
||||||
dying: { index: 14, loop: true },
|
dying: { index: 14, loop: true },
|
||||||
abnormal: { index: 15, loop: true },
|
abnormal: { index: 15, loop: true },
|
||||||
sleep: { index: 16, loop: true },
|
sleep: { index: 16, loop: true },
|
||||||
dead: { index: 17, loop: true }
|
dead: { index: 17, loop: true }
|
||||||
};
|
};
|
||||||
|
|
||||||
Sprite_Actor.prototype.initialize = function (battler) {
|
Sprite_Actor.prototype.initialize = function (battler) {
|
||||||
|
@ -844,10 +843,10 @@ Sprite_Actor.prototype.motionSpeed = function () {
|
||||||
|
|
||||||
Sprite_Actor.prototype.refreshMotion = function () {
|
Sprite_Actor.prototype.refreshMotion = function () {
|
||||||
var actor = this._actor;
|
var actor = this._actor;
|
||||||
var motionGuard = Sprite_Actor.MOTIONS.guard;
|
var motionGuard = Sprite_Actor.MOTIONS['guard'];
|
||||||
if (actor) {
|
if (actor) {
|
||||||
if (this._motion === motionGuard && !BattleManager.isInputting()) {
|
if (this._motion === motionGuard && !BattleManager.isInputting()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var stateMotion = actor.stateMotionIndex();
|
var stateMotion = actor.stateMotionIndex();
|
||||||
if (actor.isInputting() || actor.isActing()) {
|
if (actor.isInputting() || actor.isActing()) {
|
||||||
|
@ -1020,27 +1019,27 @@ Sprite_Enemy.prototype.setupEffect = function () {
|
||||||
Sprite_Enemy.prototype.startEffect = function (effectType) {
|
Sprite_Enemy.prototype.startEffect = function (effectType) {
|
||||||
this._effectType = effectType;
|
this._effectType = effectType;
|
||||||
switch (this._effectType) {
|
switch (this._effectType) {
|
||||||
case 'appear':
|
case 'appear':
|
||||||
this.startAppear();
|
this.startAppear();
|
||||||
break;
|
break;
|
||||||
case 'disappear':
|
case 'disappear':
|
||||||
this.startDisappear();
|
this.startDisappear();
|
||||||
break;
|
break;
|
||||||
case 'whiten':
|
case 'whiten':
|
||||||
this.startWhiten();
|
this.startWhiten();
|
||||||
break;
|
break;
|
||||||
case 'blink':
|
case 'blink':
|
||||||
this.startBlink();
|
this.startBlink();
|
||||||
break;
|
break;
|
||||||
case 'collapse':
|
case 'collapse':
|
||||||
this.startCollapse();
|
this.startCollapse();
|
||||||
break;
|
break;
|
||||||
case 'bossCollapse':
|
case 'bossCollapse':
|
||||||
this.startBossCollapse();
|
this.startBossCollapse();
|
||||||
break;
|
break;
|
||||||
case 'instantCollapse':
|
case 'instantCollapse':
|
||||||
this.startInstantCollapse();
|
this.startInstantCollapse();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.revertToNormal();
|
this.revertToNormal();
|
||||||
};
|
};
|
||||||
|
@ -1083,27 +1082,27 @@ Sprite_Enemy.prototype.updateEffect = function () {
|
||||||
if (this._effectDuration > 0) {
|
if (this._effectDuration > 0) {
|
||||||
this._effectDuration--;
|
this._effectDuration--;
|
||||||
switch (this._effectType) {
|
switch (this._effectType) {
|
||||||
case 'whiten':
|
case 'whiten':
|
||||||
this.updateWhiten();
|
this.updateWhiten();
|
||||||
break;
|
break;
|
||||||
case 'blink':
|
case 'blink':
|
||||||
this.updateBlink();
|
this.updateBlink();
|
||||||
break;
|
break;
|
||||||
case 'appear':
|
case 'appear':
|
||||||
this.updateAppear();
|
this.updateAppear();
|
||||||
break;
|
break;
|
||||||
case 'disappear':
|
case 'disappear':
|
||||||
this.updateDisappear();
|
this.updateDisappear();
|
||||||
break;
|
break;
|
||||||
case 'collapse':
|
case 'collapse':
|
||||||
this.updateCollapse();
|
this.updateCollapse();
|
||||||
break;
|
break;
|
||||||
case 'bossCollapse':
|
case 'bossCollapse':
|
||||||
this.updateBossCollapse();
|
this.updateBossCollapse();
|
||||||
break;
|
break;
|
||||||
case 'instantCollapse':
|
case 'instantCollapse':
|
||||||
this.updateInstantCollapse();
|
this.updateInstantCollapse();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this._effectDuration === 0) {
|
if (this._effectDuration === 0) {
|
||||||
this._effectType = null;
|
this._effectType = null;
|
||||||
|
@ -1395,7 +1394,7 @@ Sprite_Animation.prototype.updateFrame = function () {
|
||||||
|
|
||||||
Sprite_Animation.prototype.currentFrameIndex = function () {
|
Sprite_Animation.prototype.currentFrameIndex = function () {
|
||||||
return (this._animation.frames.length -
|
return (this._animation.frames.length -
|
||||||
Math.floor((this._duration + this._rate - 1) / this._rate));
|
Math.floor((this._duration + this._rate - 1) / this._rate));
|
||||||
};
|
};
|
||||||
|
|
||||||
Sprite_Animation.prototype.updateAllCellSprites = function (frame) {
|
Sprite_Animation.prototype.updateAllCellSprites = function (frame) {
|
||||||
|
@ -1422,10 +1421,10 @@ Sprite_Animation.prototype.updateCellSprite = function (sprite, cell) {
|
||||||
sprite.rotation = cell[4] * Math.PI / 180;
|
sprite.rotation = cell[4] * Math.PI / 180;
|
||||||
sprite.scale.x = cell[3] / 100;
|
sprite.scale.x = cell[3] / 100;
|
||||||
|
|
||||||
if (cell[5]) {
|
if(cell[5]){
|
||||||
sprite.scale.x *= -1;
|
sprite.scale.x *= -1;
|
||||||
}
|
}
|
||||||
if (mirror) {
|
if(mirror){
|
||||||
sprite.x *= -1;
|
sprite.x *= -1;
|
||||||
sprite.rotation *= -1;
|
sprite.rotation *= -1;
|
||||||
sprite.scale.x *= -1;
|
sprite.scale.x *= -1;
|
||||||
|
@ -1443,15 +1442,15 @@ Sprite_Animation.prototype.updateCellSprite = function (sprite, cell) {
|
||||||
Sprite_Animation.prototype.processTimingData = function (timing) {
|
Sprite_Animation.prototype.processTimingData = function (timing) {
|
||||||
var duration = timing.flashDuration * this._rate;
|
var duration = timing.flashDuration * this._rate;
|
||||||
switch (timing.flashScope) {
|
switch (timing.flashScope) {
|
||||||
case 1:
|
case 1:
|
||||||
this.startFlash(timing.flashColor, duration);
|
this.startFlash(timing.flashColor, duration);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.startScreenFlash(timing.flashColor, duration);
|
this.startScreenFlash(timing.flashColor, duration);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.startHiding(duration);
|
this.startHiding(duration);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!this._duplicated && timing.se) {
|
if (!this._duplicated && timing.se) {
|
||||||
AudioManager.playSe(timing.se);
|
AudioManager.playSe(timing.se);
|
||||||
|
@ -1614,7 +1613,7 @@ Sprite_StateIcon.prototype.initialize = function () {
|
||||||
this.loadBitmap();
|
this.loadBitmap();
|
||||||
};
|
};
|
||||||
|
|
||||||
Sprite_StateIcon._iconWidth = 32;
|
Sprite_StateIcon._iconWidth = 32;
|
||||||
Sprite_StateIcon._iconHeight = 32;
|
Sprite_StateIcon._iconHeight = 32;
|
||||||
|
|
||||||
Sprite_StateIcon.prototype.initMembers = function () {
|
Sprite_StateIcon.prototype.initMembers = function () {
|
||||||
|
@ -1908,9 +1907,6 @@ function Sprite_Picture() {
|
||||||
Sprite_Picture.prototype = Object.create(Sprite.prototype);
|
Sprite_Picture.prototype = Object.create(Sprite.prototype);
|
||||||
Sprite_Picture.prototype.constructor = Sprite_Picture;
|
Sprite_Picture.prototype.constructor = Sprite_Picture;
|
||||||
|
|
||||||
Sprite_Picture.prototype._renderCanvas_PIXI = PIXI.picture.Sprite.prototype._renderCanvas;
|
|
||||||
Sprite_Picture.prototype._render_PIXI = PIXI.picture.Sprite.prototype._render;
|
|
||||||
|
|
||||||
Sprite_Picture.prototype.initialize = function (pictureId) {
|
Sprite_Picture.prototype.initialize = function (pictureId) {
|
||||||
Sprite.prototype.initialize.call(this);
|
Sprite.prototype.initialize.call(this);
|
||||||
this._pictureId = pictureId;
|
this._pictureId = pictureId;
|
||||||
|
@ -2075,7 +2071,7 @@ Sprite_Destination.prototype.initialize = function () {
|
||||||
|
|
||||||
Sprite_Destination.prototype.update = function () {
|
Sprite_Destination.prototype.update = function () {
|
||||||
Sprite.prototype.update.call(this);
|
Sprite.prototype.update.call(this);
|
||||||
if ($gameTemp.isDestinationValid()) {
|
if ($gameTemp.isDestinationValid()){
|
||||||
this.updatePosition();
|
this.updatePosition();
|
||||||
this.updateAnimation();
|
this.updateAnimation();
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
@ -2382,14 +2378,14 @@ Spriteset_Map.prototype._canvasReAddParallax = function () {
|
||||||
this._parallax = new TilingSprite();
|
this._parallax = new TilingSprite();
|
||||||
this._parallax.move(0, 0, Graphics.width, Graphics.height);
|
this._parallax.move(0, 0, Graphics.width, Graphics.height);
|
||||||
this._parallax.bitmap = ImageManager.loadParallax(this._parallaxName);
|
this._parallax.bitmap = ImageManager.loadParallax(this._parallaxName);
|
||||||
this._baseSprite.addChildAt(this._parallax, index);
|
this._baseSprite.addChildAt(this._parallax,index);
|
||||||
};
|
};
|
||||||
|
|
||||||
Spriteset_Map.prototype.updateParallax = function () {
|
Spriteset_Map.prototype.updateParallax = function () {
|
||||||
if (this._parallaxName !== $gameMap.parallaxName()) {
|
if (this._parallaxName !== $gameMap.parallaxName()) {
|
||||||
this._parallaxName = $gameMap.parallaxName();
|
this._parallaxName = $gameMap.parallaxName();
|
||||||
|
|
||||||
if (this._parallax.bitmap && Graphics.isWebGL() !== true) {
|
if (this._parallax.bitmap && Graphics.isWebGL() != true) {
|
||||||
this._canvasReAddParallax();
|
this._canvasReAddParallax();
|
||||||
} else {
|
} else {
|
||||||
this._parallax.bitmap = ImageManager.loadParallax(this._parallaxName);
|
this._parallax.bitmap = ImageManager.loadParallax(this._parallaxName);
|
||||||
|
@ -2404,14 +2400,6 @@ Spriteset_Map.prototype.updateParallax = function () {
|
||||||
Spriteset_Map.prototype.updateTilemap = function () {
|
Spriteset_Map.prototype.updateTilemap = function () {
|
||||||
this._tilemap.origin.x = $gameMap.displayX() * $gameMap.tileWidth();
|
this._tilemap.origin.x = $gameMap.displayX() * $gameMap.tileWidth();
|
||||||
this._tilemap.origin.y = $gameMap.displayY() * $gameMap.tileHeight();
|
this._tilemap.origin.y = $gameMap.displayY() * $gameMap.tileHeight();
|
||||||
/* removed in 1.6.2 - But apparently is still needed for some games */
|
|
||||||
if (this._tilemap.bitmaps) {
|
|
||||||
if (!this.isTilesetReady && this._tilemap.bitmaps.every(bitmap => bitmap.isRequestReady())) {
|
|
||||||
this._tilemap.refresh();
|
|
||||||
this._tilemap.refreshTileset();
|
|
||||||
this.isTilesetReady = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Spriteset_Map.prototype.updateShadow = function () {
|
Spriteset_Map.prototype.updateShadow = function () {
|
||||||
|
@ -2566,57 +2554,57 @@ Spriteset_Battle.prototype.overworldBattleback2Name = function () {
|
||||||
|
|
||||||
Spriteset_Battle.prototype.normalBattleback1Name = function () {
|
Spriteset_Battle.prototype.normalBattleback1Name = function () {
|
||||||
return (this.terrainBattleback1Name(this.autotileType(1)) ||
|
return (this.terrainBattleback1Name(this.autotileType(1)) ||
|
||||||
this.terrainBattleback1Name(this.autotileType(0)) ||
|
this.terrainBattleback1Name(this.autotileType(0)) ||
|
||||||
this.defaultBattleback1Name());
|
this.defaultBattleback1Name());
|
||||||
};
|
};
|
||||||
|
|
||||||
Spriteset_Battle.prototype.normalBattleback2Name = function () {
|
Spriteset_Battle.prototype.normalBattleback2Name = function () {
|
||||||
return (this.terrainBattleback2Name(this.autotileType(1)) ||
|
return (this.terrainBattleback2Name(this.autotileType(1)) ||
|
||||||
this.terrainBattleback2Name(this.autotileType(0)) ||
|
this.terrainBattleback2Name(this.autotileType(0)) ||
|
||||||
this.defaultBattleback2Name());
|
this.defaultBattleback2Name());
|
||||||
};
|
};
|
||||||
|
|
||||||
Spriteset_Battle.prototype.terrainBattleback1Name = function (type) {
|
Spriteset_Battle.prototype.terrainBattleback1Name = function (type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 24: case 25:
|
case 24: case 25:
|
||||||
return 'Wasteland';
|
return 'Wasteland';
|
||||||
case 26: case 27:
|
case 26: case 27:
|
||||||
return 'DirtField';
|
return 'DirtField';
|
||||||
case 32: case 33:
|
case 32: case 33:
|
||||||
return 'Desert';
|
return 'Desert';
|
||||||
case 34:
|
case 34:
|
||||||
return 'Lava1';
|
return 'Lava1';
|
||||||
case 35:
|
case 35:
|
||||||
return 'Lava2';
|
return 'Lava2';
|
||||||
case 40: case 41:
|
case 40: case 41:
|
||||||
return 'Snowfield';
|
return 'Snowfield';
|
||||||
case 42:
|
case 42:
|
||||||
return 'Clouds';
|
return 'Clouds';
|
||||||
case 4: case 5:
|
case 4: case 5:
|
||||||
return 'PoisonSwamp';
|
return 'PoisonSwamp';
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Spriteset_Battle.prototype.terrainBattleback2Name = function (type) {
|
Spriteset_Battle.prototype.terrainBattleback2Name = function (type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 20: case 21:
|
case 20: case 21:
|
||||||
return 'Forest';
|
return 'Forest';
|
||||||
case 22: case 30: case 38:
|
case 22: case 30: case 38:
|
||||||
return 'Cliff';
|
return 'Cliff';
|
||||||
case 24: case 25: case 26: case 27:
|
case 24: case 25: case 26: case 27:
|
||||||
return 'Wasteland';
|
return 'Wasteland';
|
||||||
case 32: case 33:
|
case 32: case 33:
|
||||||
return 'Desert';
|
return 'Desert';
|
||||||
case 34: case 35:
|
case 34: case 35:
|
||||||
return 'Lava';
|
return 'Lava';
|
||||||
case 40: case 41:
|
case 40: case 41:
|
||||||
return 'Snowfield';
|
return 'Snowfield';
|
||||||
case 42:
|
case 42:
|
||||||
return 'Clouds';
|
return 'Clouds';
|
||||||
case 4: case 5:
|
case 4: case 5:
|
||||||
return 'PoisonSwamp';
|
return 'PoisonSwamp';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// rpg_windows.js v1.6.2.2
|
// rpg_windows.js v1.6.1
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*jshint esversion: 6 */
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Window_Base
|
// Window_Base
|
||||||
|
@ -285,6 +284,9 @@ Window_Base.prototype.convertEscapeCharacters = function (text) {
|
||||||
text = text.replace(/\x1bV\[(\d+)\]/gi, function () {
|
text = text.replace(/\x1bV\[(\d+)\]/gi, function () {
|
||||||
return $gameVariables.value(parseInt(arguments[1]));
|
return $gameVariables.value(parseInt(arguments[1]));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
text = text.replace(/\x1bSV\[(\d+)\]/gi, function () {
|
||||||
|
return $gameMap.selfVariableValue(parseInt(arguments[1]));
|
||||||
|
}.bind(this));
|
||||||
text = text.replace(/\x1bN\[(\d+)\]/gi, function () {
|
text = text.replace(/\x1bN\[(\d+)\]/gi, function () {
|
||||||
return this.actorName(parseInt(arguments[1]));
|
return this.actorName(parseInt(arguments[1]));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
@ -1481,7 +1483,7 @@ Window_Help.prototype.constructor = Window_Help;
|
||||||
|
|
||||||
Window_Help.prototype.initialize = function (numLines) {
|
Window_Help.prototype.initialize = function (numLines) {
|
||||||
var width = Graphics.boxWidth;
|
var width = Graphics.boxWidth;
|
||||||
var height = this.fittingHeight(numLines || 2);
|
var height = this.fittingHeight(numLines || 3);
|
||||||
Window_Base.prototype.initialize.call(this, 0, 0, width, height);
|
Window_Base.prototype.initialize.call(this, 0, 0, width, height);
|
||||||
this._text = '';
|
this._text = '';
|
||||||
};
|
};
|
||||||
|
@ -3071,7 +3073,7 @@ Window_ShopNumber.prototype.setup = function (item, max, price) {
|
||||||
this._price = price;
|
this._price = price;
|
||||||
this._number = 1;
|
this._number = 1;
|
||||||
this.placeButtons();
|
this.placeButtons();
|
||||||
this.updateButtonsVisibility();
|
this.updateButtonsVisiblity();
|
||||||
this.refresh();
|
this.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3119,7 +3121,7 @@ Window_ShopNumber.prototype.placeButtons = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Window_ShopNumber.prototype.updateButtonsVisibility = function () {
|
Window_ShopNumber.prototype.updateButtonsVisiblity = function () {
|
||||||
if (TouchInput.date > Input.date) {
|
if (TouchInput.date > Input.date) {
|
||||||
this.showButtons();
|
this.showButtons();
|
||||||
} else {
|
} else {
|
||||||
|
@ -3127,8 +3129,6 @@ Window_ShopNumber.prototype.updateButtonsVisibility = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Window_ShopNumber.prototype.updateButtonsVisiblity = Window_ShopNumber.prototype.updateButtonsVisibility;
|
|
||||||
|
|
||||||
Window_ShopNumber.prototype.showButtons = function () {
|
Window_ShopNumber.prototype.showButtons = function () {
|
||||||
for (var i = 0; i < this._buttons.length; i++) {
|
for (var i = 0; i < this._buttons.length; i++) {
|
||||||
this._buttons[i].visible = true;
|
this._buttons[i].visible = true;
|
||||||
|
@ -3975,7 +3975,7 @@ Window_NumberInput.prototype.start = function () {
|
||||||
this._number = this._number.clamp(0, Math.pow(10, this._maxDigits) - 1);
|
this._number = this._number.clamp(0, Math.pow(10, this._maxDigits) - 1);
|
||||||
this.updatePlacement();
|
this.updatePlacement();
|
||||||
this.placeButtons();
|
this.placeButtons();
|
||||||
this.updateButtonsVisibility();
|
this.updateButtonsVisiblity();
|
||||||
this.createContents();
|
this.createContents();
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.open();
|
this.open();
|
||||||
|
@ -4057,7 +4057,7 @@ Window_NumberInput.prototype.placeButtons = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Window_NumberInput.prototype.updateButtonsVisibility = function () {
|
Window_NumberInput.prototype.updateButtonsVisiblity = function () {
|
||||||
if (TouchInput.date > Input.date) {
|
if (TouchInput.date > Input.date) {
|
||||||
this.showButtons();
|
this.showButtons();
|
||||||
} else {
|
} else {
|
||||||
|
@ -4065,8 +4065,6 @@ Window_NumberInput.prototype.updateButtonsVisibility = function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Window_NumberInput.prototype.updateButtonsVisiblity = Window_NumberInput.prototype.updateButtonsVisibility;
|
|
||||||
|
|
||||||
Window_NumberInput.prototype.showButtons = function () {
|
Window_NumberInput.prototype.showButtons = function () {
|
||||||
for (var i = 0; i < this._buttons.length; i++) {
|
for (var i = 0; i < this._buttons.length; i++) {
|
||||||
this._buttons[i].visible = true;
|
this._buttons[i].visible = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue