mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
v3.85.2
This commit is contained in:
parent
d6ccb63de7
commit
580ff3074c
10 changed files with 302594 additions and 302387 deletions
112
dist/phaser-arcade-physics.js
vendored
112
dist/phaser-arcade-physics.js
vendored
|
@ -15645,7 +15645,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.85.1',
|
||||
VERSION: '3.85.2',
|
||||
|
||||
BlendModes: __webpack_require__(10312),
|
||||
|
||||
|
@ -47313,33 +47313,55 @@ var TransformMatrix = new Class({
|
|||
var e = matrix[4];
|
||||
var f = matrix[5];
|
||||
|
||||
// Compute the unrounded positions for the quad
|
||||
var x0 = x * a + y * c + e;
|
||||
var y0 = x * b + y * d + f;
|
||||
|
||||
var x1 = x * a + yh * c + e;
|
||||
var y1 = x * b + yh * d + f;
|
||||
|
||||
var x2 = xw * a + yh * c + e;
|
||||
var y2 = xw * b + yh * d + f;
|
||||
|
||||
var x3 = xw * a + y * c + e;
|
||||
var y3 = xw * b + y * d + f;
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
quad[0] = Math.floor((x * a + y * c + e) + 0.5);
|
||||
quad[1] = Math.floor((x * b + y * d + f) + 0.5);
|
||||
// Round the top-left corner
|
||||
var rx0 = Math.floor(x0 + 0.5);
|
||||
var ry0 = Math.floor(y0 + 0.5);
|
||||
|
||||
quad[2] = Math.floor((x * a + yh * c + e) + 0.5);
|
||||
quad[3] = Math.floor((x * b + yh * d + f) + 0.5);
|
||||
// Calculate the offset caused by rounding
|
||||
var dx = rx0 - x0;
|
||||
var dy = ry0 - y0;
|
||||
|
||||
quad[4] = Math.floor((xw * a + yh * c + e) + 0.5);
|
||||
quad[5] = Math.floor((xw * b + yh * d + f) + 0.5);
|
||||
// Adjust the other corners by the same offset
|
||||
quad[0] = rx0;
|
||||
quad[1] = ry0;
|
||||
|
||||
quad[6] = Math.floor((xw * a + y * c + e) + 0.5);
|
||||
quad[7] = Math.floor((xw * b + y * d + f) + 0.5);
|
||||
quad[2] = x1 + dx;
|
||||
quad[3] = y1 + dy;
|
||||
|
||||
quad[4] = x2 + dx;
|
||||
quad[5] = y2 + dy;
|
||||
|
||||
quad[6] = x3 + dx;
|
||||
quad[7] = y3 + dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
quad[0] = x * a + y * c + e;
|
||||
quad[1] = x * b + y * d + f;
|
||||
quad[0] = x0;
|
||||
quad[1] = y0;
|
||||
|
||||
quad[2] = x * a + yh * c + e;
|
||||
quad[3] = x * b + yh * d + f;
|
||||
quad[2] = x1;
|
||||
quad[3] = y1;
|
||||
|
||||
quad[4] = xw * a + yh * c + e;
|
||||
quad[5] = xw * b + yh * d + f;
|
||||
quad[4] = x2;
|
||||
quad[5] = y2;
|
||||
|
||||
quad[6] = xw * a + y * c + e;
|
||||
quad[7] = xw * b + y * d + f;
|
||||
quad[6] = x3;
|
||||
quad[7] = y3;
|
||||
}
|
||||
|
||||
return quad;
|
||||
|
@ -161612,7 +161634,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
/**
|
||||
* Array of strings that indicate which WebGL extensions are supported by the browser.
|
||||
* This is populated in the `boot` method.
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions
|
||||
* @type {string[]}
|
||||
|
@ -161624,6 +161646,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension
|
||||
* @type {ANGLE_instanced_arrays}
|
||||
|
@ -161635,6 +161659,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `OES_vertex_array_object` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension
|
||||
* @type {OES_vertex_array_object}
|
||||
|
@ -161980,26 +162006,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.gl = gl;
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Load supported extensions
|
||||
var setupExtensions = function ()
|
||||
{
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
_this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
_this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
_this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
|
||||
};
|
||||
|
||||
setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
this.setContextHandlers();
|
||||
|
||||
|
@ -162149,6 +162156,33 @@ var WebGLRenderer = new Class({
|
|||
this.resize(width, height);
|
||||
},
|
||||
|
||||
/**
|
||||
* Queries the GL context to get the supported extensions.
|
||||
*
|
||||
* Then sets them into the `supportedExtensions`, `instancedArraysExtension` and `vaoExtension` properties.
|
||||
*
|
||||
* Called automatically during the `init` method.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setExtensions
|
||||
* @since 3.85.2
|
||||
*/
|
||||
setExtensions: function ()
|
||||
{
|
||||
var gl = this.gl;
|
||||
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the handlers that are called when WebGL context is lost or restored by the browser.
|
||||
*
|
||||
|
@ -162289,7 +162323,7 @@ var WebGLRenderer = new Class({
|
|||
this.resize(this.game.scale.baseSize.width, this.game.scale.baseSize.height);
|
||||
|
||||
// Restore GL extensions.
|
||||
this.init.setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
// Context has been restored.
|
||||
|
||||
|
|
2
dist/phaser-arcade-physics.min.js
vendored
2
dist/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
112
dist/phaser-ie9.js
vendored
112
dist/phaser-ie9.js
vendored
|
@ -15645,7 +15645,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.85.1',
|
||||
VERSION: '3.85.2',
|
||||
|
||||
BlendModes: __webpack_require__(10312),
|
||||
|
||||
|
@ -47313,33 +47313,55 @@ var TransformMatrix = new Class({
|
|||
var e = matrix[4];
|
||||
var f = matrix[5];
|
||||
|
||||
// Compute the unrounded positions for the quad
|
||||
var x0 = x * a + y * c + e;
|
||||
var y0 = x * b + y * d + f;
|
||||
|
||||
var x1 = x * a + yh * c + e;
|
||||
var y1 = x * b + yh * d + f;
|
||||
|
||||
var x2 = xw * a + yh * c + e;
|
||||
var y2 = xw * b + yh * d + f;
|
||||
|
||||
var x3 = xw * a + y * c + e;
|
||||
var y3 = xw * b + y * d + f;
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
quad[0] = Math.floor((x * a + y * c + e) + 0.5);
|
||||
quad[1] = Math.floor((x * b + y * d + f) + 0.5);
|
||||
// Round the top-left corner
|
||||
var rx0 = Math.floor(x0 + 0.5);
|
||||
var ry0 = Math.floor(y0 + 0.5);
|
||||
|
||||
quad[2] = Math.floor((x * a + yh * c + e) + 0.5);
|
||||
quad[3] = Math.floor((x * b + yh * d + f) + 0.5);
|
||||
// Calculate the offset caused by rounding
|
||||
var dx = rx0 - x0;
|
||||
var dy = ry0 - y0;
|
||||
|
||||
quad[4] = Math.floor((xw * a + yh * c + e) + 0.5);
|
||||
quad[5] = Math.floor((xw * b + yh * d + f) + 0.5);
|
||||
// Adjust the other corners by the same offset
|
||||
quad[0] = rx0;
|
||||
quad[1] = ry0;
|
||||
|
||||
quad[6] = Math.floor((xw * a + y * c + e) + 0.5);
|
||||
quad[7] = Math.floor((xw * b + y * d + f) + 0.5);
|
||||
quad[2] = x1 + dx;
|
||||
quad[3] = y1 + dy;
|
||||
|
||||
quad[4] = x2 + dx;
|
||||
quad[5] = y2 + dy;
|
||||
|
||||
quad[6] = x3 + dx;
|
||||
quad[7] = y3 + dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
quad[0] = x * a + y * c + e;
|
||||
quad[1] = x * b + y * d + f;
|
||||
quad[0] = x0;
|
||||
quad[1] = y0;
|
||||
|
||||
quad[2] = x * a + yh * c + e;
|
||||
quad[3] = x * b + yh * d + f;
|
||||
quad[2] = x1;
|
||||
quad[3] = y1;
|
||||
|
||||
quad[4] = xw * a + yh * c + e;
|
||||
quad[5] = xw * b + yh * d + f;
|
||||
quad[4] = x2;
|
||||
quad[5] = y2;
|
||||
|
||||
quad[6] = xw * a + y * c + e;
|
||||
quad[7] = xw * b + y * d + f;
|
||||
quad[6] = x3;
|
||||
quad[7] = y3;
|
||||
}
|
||||
|
||||
return quad;
|
||||
|
@ -180158,7 +180180,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
/**
|
||||
* Array of strings that indicate which WebGL extensions are supported by the browser.
|
||||
* This is populated in the `boot` method.
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions
|
||||
* @type {string[]}
|
||||
|
@ -180170,6 +180192,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension
|
||||
* @type {ANGLE_instanced_arrays}
|
||||
|
@ -180181,6 +180205,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `OES_vertex_array_object` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension
|
||||
* @type {OES_vertex_array_object}
|
||||
|
@ -180526,26 +180552,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.gl = gl;
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Load supported extensions
|
||||
var setupExtensions = function ()
|
||||
{
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
_this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
_this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
_this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
|
||||
};
|
||||
|
||||
setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
this.setContextHandlers();
|
||||
|
||||
|
@ -180695,6 +180702,33 @@ var WebGLRenderer = new Class({
|
|||
this.resize(width, height);
|
||||
},
|
||||
|
||||
/**
|
||||
* Queries the GL context to get the supported extensions.
|
||||
*
|
||||
* Then sets them into the `supportedExtensions`, `instancedArraysExtension` and `vaoExtension` properties.
|
||||
*
|
||||
* Called automatically during the `init` method.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setExtensions
|
||||
* @since 3.85.2
|
||||
*/
|
||||
setExtensions: function ()
|
||||
{
|
||||
var gl = this.gl;
|
||||
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the handlers that are called when WebGL context is lost or restored by the browser.
|
||||
*
|
||||
|
@ -180835,7 +180869,7 @@ var WebGLRenderer = new Class({
|
|||
this.resize(this.game.scale.baseSize.width, this.game.scale.baseSize.height);
|
||||
|
||||
// Restore GL extensions.
|
||||
this.init.setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
// Context has been restored.
|
||||
|
||||
|
|
2
dist/phaser-ie9.min.js
vendored
2
dist/phaser-ie9.min.js
vendored
File diff suppressed because one or more lines are too long
112
dist/phaser.esm.js
vendored
112
dist/phaser.esm.js
vendored
|
@ -15633,7 +15633,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.85.1',
|
||||
VERSION: '3.85.2',
|
||||
|
||||
BlendModes: __webpack_require__(10312),
|
||||
|
||||
|
@ -47301,33 +47301,55 @@ var TransformMatrix = new Class({
|
|||
var e = matrix[4];
|
||||
var f = matrix[5];
|
||||
|
||||
// Compute the unrounded positions for the quad
|
||||
var x0 = x * a + y * c + e;
|
||||
var y0 = x * b + y * d + f;
|
||||
|
||||
var x1 = x * a + yh * c + e;
|
||||
var y1 = x * b + yh * d + f;
|
||||
|
||||
var x2 = xw * a + yh * c + e;
|
||||
var y2 = xw * b + yh * d + f;
|
||||
|
||||
var x3 = xw * a + y * c + e;
|
||||
var y3 = xw * b + y * d + f;
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
quad[0] = Math.floor((x * a + y * c + e) + 0.5);
|
||||
quad[1] = Math.floor((x * b + y * d + f) + 0.5);
|
||||
// Round the top-left corner
|
||||
var rx0 = Math.floor(x0 + 0.5);
|
||||
var ry0 = Math.floor(y0 + 0.5);
|
||||
|
||||
quad[2] = Math.floor((x * a + yh * c + e) + 0.5);
|
||||
quad[3] = Math.floor((x * b + yh * d + f) + 0.5);
|
||||
// Calculate the offset caused by rounding
|
||||
var dx = rx0 - x0;
|
||||
var dy = ry0 - y0;
|
||||
|
||||
quad[4] = Math.floor((xw * a + yh * c + e) + 0.5);
|
||||
quad[5] = Math.floor((xw * b + yh * d + f) + 0.5);
|
||||
// Adjust the other corners by the same offset
|
||||
quad[0] = rx0;
|
||||
quad[1] = ry0;
|
||||
|
||||
quad[6] = Math.floor((xw * a + y * c + e) + 0.5);
|
||||
quad[7] = Math.floor((xw * b + y * d + f) + 0.5);
|
||||
quad[2] = x1 + dx;
|
||||
quad[3] = y1 + dy;
|
||||
|
||||
quad[4] = x2 + dx;
|
||||
quad[5] = y2 + dy;
|
||||
|
||||
quad[6] = x3 + dx;
|
||||
quad[7] = y3 + dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
quad[0] = x * a + y * c + e;
|
||||
quad[1] = x * b + y * d + f;
|
||||
quad[0] = x0;
|
||||
quad[1] = y0;
|
||||
|
||||
quad[2] = x * a + yh * c + e;
|
||||
quad[3] = x * b + yh * d + f;
|
||||
quad[2] = x1;
|
||||
quad[3] = y1;
|
||||
|
||||
quad[4] = xw * a + yh * c + e;
|
||||
quad[5] = xw * b + yh * d + f;
|
||||
quad[4] = x2;
|
||||
quad[5] = y2;
|
||||
|
||||
quad[6] = xw * a + y * c + e;
|
||||
quad[7] = xw * b + y * d + f;
|
||||
quad[6] = x3;
|
||||
quad[7] = y3;
|
||||
}
|
||||
|
||||
return quad;
|
||||
|
@ -179608,7 +179630,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
/**
|
||||
* Array of strings that indicate which WebGL extensions are supported by the browser.
|
||||
* This is populated in the `boot` method.
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions
|
||||
* @type {string[]}
|
||||
|
@ -179620,6 +179642,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension
|
||||
* @type {ANGLE_instanced_arrays}
|
||||
|
@ -179631,6 +179655,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `OES_vertex_array_object` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension
|
||||
* @type {OES_vertex_array_object}
|
||||
|
@ -179976,26 +180002,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.gl = gl;
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Load supported extensions
|
||||
var setupExtensions = function ()
|
||||
{
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
_this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
_this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
_this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
|
||||
};
|
||||
|
||||
setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
this.setContextHandlers();
|
||||
|
||||
|
@ -180145,6 +180152,33 @@ var WebGLRenderer = new Class({
|
|||
this.resize(width, height);
|
||||
},
|
||||
|
||||
/**
|
||||
* Queries the GL context to get the supported extensions.
|
||||
*
|
||||
* Then sets them into the `supportedExtensions`, `instancedArraysExtension` and `vaoExtension` properties.
|
||||
*
|
||||
* Called automatically during the `init` method.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setExtensions
|
||||
* @since 3.85.2
|
||||
*/
|
||||
setExtensions: function ()
|
||||
{
|
||||
var gl = this.gl;
|
||||
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the handlers that are called when WebGL context is lost or restored by the browser.
|
||||
*
|
||||
|
@ -180285,7 +180319,7 @@ var WebGLRenderer = new Class({
|
|||
this.resize(this.game.scale.baseSize.width, this.game.scale.baseSize.height);
|
||||
|
||||
// Restore GL extensions.
|
||||
this.init.setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
// Context has been restored.
|
||||
|
||||
|
|
2
dist/phaser.esm.min.js
vendored
2
dist/phaser.esm.min.js
vendored
File diff suppressed because one or more lines are too long
112
dist/phaser.js
vendored
112
dist/phaser.js
vendored
|
@ -15645,7 +15645,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.85.1',
|
||||
VERSION: '3.85.2',
|
||||
|
||||
BlendModes: __webpack_require__(10312),
|
||||
|
||||
|
@ -47313,33 +47313,55 @@ var TransformMatrix = new Class({
|
|||
var e = matrix[4];
|
||||
var f = matrix[5];
|
||||
|
||||
// Compute the unrounded positions for the quad
|
||||
var x0 = x * a + y * c + e;
|
||||
var y0 = x * b + y * d + f;
|
||||
|
||||
var x1 = x * a + yh * c + e;
|
||||
var y1 = x * b + yh * d + f;
|
||||
|
||||
var x2 = xw * a + yh * c + e;
|
||||
var y2 = xw * b + yh * d + f;
|
||||
|
||||
var x3 = xw * a + y * c + e;
|
||||
var y3 = xw * b + y * d + f;
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
quad[0] = Math.floor((x * a + y * c + e) + 0.5);
|
||||
quad[1] = Math.floor((x * b + y * d + f) + 0.5);
|
||||
// Round the top-left corner
|
||||
var rx0 = Math.floor(x0 + 0.5);
|
||||
var ry0 = Math.floor(y0 + 0.5);
|
||||
|
||||
quad[2] = Math.floor((x * a + yh * c + e) + 0.5);
|
||||
quad[3] = Math.floor((x * b + yh * d + f) + 0.5);
|
||||
// Calculate the offset caused by rounding
|
||||
var dx = rx0 - x0;
|
||||
var dy = ry0 - y0;
|
||||
|
||||
quad[4] = Math.floor((xw * a + yh * c + e) + 0.5);
|
||||
quad[5] = Math.floor((xw * b + yh * d + f) + 0.5);
|
||||
// Adjust the other corners by the same offset
|
||||
quad[0] = rx0;
|
||||
quad[1] = ry0;
|
||||
|
||||
quad[6] = Math.floor((xw * a + y * c + e) + 0.5);
|
||||
quad[7] = Math.floor((xw * b + y * d + f) + 0.5);
|
||||
quad[2] = x1 + dx;
|
||||
quad[3] = y1 + dy;
|
||||
|
||||
quad[4] = x2 + dx;
|
||||
quad[5] = y2 + dy;
|
||||
|
||||
quad[6] = x3 + dx;
|
||||
quad[7] = y3 + dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
quad[0] = x * a + y * c + e;
|
||||
quad[1] = x * b + y * d + f;
|
||||
quad[0] = x0;
|
||||
quad[1] = y0;
|
||||
|
||||
quad[2] = x * a + yh * c + e;
|
||||
quad[3] = x * b + yh * d + f;
|
||||
quad[2] = x1;
|
||||
quad[3] = y1;
|
||||
|
||||
quad[4] = xw * a + yh * c + e;
|
||||
quad[5] = xw * b + yh * d + f;
|
||||
quad[4] = x2;
|
||||
quad[5] = y2;
|
||||
|
||||
quad[6] = xw * a + y * c + e;
|
||||
quad[7] = xw * b + y * d + f;
|
||||
quad[6] = x3;
|
||||
quad[7] = y3;
|
||||
}
|
||||
|
||||
return quad;
|
||||
|
@ -179716,7 +179738,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
/**
|
||||
* Array of strings that indicate which WebGL extensions are supported by the browser.
|
||||
* This is populated in the `boot` method.
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions
|
||||
* @type {string[]}
|
||||
|
@ -179728,6 +179750,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension
|
||||
* @type {ANGLE_instanced_arrays}
|
||||
|
@ -179739,6 +179763,8 @@ var WebGLRenderer = new Class({
|
|||
/**
|
||||
* If the browser supports the `OES_vertex_array_object` extension, this property will hold
|
||||
* a reference to the glExtension for it.
|
||||
*
|
||||
* This is populated in the `setExtensions` method.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension
|
||||
* @type {OES_vertex_array_object}
|
||||
|
@ -180084,26 +180110,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.gl = gl;
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Load supported extensions
|
||||
var setupExtensions = function ()
|
||||
{
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
_this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
_this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
_this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
|
||||
};
|
||||
|
||||
setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
this.setContextHandlers();
|
||||
|
||||
|
@ -180253,6 +180260,33 @@ var WebGLRenderer = new Class({
|
|||
this.resize(width, height);
|
||||
},
|
||||
|
||||
/**
|
||||
* Queries the GL context to get the supported extensions.
|
||||
*
|
||||
* Then sets them into the `supportedExtensions`, `instancedArraysExtension` and `vaoExtension` properties.
|
||||
*
|
||||
* Called automatically during the `init` method.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setExtensions
|
||||
* @since 3.85.2
|
||||
*/
|
||||
setExtensions: function ()
|
||||
{
|
||||
var gl = this.gl;
|
||||
|
||||
var exts = gl.getSupportedExtensions();
|
||||
|
||||
this.supportedExtensions = exts;
|
||||
|
||||
var angleString = 'ANGLE_instanced_arrays';
|
||||
|
||||
this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null;
|
||||
|
||||
var vaoString = 'OES_vertex_array_object';
|
||||
|
||||
this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the handlers that are called when WebGL context is lost or restored by the browser.
|
||||
*
|
||||
|
@ -180393,7 +180427,7 @@ var WebGLRenderer = new Class({
|
|||
this.resize(this.game.scale.baseSize.width, this.game.scale.baseSize.height);
|
||||
|
||||
// Restore GL extensions.
|
||||
this.init.setupExtensions();
|
||||
this.setExtensions();
|
||||
|
||||
// Context has been restored.
|
||||
|
||||
|
|
2
dist/phaser.min.js
vendored
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
33305
types/phaser.d.ts
vendored
33305
types/phaser.d.ts
vendored
File diff suppressed because it is too large
Load diff
571220
types/phaser.json
571220
types/phaser.json
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue