Skip to content

Commit

Permalink
Phaser 2.4.5-RC2 with fresh docs and build files.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Feb 12, 2016
1 parent 59ff0b0 commit 6ad22bc
Show file tree
Hide file tree
Showing 398 changed files with 98,819 additions and 861 deletions.
13,613 changes: 13,613 additions & 0 deletions build/custom/p2.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/custom/p2.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions build/custom/p2.min.js

Large diffs are not rendered by default.

100 changes: 75 additions & 25 deletions build/custom/phaser-arcade-physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Phaser - http://phaser.io
*
* v2.4.5 "Sienda" - Built: Fri Feb 05 2016 11:51:23
* v2.4.5 "Sienda" - Built: Fri Feb 12 2016 15:59:35
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
Expand Down Expand Up @@ -5662,11 +5662,11 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
var texture = this.texturePool.pop();
if(!texture)
{
texture = new PIXI.FilterTexture(this.gl, this.width, this.height);
texture = new PIXI.FilterTexture(this.gl, this.width * this.renderSession.resolution, this.height * this.renderSession.resolution);
}
else
{
texture.resize(this.width, this.height);
texture.resize(this.width * this.renderSession.resolution, this.height * this.renderSession.resolution);
}

gl.bindTexture(gl.TEXTURE_2D, texture.texture);
Expand All @@ -5689,7 +5689,7 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer);

// set view port
gl.viewport(0, 0, filterArea.width, filterArea.height);
gl.viewport(0, 0, filterArea.width * this.renderSession.resolution, filterArea.height * this.renderSession.resolution);

projection.x = filterArea.width/2;
projection.y = -filterArea.height/2;
Expand Down Expand Up @@ -5727,7 +5727,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function()

if(filterBlock.filterPasses.length > 1)
{
gl.viewport(0, 0, filterArea.width, filterArea.height);
gl.viewport(0, 0, filterArea.width * this.renderSession.resolution, filterArea.height * this.renderSession.resolution);

gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);

Expand Down Expand Up @@ -5756,8 +5756,8 @@ PIXI.WebGLFilterManager.prototype.popFilter = function()

var inputTexture = texture;
var outputTexture = this.texturePool.pop();
if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
outputTexture.resize(this.width, this.height);
if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width * this.renderSession.resolution, this.height * this.renderSession.resolution);
outputTexture.resize(this.width * this.renderSession.resolution, this.height * this.renderSession.resolution);

