mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 15:37:55 -05:00
Implement a few LegoBackgroundColor functions (#694)
* Update legobackgroundcolor.cpp * Update legobackgroundcolor.cpp * minor style * minor style --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
e454e56b52
commit
fd1b371864
1 changed files with 39 additions and 5 deletions
|
@ -67,16 +67,50 @@ void LegoBackgroundColor::SetValue(const char* p_colorString)
|
|||
delete[] colorStringCopy;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003c230
|
||||
void LegoBackgroundColor::ToggleDayNight(MxBool)
|
||||
// FUNCTION: LEGO1 0x1003c230
|
||||
void LegoBackgroundColor::ToggleDayNight(MxBool p_sun)
|
||||
{
|
||||
// TODO
|
||||
char buffer[30];
|
||||
|
||||
if (p_sun) {
|
||||
m_s += 0.1;
|
||||
if (m_s > 0.9) {
|
||||
m_s = 1.0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_s -= 0.1;
|
||||
if (m_s < 0.1) {
|
||||
m_s = 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buffer, "set %d %d %d", (MxU32) (m_h * 100.0f), (MxU32) (m_s * 100.0f), (MxU32) (m_v * 100.0f));
|
||||
m_value = buffer;
|
||||
|
||||
float convertedR, convertedG, convertedB;
|
||||
ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
|
||||
VideoManager()->SetSkyColor(convertedR, convertedG, convertedB);
|
||||
SetLights(convertedR, convertedG, convertedB);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003c330
|
||||
// FUNCTION: LEGO1 0x1003c330
|
||||
void LegoBackgroundColor::ToggleSkyColor()
|
||||
{
|
||||
// TODO
|
||||
char buffer[30];
|
||||
|
||||
m_h += 0.05;
|
||||
if (m_h > 1.0) {
|
||||
m_h -= 1.0;
|
||||
}
|
||||
|
||||
sprintf(buffer, "set %d %d %d", (MxU32) (m_h * 100.0f), (MxU32) (m_s * 100.0f), (MxU32) (m_v * 100.0f));
|
||||
m_value = buffer;
|
||||
|
||||
float convertedR, convertedG, convertedB;
|
||||
ConvertHSVToRGB(m_h, m_s, m_v, &convertedR, &convertedG, &convertedB);
|
||||
VideoManager()->SetSkyColor(convertedR, convertedG, convertedB);
|
||||
SetLights(convertedR, convertedG, convertedB);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003c400
|
||||
|
|
Loading…
Reference in a new issue