diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 47b9eaec..fb400ea4 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -2080,15 +2080,6 @@ lcMesh* lcPiecesLibrary::GetLoadingMesh() const return mLoadingMesh.get(); } -void lcPiecesLibrary::UnloadUnusedParts() -{ - for (lcPieceData* PieceData : mPieceManager->GetLibraryPieceData()) - { - if (PieceData->GetRefCount() == 0 && PieceData->mState != lcAssetState::Unloaded) - ReleasePieceData(PieceData); - } -} - void lcPiecesLibrary::AddTextureReference(lcTexture* Texture) { mTextureManager->AddTextureReference(Texture); @@ -2099,11 +2090,6 @@ void lcPiecesLibrary::ReleaseTexture(lcTexture* Texture) mTextureManager->ReleaseTexture(Texture); } -bool lcPiecesLibrary::SupportsStudStyle() const -{ - return true; -} - void lcPiecesLibrary::UpdateStudStyleAndColors(lcStudStyle StudStyle, bool StudCylinderColorEnabled) { Q_ASSERT(QThread::currentThread() == thread()); diff --git a/common/lc_library.h b/common/lc_library.h index 6deeb642..dbbd0fc9 100644 --- a/common/lc_library.h +++ b/common/lc_library.h @@ -160,8 +160,6 @@ public: // Reloads the configured colors and updates the loading mesh. void LoadColors(); - bool SupportsStudStyle() const; - lcStudStyle GetStudStyle() const { return mStudStyle; @@ -304,9 +302,6 @@ public: return { mVertexBuffer, mIndexBuffer }; } - // Checks unused library parts under the existing zero-reference release policy. - void UnloadUnusedParts(); - // Returns the borrowed placeholder mesh for pending or failed piece geometry. lcMesh* GetLoadingMesh() const; diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index fc2f3858..1ea2129d 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -2595,7 +2595,6 @@ void lcMainWindow::NewProject() Project* NewProject = new Project(); gApplication->SetProject(NewProject); - lcGetPiecesLibrary()->UnloadUnusedParts(); } bool lcMainWindow::OpenProject(const QString& FileName) diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 6564e301..0d31d11c 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -1052,7 +1052,6 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project) mCurrentStep = CurrentStep; CalculateStep(mCurrentStep); - Library->UnloadUnusedParts(); delete Piece; delete Camera; @@ -1299,7 +1298,6 @@ bool lcModel::LoadBinary(lcFile* file) } CalculateStep(mCurrentStep); - lcGetPiecesLibrary()->UnloadUnusedParts(); return true; } @@ -1322,9 +1320,7 @@ bool lcModel::LoadLDD(const QString& FileData) Piece->SetGroup(NewGroup); } - lcPiecesLibrary* Library = lcGetPiecesLibrary(); CalculateStep(mCurrentStep); - Library->UnloadUnusedParts(); return true; } @@ -1361,8 +1357,6 @@ bool lcModel::LoadInventory(const std::vector& SetInventory) if (!Library->WaitForPieceData(RequiredPieceData)) return false; - Library->UnloadUnusedParts(); - auto RoundBounds = [](float& Value) { Value = ((Value < 0.0f) ? floor((Value - 5.0f) / 10.0f) : ceil((Value + 5.0f) / 10.0f)) * 10.0f; diff --git a/common/lc_previewwidget.cpp b/common/lc_previewwidget.cpp index 894b267d..7f893894 100644 --- a/common/lc_previewwidget.cpp +++ b/common/lc_previewwidget.cpp @@ -336,7 +336,6 @@ void lcPreview::ClearPreview() lcPiecesLibrary* Library = lcGetPiecesLibrary(); Library->RemoveTemporaryPieceData(); - Library->UnloadUnusedParts(); Redraw(); } diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 955845b3..2a086526 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -236,9 +236,6 @@ lcPreferencesDialog::lcPreferencesDialog(QWidget* Parent, lcPreferencesDialogOpt else ui->PreviewViewSphereSizeCombo->setCurrentIndex(0); - if (!lcGetPiecesLibrary()->SupportsStudStyle()) - ui->studStyleCombo->setEnabled(false); - ui->studStyleCombo->setCurrentIndex(static_cast(mOptions->StudStyle)); ui->ShadingMode->setCurrentIndex(static_cast(mOptions->Preferences.mShadingMode));