mirror of
https://github.com/wassname/phaser.git
synced 2026-06-27 16:10:15 +08:00
ScaleMode fix, BitmapData change and Device updates.
This commit is contained in:
@@ -84,6 +84,7 @@ module.exports = function (grunt) {
|
||||
'src/input/InputHandler.js',
|
||||
'src/gameobjects/Events.js',
|
||||
'src/gameobjects/GameObjectFactory.js',
|
||||
'src/gameobjects/BitmapData.js',
|
||||
'src/gameobjects/Sprite.js',
|
||||
'src/gameobjects/TileSprite.js',
|
||||
'src/gameobjects/Text.js',
|
||||
|
||||
@@ -57,6 +57,7 @@ Version 1.1.3 - in build
|
||||
* New: Added Group.iterate, a powerful way to count or return children that match a certain criteria. Refactored Group to use iterate, lots of repeated code cut.
|
||||
* New: Added Group.sort. You can now sort the Group based on any given numeric property (x, y, health), finally you can do depth-sorting :) Example created to show.
|
||||
* New: Enhanced renderTexture so it can accept a Phaser.Group object and improved documentation and examples.
|
||||
* New: Device.littleEndian boolean added. Only safe to use if the browser supports TypedArrays (which IE9 doesn't, but nearly all others do)
|
||||
|
||||
* Fixed: Lots of fixes to the TypeScript definitions file (many thanks gltovar)
|
||||
* Fixed: Tilemap commands use specified layer when one given (thanks Izzimach)
|
||||
@@ -66,6 +67,7 @@ Version 1.1.3 - in build
|
||||
* Fixed: Group.swap had a hellish to find bug that only manifested when B-A upward swaps occured. Hours of debugging later = bug crushed.
|
||||
* Fixed: Point.rotate asDegrees fixed (thanks BorisKozo)
|
||||
* Fixed: ArcadePhysics.separateTile wasn't returning the value, so the custom process callback wasn't getting called (thanks flameiguana)
|
||||
* Fixed: StageScaleMode.forceOrientation now correctly stores the forcePortrait value (thanks haden)
|
||||
|
||||
* Updated: ArcadePhysics.updateMotion applies the dt to the velocity calculations as well as position now (thanks jcs)
|
||||
* Updated: RequestAnimationFrame now retains the callbackID which is passed to cancelRequestAnimationFrame.
|
||||
|
||||
+1819
-199
File diff suppressed because it is too large
Load Diff
Vendored
+10
-10
File diff suppressed because one or more lines are too long
@@ -148,6 +148,10 @@
|
||||
}
|
||||
],
|
||||
"display": [
|
||||
{
|
||||
"file": "bitmapdata+wobble.js",
|
||||
"title": "bitmapdata wobble"
|
||||
},
|
||||
{
|
||||
"file": "fullscreen.js",
|
||||
"title": "fullscreen"
|
||||
@@ -159,6 +163,18 @@
|
||||
{
|
||||
"file": "render+crisp.js",
|
||||
"title": "render crisp"
|
||||
},
|
||||
{
|
||||
"file": "render+texture+mirror.js",
|
||||
"title": "render texture mirror"
|
||||
},
|
||||
{
|
||||
"file": "render+texture+starfield.js",
|
||||
"title": "render texture starfield"
|
||||
},
|
||||
{
|
||||
"file": "render+texture+trail.js",
|
||||
"title": "render texture trail"
|
||||
}
|
||||
],
|
||||
"games": [
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -55,31 +55,11 @@ Phaser.BitmapData = function (game, width, height) {
|
||||
*/
|
||||
this.imageData = this.context.getImageData(0, 0, width, height);
|
||||
|
||||
this.pixels = new Int32Array(this.imageData.data.buffer);
|
||||
|
||||
/**
|
||||
* @property {Uint8ClampedArray} data8 - A uint8 clamped view on the buffer.
|
||||
* @property {UInt8Clamped} pixels - A reference to the context imageData buffer.
|
||||
*/
|
||||
// this.data8 = new Uint8ClampedArray(this.imageData.buffer);
|
||||
this.pixels = this.imageData.data.buffer;
|
||||
|
||||
/**
|
||||
* @property {Uint32Array} data32 - A Uint32 view on the buffer.
|
||||
*/
|
||||
// this.data32 = new Uint32Array(this.imageData.buffer);
|
||||
|
||||
// Little or big-endian?
|
||||
// this.data32[1] = 0x0a0b0c0d;
|
||||
|
||||
/**
|
||||
* @property {boolean} isLittleEndian - .
|
||||
*/
|
||||
this.isLittleEndian = true;
|
||||
|
||||
// if (this.data32[4] === 0x0a && this.data32[5] === 0x0b && this.data32[6] === 0x0c && this.data32[7] === 0x0d)
|
||||
// {
|
||||
// this.isLittleEndian = false;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @property {PIXI.BaseTexture} baseTexture - The PIXI.BaseTexture.
|
||||
* @default
|
||||
|
||||
@@ -358,7 +358,7 @@ Phaser.Sprite.prototype.constructor = Phaser.Sprite;
|
||||
*/
|
||||
Phaser.Sprite.prototype.preUpdate = function() {
|
||||
|
||||
if (!this.exists || !this.group.exists)
|
||||
if (!this.exists || (this.group && !this.group.exists))
|
||||
{
|
||||
this.renderOrderID = -1;
|
||||
return;
|
||||
|
||||
@@ -265,6 +265,12 @@ Phaser.Device = function () {
|
||||
*/
|
||||
this.pixelRatio = 0;
|
||||
|
||||
/**
|
||||
* @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays)
|
||||
* @default
|
||||
*/
|
||||
this.littleEndian = false;
|
||||
|
||||
// Run the checks
|
||||
this._checkAudio();
|
||||
this._checkBrowser();
|
||||
@@ -444,6 +450,11 @@ Phaser.Device.prototype = {
|
||||
this.iPhone4 = (this.pixelRatio == 2 && this.iPhone);
|
||||
this.iPad = navigator.userAgent.toLowerCase().indexOf('ipad') != -1;
|
||||
|
||||
if (typeof Int8Array !== 'undefined')
|
||||
{
|
||||
this.littleEndian = new Int8Array(new Int16Array([1]).buffer)[0] > 0;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -310,17 +310,15 @@ Phaser.StageScaleMode.prototype = {
|
||||
* The optional orientationImage is displayed when the game is in the incorrect orientation.
|
||||
* @method Phaser.StageScaleMode#forceOrientation
|
||||
* @param {boolean} forceLandscape - true if the game should run in landscape mode only.
|
||||
* @param {boolean} forcePortrait - true if the game should run in portrait mode only.
|
||||
* @param {string} [forcePortrait=''] - The string of an image in the Phaser.Cache to display when this game is in the incorrect orientation.
|
||||
* @param {boolean} [forcePortrait=false] - true if the game should run in portrait mode only.
|
||||
* @param {string} [orientationImage=''] - The string of an image in the Phaser.Cache to display when this game is in the incorrect orientation.
|
||||
*/
|
||||
forceOrientation: function (forceLandscape, forcePortrait, orientationImage) {
|
||||
|
||||
this.forceLandscape = forceLandscape;
|
||||
if (typeof forcePortrait === 'undefined') { forcePortrait = false; }
|
||||
|
||||
if (typeof forcePortrait === 'undefined')
|
||||
{
|
||||
this.forcePortrait = false;
|
||||
}
|
||||
this.forceLandscape = forceLandscape;
|
||||
this.forcePortrait = forcePortrait;
|
||||
|
||||
if (typeof orientationImage !== 'undefined')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user