mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
(Proposal) Introduction of naming convention checker (ncc) (#322)
* Add ncc tool * Add symlink * Fixes * Try this * Try this * Try this * Try this * Add include path * Update style * Update style * Add more rules * Fix style * Update styles * Fix name parameter * Fix MxParam p * Fix m_unk0x pattern * Allow 4 digits for relative hex * Add missing offset * Fix some parameters * Fix some vtables * Fix more vtables * Update rules, fixes * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * Fix last issue * Update readme * Update readme * Update CONTRIBUTING.md * Fix annotations * Rename * Update CONTRIBUTING.md * Update README.md
This commit is contained in:
committed by
GitHub
parent
3b155bfe38
commit
bc5ca621a4
@@ -29,27 +29,27 @@ void LegoBackgroundColor::SetValue(const char* p_colorString)
|
||||
if (!videomanager || !p_colorString)
|
||||
return;
|
||||
|
||||
float converted_r, converted_g, converted_b;
|
||||
float convertedR, convertedG, convertedB;
|
||||
char* colorStringCopy = strcpy(new char[strlen(p_colorString) + 1], p_colorString);
|
||||
char* colorStringSplit = strtok(colorStringCopy, g_delimiter);
|
||||
|
||||
if (!strcmp(colorStringSplit, g_set)) {
|
||||
colorStringSplit = strtok(0, g_delimiter);
|
||||
if (colorStringSplit)
|
||||
h = (float) (atoi(colorStringSplit) * 0.01);
|
||||
m_h = (float) (atoi(colorStringSplit) * 0.01);
|
||||
colorStringSplit = strtok(0, g_delimiter);
|
||||
if (colorStringSplit)
|
||||
s = (float) (atoi(colorStringSplit) * 0.01);
|
||||
m_s = (float) (atoi(colorStringSplit) * 0.01);
|
||||
colorStringSplit = strtok(0, g_delimiter);
|
||||
if (colorStringSplit)
|
||||
v = (float) (atoi(colorStringSplit) * 0.01);
|
||||
m_v = (float) (atoi(colorStringSplit) * 0.01);
|
||||
|
||||
ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b);
|
||||
videomanager->SetSkyColor(converted_r, converted_g, converted_b);
|
||||
ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
|
||||
videomanager->SetSkyColor(convertedR, convertedG, convertedB);
|
||||
}
|
||||
else if (!strcmp(colorStringSplit, g_reset)) {
|
||||
ConvertHSVToRGB(this->h, this->s, this->v, &converted_r, &converted_g, &converted_b);
|
||||
videomanager->SetSkyColor(converted_r, converted_g, converted_b);
|
||||
ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
|
||||
videomanager->SetSkyColor(convertedR, convertedG, convertedB);
|
||||
}
|
||||
|
||||
delete[] colorStringCopy;
|
||||
|
||||
Reference in New Issue
Block a user