mirror of
https://github.com/redstrate/Novus.git
synced 2025-05-19 06:47:44 +00:00
Various map editor fixes
Such as the wrong place name being shown, and adding a warning when a BG model failed to load.
This commit is contained in:
parent
0e39c846d7
commit
45becb20ae
3 changed files with 9 additions and 10 deletions
|
@ -84,10 +84,12 @@ void MainWindow::openMap(const QString &basePath)
|
|||
std::string bgLgbPathStd = lgbPath.toStdString();
|
||||
|
||||
auto bg_buffer = physis_gamedata_extract_file(data, bgLgbPathStd.c_str());
|
||||
if (bg_buffer.size > 0) {
|
||||
auto lgb = physis_layergroup_read(bg_buffer);
|
||||
if (lgb.num_chunks > 0) {
|
||||
m_appState->lgbFiles.push_back({name, lgb});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadLgb(QStringLiteral("planevent"));
|
||||
|
|
|
@ -59,11 +59,11 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
|||
const char *placeRegion = regionExdRow.row_data[0].column_data[0].string._0;
|
||||
|
||||
int placeZoneKey = territoryExdRow.row_data[0].column_data[4].u_int16._0;
|
||||
auto zoneExdRow = physis_exd_read_row(&nameExd, placeRegionKey); // TODO: free, use all rows
|
||||
auto zoneExdRow = physis_exd_read_row(&nameExd, placeZoneKey); // TODO: free, use all rows
|
||||
const char *placeZone = zoneExdRow.row_data[0].column_data[0].string._0;
|
||||
|
||||
int placeNameKey = territoryExdRow.row_data[0].column_data[5].u_int16._0;
|
||||
auto nameExdRow = physis_exd_read_row(&nameExd, placeRegionKey); // TODO: free, use all rows
|
||||
auto nameExdRow = physis_exd_read_row(&nameExd, placeNameKey); // TODO: free, use all rows
|
||||
const char *placeName = nameExdRow.row_data[0].column_data[0].string._0;
|
||||
|
||||
QStandardItem *item = new QStandardItem();
|
||||
|
|
|
@ -84,11 +84,6 @@ void MapView::reloadMap()
|
|||
|
||||
// add bg models
|
||||
for (const auto &[name, lgb] : m_appState->lgbFiles) {
|
||||
// only load the bg models for now
|
||||
if (name != QStringLiteral("bg")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < lgb.num_chunks; i++) {
|
||||
const auto chunk = lgb.chunks[i];
|
||||
for (int j = 0; j < chunk.num_layers; j++) {
|
||||
|
@ -130,6 +125,8 @@ void MapView::reloadMap()
|
|||
|
||||
// We don't need this, and it will just take up memory
|
||||
physis_mdl_free(&plateMdl);
|
||||
} else {
|
||||
qWarning() << "Failed to load" << assetPath;
|
||||
}
|
||||
|
||||
physis_free_file(&plateMdlFile);
|
||||
|
|
Loading…
Add table
Reference in a new issue