1
Fork 0
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:
Joshua Goins 2025-05-17 12:07:49 -04:00
parent 0e39c846d7
commit 45becb20ae
3 changed files with 9 additions and 10 deletions

View file

@ -84,9 +84,11 @@ void MainWindow::openMap(const QString &basePath)
std::string bgLgbPathStd = lgbPath.toStdString(); std::string bgLgbPathStd = lgbPath.toStdString();
auto bg_buffer = physis_gamedata_extract_file(data, bgLgbPathStd.c_str()); auto bg_buffer = physis_gamedata_extract_file(data, bgLgbPathStd.c_str());
auto lgb = physis_layergroup_read(bg_buffer); if (bg_buffer.size > 0) {
if (lgb.num_chunks > 0) { auto lgb = physis_layergroup_read(bg_buffer);
m_appState->lgbFiles.push_back({name, lgb}); if (lgb.num_chunks > 0) {
m_appState->lgbFiles.push_back({name, lgb});
}
} }
}; };

View file

@ -59,11 +59,11 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
const char *placeRegion = regionExdRow.row_data[0].column_data[0].string._0; const char *placeRegion = regionExdRow.row_data[0].column_data[0].string._0;
int placeZoneKey = territoryExdRow.row_data[0].column_data[4].u_int16._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; const char *placeZone = zoneExdRow.row_data[0].column_data[0].string._0;
int placeNameKey = territoryExdRow.row_data[0].column_data[5].u_int16._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; const char *placeName = nameExdRow.row_data[0].column_data[0].string._0;
QStandardItem *item = new QStandardItem(); QStandardItem *item = new QStandardItem();

View file

@ -84,11 +84,6 @@ void MapView::reloadMap()
// add bg models // add bg models
for (const auto &[name, lgb] : m_appState->lgbFiles) { 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++) { for (int i = 0; i < lgb.num_chunks; i++) {
const auto chunk = lgb.chunks[i]; const auto chunk = lgb.chunks[i];
for (int j = 0; j < chunk.num_layers; j++) { 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 // We don't need this, and it will just take up memory
physis_mdl_free(&plateMdl); physis_mdl_free(&plateMdl);
} else {
qWarning() << "Failed to load" << assetPath;
} }
physis_free_file(&plateMdlFile); physis_free_file(&plateMdlFile);