Ver Fonte

Removed old DEPRECATED messages.

Mr.doob há 13 anos atrás
pai
commit
4e2f5aaa0c

+ 0 - 8
src/cameras/Camera.js

@@ -5,13 +5,6 @@
 
 THREE.Camera = function () {
 
-	if ( arguments.length ) {
-
-		console.warn( 'DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera().' );
-		return new THREE.PerspectiveCamera( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] );
-
-	}
-
 	THREE.Object3D.call( this );
 
 	this.matrixWorldInverse = new THREE.Matrix4();
@@ -19,7 +12,6 @@ THREE.Camera = function () {
 	this.projectionMatrix = new THREE.Matrix4();
 	this.projectionMatrixInverse = new THREE.Matrix4();
 
-
 };
 
 THREE.Camera.prototype = new THREE.Object3D();

+ 8 - 46
src/extras/loaders/BinaryLoader.js

@@ -23,19 +23,6 @@ THREE.BinaryLoader.prototype.supr = THREE.Loader.prototype;
 
 THREE.BinaryLoader.prototype.load = function( url, callback, texturePath, binaryPath ) {
 
-	if ( url instanceof Object ) {
-
-		console.warn( 'DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath ).' );
-
-		var parameters = url;
-
-		url = parameters.model;
-		callback = parameters.callback;
-		texturePath = parameters.texture_path;
-		binaryPath = parameters.bin_path;
-
-	}
-
 	texturePath = texturePath ? texturePath : this.extractUrlbase( url );
 	binaryPath = binaryPath ? binaryPath : this.extractUrlbase( url );
 
@@ -49,41 +36,22 @@ THREE.BinaryLoader.prototype.load = function( url, callback, texturePath, binary
 
 };
 
-THREE.BinaryLoader.prototype.loadAjaxJSON = function( context, url, callback, texturePath, binaryPath, callbackProgress ) {
+THREE.BinaryLoader.prototype.loadAjaxJSON = function ( context, url, callback, texturePath, binaryPath, callbackProgress ) {
 
 	var xhr = new XMLHttpRequest();
 
-	xhr.onreadystatechange = function() {
+	xhr.onreadystatechange = function () {
 
 		if ( xhr.readyState == 4 ) {
 
 			if ( xhr.status == 200 || xhr.status == 0 ) {
 
-				try {
-
-					var json = JSON.parse( xhr.responseText );
-
-					if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) {
-
-						console.error( 'Deprecated file format.' );
-						return;
-
-					}
-
-					// #2 load BIN part via Ajax
-
-					context.loadAjaxBuffers( json, callback, binaryPath, texturePath, callbackProgress );
-
-				} catch ( error ) {
-
-					console.error( error );
-					console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" );
-
-				}
+				var json = JSON.parse( xhr.responseText );
+				context.loadAjaxBuffers( json, callback, binaryPath, texturePath, callbackProgress );
 
 			} else {
 
-				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+				console.error( "THREE.BinaryLoader: Couldn't load [" + url + "] [" + xhr.status + "]" );
 
 			}
 
@@ -98,14 +66,14 @@ THREE.BinaryLoader.prototype.loadAjaxJSON = function( context, url, callback, te
 
 };
 
-THREE.BinaryLoader.prototype.loadAjaxBuffers = function( json, callback, binaryPath, texturePath, callbackProgress ) {
+THREE.BinaryLoader.prototype.loadAjaxBuffers = function ( json, callback, binaryPath, texturePath, callbackProgress ) {
 
 	var xhr = new XMLHttpRequest(),
 		url = binaryPath + "/" + json.buffers;
 
 	var length = 0;
 
-	xhr.onreadystatechange = function() {
+	xhr.onreadystatechange = function () {
 
 		if ( xhr.readyState == 4 ) {
 
@@ -115,7 +83,7 @@ THREE.BinaryLoader.prototype.loadAjaxBuffers = function( json, callback, binaryP
 
 			} else {
 
-				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+				console.error( "THREE.BinaryLoader: Couldn't load [" + url + "] [" + xhr.status + "]" );
 
 			}
 
@@ -171,12 +139,6 @@ THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texture
 
 		md = parseMetaData( data, currentOffset );
 
-		if ( md.signature !== "Three.js 003" ) {
-
-			console.warn( "DEPRECATED: binary model seems to be using old format" );
-
-		}
-
 		currentOffset += md.header_bytes;
 /*
 		md.vertex_index_bytes = Uint32Array.BYTES_PER_ELEMENT;

+ 7 - 25
src/extras/loaders/JSONLoader.js

@@ -36,28 +36,17 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 
 			if ( xhr.status === 200 || xhr.status === 0 ) {
 
-				var json;
+				if ( xhr.responseText ) {
 
-				try {
+					var json = JSON.parse( xhr.responseText );
+					context.createModel( json, callback, texturePath );
 
-					if ( xhr.responseText ) {
+				} else {
 
-						json = JSON.parse( xhr.responseText );
-
-					} else {
-
-						console.warn( "EMPTY: [" + url + "] seems to be unreachable or file there is empty" );
-
-					}
-
-				} catch ( error ) {
-
-					console.warn( "DEPRECATED: [" + url + "] seems to be using old model format or JSON is invalid" );
+					console.warn( "THREE.JSONLoader: [" + url + "] seems to be unreachable or file there is empty" );
 
 				}
 
-				if ( json ) context.createModel( json, callback, texturePath );
-
 				// in context of more complex asset initialization
 				// do not block on single failed file
 				// maybe should go even one more level up
@@ -66,7 +55,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 
 			} else {
 
-				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+				console.error( "THREE.JSONLoader: Couldn't load [" + url + "] [" + xhr.status + "]" );
 
 			}
 
@@ -120,18 +109,11 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texturePath
 
 	function parseModel( scale ) {
 
-		if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) {
-
-			console.error( 'Deprecated file format.' );
-			return;
-
-		}
-
 		function isBitSet( value, position ) {
 
 			return value & ( 1 << position );
 
-		};
+		}
 
 		var i, j, fi,
 

+ 2 - 11
src/extras/loaders/SceneLoader.js

@@ -27,21 +27,12 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
 
 			if ( xhr.status == 200 || xhr.status == 0 ) {
 
-				try {
-
-					var json = JSON.parse( xhr.responseText );
-
-				} catch ( error ) {
-
-					console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" );
-
-				}
-
+				var json = JSON.parse( xhr.responseText );
 				context.createScene( json, callbackFinished, url );
 
 			} else {
 
-				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+				console.error( "THREE.SceneLoader: Couldn't load [" + url + "] [" + xhr.status + "]" );
 
 			}
 

+ 3 - 15
src/extras/loaders/UTF8Loader.js

@@ -13,7 +13,7 @@
  * @author won3d / http://twitter.com/won3d
  */
 
-THREE.UTF8Loader = function ( ) {
+THREE.UTF8Loader = function () {
 
 };
 
@@ -27,19 +27,7 @@ THREE.UTF8Loader.prototype.constructor = THREE.UTF8Loader;
 //		- callback (required)
 //		- metaData (optional)
 
-THREE.UTF8Loader.prototype.load = function( url, callback, metaData ) {
-
-	if ( url instanceof Object ) {
-
-		console.warn( 'DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData ).' );
-
-		var parameters = url;
-
-		url = parameters.model;
-		callback = parameters.callback;
-		metaData = { scale: parameters.scale, offsetX: parameters.offsetX, offsetY: parameters.offsetY, offsetZ: parameters.offsetZ };
-
-	}
+THREE.UTF8Loader.prototype.load = function ( url, callback, metaData ) {
 
 	var xhr = new XMLHttpRequest(),
 		callbackProgress = null,
@@ -61,7 +49,7 @@ THREE.UTF8Loader.prototype.load = function( url, callback, metaData ) {
 
 			} else {
 
-				alert( "Couldn't load [" + url + "] [" + xhr.status + "]" );
+				console.error( "THREE.UTF8Loader: Couldn't load [" + url + "] [" + xhr.status + "]" );
 
 			}
 

+ 0 - 7
src/materials/MeshShaderMaterial.js

@@ -1,7 +0,0 @@
-THREE.MeshShaderMaterial = function ( parameters ) {
-
-	console.warn( 'DEPRECATED: MeshShaderMaterial() is now ShaderMaterial().' );
-
-	return new THREE.ShaderMaterial( parameters );
-
-};

+ 0 - 7
src/objects/Mesh.js

@@ -11,13 +11,6 @@ THREE.Mesh = function ( geometry, material ) {
 	this.geometry = geometry;
 	this.material = material;
 
-	if ( material instanceof Array ) {
-
-		console.warn( 'DEPRECATED: Mesh material can no longer be an Array. Using material at index 0...' );
-		this.material = material[ 0 ];
-
-	}
-
 	if ( this.geometry ) {
 
 		// calc bound radius

+ 0 - 2
utils/build.py

@@ -50,7 +50,6 @@ COMMON_FILES = [
 'materials/MeshDepthMaterial.js',
 'materials/MeshNormalMaterial.js',
 'materials/MeshFaceMaterial.js',
-'materials/MeshShaderMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ParticleCanvasMaterial.js',
 'materials/ParticleDOMMaterial.js',
@@ -333,7 +332,6 @@ WEBGL_FILES = [
 'materials/MeshDepthMaterial.js',
 'materials/MeshNormalMaterial.js',
 'materials/MeshFaceMaterial.js',
-'materials/MeshShaderMaterial.js',
 'materials/ParticleBasicMaterial.js',
 'materials/ShaderMaterial.js',
 'textures/Texture.js',