2
0
Эх сурвалжийг харах

setType() -> setDataType()

WestLangley 6 жил өмнө
parent
commit
d40328c523

+ 9 - 1
examples/js/loaders/EXRLoader.js

@@ -82,13 +82,21 @@ THREE.EXRLoader = function ( manager ) {
 
 THREE.EXRLoader.prototype = Object.create( THREE.DataTextureLoader.prototype );
 
-THREE.EXRLoader.prototype.setType = function ( value ) {
+THREE.EXRLoader.prototype.setDataType = function ( value ) {
 
 	this.type = value;
 	return this;
 
 };
 
+THREE.EXRLoader.prototype.setType = function ( value ) {
+
+	console.warn( 'THREE.EXRLoader: .setType() has been renamed to .setDataType().' );
+
+	return this.setDataType( value );
+
+};
+
 THREE.EXRLoader.prototype._parser = function ( buffer ) {
 
 	const USHORT_RANGE = ( 1 << 16 );

+ 12 - 4
examples/js/loaders/HDRCubeTextureLoader.js

@@ -15,9 +15,9 @@ THREE.HDRCubeTextureLoader.prototype.load = function ( urls, onLoad, onProgress,
 
 	if ( ! Array.isArray( urls ) ) {
 
-		console.warn( 'THREE.HDRCubeTextureLoader signature has changed. Use .setType() instead.' );
+		console.warn( 'THREE.HDRCubeTextureLoader signature has changed. Use .setDataType() instead.' );
 
-		this.setType( urls );
+		this.setDataType( urls );
 
 		urls = onLoad;
 		onLoad = onProgress;
@@ -121,10 +121,18 @@ THREE.HDRCubeTextureLoader.prototype.setPath = function ( value ) {
 
 };
 
-THREE.HDRCubeTextureLoader.prototype.setType = function ( value ) {
+THREE.HDRCubeTextureLoader.prototype.setDataType = function ( value ) {
 
 	this.type = value;
-	this.hdrLoader.setType( value );
+	this.hdrLoader.setDataType( value );
 	return this;
 
 };
+
+THREE.HDRCubeTextureLoader.prototype.setType = function ( value ) {
+
+	console.warn( 'THREE.HDRCubeTextureLoader: .setType() has been renamed to .setDataType().' );
+
+	return this.setDataType( value );
+
+};

+ 9 - 1
examples/js/loaders/RGBELoader.js

@@ -470,13 +470,21 @@ THREE.RGBELoader.prototype._parser = function ( buffer ) {
 
 };
 
-THREE.RGBELoader.prototype.setType = function ( value ) {
+THREE.RGBELoader.prototype.setDataType = function ( value ) {
 
 	this.type = value;
 	return this;
 
 };
 
+THREE.RGBELoader.prototype.setType = function ( value ) {
+
+	console.warn( 'THREE.RGBELoader: .setType() has been renamed to .setDataType().' );
+
+	return this.setDataType( value );
+
+};
+
 THREE.RGBELoader.prototype.load = function ( url, onLoad, onProgress, onError ) {
 
 	function onLoadCallback( texture, texData ) {

+ 1 - 1
examples/jsm/loaders/EXRLoader.d.ts

@@ -19,5 +19,5 @@ export class EXRLoader extends DataTextureLoader {
   type: TextureDataType;
 
   _parser(buffer: ArrayBuffer) : EXR;
-  setType(type: TextureDataType): this;
+  setDataType(type: TextureDataType): this;
 }

+ 1 - 1
examples/jsm/loaders/HDRCubeTextureLoader.d.ts

@@ -15,5 +15,5 @@ export class HDRCubeTextureLoader {
 
   load(url: string, onLoad: (texture: CubeTexture) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
   setPath(value: string): this;
-  setType(type: TextureDataType): this;
+  setDataType(type: TextureDataType): this;
 }

+ 1 - 1
examples/jsm/loaders/RGBELoader.d.ts

@@ -21,5 +21,5 @@ export class RGBELoader extends DataTextureLoader {
   type: TextureDataType;
 
   _parser(buffer: ArrayBuffer): RGBE;
-  setType(type: TextureDataType): this;
+  setDataType(type: TextureDataType): this;
 }