Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais)

This commit is contained in:
photonstorm
2014-02-19 02:45:42 +00:00
parent 14646e811c
commit d057a9fe11
5 changed files with 160 additions and 4 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ Phaser.Gamepad = function (game) {
* @property {boolean} _gamepadSupportAvailable - Are gamepads supported in this browser or not?
* @private
*/
this._gamepadSupportAvailable = !!navigator.webkitGetGamepads || !!navigator.webkitGamepads || (navigator.userAgent.indexOf('Firefox/') != -1);
this._gamepadSupportAvailable = !!navigator.webkitGetGamepads || !!navigator.webkitGamepads || (navigator.userAgent.indexOf('Firefox/') != -1) || !!navigator.getGamepads;
/**
* Used to check for differences between earlier polls and current state of gamepads.
@@ -220,7 +220,7 @@ Phaser.Gamepad.prototype = {
*/
_pollGamepads: function () {
var rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads;
var rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads || navigator.getGamepads;
if (rawGamepads)
{