mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Compile fix.
This commit is contained in:
parent
f2be79e4ed
commit
f03ddb634e
1 changed files with 12 additions and 7 deletions
|
@ -1375,6 +1375,11 @@ void Project::ExportHTML()
|
|||
}
|
||||
}
|
||||
|
||||
struct lcColorName
|
||||
{
|
||||
char Name[LC_MAX_COLOR_NAME];
|
||||
};
|
||||
|
||||
void Project::ExportPOVRay()
|
||||
{
|
||||
lcArray<lcModelPartsEntry> ModelParts;
|
||||
|
@ -1405,7 +1410,7 @@ void Project::ExportPOVRay()
|
|||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||
std::map<PieceInfo*, std::pair<char[LC_PIECE_NAME_LEN], int>> PieceTable;
|
||||
int NumColors = gColorList.GetSize();
|
||||
std::vector<char[LC_MAX_COLOR_NAME]> ColorTable(NumColors);
|
||||
std::vector<lcColorName> ColorTable(NumColors);
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -1494,7 +1499,7 @@ void Project::ExportPOVRay()
|
|||
if (Color >= NumColors)
|
||||
continue;
|
||||
|
||||
strcpy(ColorTable[Color], Name);
|
||||
strcpy(ColorTable[Color].Name, Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1552,8 +1557,8 @@ void Project::ExportPOVRay()
|
|||
|
||||
POVFile.WriteLine(Line);
|
||||
|
||||
if (!*ColorTable[ColorIdx])
|
||||
sprintf(ColorTable[ColorIdx], "lc_%s", Color->SafeName);
|
||||
if (!*ColorTable[ColorIdx].Name)
|
||||
sprintf(ColorTable[ColorIdx].Name, "lc_%s", Color->SafeName);
|
||||
}
|
||||
|
||||
POVFile.WriteLine("\n");
|
||||
|
@ -1561,7 +1566,7 @@ void Project::ExportPOVRay()
|
|||
lcArray<const char*> ColorTablePointer;
|
||||
ColorTablePointer.SetSize(NumColors);
|
||||
for (int ColorIdx = 0; ColorIdx < NumColors; ColorIdx++)
|
||||
ColorTablePointer[ColorIdx] = ColorTable[ColorIdx];
|
||||
ColorTablePointer[ColorIdx] = ColorTable[ColorIdx].Name;
|
||||
|
||||
for (int PartIdx = 0; PartIdx < ModelParts.GetSize(); PartIdx++)
|
||||
{
|
||||
|
@ -1617,13 +1622,13 @@ void Project::ExportPOVRay()
|
|||
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"
|
||||
" 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].Name, Entry.first, ColorTable[Color].Name,
|
||||
-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
|
||||
{
|
||||
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].Name, -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);
|
||||
|
|
Loading…
Reference in a new issue