mirror of
https://github.com/photonstorm/phaser
synced 2024-11-29 16:10:56 +00:00
Device.arora has been removed.
Device.epiphany has been removed. Device.midori has been removed. Device.css3D has been removed, and the function that tested it is no longer run. Device.isConsoleOpen has been removed. The function only worked on a very limited set of old browsers. Device.littleEndian has been removed, you can use Device.LITTLE_ENDIAN instead.
This commit is contained in:
parent
e47a7741c3
commit
b5ef896448
2 changed files with 11 additions and 115 deletions
|
@ -351,6 +351,12 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
||||||
* PIXI.PI_2 has been removed, because it's available via Phaser.Math.PI2. The only place PI_2 was used has been updated to now use PI2.
|
* PIXI.PI_2 has been removed, because it's available via Phaser.Math.PI2. The only place PI_2 was used has been updated to now use PI2.
|
||||||
* The polyfills.js file now polyfills in for Float32Array, Uint16Array and ArrayBuffer.
|
* The polyfills.js file now polyfills in for Float32Array, Uint16Array and ArrayBuffer.
|
||||||
* PIXI.Float32Array, PIXI.Uint16Array, PIXI.Uint32Array and PIXI.ArrayBuffer have all been removed, and replaced with their own proper native versions. The polyfill now captures any instances where the browser needs to fall back to an Array instead.
|
* PIXI.Float32Array, PIXI.Uint16Array, PIXI.Uint32Array and PIXI.ArrayBuffer have all been removed, and replaced with their own proper native versions. The polyfill now captures any instances where the browser needs to fall back to an Array instead.
|
||||||
|
* Device.arora has been removed.
|
||||||
|
* Device.epiphany has been removed.
|
||||||
|
* Device.midori has been removed.
|
||||||
|
* Device.css3D has been removed, and the function that tested it is no longer run.
|
||||||
|
* Device.isConsoleOpen has been removed. The function only worked on a very limited set of old browsers.
|
||||||
|
* Device.littleEndian has been removed, you can use Device.LITTLE_ENDIAN instead.
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
|
@ -205,12 +205,6 @@ Phaser.Device = function () {
|
||||||
*/
|
*/
|
||||||
this.worker = false;
|
this.worker = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} css3D - Is css3D available?
|
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
this.css3D = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean} pointerLock - Is Pointer Lock available?
|
* @property {boolean} pointerLock - Is Pointer Lock available?
|
||||||
* @default
|
* @default
|
||||||
|
@ -264,12 +258,6 @@ Phaser.Device = function () {
|
||||||
|
|
||||||
// Browser
|
// Browser
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} arora - Set to true if running in Arora.
|
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
this.arora = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean} chrome - Set to true if running in Chrome.
|
* @property {boolean} chrome - Set to true if running in Chrome.
|
||||||
* @default
|
* @default
|
||||||
|
@ -282,12 +270,6 @@ Phaser.Device = function () {
|
||||||
*/
|
*/
|
||||||
this.chromeVersion = 0;
|
this.chromeVersion = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} epiphany - Set to true if running in Epiphany.
|
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
this.epiphany = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean} firefox - Set to true if running in Firefox.
|
* @property {boolean} firefox - Set to true if running in Firefox.
|
||||||
* @default
|
* @default
|
||||||
|
@ -336,12 +318,6 @@ Phaser.Device = function () {
|
||||||
*/
|
*/
|
||||||
this.mobileSafari = false;
|
this.mobileSafari = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} midori - Set to true if running in Midori.
|
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
this.midori = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean} opera - Set to true if running in Opera.
|
* @property {boolean} opera - Set to true if running in Opera.
|
||||||
* @default
|
* @default
|
||||||
|
@ -496,13 +472,7 @@ Phaser.Device = function () {
|
||||||
this.pixelRatio = 0;
|
this.pixelRatio = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays)
|
* @property {boolean} LITTLE_ENDIAN - Is the device big or little endian? (only detected if the browser supports TypedArrays)
|
||||||
* @default
|
|
||||||
*/
|
|
||||||
this.littleEndian = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @property {boolean} LITTLE_ENDIAN - Same value as `littleEndian`.
|
|
||||||
* @default
|
* @default
|
||||||
*/
|
*/
|
||||||
this.LITTLE_ENDIAN = false;
|
this.LITTLE_ENDIAN = false;
|
||||||
|
@ -958,11 +928,7 @@ Phaser.Device._initialize = function () {
|
||||||
|
|
||||||
var ua = navigator.userAgent;
|
var ua = navigator.userAgent;
|
||||||
|
|
||||||
if (/Arora/.test(ua))
|
if (/Edge\/\d+/.test(ua))
|
||||||
{
|
|
||||||
device.arora = true;
|
|
||||||
}
|
|
||||||
else if (/Edge\/\d+/.test(ua))
|
|
||||||
{
|
{
|
||||||
device.edge = true;
|
device.edge = true;
|
||||||
}
|
}
|
||||||
|
@ -971,10 +937,6 @@ Phaser.Device._initialize = function () {
|
||||||
device.chrome = true;
|
device.chrome = true;
|
||||||
device.chromeVersion = parseInt(RegExp.$1, 10);
|
device.chromeVersion = parseInt(RegExp.$1, 10);
|
||||||
}
|
}
|
||||||
else if (/Epiphany/.test(ua))
|
|
||||||
{
|
|
||||||
device.epiphany = true;
|
|
||||||
}
|
|
||||||
else if (/Firefox\D+(\d+)/.test(ua))
|
else if (/Firefox\D+(\d+)/.test(ua))
|
||||||
{
|
{
|
||||||
device.firefox = true;
|
device.firefox = true;
|
||||||
|
@ -989,10 +951,6 @@ Phaser.Device._initialize = function () {
|
||||||
device.ie = true;
|
device.ie = true;
|
||||||
device.ieVersion = parseInt(RegExp.$1, 10);
|
device.ieVersion = parseInt(RegExp.$1, 10);
|
||||||
}
|
}
|
||||||
else if (/Midori/.test(ua))
|
|
||||||
{
|
|
||||||
device.midori = true;
|
|
||||||
}
|
|
||||||
else if (/Opera/.test(ua))
|
else if (/Opera/.test(ua))
|
||||||
{
|
{
|
||||||
device.opera = true;
|
device.opera = true;
|
||||||
|
@ -1266,11 +1224,10 @@ Phaser.Device._initialize = function () {
|
||||||
|
|
||||||
if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined')
|
if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined')
|
||||||
{
|
{
|
||||||
device.littleEndian = _checkIsLittleEndian();
|
device.LITTLE_ENDIAN = _checkIsLittleEndian();
|
||||||
device.LITTLE_ENDIAN = device.littleEndian;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
device.support32bit = (typeof ArrayBuffer !== 'undefined' && typeof Uint8ClampedArray !== 'undefined' && typeof Int32Array !== 'undefined' && device.littleEndian !== null && _checkIsUint8ClampedImageData());
|
device.support32bit = (typeof ArrayBuffer !== 'undefined' && typeof Uint8ClampedArray !== 'undefined' && typeof Int32Array !== 'undefined' && device.LITTLE_ENDIAN !== null && _checkIsUint8ClampedImageData());
|
||||||
|
|
||||||
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
|
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
|
||||||
|
|
||||||
|
@ -1281,44 +1238,11 @@ Phaser.Device._initialize = function () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the host environment support 3D CSS.
|
|
||||||
*/
|
|
||||||
function _checkCSS3D () {
|
|
||||||
|
|
||||||
var el = document.createElement('p');
|
|
||||||
var has3d;
|
|
||||||
var transforms = {
|
|
||||||
'webkitTransform': '-webkit-transform',
|
|
||||||
'OTransform': '-o-transform',
|
|
||||||
'msTransform': '-ms-transform',
|
|
||||||
'MozTransform': '-moz-transform',
|
|
||||||
'transform': 'transform'
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add it to the body to get the computed style.
|
|
||||||
document.body.insertBefore(el, null);
|
|
||||||
|
|
||||||
for (var t in transforms)
|
|
||||||
{
|
|
||||||
if (el.style[t] !== undefined)
|
|
||||||
{
|
|
||||||
el.style[t] = "translate3d(1px,1px,1px)";
|
|
||||||
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
document.body.removeChild(el);
|
|
||||||
device.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run the checks
|
// Run the checks
|
||||||
_checkOS();
|
_checkOS();
|
||||||
_checkBrowser();
|
_checkBrowser();
|
||||||
_checkAudio();
|
_checkAudio();
|
||||||
_checkVideo();
|
_checkVideo();
|
||||||
_checkCSS3D();
|
|
||||||
_checkDevice();
|
_checkDevice();
|
||||||
_checkFeatures();
|
_checkFeatures();
|
||||||
_checkCanvasFeatures();
|
_checkCanvasFeatures();
|
||||||
|
@ -1401,41 +1325,6 @@ Phaser.Device.canPlayVideo = function (type) {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the console is open.
|
|
||||||
* Note that this only works in Firefox with Firebug and earlier versions of Chrome.
|
|
||||||
* It used to work in Chrome, but then they removed the ability: {@link http://src.chromium.org/viewvc/blink?view=revision&revision=151136}
|
|
||||||
*
|
|
||||||
* @method isConsoleOpen
|
|
||||||
* @memberof Phaser.Device.prototype
|
|
||||||
*/
|
|
||||||
Phaser.Device.isConsoleOpen = function () {
|
|
||||||
|
|
||||||
if (window.console && window.console['firebug'])
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.console)
|
|
||||||
{
|
|
||||||
console.profile();
|
|
||||||
console.profileEnd();
|
|
||||||
|
|
||||||
if (console.clear)
|
|
||||||
{
|
|
||||||
console.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (console['profiles'])
|
|
||||||
{
|
|
||||||
return console['profiles'].length > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect if the host is a an Android Stock browser.
|
* Detect if the host is a an Android Stock browser.
|
||||||
* This is available before the device "ready" event.
|
* This is available before the device "ready" event.
|
||||||
|
@ -1451,6 +1340,7 @@ Phaser.Device.isConsoleOpen = function () {
|
||||||
Phaser.Device.isAndroidStockBrowser = function () {
|
Phaser.Device.isAndroidStockBrowser = function () {
|
||||||
|
|
||||||
var matches = window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);
|
var matches = window.navigator.userAgent.match(/Android.*AppleWebKit\/([\d.]+)/);
|
||||||
|
|
||||||
return matches && matches[1] < 537;
|
return matches && matches[1] < 537;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue