From 7f5ab0df7feed82053f87edc4fd021d9f105f460 Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Mon, 3 Oct 2022 07:42:24 -0700 Subject: [PATCH 1/4] Fixed selection crashing when brick is removed due to physics --- Dialogs.rc | 10 +++++++++- Manifest.xml | 17 +++++++++++++++++ src/source/Application.cpp | 15 ++++++++++++++- src/source/Globals.cpp | 4 ---- src/source/PropertyWindow.cpp | 2 +- 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/Dialogs.rc b/Dialogs.rc index 2f4904e..2f06970 100644 --- a/Dialogs.rc +++ b/Dialogs.rc @@ -40,4 +40,12 @@ FONT 8, "Ms Shell Dlg" // Icon resources // LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN -IDI_ICON1 ICON "FatB3dIcon.ico" \ No newline at end of file +IDI_ICON1 ICON "FatB3dIcon.ico" + + + +// +// Manifest resources +// +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +2 RT_MANIFEST ".\\manifest.xml" diff --git a/Manifest.xml b/Manifest.xml index e69de29..618fb8e 100644 --- a/Manifest.xml +++ b/Manifest.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/source/Application.cpp b/src/source/Application.cpp index 19f0706..2a9de34 100644 --- a/src/source/Application.cpp +++ b/src/source/Application.cpp @@ -175,7 +175,7 @@ void Application::deleteInstance() } } if(g_selectedInstances.size() == 0) - g_usableApp->_propWindow->ClearProperties(); + g_usableApp->_propWindow->UpdateSelected(g_dataModel); } @@ -331,12 +331,25 @@ void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) { else _dataModel->getEngine()->createBody(partInstance); } + bool a = false; while(toDelete.size() > 0) { PartInstance * p = toDelete.back(); toDelete.pop_back(); + if(std::find(g_selectedInstances.begin(), g_selectedInstances.end(), p) != g_selectedInstances.end()) + { + g_selectedInstances.erase(std::remove(g_selectedInstances.begin(), g_selectedInstances.end(), p), g_selectedInstances.end()); + a = true; + } p->setParent(NULL); delete p; + } + if(a) + { + if(g_selectedInstances.size() == 0) + g_usableApp->_propWindow->UpdateSelected(g_dataModel); + else if(g_selectedInstances.size() == 1) + g_usableApp->_propWindow->UpdateSelected(g_selectedInstances[0]); } for(int i = 0; i < 6; i++) { diff --git a/src/source/Globals.cpp b/src/source/Globals.cpp index fab75c8..ce771d7 100644 --- a/src/source/Globals.cpp +++ b/src/source/Globals.cpp @@ -1,10 +1,6 @@ #include "Globals.h" #include "Application.h" -int const Globals::gen = 0; -int const Globals::major = 0; -int const Globals::minor = 105; -int const Globals::patch = 0; int Globals::surfaceId = 2; //bool Globals::showMouse = true; bool Globals::useMousePoint = false; diff --git a/src/source/PropertyWindow.cpp b/src/source/PropertyWindow.cpp index 39e67a8..bf72075 100644 --- a/src/source/PropertyWindow.cpp +++ b/src/source/PropertyWindow.cpp @@ -342,7 +342,7 @@ void PropertyWindow::UpdateSelected(Instance * instance) { PropGrid_ResetContent(_propGrid); prop = instance->getProperties(); - if (selectedInstance != instance) + //if (selectedInstance != instance) { selectedInstance = instance; for(size_t i = 0; i < prop.size(); i++) From eb07d852dbce4678a30a53447895adda55361e3c Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Mon, 3 Oct 2022 07:46:09 -0700 Subject: [PATCH 2/4] Add Manifest --- Blocks3D.vcproj | 4 ++++ Manifest.xml | 34 ++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Blocks3D.vcproj b/Blocks3D.vcproj index 806210b..f64c0c6 100644 --- a/Blocks3D.vcproj +++ b/Blocks3D.vcproj @@ -906,6 +906,10 @@ RelativePath=".\icon1.ico" > + + diff --git a/Manifest.xml b/Manifest.xml index 618fb8e..415eb6a 100644 --- a/Manifest.xml +++ b/Manifest.xml @@ -1,17 +1,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file From 43647086fb168e8476507dd9c33c2ae243b3a867 Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Mon, 3 Oct 2022 07:48:28 -0700 Subject: [PATCH 3/4] Fix duplication crash --- src/source/DataModelV2/PartInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/source/DataModelV2/PartInstance.cpp b/src/source/DataModelV2/PartInstance.cpp index 20b619f..f9a8210 100644 --- a/src/source/DataModelV2/PartInstance.cpp +++ b/src/source/DataModelV2/PartInstance.cpp @@ -144,6 +144,7 @@ void PartInstance::setParent(Instance* prnt) PartInstance::PartInstance(const PartInstance &oinst) { PVInstance::PVInstance(oinst); + physBody = NULL; glList = glGenLists(1); //name = oinst.name; //className = "Part"; From ad29d96068dd118aabdd5a4e88310d33e255fce3 Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Mon, 3 Oct 2022 07:57:11 -0700 Subject: [PATCH 4/4] Fix manifest file --- Blocks3D.vcproj | 10 +++++----- Dialogs.rc | 2 +- Manifest.xml | 23 ----------------------- 3 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 Manifest.xml diff --git a/Blocks3D.vcproj b/Blocks3D.vcproj index f64c0c6..f817c56 100644 --- a/Blocks3D.vcproj +++ b/Blocks3D.vcproj @@ -718,7 +718,7 @@ > + + @@ -906,10 +910,6 @@ RelativePath=".\icon1.ico" > - - diff --git a/Dialogs.rc b/Dialogs.rc index 2f06970..882bd1c 100644 --- a/Dialogs.rc +++ b/Dialogs.rc @@ -48,4 +48,4 @@ IDI_ICON1 ICON "FatB3dIcon.ico" // Manifest resources // LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -2 RT_MANIFEST ".\\manifest.xml" +1 RT_MANIFEST ".\\Blocks3D.exe.manifest" diff --git a/Manifest.xml b/Manifest.xml deleted file mode 100644 index 415eb6a..0000000 --- a/Manifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file