Browse Source

BufferAttribute: `warnOnce` for deprecated methods (#27595)

hybridherbst 1 year ago
parent
commit
597b839e17
2 changed files with 4 additions and 2 deletions
  1. 2 1
      src/core/BufferAttribute.js
  2. 2 1
      src/core/InterleavedBuffer.js

+ 2 - 1
src/core/BufferAttribute.js

@@ -3,6 +3,7 @@ import { Vector2 } from '../math/Vector2.js';
 import { denormalize, normalize } from '../math/MathUtils.js';
 import { StaticDrawUsage, FloatType } from '../constants.js';
 import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
+import { warnOnce } from '../utils.js';
 
 const _vector = /*@__PURE__*/ new Vector3();
 const _vector2 = /*@__PURE__*/ new Vector2();
@@ -45,7 +46,7 @@ class BufferAttribute {
 
 	get updateRange() {
 
-		console.warn( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
+		warnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
 		return this._updateRange;
 
 	}

+ 2 - 1
src/core/InterleavedBuffer.js

@@ -1,5 +1,6 @@
 import * as MathUtils from '../math/MathUtils.js';
 import { StaticDrawUsage } from '../constants.js';
+import { warnOnce } from '../utils.js';
 
 class InterleavedBuffer {
 
@@ -31,7 +32,7 @@ class InterleavedBuffer {
 
 	get updateRange() {
 
-		console.warn( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
+		warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
 		return this._updateRange;
 
 	}