Skip to content

Commit 46eb906

Browse files
committed
Pixi 1.6 merge.
1 parent 435fab5 commit 46eb906

9 files changed

Lines changed: 26 additions & 7 deletions

File tree

src/pixi/Pixi.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ PIXI.WEBGL_RENDERER = 0;
1616
PIXI.CANVAS_RENDERER = 1;
1717

1818
// useful for testing against if your lib is using pixi.
19-
PIXI.VERSION = 'v1.5.4';
19+
PIXI.VERSION = "v1.6";
20+
2021

2122
// the various blend modes supported by pixi
2223
PIXI.blendModes = {

src/pixi/core/Matrix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* The Matrix class is now an object, which makes it a lot faster,
77
* here is a representation of it :
88
* | a | b | tx|
9-
* | c | c | ty|
9+
* | c | d | ty|
1010
* | 0 | 0 | 1 |
1111
*
1212
* @class Matrix

src/pixi/display/DisplayObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ PIXI.DisplayObject.prototype.updateTransform = function()
425425
// TODO OPTIMIZE THIS!! with dirty
426426
if(this.rotation !== this.rotationCache)
427427
{
428+
428429
this.rotationCache = this.rotation;
429430
this._sr = Math.sin(this.rotation);
430431
this._cr = Math.cos(this.rotation);
@@ -549,7 +550,6 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession)
549550
this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
550551
this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
551552

552-
553553
this._filters = tempFilters;
554554

555555
this._cacheAsBitmap = true;

src/pixi/display/Sprite.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ PIXI.Sprite.prototype.onTextureUpdate = function()
172172
*/
173173
PIXI.Sprite.prototype.getBounds = function(matrix)
174174
{
175+
175176
var width = this.texture.frame.width;
176177
var height = this.texture.frame.height;
177178

src/pixi/extras/Spine.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ spine.ColorTimeline = function (frameCount) {
411411
spine.ColorTimeline.prototype = {
412412
slotIndex: 0,
413413
getFrameCount: function () {
414-
return this.frames.length / 2;
414+
return this.frames.length / 5;
415415
},
416-
setFrame: function (frameIndex, time, x, y) {
416+
setFrame: function (frameIndex, time, r, g, b, a) {
417417
frameIndex *= 5;
418418
this.frames[frameIndex] = time;
419419
this.frames[frameIndex + 1] = r;
@@ -1111,7 +1111,7 @@ spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
11111111
};
11121112
spine.SkeletonJson.toColor = function (hexString, colorIndex) {
11131113
if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
1114-
return parseInt(hexString.substring(colorIndex * 2, 2), 16) / 255;
1114+
return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255;
11151115
};
11161116

11171117
spine.Atlas = function (atlasText, textureLoader) {
@@ -1452,6 +1452,9 @@ PIXI.Spine.prototype.updateTransform = function () {
14521452
slotContainer.scale.y = bone.worldScaleY;
14531453

14541454
slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180);
1455+
1456+
slotContainer.alpha = slot.a;
1457+
slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]);
14551458
}
14561459

14571460
PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);

src/pixi/extras/TilingSprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
250250
// make sure to account for the anchor point..
251251
context.fillRect(-tilePosition.x + (this.anchor.x * -this._width),
252252
-tilePosition.y + (this.anchor.y * -this._height),
253-
this._width / tileScale.x,
253+
this._width / tileScale.x,
254254
this._height / tileScale.y);
255255

256256
context.scale(1 / tileScale.x, 1 / tileScale.y);

src/pixi/renderers/webgl/utils/WebGLFilterManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
116116
offset.y = -filterArea.y;
117117

118118
// update projection
119+
// now restore the regular shader..
120+
this.renderSession.shaderManager.setShader(this.defaultShader);
119121
gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2);
120122
gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y);
121123

src/pixi/textures/BaseTexture.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,16 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
194194
return baseTexture;
195195
};
196196

197+
/**
198+
* Helper function that returns a base texture based on a canvas element
199+
* If the image is not in the base texture cache it will be created and loaded
200+
*
201+
* @static
202+
* @method fromCanvas
203+
* @param canvas {Canvas} The canvas element source of the texture
204+
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
205+
* @return BaseTexture
206+
*/
197207
PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
198208
{
199209
if(!canvas._pixiId)

src/pixi/textures/Texture.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ PIXI.Texture.prototype._updateWebGLuvs = function()
234234
* @method fromImage
235235
* @param imageUrl {String} The image url of the texture
236236
* @param crossorigin {Boolean} Whether requests should be treated as crossorigin
237+
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
237238
* @return Texture
238239
*/
239240
PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
@@ -272,6 +273,7 @@ PIXI.Texture.fromFrame = function(frameId)
272273
* @static
273274
* @method fromCanvas
274275
* @param canvas {Canvas} The canvas element source of the texture
276+
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
275277
* @return Texture
276278
*/
277279
PIXI.Texture.fromCanvas = function(canvas, scaleMode)

0 commit comments

Comments
 (0)