return ret;
}
-static char *validate_params(game_params *params)
+static char *validate_params(game_params *params, int full)
{
- if (params->w <= 3 || params->h <= 3)
+ if (full && (params->w <= 3 || params->h <= 3))
return "Width and height must both be greater than three";
/*
* soluble. For the moment, therefore, I'm going to disallow
* them at any size other than the standard one.
*/
- if (params->type == TYPE_CROSS || params->type == TYPE_OCTAGON) {
+ if (full && (params->type == TYPE_CROSS || params->type == TYPE_OCTAGON)) {
if (params->w != 7 || params->h != 7)
return "This board type is only supported at 7x7";
}
static float *game_colours(frontend *fe, game_state *state, int *ncolours)
{
float *ret = snewn(3 * NCOLOURS, float);
- int i;
- float max;
-
- frontend_default_colour(fe, &ret[COL_BACKGROUND * 3]);
- /*
- * Drop the background colour so that the highlight is
- * noticeably brighter than it while still being under 1.
- */
- max = ret[COL_BACKGROUND*3];
- for (i = 1; i < 3; i++)
- if (ret[COL_BACKGROUND*3+i] > max)
- max = ret[COL_BACKGROUND*3+i];
- if (max * 1.2F > 1.0F) {
- for (i = 0; i < 3; i++)
- ret[COL_BACKGROUND*3+i] /= (max * 1.2F);
- }
-
- for (i = 0; i < 3; i++) {
- ret[COL_HIGHLIGHT * 3 + i] = ret[COL_BACKGROUND * 3 + i] * 1.2F;
- ret[COL_LOWLIGHT * 3 + i] = ret[COL_BACKGROUND * 3 + i] * 0.8F;
- }
+ game_mkhighlight(fe, ret, COL_BACKGROUND, COL_HIGHLIGHT, COL_LOWLIGHT);
ret[COL_PEG * 3 + 0] = 0.0F;
ret[COL_PEG * 3 + 1] = 0.0F;