diff --git a/common/lc_colors.cpp b/common/lc_colors.cpp index 74606d38..e5baeafa 100644 --- a/common/lc_colors.cpp +++ b/common/lc_colors.cpp @@ -6,7 +6,6 @@ std::vector gColorList; lcColorGroup gColorGroups[LC_NUM_COLORGROUPS]; -int gNumUserColors; int gEdgeColor; int gDefaultColor; @@ -486,8 +485,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle) gEdgeColor = ColorIndex; } - gNumUserColors = (int)Colors.size() - 2; - return Valid; } diff --git a/common/lc_colors.h b/common/lc_colors.h index 8d74e40e..735cbd50 100644 --- a/common/lc_colors.h +++ b/common/lc_colors.h @@ -45,7 +45,6 @@ enum lcInterfaceColor extern lcVector4 gInterfaceColors[LC_NUM_INTERFACECOLORS]; extern std::vector gColorList; extern lcColorGroup gColorGroups[LC_NUM_COLORGROUPS]; -extern int gNumUserColors; extern int gEdgeColor; extern int gDefaultColor; diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp index 85e8ca44..f08c6f54 100644 --- a/common/pieceinf.cpp +++ b/common/pieceinf.cpp @@ -324,7 +324,7 @@ void PieceInfo::GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool Add if (ScanSubModels) mModel->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList); - if (AddSubModels && DefaultColorIndex < gNumUserColors) + if (AddSubModels) PartsList[this][DefaultColorIndex]++; } else if (IsProject()) @@ -333,7 +333,7 @@ void PieceInfo::GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool Add if (Model) Model->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList); } - else if (DefaultColorIndex < gNumUserColors) + else PartsList[this][DefaultColorIndex]++; } diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp index 6d23f682..9bae246e 100644 --- a/qt/lc_qpropertiesdialog.cpp +++ b/qt/lc_qpropertiesdialog.cpp @@ -50,23 +50,23 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget* Parent, lcPropertiesDialogOpti const lcPartsList& PartsList = mOptions->PartsList; QStringList horizontalLabels; - QVector ColorsUsed(gNumUserColors); + std::vector ColorsUsed(gColorList.size()); for (const auto& PartIt : PartsList) for (const auto& ColorIt : PartIt.second) ColorsUsed[ColorIt.first] = true; - QVector ColorColumns(gNumUserColors); + std::vector ColorColumns(gColorList.size()); int NumColors = 0; horizontalLabels.append(tr("Part")); - for (int colorIdx = 0; colorIdx < gNumUserColors; colorIdx++) + for (size_t ColorIndex = 0; ColorIndex < gColorList.size(); ColorIndex++) { - if (ColorsUsed[colorIdx]) + if (ColorsUsed[ColorIndex]) { - ColorColumns[colorIdx] = NumColors++; - horizontalLabels.append(gColorList[colorIdx].Name); + ColorColumns[ColorIndex] = NumColors++; + horizontalLabels.append(gColorList[ColorIndex].Name); } }