eslint fixes

This commit is contained in:
Richard Davey 2018-03-05 01:40:11 +00:00
parent 375db253f2
commit ae1c91cf6a
9 changed files with 17 additions and 18 deletions

View file

@ -19,6 +19,7 @@
"watch": "webpack --watch",
"dist": "webpack --config webpack.dist.config.js",
"lint": "eslint --config .eslintrc.json \"src/**/*.js\"",
"lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix",
"sloc": "node-sloc './src' --include-extensions \"js\""
},
"keywords": [

View file

@ -7,14 +7,14 @@ var MatrixStack = {
initMatrixStack: function ()
{
this.matrixStack = new Float32Array(6000); // up to 1000 matrices
this.currentMatrix = new Float32Array([1.0, 0.0, 0.0, 1.0, 0.0, 0.0]);
this.currentMatrix = new Float32Array([ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 ]);
this.currentMatrixIndex = 0;
return this;
},
save: function ()
{
if (this.currentMatrixIndex >= this.matrixStack.length) return this;
if (this.currentMatrixIndex >= this.matrixStack.length) { return this; }
var matrixStack = this.matrixStack;
var currentMatrix = this.currentMatrix;
@ -33,7 +33,7 @@ var MatrixStack = {
restore: function ()
{
if (this.currentMatrixIndex <= 0) return this;
if (this.currentMatrixIndex <= 0) { return this; }
this.currentMatrixIndex -= 6;

View file

@ -30,7 +30,7 @@ var RenderTexture = new Class({
initialize:
function RenderTexture(scene, x, y, width, height)
function RenderTexture (scene, x, y, width, height)
{
GameObject.call(this, scene, 'RenderTexture');
this.initMatrixStack();
@ -55,7 +55,7 @@ var RenderTexture = new Class({
this.draw = RenderTextureCanvas.draw;
this.drawFrame = RenderTextureCanvas.drawFrame;
this.canvas = CanvasPool.create2D(null, width, height);
this.context = this.canvas.getContext('2d');
this.context = this.canvas.getContext('2d');
}
this.setPosition(x, y);
@ -71,7 +71,7 @@ var RenderTexture = new Class({
this.renderer.deleteTexture(this.texture);
this.renderer.deleteFramebuffer(this.framebuffer);
}
}
}
});

View file

@ -20,7 +20,7 @@ var RenderTextureWebGLRenderer = function (renderer, renderTexture, interpolatio
renderTexture.displayOriginX, renderTexture.displayOriginY,
0, 0, renderTexture.texture.width, renderTexture.texture.height,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0, 0,
0, 0,
camera
);
};

View file

@ -248,11 +248,9 @@ var Zone = new Class({
this.setRectangleDropZone(this.width, this.height);
}
else
if (!this.input)
{
if (!this.input)
{
this.setInteractive(shape, callback, true);
}
this.setInteractive(shape, callback, true);
}
return this;

View file

@ -118,7 +118,7 @@ var File = new Class({
* @type {integer}
* @since 3.0.0
*/
this.state = typeof(this.url) === "function" ? CONST.FILE_POPULATED : CONST.FILE_PENDING;
this.state = typeof(this.url) === 'function' ? CONST.FILE_POPULATED : CONST.FILE_PENDING;
/**
* The total size of this file.

View file

@ -13,7 +13,7 @@ function P0 (t, p)
function P1 (t, p)
{
return 2 * ( 1 - t ) * t * p;
return 2 * (1 - t) * t * p;
}
function P2 (t, p)

View file

@ -1494,11 +1494,11 @@ var WebGLRenderer = new Class({
{
this.setTexture2D(dstTexture, 0);
//if (!shouldReallocate && dstTexture.width >= srcCanvas.width || dstTexture.height >= srcCanvas.height)
//{
// if (!shouldReallocate && dstTexture.width >= srcCanvas.width || dstTexture.height >= srcCanvas.height)
// {
// gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, srcCanvas.width, srcCanvas.height, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas);
//}
//else
// }
// else
{
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas);
dstTexture.width = srcCanvas.width;

View file

@ -1284,7 +1284,7 @@ var SceneManager = new Class({
dump: function ()
{
var out = [];
var out = [];
var map = [ 'pending', 'init', 'start', 'loading', 'creating', 'running', 'paused', 'sleeping', 'shutdown', 'destroyed' ];
for (var i = 0; i < this.scenes.length; i++)