@vpmedia/phaser 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/phaser.cjs +1 -1
- package/dist/phaser.cjs.LICENSE.txt +1 -1
- package/dist/phaser.cjs.map +1 -1
- package/dist/phaser.js +1 -1
- package/dist/phaser.js.LICENSE.txt +1 -1
- package/dist/phaser.js.map +1 -1
- package/package.json +2 -2
- package/src/phaser/core/animation_parser.js +0 -2
- package/src/phaser/core/game.js +10 -3
- package/src/phaser/core/sound.js +2 -12
- package/src/phaser/core/sound_manager.js +9 -4
- package/src/phaser/display/display_object.js +0 -5
- package/src/phaser/display/webgl/graphics.js +0 -2
- package/src/phaser/display/webgl/util.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
|
|
5
5
|
"author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"husky": "^8.0.2",
|
|
33
33
|
"jest": "^29.3.1",
|
|
34
34
|
"lint-staged": "^13.0.3",
|
|
35
|
-
"prettier": "^2.
|
|
35
|
+
"prettier": "^2.8.0",
|
|
36
36
|
"webpack": "^5.75.0",
|
|
37
37
|
"webpack-cli": "^4.10.0"
|
|
38
38
|
},
|
|
@@ -68,8 +68,6 @@ export function spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin
|
|
|
68
68
|
export function JSONData(game, json) {
|
|
69
69
|
// Malformed?
|
|
70
70
|
if (!json.frames) {
|
|
71
|
-
console.warn('AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing frames array');
|
|
72
|
-
console.log(json);
|
|
73
71
|
return null;
|
|
74
72
|
}
|
|
75
73
|
// Let's create some frames then
|
package/src/phaser/core/game.js
CHANGED
|
@@ -143,7 +143,14 @@ export default class {
|
|
|
143
143
|
isWebGlReady = true;
|
|
144
144
|
} catch (e) {
|
|
145
145
|
isWebGlReady = false;
|
|
146
|
-
|
|
146
|
+
const keys = {};
|
|
147
|
+
if (window.PhaserRegistry?.GL_PROGRAM_INFO_LOG) {
|
|
148
|
+
keys.gl_program_log = window.PhaserRegistry.GL_PROGRAM_INFO_LOG;
|
|
149
|
+
}
|
|
150
|
+
if (window.PhaserRegistry?.GL_SHADER_INFO_LOG) {
|
|
151
|
+
keys.gl_shader_log = window.PhaserRegistry.GL_SHADER_INFO_LOG;
|
|
152
|
+
}
|
|
153
|
+
this.exceptionHandler(e, keys);
|
|
147
154
|
}
|
|
148
155
|
/*
|
|
149
156
|
this.renderer = new WebGLRenderer(this);
|
|
@@ -219,8 +226,8 @@ export default class {
|
|
|
219
226
|
if (config.exceptionHandler) {
|
|
220
227
|
this.exceptionHandler = config.exceptionHandler;
|
|
221
228
|
} else {
|
|
222
|
-
this.exceptionHandler = (e) => {
|
|
223
|
-
console.error(e);
|
|
229
|
+
this.exceptionHandler = (e, keys) => {
|
|
230
|
+
console.error(e, keys);
|
|
224
231
|
};
|
|
225
232
|
}
|
|
226
233
|
if (config.parent) {
|
package/src/phaser/core/sound.js
CHANGED
|
@@ -196,12 +196,7 @@ export default class {
|
|
|
196
196
|
if (this._sound.stop === undefined) {
|
|
197
197
|
this._sound.noteOff(0);
|
|
198
198
|
} else {
|
|
199
|
-
|
|
200
|
-
this._sound.stop(0);
|
|
201
|
-
} catch (e) {
|
|
202
|
-
// pass
|
|
203
|
-
this.game.exceptionHandler(e);
|
|
204
|
-
}
|
|
199
|
+
this._sound.stop(0);
|
|
205
200
|
}
|
|
206
201
|
if (this.externalNode) {
|
|
207
202
|
this._sound.disconnect(this.externalNode);
|
|
@@ -383,12 +378,7 @@ export default class {
|
|
|
383
378
|
if (this._sound.stop === undefined) {
|
|
384
379
|
this._sound.noteOff(0);
|
|
385
380
|
} else {
|
|
386
|
-
|
|
387
|
-
this._sound.stop(0);
|
|
388
|
-
} catch (e) {
|
|
389
|
-
// pass
|
|
390
|
-
this.game.exceptionHandler(e);
|
|
391
|
-
}
|
|
381
|
+
this._sound.stop(0);
|
|
392
382
|
}
|
|
393
383
|
if (this.externalNode) {
|
|
394
384
|
this._sound.disconnect(this.externalNode);
|
|
@@ -94,8 +94,11 @@ export default class {
|
|
|
94
94
|
if (this.noAudio) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
const state = this.context.state;
|
|
98
|
+
if (state === 'suspended') {
|
|
99
|
+
this.context.resume().catch((e) => {
|
|
100
|
+
this.game.exceptionHandler(e, { state });
|
|
101
|
+
});
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
|
|
@@ -162,7 +165,7 @@ export default class {
|
|
|
162
165
|
this.onSoundDecode.dispatch(key, sound);
|
|
163
166
|
})
|
|
164
167
|
.catch((e) => {
|
|
165
|
-
this.game.exceptionHandler(e);
|
|
168
|
+
this.game.exceptionHandler(e, { key });
|
|
166
169
|
});
|
|
167
170
|
}
|
|
168
171
|
}
|
|
@@ -202,7 +205,9 @@ export default class {
|
|
|
202
205
|
this._unlockSource = null;
|
|
203
206
|
this.resumeAudioContext();
|
|
204
207
|
} else if (this.context.state === 'interrupted') {
|
|
205
|
-
this.context.resume()
|
|
208
|
+
this.context.resume().catch((e) => {
|
|
209
|
+
this.game.exceptionHandler(e, { state: this.context.state });
|
|
210
|
+
});
|
|
206
211
|
}
|
|
207
212
|
for (let i = 0; i < this._sounds.length; i += 1) {
|
|
208
213
|
this._sounds[i].update();
|
|
@@ -274,11 +274,6 @@ export default class {
|
|
|
274
274
|
if (child.visible) {
|
|
275
275
|
childVisible = true;
|
|
276
276
|
childBounds = this.children[i].getBounds();
|
|
277
|
-
/*
|
|
278
|
-
if (isNaN(childBounds.x) && this.children[i].type !== 7) {
|
|
279
|
-
console.log(this.children[i]);
|
|
280
|
-
}
|
|
281
|
-
*/
|
|
282
277
|
minX = (minX < childBounds.x) ? minX : childBounds.x;
|
|
283
278
|
minY = (minY < childBounds.y) ? minY : childBounds.y;
|
|
284
279
|
childMaxX = childBounds.width + childBounds.x;
|
|
@@ -539,9 +539,7 @@ export function updateGraphics(graphics, gl) {
|
|
|
539
539
|
if (data.points.length < stencilBufferLimit * 2) {
|
|
540
540
|
webGLData = switchMode(webGL, 0);
|
|
541
541
|
const canDrawUsingSimple = buildPoly(data, webGLData);
|
|
542
|
-
// console.log(canDrawUsingSimple);
|
|
543
542
|
if (!canDrawUsingSimple) {
|
|
544
|
-
// console.log("<>>>")
|
|
545
543
|
webGLData = switchMode(webGL, 1);
|
|
546
544
|
buildComplexPoly(data, webGLData);
|
|
547
545
|
}
|
|
@@ -27,7 +27,9 @@ export function compileShader(gl, shaderSrc, shaderType) {
|
|
|
27
27
|
gl.shaderSource(shader, src);
|
|
28
28
|
gl.compileShader(shader);
|
|
29
29
|
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
30
|
-
|
|
30
|
+
if (window.PhaserRegistry) {
|
|
31
|
+
window.PhaserRegistry.GL_SHADER_INFO_LOG = gl.getShaderInfoLog(shader);
|
|
32
|
+
}
|
|
31
33
|
return null;
|
|
32
34
|
}
|
|
33
35
|
return shader;
|
|
@@ -71,8 +73,9 @@ export function compileProgram(gl, vertexSrc, fragmentSrc) {
|
|
|
71
73
|
gl.linkProgram(shaderProgram);
|
|
72
74
|
|
|
73
75
|
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
if (window.PhaserRegistry) {
|
|
77
|
+
window.PhaserRegistry.GL_PROGRAM_INFO_LOG = gl.getProgramInfoLog(shaderProgram);
|
|
78
|
+
}
|
|
76
79
|
}
|
|
77
80
|
return shaderProgram;
|
|
78
81
|
}
|