--- ray/src/rt/colortab.c 1990/01/19 00:00:37 1.11 +++ ray/src/rt/colortab.c 1990/02/23 10:08:33 1.13 @@ -129,9 +129,10 @@ int (*set_pixel)(); clrtab[h].ent[RED] = r; clrtab[h].ent[GRN] = g; /* reassign pixel */ clrtab[h].ent[BLU] = b; -#ifdef notdef - printf("pixel %d = (%d,%d,%d) (%d refs)\n", +#ifdef DEBUG + sprintf(errmsg, "pixel %d = (%d,%d,%d) (%d refs)\n", h, r, g, b, clrtab[h].n); + eputs(errmsg); #endif (*set_pixel)(h, r, g, b); } @@ -158,6 +159,16 @@ BYTE *rmap, *gmap, *bmap; bcopy((char *)rmap, (char *)clrmap[RED], 256); bcopy((char *)gmap, (char *)clrmap[GRN], 256); bcopy((char *)bmap, (char *)clrmap[BLU], 256); +} + + +map_color(rgb, col) /* map a color to a byte triplet */ +BYTE rgb[3]; +COLOR col; +{ + rgb[RED] = map_col(col,RED); + rgb[GRN] = map_col(col,GRN); + rgb[BLU] = map_col(col,BLU); }