提交 4a1db7b5 编写于 作者: T Takahiro 提交者: Mr.doob

Use FileLoader.setMimeType() from MMDLoader (#9990)

上级 0d47a62f
......@@ -308,10 +308,12 @@ THREE.MMDLoader.prototype.extractExtension = function ( url ) {
};
THREE.MMDLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType ) {
THREE.MMDLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType, mimeType ) {
var loader = new THREE.FileLoader( this.manager );
if ( mimeType !== undefined ) loader.setMimeType( mimeType );
loader.setResponseType( responseType );
var request = loader.load( url, function ( result ) {
......@@ -338,15 +340,7 @@ THREE.MMDLoader.prototype.loadFileAsText = function ( url, onLoad, onProgress, o
THREE.MMDLoader.prototype.loadFileAsShiftJISText = function ( url, onLoad, onProgress, onError ) {
var request = this.loadFile( url, onLoad, onProgress, onError, 'text' );
/*
* TODO: some browsers seem not support overrideMimeType
* so some workarounds for them may be necessary.
* Note: to set property of request after calling request.send(null)
* (it's called in THREE.FileLoader.load()) could be a bad manner.
*/
request.overrideMimeType( 'text/plain; charset=shift_jis' );
var request = this.loadFile( url, onLoad, onProgress, onError, 'text', 'text/plain; charset=shift_jis' );
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册