提交 364ab469 编写于 作者: M Mugen87

DataTextureLoader: Refactor parsing.

上级 e9a6868c
此差异已折叠。
......@@ -79,7 +79,7 @@ THREE.HDRCubeTextureLoader.prototype = Object.assign( Object.create( THREE.Loade
loaded ++;
var texData = scope.hdrLoader._parser( buffer );
var texData = scope.hdrLoader.parse( buffer );
if ( ! texData ) return;
......
此差异已折叠。
......@@ -18,6 +18,6 @@ export class EXRLoader extends DataTextureLoader {
constructor(manager?: LoadingManager);
type: TextureDataType;
_parser(buffer: ArrayBuffer) : EXR;
parse(buffer: ArrayBuffer) : EXR;
setDataType(type: TextureDataType): this;
}
此差异已折叠。
......@@ -96,7 +96,7 @@ HDRCubeTextureLoader.prototype = Object.assign( Object.create( Loader.prototype
loaded ++;
var texData = scope.hdrLoader._parser( buffer );
var texData = scope.hdrLoader.parse( buffer );
if ( ! texData ) return;
......
......@@ -20,6 +20,6 @@ export class RGBELoader extends DataTextureLoader {
constructor(manager?: LoadingManager);
type: TextureDataType;
_parser(buffer: ArrayBuffer): RGBE;
parse(buffer: ArrayBuffer): RGBE;
setDataType(type: TextureDataType): this;
}
此差异已折叠。
......@@ -7,6 +7,8 @@ import { Loader } from './Loader.js';
* @author mrdoob / http://mrdoob.com/
*
* Abstract Base class to block based textures loader (dds, pvr, ...)
*
* Sub classes have to implement the parse() method which will be used in load().
*/
function CompressedTextureLoader( manager ) {
......
......@@ -7,15 +7,14 @@ import { Loader } from './Loader.js';
* @author Nikos M. / https://github.com/foo123/
*
* Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)
*
* Sub classes have to implement the parse() method which will be used in load().
*/
function DataTextureLoader( manager ) {
Loader.call( this, manager );
// override in sub classes
this._parser = null;
}
DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
......@@ -33,7 +32,7 @@ DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ),
loader.setPath( this.path );
loader.load( url, function ( buffer ) {
var texData = scope._parser( buffer );
var texData = scope.parse( buffer );
if ( ! texData ) return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册