mirror of
https://github.com/leozide/leocad
synced 2025-02-06 08:46:06 +01:00
Fixed compiler error in some gcc versions.
This commit is contained in:
parent
8fed7534ff
commit
5dd0a9a203
1 changed files with 7 additions and 7 deletions
|
@ -1953,7 +1953,7 @@ bool Project::ExportPOVRay(const QString& FileName)
|
||||||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||||
std::map<PieceInfo*, std::pair<char[LC_PIECE_NAME_LEN], int>> PieceTable;
|
std::map<PieceInfo*, std::pair<char[LC_PIECE_NAME_LEN], int>> PieceTable;
|
||||||
int NumColors = gColorList.GetSize();
|
int NumColors = gColorList.GetSize();
|
||||||
std::vector<char[LC_MAX_COLOR_NAME]> ColorTable(NumColors);
|
std::vector<std::array<char, LC_MAX_COLOR_NAME>> ColorTable(NumColors);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -2046,7 +2046,7 @@ bool Project::ExportPOVRay(const QString& FileName)
|
||||||
if (Color >= NumColors)
|
if (Color >= NumColors)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
strcpy(ColorTable[Color], Name);
|
strcpy(ColorTable[Color].data(), Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2104,8 +2104,8 @@ bool Project::ExportPOVRay(const QString& FileName)
|
||||||
|
|
||||||
POVFile.WriteLine(Line);
|
POVFile.WriteLine(Line);
|
||||||
|
|
||||||
if (!*ColorTable[ColorIdx])
|
if (!ColorTable[ColorIdx][0])
|
||||||
sprintf(ColorTable[ColorIdx], "lc_%s", Color->SafeName);
|
sprintf(ColorTable[ColorIdx].data(), "lc_%s", Color->SafeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
POVFile.WriteLine("\n");
|
POVFile.WriteLine("\n");
|
||||||
|
@ -2113,7 +2113,7 @@ bool Project::ExportPOVRay(const QString& FileName)
|
||||||
lcArray<const char*> ColorTablePointer;
|
lcArray<const char*> ColorTablePointer;
|
||||||
ColorTablePointer.SetSize(NumColors);
|
ColorTablePointer.SetSize(NumColors);
|
||||||
for (int ColorIdx = 0; ColorIdx < NumColors; ColorIdx++)
|
for (int ColorIdx = 0; ColorIdx < NumColors; ColorIdx++)
|
||||||
ColorTablePointer[ColorIdx] = ColorTable[ColorIdx];
|
ColorTablePointer[ColorIdx] = ColorTable[ColorIdx].data();
|
||||||
|
|
||||||
for (int PartIdx = 0; PartIdx < ModelParts.GetSize(); PartIdx++)
|
for (int PartIdx = 0; PartIdx < ModelParts.GetSize(); PartIdx++)
|
||||||
{
|
{
|
||||||
|
@ -2171,13 +2171,13 @@ bool Project::ExportPOVRay(const QString& FileName)
|
||||||
sprintf(Line, "merge {\n object {\n %s%s\n texture { %s }\n }\n"
|
sprintf(Line, "merge {\n object {\n %s%s\n texture { %s }\n }\n"
|
||||||
" object {\n %s_slope\n texture { %s normal { bumps 0.3 scale 0.02 } }\n }\n"
|
" object {\n %s_slope\n texture { %s normal { bumps 0.3 scale 0.02 } }\n }\n"
|
||||||
" matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
" matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
||||||
Entry.first, Suffix, ColorTable[Color], Entry.first, ColorTable[Color],
|
Entry.first, Suffix, ColorTable[Color].data(), Entry.first, ColorTable[Color].data(),
|
||||||
-f[5], -f[4], -f[6], -f[1], -f[0], -f[2], f[9], f[8], f[10], f[13] / 25.0f, f[12] / 25.0f, f[14] / 25.0f);
|
-f[5], -f[4], -f[6], -f[1], -f[0], -f[2], f[9], f[8], f[10], f[13] / 25.0f, f[12] / 25.0f, f[14] / 25.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(Line, "object {\n %s%s\n texture { %s }\n matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
sprintf(Line, "object {\n %s%s\n texture { %s }\n matrix <%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f>\n}\n",
|
||||||
Entry.first, Suffix, ColorTable[Color], -f[5], -f[4], -f[6], -f[1], -f[0], -f[2], f[9], f[8], f[10], f[13] / 25.0f, f[12] / 25.0f, f[14] / 25.0f);
|
Entry.first, Suffix, ColorTable[Color].data(), -f[5], -f[4], -f[6], -f[1], -f[0], -f[2], f[9], f[8], f[10], f[13] / 25.0f, f[12] / 25.0f, f[14] / 25.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
POVFile.WriteLine(Line);
|
POVFile.WriteLine(Line);
|
||||||
|
|
Loading…
Add table
Reference in a new issue