mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
ESLint updates.
This commit is contained in:
parent
9a1bb506ee
commit
ea44513fda
4 changed files with 20 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: '1ced6ae0-471b-11e7-aeea-e52f23bf6487'
|
||||
build: '50d8bd90-478a-11e7-9f64-3f061ec2a0e8'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
|
@ -1,3 +1,5 @@
|
|||
// Phaser.DOM
|
||||
|
||||
module.exports = {
|
||||
|
||||
AddEventListener: require('./AddEventListener'),
|
||||
|
|
|
@ -45,10 +45,10 @@ var TileSprite = new Class({
|
|||
this.setSize(width, height);
|
||||
|
||||
this.potWidth = this.frame.width;
|
||||
this.potHeight = this.frame.height;
|
||||
this.potHeight = this.frame.height;
|
||||
this.canvasPattern = null;
|
||||
|
||||
if (resourceManager)
|
||||
if (resourceManager)
|
||||
{
|
||||
this.potWidth--;
|
||||
this.potWidth |= this.potWidth >> 1;
|
||||
|
@ -67,11 +67,10 @@ var TileSprite = new Class({
|
|||
this.potHeight++;
|
||||
|
||||
this.renderer = state.game.renderer;
|
||||
gl = state.game.renderer.gl;
|
||||
var gl = state.game.renderer.gl;
|
||||
|
||||
this.tileTexture = resourceManager.createTexture(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.canvasBuffer, this.potWidth, this.potHeight);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.canvasBuffer = CanvasPool.create2D(null, this.potWidth, this.potHeight);
|
||||
this.canvasBufferCtx = this.canvasBuffer.getContext('2d');
|
||||
|
@ -79,21 +78,24 @@ var TileSprite = new Class({
|
|||
this.updateTileTexture();
|
||||
},
|
||||
|
||||
updateTileTexture: function ()
|
||||
updateTileTexture: function ()
|
||||
{
|
||||
if (!this.dirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.canvasBuffer.width = this.canvasBuffer.width;
|
||||
|
||||
this.canvasBufferCtx.drawImage(
|
||||
this.frame.source.image,
|
||||
this.frame.source.image,
|
||||
this.frame.cutX, this.frame.cutY,
|
||||
this.frame.cutWidth, this.frame.cutHeight,
|
||||
0, 0,
|
||||
this.potWidth, this.potHeight
|
||||
);
|
||||
|
||||
if (this.renderer)
|
||||
if (this.renderer)
|
||||
{
|
||||
this.renderer.uploadCanvasToGPU(this.canvasBuffer, this.tileTexture, true);
|
||||
}
|
||||
|
@ -101,19 +103,23 @@ var TileSprite = new Class({
|
|||
{
|
||||
this.canvasPattern = this.canvasBufferCtx.createPattern(this.canvasBuffer, 'repeat');
|
||||
}
|
||||
|
||||
this.dirty = false;
|
||||
},
|
||||
|
||||
destroy: function ()
|
||||
destroy: function ()
|
||||
{
|
||||
if (this.renderer)
|
||||
if (this.renderer)
|
||||
{
|
||||
this.renderer.gl.deleteTexture(this.tileTexture);
|
||||
}
|
||||
|
||||
CanvasPool.remove(this.canvasBuffer);
|
||||
|
||||
this.canvasPattern = null;
|
||||
this.canvasBufferCtx = null;
|
||||
this.canvasBuffer = null;
|
||||
|
||||
this.renderer = null;
|
||||
this.visible = false;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.export = {
|
||||
module.exports = {
|
||||
|
||||
GetNext: require('./GetPowerOfTwo'),
|
||||
IsSize: require('./IsSizePowerOfTwo'),
|
||||
|
|
Loading…
Reference in a new issue