Просмотр исходного кода

Core: Remove deprecated code. (#30621)

* Core: Remove deprecated code.

* Tests: Clean up.
Michael Herzog 10 месяцев назад
Родитель
Сommit
e26f94f0c5

+ 0 - 44
src/loaders/LoaderUtils.js

@@ -3,50 +3,6 @@
  */
 class LoaderUtils {
 
-	/**
-	 * The function takes a stream of bytes as input and returns a string
-	 * representation.
-	 *
-	 * @deprecated since r165. Use the native `TextDecoder` API instead.
-	 * @param {TypedArray} array - A stream of bytes as a typed array.
-	 * @return {string} The decoded text.
-	 */
-	static decodeText( array ) { // @deprecated, r165
-
-		console.warn( 'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.' );
-
-		if ( typeof TextDecoder !== 'undefined' ) {
-
-			return new TextDecoder().decode( array );
-
-		}
-
-		// Avoid the String.fromCharCode.apply(null, array) shortcut, which
-		// throws a "maximum call stack size exceeded" error for large arrays.
-
-		let s = '';
-
-		for ( let i = 0, il = array.length; i < il; i ++ ) {
-
-			// Implicitly assumes little-endian.
-			s += String.fromCharCode( array[ i ] );
-
-		}
-
-		try {
-
-			// merges multi-byte utf-8 characters.
-
-			return decodeURIComponent( escape( s ) );
-
-		} catch ( e ) { // see #16358
-
-			return s;
-
-		}
-
-	}
-
 	/**
 	 * Extracts the base URL from the given URL.
 	 *

+ 0 - 39
src/renderers/WebGLRenderer.js

@@ -2558,17 +2558,6 @@ class WebGLRenderer {
 
 		this.copyFramebufferToTexture = function ( texture, position = null, level = 0 ) {
 
-			// support previous signature with position first
-			if ( texture.isTexture !== true ) {
-
-				// @deprecated, r165
-				warnOnce( 'WebGLRenderer: copyFramebufferToTexture function signature has changed.' );
-
-				position = arguments[ 0 ] || null;
-				texture = arguments[ 1 ];
-
-			}
-
 			const levelScale = Math.pow( 2, - level );
 			const width = Math.floor( texture.image.width * levelScale );
 			const height = Math.floor( texture.image.height * levelScale );
@@ -2588,20 +2577,6 @@ class WebGLRenderer {
 		const _dstFramebuffer = _gl.createFramebuffer();
 		this.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, srcLevel = 0, dstLevel = null ) {
 
-			// support previous signature with dstPosition first
-			if ( srcTexture.isTexture !== true ) {
-
-				// @deprecated, r165
-				warnOnce( 'WebGLRenderer: copyTextureToTexture function signature has changed.' );
-
-				dstPosition = arguments[ 0 ] || null;
-				srcTexture = arguments[ 1 ];
-				dstTexture = arguments[ 2 ];
-				dstLevel = arguments[ 3 ] || 0;
-				srcRegion = null;
-
-			}
-
 			// support the previous signature with just a single dst mipmap level
 			if ( dstLevel === null ) {
 
@@ -2854,20 +2829,6 @@ class WebGLRenderer {
 
 		this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
 
-			// support previous signature with source box first
-			if ( srcTexture.isTexture !== true ) {
-
-				// @deprecated, r165
-				warnOnce( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' );
-
-				srcRegion = arguments[ 0 ] || null;
-				dstPosition = arguments[ 1 ] || null;
-				srcTexture = arguments[ 2 ];
-				dstTexture = arguments[ 3 ];
-				level = arguments[ 4 ] || 0;
-
-			}
-
 			// @deprecated, r170
 			warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
 

+ 0 - 9
test/unit/src/loaders/LoaderUtils.tests.js

@@ -7,15 +7,6 @@ export default QUnit.module( 'Loaders', () => {
 	QUnit.module( 'LoaderUtils', () => {
 
 		// STATIC
-		QUnit.test( 'decodeText', ( assert ) => {
-
-			const jsonArray = new Uint8Array( [ 123, 34, 106, 115, 111, 110, 34, 58, 32, 116, 114, 117, 101, 125 ] );
-			assert.equal( '{"json": true}', LoaderUtils.decodeText( jsonArray ) );
-
-			const multibyteArray = new Uint8Array( [ 230, 151, 165, 230, 156, 172, 229, 155, 189 ] );
-			assert.equal( '日本国', LoaderUtils.decodeText( multibyteArray ) );
-
-		} );
 
 		QUnit.test( 'extractUrlBase', ( assert ) => {
 

粤ICP备19079148号