lightpreview: show bspx lump sizes

This commit is contained in:
Eric Wasylishen 2024-03-16 11:49:52 -06:00
parent 71aa8aaeea
commit 40e4c71407
3 changed files with 9 additions and 3 deletions

View File

@ -991,7 +991,7 @@ void MainWindow::compileThreadExited()
lightstyles->addWidget(style); lightstyles->addWidget(style);
} }
stats_panel->updateWithBSP(&bsp); stats_panel->updateWithBSP(&bsp, m_bspdata.bspx.entries);
} }
void MainWindow::loadFileInternal(const QString &file, bool is_reload) void MainWindow::loadFileInternal(const QString &file, bool is_reload)

View File

@ -47,7 +47,7 @@ void StatsPanel::addStat(const QString &str, int value)
m_table->setItem(currentRow, 1, valueItem); m_table->setItem(currentRow, 1, valueItem);
} }
void StatsPanel::updateWithBSP(const mbsp_t *bsp) void StatsPanel::updateWithBSP(const mbsp_t *bsp, const bspxentries_t &entries)
{ {
m_table->setRowCount(0); m_table->setRowCount(0);
@ -79,4 +79,9 @@ void StatsPanel::updateWithBSP(const mbsp_t *bsp)
addStat(QStringLiteral("visdata bytes"), bsp->dvis.bits.size()); addStat(QStringLiteral("visdata bytes"), bsp->dvis.bits.size());
addStat(QStringLiteral("lightdata bytes"), bsp->dlightdata.size()); addStat(QStringLiteral("lightdata bytes"), bsp->dlightdata.size());
addStat(QStringLiteral("entdata bytes"), bsp->dentdata.size()); addStat(QStringLiteral("entdata bytes"), bsp->dentdata.size());
// bspx lumps
for (const auto &[lumpname, data] : entries) {
addStat(QStringLiteral("%1 bytes").arg(lumpname.c_str()), data.size());
}
} }

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include <common/bspfile.hh>
struct mbsp_t; struct mbsp_t;
class QTableWidget; class QTableWidget;
@ -16,5 +17,5 @@ private:
void addStat(const QString &str, int value); void addStat(const QString &str, int value);
public: public:
void updateWithBSP(const mbsp_t *bsp); void updateWithBSP(const mbsp_t *bsp, const bspxentries_t &entries);
}; };