diff options
| author | Max Horn | 2003-05-19 11:34:13 +0000 | 
|---|---|---|
| committer | Max Horn | 2003-05-19 11:34:13 +0000 | 
| commit | ec4cc7d774450b1877b18b2e13a6ff7e8f19d25d (patch) | |
| tree | e0d9b2ac04824bbf07149cf16d6fa4f4edcf29a4 /scumm | |
| parent | 18a6b5dcc1215902ccd9313f2a0a827e27107061 (diff) | |
| download | scummvm-rg350-ec4cc7d774450b1877b18b2e13a6ff7e8f19d25d.tar.gz scummvm-rg350-ec4cc7d774450b1877b18b2e13a6ff7e8f19d25d.tar.bz2 scummvm-rg350-ec4cc7d774450b1877b18b2e13a6ff7e8f19d25d.zip | |
more special palette fixes by erik
svn-id: r7689
Diffstat (limited to 'scumm')
| -rw-r--r-- | scumm/gfx.cpp | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 2eb037ea5a..3d154a851d 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -3104,11 +3104,18 @@ void Scumm::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 gre  		int g = (int) (*curPtr++ * greenScale) >> 8;  		int b = (int) (*curPtr++ * blueScale) >> 8; +		if (r > 255) +			r = 255; +		if (g > 255) +			g = 255; +		if (b > 255) +			b = 255; +  		searchPtr = palPtr + from * 3; -		bestResult = 32000; +		bestResult = (uint)-1;  		currentIndex = (byte) from; -		for (j = from; j < to; j++) { +		for (j = from; j <= to; j++) {  			int ar = (*searchPtr++);  			int ag = (*searchPtr++);  			int ab = (*searchPtr++); | 
