- Fixed: The yellow color range contained gaps in its definition which

resulted in incorrect colors.
- Fixed: FFont::BuildTranslations didn't clamp the RGB color values. This
  can happen if some font colors overflow or underflow due to incomplete
  range specifications.


SVN r358 (trunk)
This commit is contained in:
Christoph Oelckers 2006-10-21 09:01:45 +00:00
commit fb5f4a132b
3 changed files with 11 additions and 1 deletions

View file

@ -578,6 +578,9 @@ void FFont::BuildTranslations (const double *luminosity, const BYTE *identity, c
int r = ((parms->Start[0] << 8) + rangev * (parms->End[0] - parms->Start[0])) >> 8; // red
int g = ((parms->Start[1] << 8) + rangev * (parms->End[1] - parms->Start[1])) >> 8; // green
int b = ((parms->Start[2] << 8) + rangev * (parms->End[2] - parms->Start[2])) >> 8; // blue
r=clamp(r, 0, 255);
g=clamp(g, 0, 255);
b=clamp(b, 0, 255);
*range++ = ColorMatcher.Pick (r, g, b);
}