Merge branch 'isledecomp:master' into psp

This commit is contained in:
VoxelTek 2025-08-14 10:40:39 +10:00 committed by GitHub
commit 3ee9c0ea1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 69 additions and 38 deletions

View File

@ -7,12 +7,9 @@
DECOMP_SIZE_ASSERT(CDialog, 0x60) DECOMP_SIZE_ASSERT(CDialog, 0x60)
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60) DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)
// FIXME: disable dialog resizing
// FUNCTION: CONFIG 0x00403c20 // FUNCTION: CONFIG 0x00403c20
CAboutDialog::CAboutDialog() : QDialog() CAboutDialog::CAboutDialog() : QDialog()
{ {
m_ui = new Ui::AboutDialog; m_ui = new Ui::AboutDialog;
m_ui->setupUi(this); m_ui->setupUi(this);
layout()->setSizeConstraint(QLayout::SetFixedSize);
} }

View File

@ -312,7 +312,11 @@ void CMainDialog::UpdateInterface()
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path)); m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
m_ui->textureCheckBox->setChecked(currentConfigApp->m_texture_load); m_ui->textureCheckBox->setChecked(currentConfigApp->m_texture_load);
m_ui->texturePath->setText(QString::fromStdString(currentConfigApp->m_texture_path)); QString texture_path = QString::fromStdString(currentConfigApp->m_texture_path);
if (texture_path.startsWith(QDir::separator())) {
texture_path.remove(0, 1);
}
m_ui->texturePath->setText(texture_path);
m_ui->texturePath->setEnabled(currentConfigApp->m_texture_load); m_ui->texturePath->setEnabled(currentConfigApp->m_texture_load);
m_ui->texturePathOpen->setEnabled(currentConfigApp->m_texture_load); m_ui->texturePathOpen->setEnabled(currentConfigApp->m_texture_load);
@ -324,6 +328,11 @@ void CMainDialog::UpdateInterface()
m_ui->customAssetPaths->clear(); m_ui->customAssetPaths->clear();
assetPaths = QString::fromStdString(currentConfigApp->m_custom_asset_path).split(u','); assetPaths = QString::fromStdString(currentConfigApp->m_custom_asset_path).split(u',');
for (QString& path : assetPaths) {
if (path.startsWith(QDir::separator())) {
path.remove(0, 1);
}
}
m_ui->customAssetPaths->addItems(assetPaths); m_ui->customAssetPaths->addItems(assetPaths);
m_ui->aspectRatioComboBox->setCurrentIndex(currentConfigApp->m_aspect_ratio); m_ui->aspectRatioComboBox->setCurrentIndex(currentConfigApp->m_aspect_ratio);
@ -496,14 +505,15 @@ void CMainDialog::SelectDataPathDialog()
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
); );
QDir data_dir = QDir(data_path); if (!data_path.isEmpty()) {
QDir data_dir = QDir(data_path);
if (data_dir.exists()) { if (data_dir.exists()) {
currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString(); currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString();
data_dir.cd(QString("DATA")); data_dir.cd(QString("DATA"));
data_dir.cd(QString("disk")); data_dir.cd(QString("disk"));
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString(); currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
}
} }
UpdateInterface(); UpdateInterface();
} }
@ -518,11 +528,12 @@ void CMainDialog::SelectSavePathDialog()
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
); );
QDir save_dir = QDir(save_path); if (!save_path.isEmpty()) {
QDir save_dir = QDir(save_path);
if (save_dir.exists()) { if (save_dir.exists()) {
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString(); currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
}
} }
UpdateInterface(); UpdateInterface();
} }
@ -538,13 +549,11 @@ void CMainDialog::DataPathEdited()
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString(); currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
m_modified = true; m_modified = true;
} }
UpdateInterface(); UpdateInterface();
} }
void CMainDialog::SavePathEdited() void CMainDialog::SavePathEdited()
{ {
QDir save_dir = QDir(m_ui->savePath->text()); QDir save_dir = QDir(m_ui->savePath->text());
if (save_dir.exists()) { if (save_dir.exists()) {
@ -584,7 +593,12 @@ void CMainDialog::AFChanged(int value)
void CMainDialog::SelectTexturePathDialog() void CMainDialog::SelectTexturePathDialog()
{ {
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path));
QString texture_path = QString::fromStdString(currentConfigApp->m_texture_path); QString texture_path = QString::fromStdString(currentConfigApp->m_texture_path);
if (texture_path.startsWith(QDir::separator())) {
texture_path.remove(0, 1);
}
texture_path = data_path.absoluteFilePath(texture_path);
texture_path = QFileDialog::getExistingDirectory( texture_path = QFileDialog::getExistingDirectory(
this, this,
tr("Open Directory"), tr("Open Directory"),
@ -592,10 +606,10 @@ void CMainDialog::SelectTexturePathDialog()
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
); );
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path)); if (!texture_path.isEmpty() && data_path.exists(texture_path)) {
texture_path = data_path.relativeFilePath(texture_path);
if (data_path.exists(texture_path)) { texture_path.prepend(QDir::separator());
currentConfigApp->m_texture_path = data_path.relativeFilePath(texture_path).toStdString(); currentConfigApp->m_texture_path = texture_path.toStdString();
m_modified = true; m_modified = true;
} }
UpdateInterface(); UpdateInterface();
@ -606,8 +620,13 @@ void CMainDialog::TexturePathEdited()
QString texture_path = m_ui->texturePath->text(); QString texture_path = m_ui->texturePath->text();
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path)); QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path));
if (data_path.exists(texture_path)) { if (texture_path.startsWith(QDir::separator())) {
currentConfigApp->m_texture_path = data_path.relativeFilePath(texture_path).toStdString(); texture_path.remove(0, 1);
}
if (data_path.exists(data_path.absoluteFilePath(texture_path))) {
texture_path = data_path.relativeFilePath(texture_path);
texture_path.prepend(QDir::separator());
currentConfigApp->m_texture_path = texture_path.toStdString();
m_modified = true; m_modified = true;
} }
UpdateInterface(); UpdateInterface();
@ -622,16 +641,20 @@ void CMainDialog::AddCustomAssetPath()
data_path.absolutePath(), data_path.absolutePath(),
"Interleaf files (*.si)" "Interleaf files (*.si)"
); );
for (QString& item : new_files) { if (!new_files.isEmpty()) {
item = data_path.relativeFilePath(item); for (QString& item : new_files) {
item = data_path.relativeFilePath(item);
}
assetPaths += new_files;
m_modified = true;
} }
assetPaths += new_files;
UpdateAssetPaths(); UpdateAssetPaths();
} }
void CMainDialog::RemoveCustomAssetPath() void CMainDialog::RemoveCustomAssetPath()
{ {
assetPaths.removeAt(m_ui->customAssetPaths->currentRow()); assetPaths.removeAt(m_ui->customAssetPaths->currentRow());
m_modified = true;
UpdateAssetPaths(); UpdateAssetPaths();
} }
@ -653,6 +676,7 @@ void CMainDialog::EditCustomAssetPath()
if (!new_file.isEmpty()) { if (!new_file.isEmpty()) {
new_file = data_path.relativeFilePath(new_file); new_file = data_path.relativeFilePath(new_file);
assetPaths[m_ui->customAssetPaths->currentRow()] = new_file; assetPaths[m_ui->customAssetPaths->currentRow()] = new_file;
m_modified = true;
} }
UpdateAssetPaths(); UpdateAssetPaths();
} }
@ -660,6 +684,12 @@ void CMainDialog::EditCustomAssetPath()
void CMainDialog::UpdateAssetPaths() void CMainDialog::UpdateAssetPaths()
{ {
assetPaths.removeDuplicates(); assetPaths.removeDuplicates();
for (QString& path : assetPaths) {
if (!path.startsWith(QDir::separator())) {
path.prepend(QDir::separator());
}
}
currentConfigApp->m_custom_asset_path = assetPaths.join(u',').toStdString(); currentConfigApp->m_custom_asset_path = assetPaths.join(u',').toStdString();
UpdateInterface(); UpdateInterface();
} }

