Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
cf2b73fd
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf2b73fd
编写于
6月 03, 2019
作者:
D
Don McCurdy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BasisTextureLoader: Lint.
上级
7dcb5fd7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
17 deletion
+22
-17
examples/js/loaders/BasisTextureLoader.js
examples/js/loaders/BasisTextureLoader.js
+22
-17
未找到文件。
examples/js/loaders/BasisTextureLoader.js
浏览文件 @
cf2b73fd
...
...
@@ -72,10 +72,10 @@ THREE.BasisTextureLoader.prototype = {
var
context
=
renderer
.
context
;
var
config
=
this
.
workerConfig
;
config
.
etcSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_etc1
'
);
config
.
dxtSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_s3tc
'
);
config
.
pvrtcSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_pvrtc
'
)
||
!!
context
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_pvrtc
'
);
config
.
etcSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_etc1
'
);
config
.
dxtSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_s3tc
'
);
config
.
pvrtcSupported
=
!!
context
.
getExtension
(
'
WEBGL_compressed_texture_pvrtc
'
)
||
!!
context
.
getExtension
(
'
WEBKIT_WEBGL_compressed_texture_pvrtc
'
);
if
(
config
.
etcSupported
)
{
...
...
@@ -128,7 +128,7 @@ THREE.BasisTextureLoader.prototype = {
.
then
(
(
_worker
)
=>
{
worker
=
_worker
;
taskID
=
this
.
workerNextTaskID
++
;
taskID
=
this
.
workerNextTaskID
++
;
return
new
Promise
(
(
resolve
,
reject
)
=>
{
...
...
@@ -138,7 +138,7 @@ THREE.BasisTextureLoader.prototype = {
worker
.
postMessage
(
{
type
:
'
transcode
'
,
id
:
taskID
,
buffer
},
[
buffer
]
);
}
)
}
)
;
}
)
.
then
(
(
message
)
=>
{
...
...
@@ -174,7 +174,7 @@ THREE.BasisTextureLoader.prototype = {
return
texture
;
});
}
);
texturePending
.
finally
(
()
=>
{
...
...
@@ -281,13 +281,17 @@ THREE.BasisTextureLoader.prototype = {
}
}
}
;
this
.
workerPool
.
push
(
worker
);
}
else
{
this
.
workerPool
.
sort
(
function
(
a
,
b
)
{
return
a
.
_taskLoad
>
b
.
_taskLoad
?
-
1
:
1
;
}
);
this
.
workerPool
.
sort
(
function
(
a
,
b
)
{
return
a
.
_taskLoad
>
b
.
_taskLoad
?
-
1
:
1
;
}
);
}
...
...
@@ -299,7 +303,7 @@ THREE.BasisTextureLoader.prototype = {
dispose
:
function
()
{
for
(
var
i
=
0
;
i
<
this
.
workerPool
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
workerPool
.
length
;
i
++
)
{
this
.
workerPool
[
i
].
terminate
();
...
...
@@ -310,7 +314,7 @@ THREE.BasisTextureLoader.prototype = {
return
this
;
}
}
}
;
/* CONSTANTS */
...
...
@@ -342,6 +346,7 @@ THREE.BasisTextureLoader.DXT_FORMAT_MAP[ THREE.BasisTextureLoader.BASIS_FORMAT.c
/* WEB WORKER */
THREE
.
BasisTextureLoader
.
BasisWorker
=
function
()
{
var
config
;
var
transcoderPending
;
var
_BasisFile
;
...
...
@@ -366,9 +371,9 @@ THREE.BasisTextureLoader.BasisWorker = function () {
var
buffers
=
[];
for
(
var
i
=
0
;
i
<
mipmaps
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
mipmaps
.
length
;
++
i
)
{
buffers
.
push
(
mipmaps
[
i
].
data
.
buffer
);
buffers
.
push
(
mipmaps
[
i
].
data
.
buffer
);
}
...
...
@@ -389,7 +394,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
};
function
init
(
wasmBinary
)
{
function
init
(
wasmBinary
)
{
transcoderPending
=
new
Promise
(
(
resolve
)
=>
{
...
...
@@ -415,7 +420,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
}
function
transcode
(
buffer
)
{
function
transcode
(
buffer
)
{
var
basisFile
=
new
_BasisFile
(
new
Uint8Array
(
buffer
)
);
...
...
@@ -423,7 +428,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
var
height
=
basisFile
.
getImageHeight
(
0
,
0
);
var
levels
=
basisFile
.
getNumLevels
(
0
);
function
cleanup
()
{
function
cleanup
()
{
basisFile
.
close
();
basisFile
.
delete
();
...
...
@@ -446,7 +451,7 @@ THREE.BasisTextureLoader.BasisWorker = function () {
var
mipmaps
=
[];
for
(
var
mip
=
0
;
mip
<
levels
;
mip
++
)
{
for
(
var
mip
=
0
;
mip
<
levels
;
mip
++
)
{
var
mipWidth
=
basisFile
.
getImageWidth
(
0
,
mip
);
var
mipHeight
=
basisFile
.
getImageHeight
(
0
,
mip
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录