scaling color values so that they have the right intensity

This commit is contained in:
markt 2007-01-02 06:31:23 +00:00
parent 590b6c93d9
commit aeac1b3344
2 changed files with 9 additions and 9 deletions

View file

@ -148,9 +148,9 @@ void Color::copy(const Color &col_copy) {
return;
}
allocate(col_copy.red()*0xFF,
col_copy.green()*0xFF,
col_copy.blue()*0xFF,
allocate(col_copy.red()*0x101,
col_copy.green()*0x101,
col_copy.blue()*0x101,
col_copy.m_screen);
}

View file

@ -118,15 +118,15 @@ void Texture::calcHiLoColors(int screen_num) {
xcol.red = (unsigned int) (m_color.red() +
(m_color.red() >> 1));
if (xcol.red >= 0xff) xcol.red = 0xffff;
else xcol.red *= 0xff;
else xcol.red *= 0x101;
xcol.green = (unsigned int) (m_color.green() +
(m_color.green() >> 1));
if (xcol.green >= 0xff) xcol.green = 0xffff;
else xcol.green *= 0xff;
else xcol.green *= 0x101;
xcol.blue = (unsigned int) (m_color.blue() +
(m_color.blue() >> 1));
if (xcol.blue >= 0xff) xcol.blue = 0xffff;
else xcol.blue *= 0xff;
else xcol.blue *= 0x101;
if (! XAllocColor(disp, colm, &xcol))
xcol.pixel = 0;
@ -135,13 +135,13 @@ void Texture::calcHiLoColors(int screen_num) {
xcol.red =
(unsigned int) ((m_color.red() >> 2) +
(m_color.red() >> 1)) * 0xff;
(m_color.red() >> 1)) * 0x101;
xcol.green =
(unsigned int) ((m_color.green() >> 2) +
(m_color.green() >> 1)) * 0xff;
(m_color.green() >> 1)) * 0x101;
xcol.blue =
(unsigned int) ((m_color.blue() >> 2) +
(m_color.blue() >> 1)) * 0xff;
(m_color.blue() >> 1)) * 0x101;
if (! XAllocColor(disp, colm, &xcol))
xcol.pixel = 0;