70 for (
int j = 0; j < 6; j++)
122 if (
this == &colorParameterSet)
154 const int nIndex = (int) color;
158 printf(
"error: tried to assign color '%i' with enum out of range (m_nColors = %i)\n", nIndex,
m_nColors);
172 const int nIndex = (int) color;
176 printf(
"error: tried to retrieve color '%i' with enum out of range (m_nColors = %i)\n", nIndex,
m_nColors);
185 if (strcmp(pColorName,
"skin") == 0)
return eSkin;
186 else if (strcmp(pColorName,
"yellow") == 0)
return eYellow;
187 else if (strcmp(pColorName,
"yellow2") == 0)
return eYellow2;
188 else if (strcmp(pColorName,
"yellow3") == 0)
return eYellow3;
189 else if (strcmp(pColorName,
"orange") == 0)
return eOrange;
190 else if (strcmp(pColorName,
"orange2") == 0)
return eOrange2;
191 else if (strcmp(pColorName,
"orange3") == 0)
return eOrange3;
192 else if (strcmp(pColorName,
"red") == 0)
return eRed;
193 else if (strcmp(pColorName,
"red2") == 0)
return eRed2;
194 else if (strcmp(pColorName,
"red3") == 0)
return eRed3;
195 else if (strcmp(pColorName,
"blue") == 0)
return eBlue;
196 else if (strcmp(pColorName,
"blue2") == 0)
return eBlue2;
197 else if (strcmp(pColorName,
"blue3") == 0)
return eBlue3;
198 else if (strcmp(pColorName,
"green") == 0)
return eGreen;
199 else if (strcmp(pColorName,
"green2") == 0)
return eGreen2;
200 else if (strcmp(pColorName,
"green3") == 0)
return eGreen3;
201 else if (strcmp(pColorName,
"white") == 0)
return eWhite;
202 else if (strcmp(pColorName,
"none") == 0)
return eNone;
203 else if (strcmp(pColorName,
"colored") == 0)
return eColored;
211 case eSkin: sName =
"skin";
break;
212 case eYellow: sName =
"yellow";
break;
213 case eYellow2: sName =
"yellow2";
break;
214 case eYellow3: sName =
"yellow3";
break;
215 case eOrange: sName =
"orange";
break;
216 case eOrange2: sName =
"orange2";
break;
217 case eOrange3: sName =
"orange3";
break;
218 case eRed: sName =
"red";
break;
219 case eRed2: sName =
"red2";
break;
220 case eRed3: sName =
"red3";
break;
221 case eBlue: sName =
"blue";
break;
222 case eBlue2: sName =
"blue2";
break;
223 case eBlue3: sName =
"blue3";
break;
224 case eGreen: sName =
"green";
break;
225 case eGreen2: sName =
"green2";
break;
226 case eGreen3: sName =
"green3";
break;
227 case eWhite: sName =
"white";
break;
228 case eNone: sName =
"none";
break;
229 case eColored: sName =
"colored";
break;
230 default: sName =
""; printf(
"error: (internal error) color %i not handled\n", (
int) color);
break;
237 FILE *f = fopen(pFileName,
"r");
242 int par1, par2, par3, par4, par5, par6;
247 if (fscanf(f,
"%s%i%i%i%i%i%i", colorName, &par1, &par2, &par3, &par4, &par5, &par6) == EOF)
254 printf(
"error: color name '%s' is not handled\n", colorName);
258 const int nIndex = (int) color;
260 pp[nIndex][0] = par1;
261 pp[nIndex][1] = par2;
262 pp[nIndex][2] = par3;
263 pp[nIndex][3] = par4;
264 pp[nIndex][4] = par5;
265 pp[nIndex][5] = par6;
276 FILE *f = fopen(pFileName,
"w");
287 fprintf(f,
"%s %i %i %i %i %i %i\n", sName.c_str(), pp[
c][0], pp[
c][1], pp[
c][2], pp[
c][3], pp[
c][4], pp[
c][5]);
const int * GetColorParameters(ObjectColor color) const
bool SaveToFile(const char *pFileName)
void SetColorParameters(ObjectColor color, int par1, int par2, int par3, int par4, int par5, int par6)
GLsizei const GLchar ** string
bool LoadFromFile(const char *pFileName)
CColorParameterSet & operator=(const CColorParameterSet &colorParameterSet)
static ObjectColor Translate(const char *pColorName)