Fixed arithmetic overflow in palette generator; some basic fixes related to recent update of the Draw package.

git-svn-id: svn://ultimatepp.org/upp/trunk@1371 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
rylek 2009-07-06 20:09:12 +00:00
parent a438f12393
commit 7ae5221acb
7 changed files with 129 additions and 125 deletions

View file

@ -182,7 +182,7 @@ void sPalMaker::Update(Box& x, int ii)
static byte sRc(int avg, int pop, int div)
{
return Saturate255(255 * (avg + (pop >> 1)) / pop / (div - 1));
return Saturate255(iscale(avg + (pop >> 1), 255, pop * (div - 1)));
}
sPalMaker::sPalMaker(Raster& raster, RGBA *palette, int ncolors)