Skip to content

Commit e26f94f

Browse files
authoredFeb 27, 2025··
Core: Remove deprecated code. (#30621)
* Core: Remove deprecated code. * Tests: Clean up.
1 parent 2ed77d2 commit e26f94f

File tree

3 files changed

+0
-92
lines changed

3 files changed

+0
-92
lines changed
 

‎src/loaders/LoaderUtils.js

-44
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,6 @@
33
*/
44
class LoaderUtils {
55

6-
/**
7-
* The function takes a stream of bytes as input and returns a string
8-
* representation.
9-
*
10-
* @deprecated since r165. Use the native `TextDecoder` API instead.
11-
* @param {TypedArray} array - A stream of bytes as a typed array.
12-
* @return {string} The decoded text.
13-
*/
14-
static decodeText( array ) { // @deprecated, r165
15-
16-
console.warn( 'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.' );
17-
18-
if ( typeof TextDecoder !== 'undefined' ) {
19-
20-
return new TextDecoder().decode( array );
21-
22-
}
23-
24-
// Avoid the String.fromCharCode.apply(null, array) shortcut, which
25-
// throws a "maximum call stack size exceeded" error for large arrays.
26-
27-
let s = '';
28-
29-
for ( let i = 0, il = array.length; i < il; i ++ ) {
30-
31-
// Implicitly assumes little-endian.
32-
s += String.fromCharCode( array[ i ] );
33-
34-
}
35-
36-
try {
37-
38-
// merges multi-byte utf-8 characters.
39-
40-
return decodeURIComponent( escape( s ) );
41-
42-
} catch ( e ) { // see #16358
43-
44-
return s;
45-
46-
}
47-
48-
}
49-
506
/**
517
* Extracts the base URL from the given URL.
528
*

‎src/renderers/WebGLRenderer.js

-39
Original file line numberDiff line numberDiff line change
@@ -2558,17 +2558,6 @@ class WebGLRenderer {
25582558

25592559
this.copyFramebufferToTexture = function ( texture, position = null, level = 0 ) {
25602560

2561-
// support previous signature with position first
2562-
if ( texture.isTexture !== true ) {
2563-
2564-
// @deprecated, r165
2565-
warnOnce( 'WebGLRenderer: copyFramebufferToTexture function signature has changed.' );
2566-
2567-
position = arguments[ 0 ] || null;
2568-
texture = arguments[ 1 ];
2569-
2570-
}
2571-
25722561
const levelScale = Math.pow( 2, - level );
25732562
const width = Math.floor( texture.image.width * levelScale );
25742563
const height = Math.floor( texture.image.height * levelScale );
@@ -2588,20 +2577,6 @@ class WebGLRenderer {
25882577
const _dstFramebuffer = _gl.createFramebuffer();
25892578
this.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, srcLevel = 0, dstLevel = null ) {
25902579

2591-
// support previous signature with dstPosition first
2592-
if ( srcTexture.isTexture !== true ) {
2593-
2594-
// @deprecated, r165
2595-
warnOnce( 'WebGLRenderer: copyTextureToTexture function signature has changed.' );
2596-
2597-
dstPosition = arguments[ 0 ] || null;
2598-
srcTexture = arguments[ 1 ];
2599-
dstTexture = arguments[ 2 ];
2600-
dstLevel = arguments[ 3 ] || 0;
2601-
srcRegion = null;
2602-
2603-
}
2604-
26052580
// support the previous signature with just a single dst mipmap level
26062581
if ( dstLevel === null ) {
26072582

@@ -2854,20 +2829,6 @@ class WebGLRenderer {
28542829

28552830
this.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {
28562831

2857-
// support previous signature with source box first
2858-
if ( srcTexture.isTexture !== true ) {
2859-
2860-
// @deprecated, r165
2861-
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' );
2862-
2863-
srcRegion = arguments[ 0 ] || null;
2864-
dstPosition = arguments[ 1 ] || null;
2865-
srcTexture = arguments[ 2 ];
2866-
dstTexture = arguments[ 3 ];
2867-
level = arguments[ 4 ] || 0;
2868-
2869-
}
2870-
28712832
// @deprecated, r170
28722833
warnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.' );
28732834

‎test/unit/src/loaders/LoaderUtils.tests.js

-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ export default QUnit.module( 'Loaders', () => {
77
QUnit.module( 'LoaderUtils', () => {
88

99
// STATIC
10-
QUnit.test( 'decodeText', ( assert ) => {
11-
12-
const jsonArray = new Uint8Array( [ 123, 34, 106, 115, 111, 110, 34, 58, 32, 116, 114, 117, 101, 125 ] );
13-
assert.equal( '{"json": true}', LoaderUtils.decodeText( jsonArray ) );
14-
15-
const multibyteArray = new Uint8Array( [ 230, 151, 165, 230, 156, 172, 229, 155, 189 ] );
16-
assert.equal( '日本国', LoaderUtils.decodeText( multibyteArray ) );
17-
18-
} );
1910

2011
QUnit.test( 'extractUrlBase', ( assert ) => {
2112

0 commit comments

Comments
 (0)
Please sign in to comment.