// need to clear this FBO as it may have some left over elements from a previous filter.
gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
Expand Down Expand Up @@ -9114,7 +9114,7 @@ var Phaser = Phaser || {
* @constant
* @type {string}
*/
VERSION: '2.4.5-dev',
VERSION: '2.4.5-RC2',

/**
* An array of Phaser game instances.
Expand Down Expand Up @@ -9700,7 +9700,7 @@ Phaser.Utils = {
* Returns true or false based on the chance value (default 50%). For example if you wanted a player to have a 30% chance
* of getting a bonus, call chanceRoll(30) - true means the chance passed, false means it failed.
*
* @method Phaser.Math#chanceRoll
* @method Phaser.Utils#chanceRoll
* @param {number} chance - The chance of receiving the value. A number between 0 and 100 (effectively 0% to 100%).
* @return {boolean} True if the roll passed, or false otherwise.
*/
Expand Down Expand Up @@ -17851,10 +17851,10 @@ Phaser.Group.prototype.add = function (child, silent) {
child.parent.removeFromHash(child);
}

this.addChild(child);

child.z = this.children.length;

this.addChild(child);

if (this.enableBody && child.body === null)
{
this.game.physics.enable(child, this.physicsBodyType);
Expand Down Expand Up @@ -18053,10 +18053,10 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) {
child.visible = exists;
child.alive = exists;

this.addChild(child);

child.z = this.children.length;

this.addChild(child);

if (this.enableBody)
{
this.game.physics.enable(child, this.physicsBodyType, this.enableBodyDebug);
Expand Down Expand Up @@ -20770,13 +20770,6 @@ Phaser.Game.prototype = {
return;
}

// The game width / height must be an integer
this.width = Math.floor(this.width);
this.height = Math.floor(this.height);

this._width = Math.floor(this._width);
this._height = Math.floor(this._height);

this.onPause = new Phaser.Signal();
this.onResume = new Phaser.Signal();
this.onBlur = new Phaser.Signal();
Expand Down Expand Up @@ -44259,6 +44252,12 @@ Phaser.Device = function () {
*/
this.tridentVersion = 0;

/**
* @property {boolean} edge - Set to true if running in Microsoft Edge browser.
* @default
*/
this.edge = false;

/**
* @property {boolean} mobileSafari - Set to true if running in Mobile Safari.
* @default
Expand All @@ -44283,6 +44282,12 @@ Phaser.Device = function () {
*/
this.safari = false;

/**
* @property {number} safariVersion - If running in Safari this will contain the major version number.
* @default
*/
this.safariVersion = 0;

/**
* @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView
* @default
Expand Down Expand Up @@ -44346,6 +44351,12 @@ Phaser.Device = function () {
*/
this.webm = false;

/**
* @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files?
* @default
*/
this.dolby = false;

// Video

/**
Expand Down Expand Up @@ -44845,9 +44856,14 @@ Phaser.Device._initialize = function () {
{
device.opera = true;
}
else if (/Safari/.test(ua) && !device.windowsPhone)
else if (/Safari\/(\d+)/.test(ua) && !device.windowsPhone)
{
device.safari = true;

if (/Version\/(\d+)\./.test(ua))
{
device.safariVersion = parseInt(RegExp.$1, 10);
}
}
else if (/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(ua))
{
Expand All @@ -44856,6 +44872,10 @@ Phaser.Device._initialize = function () {
device.tridentVersion = parseInt(RegExp.$1, 10);
device.ieVersion = parseInt(RegExp.$3, 10);
}
else if (/Edge\/\d+/.test(ua))
{
device.edge = true;
}

// Silk gets its own if clause because its ua also contains 'Safari'
if (/Silk/.test(ua))
Expand Down Expand Up @@ -45000,6 +45020,29 @@ Phaser.Device._initialize = function () {
{
device.webm = true;
}

if (audioElement.canPlayType('audio/mp4;codecs="ec-3"') !== '')
{
if (device.edge)
{
device.dolby = true;
}
else if (device.safari && device.safariVersion >= 9)
{
var ua = navigator.userAgent;

if (/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent))
{
var major = parseInt(RegExp.$1, 10);
var minor = parseInt(RegExp.$2, 10);

if ((major === 10 && minor >= 11) || major > 10)
{
device.dolby = true;
}
}
}
}
}
} catch (e) {
}
Expand Down Expand Up @@ -45137,9 +45180,9 @@ Phaser.Device._initialize = function () {

// Run the checks
_checkOS();
_checkBrowser();
_checkAudio();
_checkVideo();
_checkBrowser();
_checkCSS3D();
_checkDevice();
_checkFeatures();
Expand Down Expand Up @@ -45182,6 +45225,10 @@ Phaser.Device.canPlayAudio = function (type) {
{
return true;
}
else if (type === 'mp4' && this.dolby)
{
return true;
}

return false;

Expand Down Expand Up @@ -60540,7 +60587,7 @@ Phaser.SoundManager.prototype = {
*/
setTouchLock: function () {

if (this.noAudio || window['PhaserGlobal'].disableAudio === true)
if (this.noAudio || (window['PhaserGlobal'] && window['PhaserGlobal'].disableAudio === true))
{
return;
}
Expand Down Expand Up @@ -61957,6 +62004,9 @@ Phaser.ScaleManager.prototype = {
newHeight = rect.height * this.parentScaleFactor.y;
}

newWidth = Math.floor(newWidth);
newHeight = Math.floor(newHeight);

this._gameSize.setTo(0, 0, newWidth, newHeight);

this.updateDimensions(newWidth, newHeight, false);
Expand Down Expand Up @@ -62476,8 +62526,8 @@ Phaser.ScaleManager.prototype = {
}
else if (scaleMode === Phaser.ScaleManager.NO_SCALE)
{
this.width = this.game.width / this.game.device.pixelRatio;
this.height = this.game.height / this.game.device.pixelRatio;
this.width = this.game.width;
this.height = this.game.height;
}
else if (scaleMode === Phaser.ScaleManager.USER_SCALE)
{
Expand Down
2 changes: 1 addition & 1 deletion build/custom/phaser-arcade-physics.map

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions build/custom/phaser-arcade-physics.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 6ad22bc

Please sign in to comment.