Display textures size in MB

This commit is contained in:
David Rowe 2016-09-13 10:52:19 +12:00
parent fe8b3b4d0d
commit d61e4c5c11
2 changed files with 12 additions and 2 deletions

View file

@ -59,7 +59,7 @@
<th id="entity-visible"><span class="glyph">&#xe007;</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">&#xe00b;</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>

View file

@ -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) {