mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 09:27:37 +00:00
Phaser 2.2 RC13 Build Files.
This commit is contained in:
parent
35e2893db4
commit
a51e22a497
13 changed files with 5518 additions and 3893 deletions
File diff suppressed because it is too large
Load diff
34
build/custom/phaser-arcade-physics.min.js
vendored
34
build/custom/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
36
build/custom/phaser-ninja-physics.min.js
vendored
36
build/custom/phaser-ninja-physics.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
24
build/custom/phaser-no-libs.min.js
vendored
24
build/custom/phaser-no-libs.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
30
build/custom/phaser-no-physics.min.js
vendored
30
build/custom/phaser-no-physics.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -2398,6 +2398,15 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
|
||||
}
|
||||
// If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
|
||||
var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
|
||||
var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
|
||||
// Allow for pixel rounding
|
||||
if (renderSession.roundPixels)
|
||||
{
|
||||
|
@ -2408,6 +2417,8 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
|
|||
this.worldTransform.d,
|
||||
(this.worldTransform.tx* renderSession.resolution) | 0,
|
||||
(this.worldTransform.ty* renderSession.resolution) | 0);
|
||||
dx = dx | 0;
|
||||
dy = dy | 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2420,17 +2431,6 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
|
|||
this.worldTransform.ty * renderSession.resolution);
|
||||
}
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
|
||||
}
|
||||
|
||||
// If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
|
||||
var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
|
||||
var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
|
||||
|
||||
if (this.tint !== 0xFFFFFF)
|
||||
{
|
||||
if (this.cachedTint !== this.tint)
|
||||
|
@ -3810,6 +3810,10 @@ PIXI.getNextPowerOfTwo = function(number)
|
|||
return result;
|
||||
}
|
||||
};
|
||||
PIXI.isPowerOfTwo = function(width, height)
|
||||
{
|
||||
return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
|
@ -6118,7 +6122,6 @@ PIXI.WebGLGraphicsData = function(gl)
|
|||
this.color = [0,0,0]; // color split!
|
||||
this.points = [];
|
||||
this.indices = [];
|
||||
this.lastIndex = 0;
|
||||
this.buffer = gl.createBuffer();
|
||||
this.indexBuffer = gl.createBuffer();
|
||||
this.mode = 1;
|
||||
|
@ -6133,7 +6136,6 @@ PIXI.WebGLGraphicsData.prototype.reset = function()
|
|||
{
|
||||
this.points = [];
|
||||
this.indices = [];
|
||||
this.lastIndex = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -6580,7 +6582,17 @@ PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
|
|||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
|
||||
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
|
||||
|
||||
|
||||
if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height))
|
||||
{
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);
|
||||
gl.generateMipmap(gl.TEXTURE_2D);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
|
||||
}
|
||||
|
||||
// reguler...
|
||||
if(!texture._powerOf2)
|
||||
|
@ -7531,50 +7543,71 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
|
|||
var tx = worldTransform.tx;
|
||||
var ty = worldTransform.ty;
|
||||
|
||||
if(this.renderSession.roundPixels)
|
||||
{
|
||||
//xy
|
||||
verticies[index] = a * w1 + c * h1 + tx | 0;
|
||||
verticies[index+1] = d * h1 + b * w1 + ty | 0;
|
||||
|
||||
// xy
|
||||
verticies[index++] = a * w1 + c * h1 + tx;
|
||||
verticies[index++] = d * h1 + b * w1 + ty;
|
||||
// uv
|
||||
verticies[index++] = uvs.x0;
|
||||
verticies[index++] = uvs.y0;
|
||||
// color
|
||||
verticies[index++] = alpha;
|
||||
verticies[index++] = tint;
|
||||
verticies[index+6] = a * w0 + c * h1 + tx | 0;
|
||||
verticies[index+7] = d * h1 + b * w0 + ty | 0;
|
||||
|
||||
// xy
|
||||
verticies[index++] = a * w0 + c * h1 + tx;
|
||||
verticies[index++] = d * h1 + b * w0 + ty;
|
||||
// uv
|
||||
verticies[index++] = uvs.x1;
|
||||
verticies[index++] = uvs.y1;
|
||||
// color
|
||||
verticies[index++] = alpha;
|
||||
verticies[index++] = tint;
|
||||
verticies[index+12] = a * w0 + c * h0 + tx | 0;
|
||||
verticies[index+13] = d * h0 + b * w0 + ty | 0;
|
||||
|
||||
// xy
|
||||
verticies[index++] = a * w0 + c * h0 + tx;
|
||||
verticies[index++] = d * h0 + b * w0 + ty;
|
||||
// uv
|
||||
verticies[index++] = uvs.x2;
|
||||
verticies[index++] = uvs.y2;
|
||||
// color
|
||||
verticies[index++] = alpha;
|
||||
verticies[index++] = tint;
|
||||
verticies[index+18] = a * w1 + c * h0 + tx | 0;
|
||||
verticies[index+19] = d * h0 + b * w1 + ty | 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//xy
|
||||
verticies[index] = a * w1 + c * h1 + tx;
|
||||
verticies[index+1] = d * h1 + b * w1 + ty;
|
||||
|
||||
// xy
|
||||
verticies[index++] = a * w1 + c * h0 + tx;
|
||||
verticies[index++] = d * h0 + b * w1 + ty;
|
||||
verticies[index+6] = a * w0 + c * h1 + tx;
|
||||
verticies[index+7] = d * h1 + b * w0 + ty;
|
||||
|
||||
// xy
|
||||
verticies[index+12] = a * w0 + c * h0 + tx;
|
||||
verticies[index+13] = d * h0 + b * w0 + ty;
|
||||
|
||||
// xy
|
||||
verticies[index+18] = a * w1 + c * h0 + tx;
|
||||
verticies[index+19] = d * h0 + b * w1 + ty;
|
||||
}
|
||||
|
||||
// uv
|
||||
verticies[index++] = uvs.x3;
|
||||
verticies[index++] = uvs.y3;
|
||||
verticies[index+2] = uvs.x0;
|
||||
verticies[index+3] = uvs.y0;
|
||||
|
||||
// uv
|
||||
verticies[index+8] = uvs.x1;
|
||||
verticies[index+9] = uvs.y1;
|
||||
|
||||
// uv
|
||||
verticies[index+14] = uvs.x2;
|
||||
verticies[index+15] = uvs.y2;
|
||||
|
||||
// uv
|
||||
verticies[index+20] = uvs.x3;
|
||||
verticies[index+21] = uvs.y3;
|
||||
|
||||
// color
|
||||
verticies[index++] = alpha;
|
||||
verticies[index++] = tint;
|
||||
verticies[index+4] = verticies[index+10] = verticies[index+16] = verticies[index+22] = alpha;
|
||||
|
||||
// alpha
|
||||
verticies[index+5] = verticies[index+11] = verticies[index+17] = verticies[index+23] = tint;
|
||||
|
||||
|
||||
|
||||
// increment the batchsize
|
||||
this.sprites[this.currentBatchSize++] = sprite;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -11165,6 +11198,15 @@ PIXI.BaseTexture = function(source, scaleMode)
|
|||
*/
|
||||
this._glTextures = [];
|
||||
|
||||
/**
|
||||
*
|
||||
* Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used
|
||||
* Also the texture must be a power of two size to work
|
||||
*
|
||||
* @property mipmap
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.mipmap = false;
|
||||
// used for webGL texture updating...
|
||||
// TODO - this needs to be addressed
|
||||
|
||||
|
|
8
build/custom/pixi.min.js
vendored
8
build/custom/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
1799
build/phaser.js
1799
build/phaser.js
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
40
build/phaser.min.js
vendored
40
build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue