提交 6cec1104 编写于 作者: M Mr.doob

TextureLoader: Clean up.

上级 da0d1c1f
......@@ -20,10 +20,8 @@ Object.assign( THREE.TextureLoader.prototype, {
loader.load( url, function ( image ) {
// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
var isJPEG = url.search(/\.(jpg|jpeg)$/) > 0;
if (!isJPEG) {
isJPEG = url.search(/^data\:image\/jpeg/) == 0;
}
var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
texture.format = isJPEG ? THREE.RGBFormat : THREE.RGBAFormat;
texture.image = image;
texture.needsUpdate = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册