From f03ddb634efe3bc92c879d669a6e1ddf0a8b8d1c Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 15 Apr 2017 16:25:47 -0700 Subject: [PATCH] Compile fix. --- common/project.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/common/project.cpp b/common/project.cpp index d7bc94c6..4e13d7dd 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -1375,6 +1375,11 @@ void Project::ExportHTML() } } +struct lcColorName +{ + char Name[LC_MAX_COLOR_NAME]; +}; + void Project::ExportPOVRay() { lcArray ModelParts; @@ -1405,7 +1410,7 @@ void Project::ExportPOVRay() lcPiecesLibrary* Library = lcGetPiecesLibrary(); std::map> PieceTable; int NumColors = gColorList.GetSize(); - std::vector ColorTable(NumColors); + std::vector 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 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);