On Mon, 5 Mar 2001, Mariano Alvarez Fernandez wrote:
A last change to colors.c. This code:
int i, cbpp, c; cbpp = 0; for (i=0; i < 3; ++i) { c = DRVINFO->actmode.extinfo->cprec[i] + DRVINFO->actmode.extinfo->cpos[i]; if ( c > cbpp ) cbpp = c; }
breaks the 32H driver, so I think we must use this (and be confident that GRX drivers now what they are doing):
int cbpp = 0; for (i=0; i < 3; ++i) cbpp += DRVINFO->actmode.extinfo->cprec[i];
May be we should have a separate function for this as similar construction is needed also in build_mode_table (bccgrx.c)
unsigned GrModeNumColors (_GR_video_mode * mode) { int cbpp = 0; for (i=0; i<3; i++) cbpp += DRVINFO->actmode.extinfo->cprec[i]; return 1 << cbpp; }
Also I don't think more we should use 1 << DRVINFO->actmode.bpp in _GrResetColors at all as calling such function (GrModeNumColors) is not so large overhead (and it's unlikely to be called in tight loop ...)
Andris