Code: Select all
void M_DrawColorBar (int x, int y, int highlight)
{
int i;
int intense = highlight * 16 + (highlight < 8 ? 11 : 4);
// position correctly
x = x + ((vid.width - 320) >> 1);
for (i = 0; i < 14; i++)
{
// take the approximate midpoint colour (handle backward ranges)
int c = i * 16 + (i < 8 ? 8 : 7);
// braw baseline colour (offset downwards a little so that it fits correctly
Draw_Fill (x + i * 8, y + 4, 8, 8, c);
}
// draw the highlight rectangle
Draw_Fill (x - 1 + highlight * 8, y + 3, 10, 10, 15);
// redraw the highlighted color at brighter intensity
Draw_Fill (x + highlight * 8, y + 4, 8, 8, intense);
}
Code: Select all
M_Print (64, 80, "Shirt color");
M_Print (64, 104, "Pants color");
Code: Select all
M_Print (64, 80, "Shirt color");
M_DrawColorBar (64, 88, setup_top);
M_Print (64, 104, "Pants color");
M_DrawColorBar (64, 112, setup_bottom);
Job's a good 'un.