Removed gNumUserColors.

This commit is contained in:
Leonardo Zide 2021-01-23 10:21:00 -08:00
parent 3553de5a58
commit 99a0011764
4 changed files with 8 additions and 12 deletions

View file

@ -6,7 +6,6 @@
std::vector<lcColor> 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;
}

View file

@ -45,7 +45,6 @@ enum lcInterfaceColor
extern lcVector4 gInterfaceColors[LC_NUM_INTERFACECOLORS];
extern std::vector<lcColor> gColorList;
extern lcColorGroup gColorGroups[LC_NUM_COLORGROUPS];
extern int gNumUserColors;
extern int gEdgeColor;
extern int gDefaultColor;

View file

@ -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]++;
}

View file

@ -50,23 +50,23 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget* Parent, lcPropertiesDialogOpti
const lcPartsList& PartsList = mOptions->PartsList;
QStringList horizontalLabels;
QVector<bool> ColorsUsed(gNumUserColors);
std::vector<bool> ColorsUsed(gColorList.size());
for (const auto& PartIt : PartsList)
for (const auto& ColorIt : PartIt.second)
ColorsUsed[ColorIt.first] = true;
QVector<int> ColorColumns(gNumUserColors);
std::vector<int> 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);
}
}