From 04f73a968740a04b2e2137bb19137a0e39ece4eb Mon Sep 17 00:00:00 2001 From: Lioncache Date: Mon, 8 Dec 2025 17:58:06 -0500 Subject: [PATCH] Externals: Update LibCommon Fixes a bug in string splitting that broke the texture selection dialogs in the model editor. They should now populate properly and let you change textures if you want to do a little modding or something of the sort. It also exposed a bug where we had a stack overflow case that was never hit until now. IsValidDirectoryPath() was intended to be calling IsValidDirectoryName() on the consitituent parts of the path, but was calling into itself. The only reason this was never hit in practice is because the bugged Split() function would keep discarding the end character in the strings recursively over the course of execution until the strings were completely empty (oof!). It also turns out that the handler for the indirect texture handling was never hooked up to a slot in the model window. So, not only could the model never have it's indirect texture changed, but would never render it either, since the respective material would never be set. We essentially smoked 3 bugs with a one-liner at the same time. --- externals/LibCommon | 2 +- src/Core/GameProject/CVirtualDirectory.cpp | 2 +- src/Editor/ModelEditor/CModelEditorWindow.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/externals/LibCommon b/externals/LibCommon index 6399dbe9..4ff3ada3 160000 --- a/externals/LibCommon +++ b/externals/LibCommon @@ -1 +1 @@ -Subproject commit 6399dbe932c631d0f9e409de05b1f3bd77a5ed1e +Subproject commit 4ff3ada3457ec8d62f997d042a6008edabe5e212 diff --git a/src/Core/GameProject/CVirtualDirectory.cpp b/src/Core/GameProject/CVirtualDirectory.cpp index ec519b62..b35bfed3 100644 --- a/src/Core/GameProject/CVirtualDirectory.cpp +++ b/src/Core/GameProject/CVirtualDirectory.cpp @@ -414,5 +414,5 @@ bool CVirtualDirectory::IsValidDirectoryPath(TString Path) Path = Path.ChopBack(1); const TStringList Parts = Path.Split("/\\", true); - return std::all_of(Parts.cbegin(), Parts.cend(), IsValidDirectoryPath); + return std::all_of(Parts.cbegin(), Parts.cend(), IsValidDirectoryName); } diff --git a/src/Editor/ModelEditor/CModelEditorWindow.cpp b/src/Editor/ModelEditor/CModelEditorWindow.cpp index 90ae38a3..f1a6e5e3 100644 --- a/src/Editor/ModelEditor/CModelEditorWindow.cpp +++ b/src/Editor/ModelEditor/CModelEditorWindow.cpp @@ -118,6 +118,7 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent) connect(ui->TevKAlphaSelComboBox, &QComboBox::currentIndexChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); connect(ui->TevRasSelComboBox, &QComboBox::currentIndexChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); connect(ui->TexCoordSrcComboBox, &QComboBox::currentIndexChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); + connect(ui->IndTextureResSelector, &CResourceSelector::ResourceChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); connect(ui->PassTextureResSelector, &CResourceSelector::ResourceChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); connect(ui->TevColor1ComboBox, &QComboBox::currentIndexChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial)); connect(ui->TevColor2ComboBox, &QComboBox::currentIndexChanged, this, qOverload(&CModelEditorWindow::UpdateMaterial));