提交 e1360010 编写于 作者: G gero3

don't allow else statemnt on new line

上级 760252a5
......@@ -315,15 +315,13 @@ THREE.Ocean.prototype.renderSpectrumFFT = function() {
this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
this.renderer.render( this.scene, this.oceanCamera, this.pingTransformFramebuffer );
}
else if ( i % 2 === 1 ) {
} else if ( i % 2 === 1 ) {
this.materialOceanHorizontal.uniforms.u_input.value = this.pingTransformFramebuffer;
this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
this.renderer.render( this.scene, this.oceanCamera, this.pongTransformFramebuffer );
}
else {
} else {
this.materialOceanHorizontal.uniforms.u_input.value = this.pongTransformFramebuffer;
this.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
......@@ -341,15 +339,13 @@ THREE.Ocean.prototype.renderSpectrumFFT = function() {
this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
this.renderer.render( this.scene, this.oceanCamera, this.displacementMapFramebuffer );
}
else if ( i % 2 === 1 ) {
} else if ( i % 2 === 1 ) {
this.materialOceanVertical.uniforms.u_input.value = this.pingTransformFramebuffer;
this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
this.renderer.render( this.scene, this.oceanCamera, this.pongTransformFramebuffer );
}
else {
} else {
this.materialOceanVertical.uniforms.u_input.value = this.pongTransformFramebuffer;
this.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow( 2, ( i % ( iterations ) ) + 1 );
......
......@@ -389,8 +389,7 @@ SPARKS.Age.prototype.update = function ( emitter, particle, time ) {
particle.energy = 0;
particle.isDead = true;
}
else {
} else {
var t = this._easing( particle.age / particle.lifetime );
particle.energy = - 1 * t + 1;
......@@ -970,8 +969,7 @@ SPARKS.Utils = {
return new THREE.Vector3D( 1, 0, 0 );
}
else {
} else {
var temp = new THREE.Vector3( v.y, - v.x, 0 );
return temp.normalize();
......
......@@ -45,8 +45,7 @@ function generateGeometry( objectType, numObjects ) {
scale.z = Math.random() * 200 + 100;
color.setRGB( 0, 0, Math.random() + 0.1 );
}
else if ( objectType == "sphere" ) {
} else if ( objectType == "sphere" ) {
geom = new THREE.IcosahedronGeometry( 1, 1 );
scale.y = scale.z = scale.x;
......
......@@ -136,8 +136,7 @@ function Transition ( sceneA, sceneB ) {
}
}
else
} else
this.needChange = true;
}
......
......@@ -334,8 +334,7 @@
}
}
else {
} else {
mesh = new THREE.Mesh( geometries[ 0 ] );
meshes.push( mesh );
......@@ -417,8 +416,7 @@
// Color material
mat.color.setHex( props.get( 1, 0xcccccc ) );
}
else if ( type === 2 ) {
} else if ( type === 2 ) {
// Bitmap material
var tex_addr = props.get( 2, 0 );
......@@ -1133,8 +1131,7 @@
return list;
}
else {
} else {
return read_func.call( this );
......
......@@ -279,18 +279,15 @@ THREE.AssimpJSONLoader.prototype = {
keyname = 'map';
}
else if ( semantic === 5 ) {
} else if ( semantic === 5 ) {
keyname = 'bumpMap';
}
else if ( semantic === 6 ) {
} else if ( semantic === 6 ) {
keyname = 'normalMap';
}
else if ( semantic === 2 ) {
} else if ( semantic === 2 ) {
keyname = 'specularMap';
......@@ -320,28 +317,23 @@ THREE.AssimpJSONLoader.prototype = {
}
}
else if ( prop.key === '?mat.name' ) {
} else if ( prop.key === '?mat.name' ) {
init_props.name = prop.value;
}
else if ( prop.key === '$clr.diffuse' ) {
} else if ( prop.key === '$clr.diffuse' ) {
init_props.color = toColor( prop.value );
}
else if ( prop.key === '$clr.specular' ) {
} else if ( prop.key === '$clr.specular' ) {
init_props.specular = toColor( prop.value );
}
else if ( prop.key === '$clr.emissive' ) {
} else if ( prop.key === '$clr.emissive' ) {
init_props.emissive = toColor( prop.value );
}
else if ( prop.key === '$mat.shadingm' ) {
} else if ( prop.key === '$mat.shadingm' ) {
// aiShadingMode_Flat
if ( prop.value === 1 ) {
......@@ -350,8 +342,7 @@ THREE.AssimpJSONLoader.prototype = {
}
}
else if ( prop.key === '$mat.shininess' ) {
} else if ( prop.key === '$mat.shininess' ) {
init_props.shininess = prop.value;
......
......@@ -134,14 +134,12 @@ THREE.PVRLoader._parseV2 = function ( pvrDatas ) {
format = _hasAlpha ? THREE.RGBA_PVRTC_4BPPV1_Format : THREE.RGB_PVRTC_4BPPV1_Format;
bpp = 4;
}
else if ( formatFlags === PVRTC_2 ) {
} else if ( formatFlags === PVRTC_2 ) {
format = _hasAlpha ? THREE.RGBA_PVRTC_2BPPV1_Format : THREE.RGB_PVRTC_2BPPV1_Format;
bpp = 2;
}
else
} else
throw new Error( "pvrtc - unknown format " + formatFlags );
......
......@@ -376,17 +376,13 @@ THREE.Lut.prototype = {
value = callback ( value );
}
else {
} else {
if ( this.legend.labels.notation == 'scientific' ) {
value = value.toExponential( this.legend.labels.decimal );
}
else {
} else {
value = value.toFixed( this.legend.labels.decimal );
......@@ -440,17 +436,13 @@ THREE.Lut.prototype = {
var offset = 1.7;
}
else {
} else {
var offset = 2.1;
}
}
else {
} else {
var offset = 1.7;
......
......@@ -221,8 +221,7 @@ THREE.AdaptiveToneMappingPass.prototype = {
this.materialToneMap.defines[ "ADAPTED_LUMINANCE" ] = "";
this.materialToneMap.uniforms.luminanceMap.value = this.luminanceRT;
}
else {
} else {
this.adaptive = false;
delete this.materialToneMap.defines[ "ADAPTED_LUMINANCE" ];
......
......@@ -59,8 +59,7 @@ THREE.GlitchPass.prototype = {
this.curF = 0;
this.generateTrigger();
}
else if ( this.curF % this.randX < this.randX / 5 ) {
} else if ( this.curF % this.randX < this.randX / 5 ) {
this.uniforms[ 'amount' ].value = Math.random() / 90;
this.uniforms[ 'angle' ].value = THREE.Math.randFloat( - Math.PI, Math.PI );
......@@ -69,8 +68,7 @@ THREE.GlitchPass.prototype = {
this.uniforms[ 'seed_x' ].value = THREE.Math.randFloat( - 0.3, 0.3 );
this.uniforms[ 'seed_y' ].value = THREE.Math.randFloat( - 0.3, 0.3 );
}
else if ( this.goWild == false ) {
} else if ( this.goWild == false ) {
this.uniforms[ 'byp' ].value = 1;
......@@ -82,8 +80,7 @@ THREE.GlitchPass.prototype = {
renderer.render( this.scene, this.camera );
}
else {
} else {
renderer.render( this.scene, this.camera, writeBuffer, false );
......
......@@ -375,8 +375,7 @@ THREE.SoftwareRenderer = function ( parameters ) {
buffer[ colorOffset + 3 ] = material.opacity * 255;
depthBuf[ offset ] = depth;
}
else {
} else {
var opaci = tdata[ tIndex + 3 ] * material.opacity;
var texel = ( tdata[ tIndex ] << 16 ) + ( tdata[ tIndex + 1 ] << 8 ) + tdata[ tIndex + 2 ];
......
......@@ -2,6 +2,7 @@
"preset": "mdcs",
"disallowNewlineBeforeBlockStatements": true,
"requireSpaceAfterBinaryOperators": [","],
"disallowKeywordsOnNewLine": ["else"],
"excludeFiles": [
"../../.c9/",
"../../.c9version/",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册