Skip to content

Commit e5f9373

Browse files
authored
Merge pull request phaserjs#4807 from jcyuan/master
fix TS issues and fix the condition to check video support.
2 parents bd6cabe + a679cf8 commit e5f9373

10 files changed

Lines changed: 17 additions & 13 deletions

File tree

src/core/typedefs/GameConfig.js

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

src/dom/GetScreenOrientation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,26 @@ var GetScreenOrientation = function (width, height)
3535

3636
if (screen)
3737
{
38-
return (screen.height > screen.width) ? CONST.PORTRAIT : CONST.LANDSCAPE;
38+
return (screen.height > screen.width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;
3939
}
4040
else if (typeof window.orientation === 'number')
4141
{
4242
// This may change by device based on "natural" orientation.
43-
return (window.orientation === 0 || window.orientation === 180) ? CONST.PORTRAIT : CONST.LANDSCAPE;
43+
return (window.orientation === 0 || window.orientation === 180) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;
4444
}
4545
else if (window.matchMedia)
4646
{
4747
if (window.matchMedia('(orientation: portrait)').matches)
4848
{
49-
return CONST.PORTRAIT;
49+
return CONST.ORIENTATION.PORTRAIT;
5050
}
5151
else if (window.matchMedia('(orientation: landscape)').matches)
5252
{
53-
return CONST.LANDSCAPE;
53+
return CONST.ORIENTATION.LANDSCAPE;
5454
}
5555
}
5656

57-
return (height > width) ? CONST.PORTRAIT : CONST.LANDSCAPE;
57+
return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE;
5858
};
5959

6060
module.exports = GetScreenOrientation;

src/gameobjects/UpdateList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var SceneEvents = require('../scene/events');
1818
* Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering.
1919
*
2020
* @class UpdateList
21+
* @extends Phaser.Structs.ProcessQueue.<Phaser.GameObjects.GameObject>
2122
* @memberof Phaser.GameObjects
2223
* @constructor
2324
* @since 3.0.0

src/math/pow2/GetPowerOfTwo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Returns the nearest power of 2 to the given `value`.
99
*
10-
* @function Phaser.Math.Pow2.GetPowerOfTwo
10+
* @function Phaser.Math.Pow2.GetNext
1111
* @since 3.0.0
1212
*
1313
* @param {number} value - The value.

src/math/pow2/IsSizePowerOfTwo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Checks if the given `width` and `height` are a power of two.
99
* Useful for checking texture dimensions.
1010
*
11-
* @function Phaser.Math.Pow2.IsSizePowerOfTwo
11+
* @function Phaser.Math.Pow2.IsSize
1212
* @since 3.0.0
1313
*
1414
* @param {number} width - The width.

src/math/pow2/IsValuePowerOfTwo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Tests the value and returns `true` if it is a power of two.
99
*
10-
* @function Phaser.Math.Pow2.IsValuePowerOfTwo
10+
* @function Phaser.Math.Pow2.IsValue
1111
* @since 3.0.0
1212
*
1313
* @param {number} value - The value to check if it's a power of two.

src/textures/TextureManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ var TextureManager = new Class({
391391
*
392392
* @param {string} key - The unique string-based key of the Texture.
393393
* @param {WebGLTexture} glTexture - The source Render Texture.
394+
* @param {number} width - The new width of the Texture.
395+
* @param {number} height - The new height of the Texture.
394396
*
395397
* @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use.
396398
*/

src/textures/TextureSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var TextureSource = new Class({
144144
* @type {boolean}
145145
* @since 3.20.0
146146
*/
147-
this.isVideo = (source instanceof HTMLVideoElement);
147+
this.isVideo = (window.hasOwnProperty('HTMLVideoElement') && source instanceof HTMLVideoElement);
148148

149149
/**
150150
* Is the source image a Render Texture?

src/time/Clock.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ var Clock = new Class({
182182
*
183183
* @param {number} delay - The delay of the function call, in milliseconds.
184184
* @param {function} callback - The function to call after the delay expires.
185-
* @param {Array.<*>} args - The arguments to call the function with.
186-
* @param {*} callbackScope - The scope (`this` object) to call the function with.
185+
* @param {Array.<*>} [args] - The arguments to call the function with.
186+
* @param {*} [callbackScope] - The scope (`this` object) to call the function with.
187187
*
188188
* @return {Phaser.Time.TimerEvent} The Timer Event which was created.
189189
*/

src/tweens/TweenManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ var TweenManager = new Class({
155155
* @method Phaser.Tweens.TweenManager#createTimeline
156156
* @since 3.0.0
157157
*
158-
* @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline and its Tweens.
158+
* @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens.
159159
*
160160
* @return {Phaser.Tweens.Timeline} The created Timeline object.
161161
*/
@@ -170,7 +170,7 @@ var TweenManager = new Class({
170170
* @method Phaser.Tweens.TweenManager#timeline
171171
* @since 3.0.0
172172
*
173-
* @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline and its Tweens.
173+
* @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens.
174174
*
175175
* @return {Phaser.Tweens.Timeline} The created Timeline object.
176176
*/

0 commit comments

Comments
 (0)