@vpmedia/phaser 1.56.0 → 1.57.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vpmedia/phaser
2
2
 
3
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.56.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
3
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.57.0)](https://badge.fury.io/js/@vpmedia%2Fphaser)
4
4
  [![Node.js CI](https://github.com/vpmedia/phaser/actions/workflows/ci.yml/badge.svg)](https://github.com/vpmedia/phaser/actions/workflows/ci.yml)
5
5
 
6
6
  @vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
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",
@@ -150,31 +150,23 @@ export class Game {
150
150
  isWebGlReady = true;
151
151
  } catch (e) {
152
152
  isWebGlReady = false;
153
- const tags = {};
154
- /** @type {WebGLRenderer} */
155
- // @ts-ignore
156
- const renderer = this.renderer;
157
- if (renderer?.gl) {
158
- tags['webgl.error'] = renderer.gl.getError();
159
- tags['webgl.context_lost'] = renderer.gl.isContextLost();
160
- }
161
153
  if (window.PhaserRegistry?.GL_PROGRAM_INFO_LOG) {
162
- tags['webgl.program_log'] = window.PhaserRegistry.GL_PROGRAM_INFO_LOG;
154
+ this.logger.warn('WebGL program info', { log: window.PhaserRegistry.GL_PROGRAM_INFO_LOG });
163
155
  }
164
156
  if (window.PhaserRegistry?.GL_SHADER_INFO_LOG) {
165
- tags['webgl.shader_log'] = window.PhaserRegistry.GL_SHADER_INFO_LOG;
157
+ this.logger.warn('WebGL shader info', { log: window.PhaserRegistry.GL_SHADER_INFO_LOG });
166
158
  }
167
- this.exceptionHandler(e, tags);
159
+ this.exceptionHandler(e);
168
160
  }
169
161
  }
170
162
  if (!isWebGlReady) {
163
+ if (this.contextLostBinded) {
164
+ this.canvas.removeEventListener('webglcontextlost', this.contextLostBinded, false);
165
+ }
166
+ if (this.contextRestoredBinded) {
167
+ this.canvas.removeEventListener('webglcontextlost', this.contextRestoredBinded, false);
168
+ }
171
169
  if (this.renderer) {
172
- if (this.contextLostBinded) {
173
- this.canvas.removeEventListener('webglcontextlost', this.contextLostBinded, false);
174
- }
175
- if (this.contextRestoredBinded) {
176
- this.canvas.removeEventListener('webglcontextlost', this.contextRestoredBinded, false);
177
- }
178
170
  this.renderer.destroy();
179
171
  }
180
172
  this.createRendererCanvas();
@@ -132,12 +132,12 @@ export class WebGLRenderer {
132
132
  if (!gl) {
133
133
  throw new Error('Error creating WebGL context');
134
134
  }
135
- if (gl?.isContextLost()) {
136
- game.logger.warn('WebGL context lost');
137
- }
138
- if (gl?.getError()) {
135
+ if (gl?.getError() > 0) {
139
136
  game.logger.warn('WebGL context error', { errorCode: gl?.getError() });
140
137
  }
138
+ if (gl?.isContextLost()) {
139
+ throw new Error('WebGL context lost');
140
+ }
141
141
  // set current context
142
142
  this.initRegistry();
143
143
  this.glContextId = window.PhaserRegistry.GL_CONTEXT_ID;
@@ -1 +1 @@
1
- {"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/game.js"],"names":[],"mappings":"AAqBA;IACE;;;OAGG;IACH,yBAFW,MAAM,EAoDhB;IA9CC,WAAgB;IAChB,WAAW;IACX,eAAgB;IAChB,cAAgB;IAChB,eAAiB;IACjB,yCAAoB;IACpB,oBAAiB;IACjB,kBAAqB;IACrB,gBAAmB;IACnB,2BAAe;IACf,uBAAe;IACf,aAAiB;IACjB,aAAiB;IACjB,aAAgB;IAChB,oBAAiB;IACjB,oBAAiB;IACjB,aAAiB;IACjB,WAAgB;IAChB,qBAAkB;IAClB,aAAiB;IACjB,eAA0B;IAC1B,qBAAqB;IACrB,QADW,MAAM,CACC;IAClB,gCAAgC;IAChC,QADW,iBAAiB,CACV;IAClB,+BAA+B;IAC/B,SADW,gBAAgB,CACR;IACnB,gBAA2B;IAC3B,iBAA4B;IAC5B,eAA0B;IAC1B,kBAAqB;IAkBvB;;OAEG;IACH,aA+BC;IAED;;OAEG;IACH,6BAeC;IAED;;OAEG;IACH,qBAkDC;IA1CK,2BAkGK,iBAAiB,GAAG,KAAK,UAlGsB;IACpD,+BA6GK,iBAAiB,GAAG,KAAK,UA7G8B;IA2ClE;;;;;OAKG;IACH,2BAJW,MAAM,OACN,MAAM,gBACN,GAAC,QAQX;IAED;;;OAGG;IACH,oBAFW,MAAM,QAkChB;IAdG,sBAA+C;IAgBnD;;;OAGG;IACH,mBAFW,iBAAiB,GAAG,KAAK,QAQnC;IAED;;;OAGG;IACH,uBAFW,iBAAiB,GAAG,KAAK,QASnC;IAED;;;OAGG;IACH,aAFW,MAAM,QAoBhB;IAED;;OAEG;IACH,gBAwCC;CACF;+BA7U8B,+BAA+B;8BAEhC,8BAA8B;6BAU/B,oBAAoB;sCAFX,UAAU;kCAHd,cAAc;sBAJ1B,YAAY;sBAKZ,YAAY;uBACX,aAAa;6BAEP,oBAAoB;6BAGpB,oBAAoB;sBAC3B,YAAY;qBACb,WAAW;6BACH,oBAAoB;sBAC3B,YAAY;uBAbX,aAAa;uBANb,mBAAmB;uBAcnB,aAAa"}
1
+ {"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/game.js"],"names":[],"mappings":"AAqBA;IACE;;;OAGG;IACH,yBAFW,MAAM,EAoDhB;IA9CC,WAAgB;IAChB,WAAW;IACX,eAAgB;IAChB,cAAgB;IAChB,eAAiB;IACjB,yCAAoB;IACpB,oBAAiB;IACjB,kBAAqB;IACrB,gBAAmB;IACnB,2BAAe;IACf,uBAA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