View File

@ -368,6 +368,7 @@ void CConfigApp::WriteRegisterSettings() const
dictionary* dict = dictionary_new(0); dictionary* dict = dictionary_new(0);
iniparser_set(dict, "isle", NULL); iniparser_set(dict, "isle", NULL);
iniparser_set(dict, "extensions", NULL); iniparser_set(dict, "extensions", NULL);
iniparser_set(dict, "texture loader", NULL);
iniparser_set(dict, "si loader", NULL); iniparser_set(dict, "si loader", NULL);
if (m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device) >= 0) { if (m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device) >= 0) {

View File

@ -14,6 +14,9 @@
<string>About Configure LEGO© Island</string> <string>About Configure LEGO© Island</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
</property>
<item> <item>
<widget class="QLabel" name="houseIcon"> <widget class="QLabel" name="houseIcon">
<property name="sizePolicy"> <property name="sizePolicy">
@ -36,14 +39,14 @@
<item> <item>
<widget class="QLabel" name="configureLabel"> <widget class="QLabel" name="configureLabel">
<property name="text"> <property name="text">
<string>Configure LEGO Island Version 1.0</string> <string>Configure LEGO Island Version 2.0</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="copyrightLabel"> <widget class="QLabel" name="copyrightLabel">
<property name="text"> <property name="text">
<string>Copyright © 1997 mindscape</string> <string>Copyright © 2025</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -53,7 +56,7 @@
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Ok</set> <set>QDialogButtonBox::StandardButton::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -1401,12 +1401,12 @@ SDL_AppResult IsleApp::ParseArguments(int argc, char** argv)
consumed = 1; consumed = 1;
} }
else if (strcmp(argv[i], "--help") == 0) { else if (strcmp(argv[i], "--help") == 0) {
DisplayArgumentHelp(); DisplayArgumentHelp(argv[0]);
return SDL_APP_SUCCESS; return SDL_APP_SUCCESS;
} }
if (consumed <= 0) { if (consumed <= 0) {
SDL_Log("Invalid argument(s): %s", argv[i]); SDL_Log("Invalid argument(s): %s", argv[i]);
DisplayArgumentHelp(); DisplayArgumentHelp(argv[0]);
return SDL_APP_FAILURE; return SDL_APP_FAILURE;
} }
} }
@ -1414,9 +1414,9 @@ SDL_AppResult IsleApp::ParseArguments(int argc, char** argv)
return SDL_APP_CONTINUE; return SDL_APP_CONTINUE;
} }
void IsleApp::DisplayArgumentHelp() void IsleApp::DisplayArgumentHelp(const char* p_execName)
{ {
SDL_Log("Usage: isle [options]"); SDL_Log("Usage: %s [options]", p_execName);
SDL_Log("Options:"); SDL_Log("Options:");
SDL_Log(" --ini <path> Set custom path to .ini config"); SDL_Log(" --ini <path> Set custom path to .ini config");
#ifdef ISLE_DEBUG #ifdef ISLE_DEBUG

View File

@ -99,7 +99,7 @@ class IsleApp {
const CursorBitmap* m_cursorCurrentBitmap; const CursorBitmap* m_cursorCurrentBitmap;
char* m_mediaPath; char* m_mediaPath;
MxFloat m_cursorSensitivity; MxFloat m_cursorSensitivity;
void DisplayArgumentHelp(); void DisplayArgumentHelp(const char* p_execName);
char* m_iniPath; char* m_iniPath;
MxFloat m_maxLod; MxFloat m_maxLod;

View File

@ -68,10 +68,10 @@ class DebugViewer {
static void InsideBuildingManager() static void InsideBuildingManager()
{ {
auto buildingManager = Lego()->GetBuildingManager(); auto buildingManager = Lego()->GetBuildingManager();
ImGui::Text("nextVariant: %d", buildingManager->m_nextVariant); ImGui::Text("nextVariant: %u", buildingManager->m_nextVariant);
ImGui::Text("m_boundariesDetermined: %d", buildingManager->m_boundariesDetermined); ImGui::Text("m_boundariesDetermined: %d", buildingManager->m_boundariesDetermined);
ImGui::Text("m_hideAfterAnimation: %d", buildingManager->m_hideAfterAnimation); ImGui::Text("m_hideAfterAnimation: %d", buildingManager->m_hideAfterAnimation);
ImGui::Text("#Animated Entries", buildingManager->m_numEntries); ImGui::Text("#Animated Entries: %d", buildingManager->m_numEntries);
if (buildingManager->m_numEntries) { if (buildingManager->m_numEntries) {
if (ImGui::BeginTable("Animated Entries", 6, ImGuiTableFlags_Borders)) { if (ImGui::BeginTable("Animated Entries", 6, ImGuiTableFlags_Borders)) {
ImGui::TableSetupColumn("ROI Name"); ImGui::TableSetupColumn("ROI Name");