Merged all of the relevant Pixi 2.2.7 fixes in (#1621)

This commit is contained in:
photonstorm 2015-02-25 17:04:48 +00:00
parent 03a2db18cb
commit 41396d5ad2
6 changed files with 40 additions and 36 deletions

View file

@ -192,6 +192,13 @@ We've also removed functions and properties from Pixi classes that Phaser doesn'
* Animation.update skips ahead frames when the system is lagging, however it failed to set the animation to the final frame in the sequence if the animation skipped ahead too far (thanks @richpixel #1628)
* Loader.preloadSprite had an extra guard added to ensure it didn't try to updateCrop a non-existent sprite (thanks @noidexe #1636)
### Pixi 2.2.7 Bug Fixes
* SpriteBatch added fix to handle batch context loss on change.
* RenderTexture resolution fix.
* WebGL Filter Resolution fix.
* TilingSprite fixes when masked in canvas mode.
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
![div](http://www.phaser.io/images/github/div.png)
@ -361,12 +368,10 @@ We don't officially support any version of TypeScript before 1.4, however you ca
Here are some of the features planned for future releases. Not all are promised to be delivered and no timescale is given. But they serve as a good indication of the direction Phaser is heading in.
### Version 2.3 ("Tarabon")
### Version 2.4
* New parallel asset loader (already started in dev branch)
* Enhance the State Management, so you can perform non-destructive State swaps and persistence.
* Updated Text handling
* Look carefully at the internal structure of Phaser to avoid method repetition (such as Sprite.crop and Image.crop), investigate using mixins to help reduce overall codebase size.
* Restore Math.interpolateAngles and Math.nearestAngleBetween
* Scene Manager - json scene parser.
* Touch Gestures.
@ -376,12 +381,8 @@ Here are some of the features planned for future releases. Not all are promised
* Allow Groups to be InputEnabled? Dragging a Group would be really useful.
* Cache to localStorage using If-Modified-Since. [See github request](https://github.com/photonstorm/phaser/issues/495)
* Allow for complex assets like Bitmap Fonts to be stored within a texture atlas.
### Version 2.4
* Add more support for [Legacy Audio Events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events)
* Ability to control DOM elements from the core game and layer them into the game.
* Game parameters stored in Google Docs.
* Optimised global Animation manager to cut down on object creation.
* Flash CC HTML5 export integration.
* Massively enhance the audio side of Phaser. Take more advantage of Web Audio: echo effects, positional sound, etc.
* DragonBones support.

View file

@ -37,7 +37,7 @@ PIXI.CANVAS_RENDERER = 1;
* @property {String} VERSION
* @static
*/
PIXI.VERSION = "v2.2.5c";
PIXI.VERSION = "v2.2.7c";
// used to create uids for various pixi objects..
PIXI._UID = 0;

View file

@ -22,8 +22,6 @@
* @constructor
* @param texture {Texture}
*/
//TODO RENAME to PARTICLE CONTAINER?
PIXI.SpriteBatch = function(texture)
{
PIXI.DisplayObjectContainer.call( this);
@ -72,10 +70,18 @@ PIXI.SpriteBatch.prototype.updateTransform = function()
*/
PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
{
if(!this.visible || this.alpha <= 0 || !this.children.length)return;
if (!this.visible || this.alpha <= 0 || !this.children.length) return;
if(!this.ready)this.initWebGL( renderSession.gl );
if (!this.ready)
{
this.initWebGL(renderSession.gl);
}
if (this.fastSpriteBatch.gl !== renderSession.gl)
{
this.fastSpriteBatch.setContext(renderSession.gl);
}
renderSession.spriteBatch.stop();
renderSession.shaderManager.setShader(renderSession.shaderManager.fastShader);
@ -96,32 +102,32 @@ PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
*/
PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
{
if(!this.visible || this.alpha <= 0 || !this.children.length)return;
if (!this.visible || this.alpha <= 0 || !this.children.length) return;
var context = renderSession.context;
context.globalAlpha = this.worldAlpha;
this.displayObjectUpdateTransform();
var transform = this.worldTransform;
// alow for trimming
var isRotated = true;
for (var i = 0; i < this.children.length; i++) {
for (var i = 0; i < this.children.length; i++)
{
var child = this.children[i];
if(!child.visible)continue;
if (!child.visible) continue;
var texture = child.texture;
var frame = texture.frame;
context.globalAlpha = this.worldAlpha * child.alpha;
if(child.rotation % (Math.PI * 2) === 0)
if (child.rotation % (Math.PI * 2) === 0)
{
if(isRotated)
if (isRotated)
{
context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
isRotated = false;
@ -140,7 +146,7 @@ PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
}
else
{
if(!isRotated)isRotated = true;
if (!isRotated) isRotated = true;
child.displayObjectUpdateTransform();
@ -166,12 +172,7 @@ PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
((child.anchor.y) * (-frame.height) + 0.5) | 0,
frame.width,
frame.height);
}
// context.restore();
}
// context.restore();
};

View file

@ -204,7 +204,7 @@ PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
if (this._mask)
{
renderSession.maskManager.pushMask(this._mask, context);
renderSession.maskManager.pushMask(this._mask, renderSession);
}
context.globalAlpha = this.worldAlpha;
@ -265,7 +265,7 @@ PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
if (this._mask)
{
renderSession.maskManager.popMask(renderSession.context);
renderSession.maskManager.popMask(renderSession);
}
for (i=0,j=this.children.length; i<j; i++)

View file

@ -286,7 +286,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function()
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
gl.viewport(0, 0, sizeX, sizeY);
gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution);
// bind the buffer
gl.bindFramebuffer(gl.FRAMEBUFFER, buffer );

View file

@ -93,7 +93,7 @@ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
PIXI.Texture.call(this,
this.baseTexture,
new PIXI.Rectangle(0, 0, this.width, this.height)
new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution)
);
/**
@ -109,7 +109,7 @@ PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
var gl = this.renderer.gl;
this.baseTexture._dirty[gl.id] = false;
this.textureBuffer = new PIXI.FilterTexture(gl, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode);
this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode);
this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture;
this.render = this.renderWebGL;
@ -148,13 +148,15 @@ PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
this.valid = (width > 0 && height > 0);
this.width = this.frame.width = this.crop.width = width;
this.height = this.frame.height = this.crop.height = height;
this.width = width;
this.height = height;
this.frame.width = this.crop.width = width * this.resolution;
this.frame.height = this.crop.height = height * this.resolution;
if (updateBase)
{
this.baseTexture.width = this.width;
this.baseTexture.height = this.height;
this.baseTexture.width = this.width * this.resolution;
this.baseTexture.height = this.height * this.resolution;
}
if (this.renderer.type === PIXI.WEBGL_RENDERER)
@ -165,7 +167,7 @@ PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
if(!this.valid)return;
this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution);
this.textureBuffer.resize(this.width, this.height);
};
/**