dos3d

changeset 6:7f12c7d084d5

fixed a small error in palman
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 Nov 2011 12:11:41 +0200
parents c8ffdbc6139e
children 3239511d1a76
files src/palman.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/src/palman.c	Mon Nov 21 12:00:13 2011 +0200
     1.2 +++ b/src/palman.c	Mon Nov 21 12:11:41 2011 +0200
     1.3 @@ -71,13 +71,13 @@
     1.4  	pcol = 0;
     1.5  
     1.6  	for(i=0; i<ncol; i++) {
     1.7 -		unsigned int r, g, b, dr, dg, db;
     1.8 +		unsigned short r, g, b, dr, dg, db;
     1.9  
    1.10  		base_index[i] = pcol;
    1.11  
    1.12 -		dr = (colors[i].r << 8) / (range - 1);
    1.13 -		dg = (colors[i].g << 8) / (range - 1);
    1.14 -		db = (colors[i].b << 8) / (range - 1);
    1.15 +		dr = ((unsigned short)colors[i].r << 8) / (range - 1);
    1.16 +		dg = ((unsigned short)colors[i].g << 8) / (range - 1);
    1.17 +		db = ((unsigned short)colors[i].b << 8) / (range - 1);
    1.18  
    1.19  		r = g = b = 0;
    1.20  		for(j=0; j<range; j++) {