mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Display textures size in MB
This commit is contained in:
parent
fe8b3b4d0d
commit
d61e4c5c11
2 changed files with 12 additions and 2 deletions
|
@ -59,7 +59,7 @@
|
|||
<th id="entity-visible"><span class="glyph"></span><span class="sort-order"></span></th>
|
||||
<th id="entity-verticesCount">Verts<span class="sort-order"></span></th>
|
||||
<th id="entity-texturesCount">Texts<span class="sort-order"></span></th>
|
||||
<th id="entity-texturesSize">T Size<span class="sort-order"></span></th>
|
||||
<th id="entity-texturesSize">Text MB<span class="sort-order"></span></th>
|
||||
<th id="entity-hasTransparent"><span class="glyph"></span><span class="sort-order"></span></th>
|
||||
<th id="entity-drawCalls">Draws<span class="sort-order"></span></th>
|
||||
<th colspan="1" id="entity-hasScript"><span class="glyph">k</span><span class="sort-order"></span></th>
|
||||
|
|
|
@ -132,6 +132,16 @@ function loaded() {
|
|||
}));
|
||||
}
|
||||
|
||||
const BYTES_PER_MEGABYTE = 1024 * 1024;
|
||||
|
||||
function decimalMegabytes(number) {
|
||||
if (number) {
|
||||
return (number / BYTES_PER_MEGABYTE).toFixed(1);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
|
||||
drawCalls, hasScript) {
|
||||
|
||||
|
@ -141,7 +151,7 @@ function loaded() {
|
|||
if (entities[id] === undefined) {
|
||||
entityList.add([{
|
||||
id: id, name: name, type: type, url: filename, locked: locked, visible: visible, verticesCount: verticesCount,
|
||||
texturesCount: texturesCount, texturesSize: texturesSize, hasTransparent: hasTransparent,
|
||||
texturesCount: texturesCount, texturesSize: decimalMegabytes(texturesSize), hasTransparent: hasTransparent,
|
||||
drawCalls: drawCalls, hasScript: hasScript
|
||||
}],
|
||||
function (items) {
|
||||
|
|
Loading…
Reference in a new issue