--- ray/src/rt/colortab.c 1990/01/19 00:00:37 1.11 +++ ray/src/rt/colortab.c 1990/03/29 12:43:07 1.14 @@ -91,6 +91,7 @@ get_pixel(col, set_pixel) /* get pixel for color */ COLOR col; int (*set_pixel)(); { + extern char errmsg[]; int r, g, b; int cv[3]; register CNODE *tp; @@ -129,9 +130,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 +160,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); }