Skip to content

Commit 585b93c

Browse files
authored
Merge pull request #707 from photonstorm/release/v2.19.1
Release Phaser CE v2.19.1
2 parents 3dbfafa + 8377ed1 commit 585b93c

File tree

224 files changed

+8044
-7996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+8044
-7996
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Change Log
22

3-
## Unreleased
3+
## Version 2.19.1 - 13 October 2021
44

55
### Bug Fixes
66

77
- [TilemapLayer#getRayCastTiles()](https://photonstorm.github.io/phaser-ce/Phaser.TilemapLayer.html#getRayCastTiles) was less efficient and behaved incorrectly for horizontal or vertical rays.
88
- [Text](https://photonstorm.github.io/phaser-ce/Phaser.Text.html#Text) no longer errors when missing a `style` parameter.
9+
- Fixed some WebGL warnings.
910

1011
### Thanks
1112

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Phaser CE is a fast, free, and fun open source HTML5 game framework. It uses a c
66

77
Phaser CE is based on Phaser v2.6.2 by [Photon Storm](http://www.photonstorm.com). [Phaser v3](http://phaser.io/phaser3) and [Phaser v4](https://github.com/phaserjs/phaser4) are in active development.
88

9-
The [current Phaser CE release is 2.19.0](https://github.com/photonstorm/phaser-ce/releases/tag/v2.19.0).
9+
The [current Phaser CE release is 2.19.1](https://github.com/photonstorm/phaser-ce/releases/tag/v2.19.0).
1010

1111
- **Visit:** The [Phaser website](http://phaser.io) and follow on [Twitter](https://twitter.com/photonstorm) (#[phaserjs](https://twitter.com/hashtag/phaserjs))
1212
- **Learn:** [API Docs](https://photonstorm.github.io/phaser-ce/), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)
@@ -82,19 +82,19 @@ Please see additional steps for [Browserify/CommonJS](#browserify) and [Webpack]
8282
[Phaser CE is on jsDelivr](http://www.jsdelivr.com/projects/phaser-ce). Include the following in your html:
8383

8484
```html
85-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.0/build/phaser.js"></script>
85+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.1/build/phaser.js"></script>
8686
```
8787

8888
or the minified version:
8989

9090
```html
91-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.0"></script>
91+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.1"></script>
9292
```
9393

94-
[Custom builds](https://cdn.jsdelivr.net/npm/phaser-ce@2.19.0/build/custom/) are available too, e.g.,
94+
[Custom builds](https://cdn.jsdelivr.net/npm/phaser-ce@2.19.1/build/custom/) are available too, e.g.,
9595

9696
```html
97-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.0/build/custom/phaser-arcade-physics.js"></script>
97+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.19.1/build/custom/phaser-arcade-physics.js"></script>
9898
```
9999

100100
<a name="getting-started"></a>

build/custom/creature.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/creature.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.js

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser CE - https://github.com/photonstorm/phaser-ce
99
*
10-
* v2.19.0 "2021-08-23" - Built: Mon Aug 23 2021 13:20:15
10+
* v2.19.1 "2021-10-13" - Built: Tue Oct 19 2021 11:50:07
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
1313
*
@@ -5311,7 +5311,10 @@ PIXI.WebGLSpriteBatch.prototype.flush = function ()
53115311
gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 16);
53125312

53135313
// Texture index
5314-
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);
5314+
if (PIXI._enableMultiTextureToggle)
5315+
{
5316+
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);
5317+
}
53155318
}
53165319

53175320
// upload the verts to the buffer
@@ -7784,7 +7787,7 @@ var Phaser = Phaser || { // jshint ignore:line
77847787
* @constant Phaser.VERSION
77857788
* @type {string}
77867789
*/
7787-
VERSION: '2.19.0',
7790+
VERSION: '2.19.1',
77887791

77897792
/**
77907793
* An array of Phaser game instances.
@@ -22035,6 +22038,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
2203522038
/**
2203622039
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false).
2203722040
* @default
22041+
* @see Phaser.Time#desiredFps
2203822042
*/
2203922043
this.forceSingleUpdate = true;
2204022044

@@ -22045,7 +22049,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
2204522049
this.forceSingleRender = false;
2204622050

2204722051
/**
22048-
* @property {boolean} dropFrames - Skip a logic update and render if the delta is too large (see {@link Phaser.Time#deltaMax}).
22052+
* @property {boolean} dropFrames - Skip a logic update and render if the delta is too large (see {@link Phaser.Time#deltaMax}). When false, the delta is clamped to the maximum instead.
2204922053
* @default
2205022054
*/
2205122055
this.dropFrames = false;
@@ -43791,7 +43795,7 @@ Phaser.Text = function (game, x, y, text, style)
4379143795
* @property {string} _testString
4379243796
* @private
4379343797
*/
43794-
this._testString = style.testString || '|MÂÉQfjq_';
43798+
this._testString = '|MÂÉQfjq_';
4379543799

4379643800
/**
4379743801
* @property {number} _res - Internal canvas resolution var.
@@ -55363,7 +55367,7 @@ Phaser.Time = function (game)
5536355367
this.deltaTotal = 0;
5536455368

5536555369
/**
55366-
* The maximum acceptable step interval in milliseconds, based on `desiredMinFps`.
55370+
* The maximum acceptable step interval in milliseconds, based on `desiredMinFps`. You can also set this directly.
5536755371
* @property {number} deltaMax
5536855372
*/
5536955373
this.deltaMax = 200;
@@ -55377,12 +55381,10 @@ Phaser.Time = function (game)
5537755381

5537855382
/**
5537955383
* The desired frame rate of the game.
55380-
*
55381-
* This is used is used to calculate the physic/logic multiplier and how to apply catch-up logic updates.
55382-
*
5538355384
* @property {number} _desiredFps
5538455385
* @private
5538555386
* @default
55387+
* @see Phaser.Time#desiredFps
5538655388
*/
5538755389
this._desiredFps = 60;
5538855390

@@ -55872,7 +55874,7 @@ Phaser.Time.prototype = {
5587255874
/**
5587355875
* The number of logic updates per second.
5587455876
*
55875-
* This is used is used to calculate the physic / logic multiplier and how to apply catch-up logic updates.
55877+
* This is used is used to calculate {@link Phaser.Time#delta} when {@link Phaser.Game#forceSingleUpdate} is off.
5587655878
*
5587755879
* The render rate is unaffected unless you also turn off {@link Phaser.Game#forceSingleRender}.
5587855880
*
@@ -70340,6 +70342,7 @@ Phaser.Utils.Debug.prototype = {
7034070342
{
7034170343
this.bmd = new Phaser.BitmapData(this.game, '__DEBUG', this.game.width, this.game.height, true);
7034270344
this.sprite = this.game.make.image(0, 0, this.bmd);
70345+
this.sprite.anchor.set(0, 0);
7034370346
this.game.stage.addChild(this.sprite);
7034470347

7034570348
this.game.scale.onSizeChange.add(this.resize, this);
@@ -82289,7 +82292,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height)
8228982292
*
8229082293
* @property {?DOMCanvasElement} [copyCanvas=(auto)] - [Internal] If set, force using a separate (shared) copy canvas.
8229182294
* Using a canvas bitblt/copy when the source and destinations region overlap produces unexpected behavior
82292-
* in some browsers, notably Safari.
82295+
* in some browsers, notably Safari.
8229382296
*
8229482297
* @default
8229582298
*/
@@ -82397,7 +82400,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height)
8239782400
/*
8239882401
* Collision width/height (pixels)
8239982402
* What purpose do these have? Most things use tile width/height directly.
82400-
* This also only extends collisions right and down.
82403+
* This also only extends collisions right and down.
8240182404
*/
8240282405
cw: tilemap.tileWidth,
8240382406
ch: tilemap.tileHeight,
@@ -82539,7 +82542,7 @@ Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession)
8253982542
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
8254082543
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
8254182544
}
82542-
82545+
8254382546
this._scrollX = (this.game.camera.view.x - this.tileOffset.x) * this.scrollFactorX / this.scale.x;
8254482547
this._scrollY = (this.game.camera.view.y - this.tileOffset.y) * this.scrollFactorY / this.scale.y;
8254582548

@@ -82646,7 +82649,7 @@ Phaser.TilemapLayer.prototype._fixX = function (x)
8264682649
{
8264782650
return x;
8264882651
}
82649-
82652+
8265082653
// This executes if the scrollFactorX is 0 and the x position of the tilemap is off from standard.
8265182654
if (this.scrollFactorX === 0 && this.position.x !== 0)
8265282655
{
@@ -82688,13 +82691,13 @@ Phaser.TilemapLayer.prototype._fixY = function (y)
8268882691
{
8268982692
return y;
8269082693
}
82691-
82694+
8269282695
// This executes if the scrollFactorY is 0 and the y position of the tilemap is off from standard.
8269382696
if (this.scrollFactorY === 0 && this.position.y !== 0)
8269482697
{
8269582698
return y - this.position.y;
8269682699
}
82697-
82700+
8269882701
return this._scrollY + (y - (this._scrollY / this.scrollFactorY));
8269982702
};
8270082703

@@ -82779,29 +82782,32 @@ Phaser.TilemapLayer.prototype.getRayCastTiles = function (line, stepRate, collid
8277982782
if (collides === undefined) { collides = false; }
8278082783
if (interestingFace === undefined) { interestingFace = false; }
8278182784

82782-
// First get all tiles that touch the bounds of the line
82783-
var tiles = this.getTiles(line.x, line.y, line.width, line.height, collides, interestingFace);
82785+
var skipInteresting = !(collides || interestingFace);
8278482786

82785-
if (tiles.length === 0)
82786-
{
82787-
return [];
82788-
}
82789-
82790-
// Now we only want the tiles that intersect with the points on this line
8279182787
var coords = line.coordinatesOnLine(stepRate);
8279282788
var results = [];
82789+
var point = new Phaser.Point();
82790+
var layer = this.map.layers[this.map.getLayer(this)];
82791+
var layerData = layer.data;
82792+
var width = layer.width;
82793+
var height = layer.height;
8279382794

82794-
for (var i = 0; i < tiles.length; i++)
82795+
for (var t = 0; t < coords.length; t++)
8279582796
{
82796-
for (var t = 0; t < coords.length; t++)
82797+
var coord = coords[t];
82798+
82799+
this.getTileXY(coord[0], coord[1], point);
82800+
82801+
var x = point.x;
82802+
var y = point.y;
82803+
82804+
if (x < 0 || x >= width || y < 0 || y >= height) { continue; }
82805+
82806+
var tile = layerData[y][x];
82807+
82808+
if (results.indexOf(tile) === -1 && (skipInteresting || tile.isInteresting(collides, interestingFace)))
8279782809
{
82798-
var tile = tiles[i];
82799-
var coord = coords[t];
82800-
if (tile.containsPoint(coord[0], coord[1]))
82801-
{
82802-
results.push(tile);
82803-
break;
82804-
}
82810+
results.push(tile);
8280582811
}
8280682812
}
8280782813

@@ -82922,9 +82928,9 @@ Phaser.TilemapLayer.prototype.resetTilesetCache = function ()
8292282928

8292382929
/**
8292482930
* This method will set the scale of the tilemap as well as update the underlying block data of this layer.
82925-
*
82931+
*
8292682932
* @method Phaser.TilemapLayer#setScale
82927-
* @param {number} [xScale=1] - The scale factor along the X-plane
82933+
* @param {number} [xScale=1] - The scale factor along the X-plane
8292882934
* @param {number} [yScale] - The scale factor along the Y-plane
8292982935
*/
8293082936
Phaser.TilemapLayer.prototype.setScale = function (xScale, yScale)
@@ -83059,7 +83065,7 @@ Phaser.TilemapLayer.prototype.renderRegion = function (scrollX, scrollY, left, t
8305983065
bottom = Math.min(height - 1, bottom);
8306083066
}
8306183067
}
83062-
83068+
8306383069
// top-left pixel of top-left cell
8306483070
var baseX = (left * tw) - scrollX;
8306583071
var baseY = (top * th) - scrollY;
@@ -83294,7 +83300,7 @@ Phaser.TilemapLayer.prototype.render = function ()
8329483300
}
8329583301

8329683302
this.context.save();
83297-
83303+
8329883304
mc.scrollX = scrollX;
8329983305
mc.scrollY = scrollY;
8330083306

build/custom/phaser-arcade-physics.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)